Пример #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>();
 }