Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     this.playerManager                = GetComponentInParent <PlayerManager>();
     this.playerCombat                 = GetComponentInParent <PlayerCombat>();
     this.playerCombat.OnDie          += SetText;
     GameManager.OnGameStateEnded     += ((string _) => SetText());
     GameManager.OnLivePlayersUpdated += SetText;
     SetText();
 }
Exemplo n.º 2
0
        // Start is called before the first frame update
        void Start()
        {
            controller = this.gameObject.GetComponent <Rigidbody2D>();
            CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

            PlayerCombat combat = this.gameObject.GetComponent <PlayerCombat>();

            combat.OnDie += TurnToGhost;
            GameManager.OnGameStateEnded += (string winnerId) => ComeBackToLife();

            if (_cameraWork != null)
            {
                // Check network status
                if (photonView.IsMine)
                {
                    _cameraWork.OnStartFollowing();
                }
            }
        }