Exemplo n.º 1
0
        private Quaternion correctPlayerRot = Quaternion.identity; //We lerp towards this

        void Awake()
        {
            cameraScript     = GetComponent <ThirdPersonCamera>();
            controllerScript = GetComponent <ThirdPersonController>();

            if (photonView.isMine)
            {
                //MINE: local player, simply enable the local scripts
                cameraScript.enabled     = true;
                controllerScript.enabled = true;
            }
            else
            {
                //Anderer Spieler -> hier muss nur Rotation und Position angepasst werden, daher muss er f¨¹r uns kontrollierbar sein
                cameraScript.enabled            = false;
                controllerScript.enabled        = true;
                controllerScript.isControllable = false;
            }

            gameObject.name = gameObject.name + photonView.viewID;
        }