public void switchPlayer() { if (objetoAMostrar.sprite == objetoPlayer1) { objetoAMostrar.sprite = objetoPlayer2; recolectorPlayerActual = recolectorPlayer2; cantidadObjeto.text = recolectorPlayer2.getRecolecciones().ToString(); } else { objetoAMostrar.sprite = objetoPlayer1; recolectorPlayerActual = recolectorPlayer1; cantidadObjeto.text = recolectorPlayer1.getRecolecciones().ToString(); } }
// Use this for initialization void Start() { recolectorPlayerActual = recolectorPlayer1; cantidadObjeto.text = recolectorPlayer1.getRecolecciones().ToString(); objetoAMostrar.sprite = objetoPlayer1; }