Buenas tardes
Tengo un problema con un int que aprenetemente es facul pero me lleva de cabeza.
Quiero añadir +1 a un public int en este caso numero de bolas al llegar a una puntuación...pues no hay manera.
Este script alberga el numero de bolas:
using UnityEngine;
using System.Collections;
public class BallManager : MonoBehaviour
{
public GameObject ball;
public Transform spawnPosition;
public TextMesh display;
public int lives = 3;
public bool gameOver = false;
AudioSource audio;
public GameObject luzx1;
public GameObject luzx2;
public GameObject luzx3;
void Update()
{
AudioSource audio = GetComponent<AudioSource> ();
//Check for gameover
if (lives < ) {
if (display) {
display.text = "GAME OVER";
gameOver = true;
}
}
//Ball cae y no es game over
if (!GameObject.FindGameObjectWithTag ("Ball") && !gameOver) {
lives--;
Instantiate (ball, spawnPosition.position, ball.transform.rotation);
audio.Play ();
luzx1.SetActive (true);
luzx2.SetActive (false);
luzx3.SetActive (false);
ScoreManager.Instance.SetScorePower (1);
//Update bolas restantes
if(display)
{
display.text = "BOLAS RESTANTES: " + lives.ToString();
}
}
if(gameOver)
{
if(Input.GetKeyDown(KeyCode.Return