Ejemplo n.º 1
0
    public void LaunchSpectatorMode()
    {
        if (GameObject.Find("Perso(Clone)") != null)
        {
            GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

            for (int i = 0; i < players.Length; i++)
            {
                if (!players[i].GetComponent <PlayerBoson>().won)
                {
                    playerObserved = players[i].GetComponent <PlayerBoson>();
                }
            }
            spectatorMode = true;
        }
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (spectatorMode)
     {
         if (playerObserved != null && !playerObserved.won)
         {
             Camera.main.transform.position = new Vector3((playerObserved.positionX * playerObserved.game.SCALE_X),
                                                          (playerObserved.positionY * playerObserved.game.SCALE_Y),
                                                          -(playerObserved.game.INITIATE_POSITION));
         }
         else
         {
             LaunchSpectatorMode();
         }
     }
     else
     {
         if (player != null)
         {
             playerObserved = player;
         }
     }
 }
Ejemplo n.º 3
0
 void Start()
 {
     player = this.transform.GetComponent <PlayerBoson>();
     SceneManager.sceneLoaded += OnSceneLoaded;
 }
Ejemplo n.º 4
0
 void Start()
 {
     player       = this.GetComponent <PlayerBoson>();
     isInvincible = false;
 }
Ejemplo n.º 5
0
 public void SetPlayer(PlayerBoson player)
 {
     this.player = player;
 }
Ejemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     player = this.GetComponent <PlayerBoson>();
     SceneManager.sceneLoaded += OnSceneLoaded;
     recharge = false;
 }