Beispiel #1
0
        private void Update()
        {
            if (time > 0)
            {
                time -= Time.deltaTime;

                if (time <= 0)
                {
                    go = true;
                }
            }
            if (go)
            {
                bool done = true;
                if (PhotonNetwork.CurrentRoom.PlayerCount == 2)
                {
                    if (done)
                    {
                        player = FindObjectOfType <FirstPersonController1>();
                        done   = false;
                    }
                }
                if (cams.failState == 3)
                {
                    Buttons.SetActive(false);
                }
            }
        }
Beispiel #2
0
 void SpawnPlayer()
 {
     if (PhotonNetwork.CurrentRoom.PlayerCount == 1)
     {
         player = PhotonNetwork.Instantiate(playerPrefab.gameObject.name, Helper.position, Helper.rotation);
         photonView.RPC("RPC_First", RpcTarget.AllBufferedViaServer, player.GetPhotonView().ViewID);
     }
     else if (PhotonNetwork.CurrentRoom.PlayerCount == 2)
     {
         player2 = PhotonNetwork.Instantiate(playerPrefab2.gameObject.name, Prisoner.position, Prisoner.rotation);
         time    = 1;
         if (go)
         {
             Controller1 = player.GetComponent <FirstPersonController>();
             Controller2 = player2.GetComponent <FirstPersonController1>();
             photonView.RPC("RPC_Spawning", RpcTarget.All, Controller1, Controller2, player2.GetPhotonView().ViewID);
         }
     }
 }
Beispiel #3
0
        private void Update()
        {
            bool done = false;

            if (cams.failState == 3)
            {
                if (GetComponent <PhotonView>().InstantiationId == 0)
                {
                    Destroy(gameObject);
                }
                else
                {
                    if (GetComponent <PhotonView>().IsMine)
                    {
                        cams.failState = 0;
                        GameManager nm = GameObject.FindObjectOfType <GameManager>();
                        nm.RespawnTimer2 = 3f;
                        PhotonNetwork.Destroy(gameObject);
                    }
                }
            }
            if (PhotonNetwork.CurrentRoom.PlayerCount == 2)
            {
                MorseCode();
                if (!done)
                {
                    Prisoner = FindObjectOfType <FirstPersonController1>();
                    done     = true;
                }
            }
            if (!photonView.IsMine)
            {
                return;
            }
            WaitingForInput();

            HandleCharacterLook();
            HandleCharacterMovement();
        }
Beispiel #4
0
 void RPC_Spawning(FirstPersonController Con1, FirstPersonController1 Con2, int Player2)
 {
     player2 = PhotonView.Find(Player2).gameObject;
 }