Example #1
0
        /// <summary>
        /// MonoBehaviour method called on GameObject by Unity on every frame.
        /// </summary>
        void Update()
        {
            if (photonView.isMine == false && PhotonNetwork.connected == true)
            {
                return;
            }

            if (playerInfo.health <= 0f)
            {
                // after recording, we leave the room
                GameManager.Instance.LeaveRoom();
            }

            ProcessInputs();
            if (IsFiring)
            {
                // TODO: temp
                if (LocalPlayerType.Equals(Constant.StoneElementType))
                {
                    CmdShoot();
                }

                if (nextShootTime <= Time.time)
                {
                    CmdShoot();
                    nextShootTime = Time.time + playerInfo.fireRate;
                }
            }
            else
            {
                CmdStopFire();
            }
            if (UsingUltra)
            {
                UseUltra();
            }
            // Debug
            DebugController.displayPlayerInfo(playerInfo);
            UltraUI.updateEnergyStatus(playerInfo);
            return;
        }
Example #2
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
 }