예제 #1
0
 void Awake()
 {
     RoomIndex  = SceneManager.GetActiveScene().buildIndex;
     PV         = GetComponent <PhotonView>();
     controller = GetComponent <PlayerControllerTest>();
     rb         = GetComponent <Rigidbody>();
 }
예제 #2
0
        void OnTriggerEnter(Collider collider)
        {
            if (collider.gameObject.tag == "Player")
            {
                Player = collider.gameObject.GetComponent <PlayerControllerTest>();
                if (CanBePickUp && Player != null)
                {
                    Debug.Log("I'm not null");
                    PickUpObject();
                    print("Item Picked Up");
                }

                //Destroy(gameObject);
            }
        }
예제 #3
0
        private void Awake()
        {
            Player = GetComponent <PlayerControllerTest>();

            //destroy the controller if the player is not controlled by me
            if (!photonView.IsMine)
            {
                if (GetComponent <InputReceive>() != null)
                {
                    Destroy(GetComponent <InputReceive>());
                }
                Destroy(GetComponentInChildren <Camera>().gameObject);
                Destroy(GetComponentInChildren <Rigidbody>());
                Destroy(orientation.gameObject);
            }
        }
예제 #4
0
        private void Awake()
        {
            PhotonNetwork.SendRate          = 25;
            PhotonNetwork.SerializationRate = 15;

            Player = GetComponent <PlayerControllerTest>();

            //destroy the controller if the player is not controlled by me
            if (!photonView.IsMine)
            {
                if (GetComponent <InputReceive>() != null)
                {
                    Destroy(GetComponent <InputReceive>());
                }
                Destroy(GetComponentInChildren <Camera>().gameObject);
                _rb            = GetComponentInChildren <Rigidbody>();
                _rb.useGravity = false;
                Destroy(orientation.gameObject);
                Destroy(SpeedLine);
                Destroy(SprintEffect);
            }
        }
예제 #5
0
 private void Awake()
 {
     rb         = GetComponent <Rigidbody>();
     player     = GetComponent <PlayerControllerTest>();
     Controller = GetComponent <InputReceive>();
 }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     Player = GetComponent <PlayerControllerTest>();
 }