Example #1
0
        /// <summary>
        /// MonoBehaviour method called on GameObject by Unity during initialization phase.
        /// </summary>
        void Start()
        {
            CameraWork _cameraWork = GetComponent <CameraWork>();

            if (_cameraWork != null)
            {
                if (photonView.IsMine)
                {
                    _cameraWork.OnStartFollowing();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
            }

#if UNITY_5_4_OR_NEWER
            // Unity 5.4 has a new scene management. register a method to call CalledOnLevelWasLoaded.
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
#endif

            if (PlayerUiPrefab != null)
            {
                GameObject _uiGo = Instantiate(PlayerUiPrefab);
                _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
            }
            else
            {
                Debug.LogWarning("<Color=Red><a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this);
            }
        }
Example #2
0
        public void Start()
        {
            CameraWork _cameraWork = gameObject.GetComponent <CameraWork>();

            if (_cameraWork != null)
            {
                if (photonView.IsMine)
                {
                    _cameraWork.OnStartFollowing();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><b>Missing</b></Color> CameraWork Component on player Prefab.", this);
            }

            // Create the UI
            if (this.PlayerUiPrefab != null)
            {
                GameObject _uiGo = Instantiate(this.PlayerUiPrefab);
                _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
            }
            else
            {
                Debug.LogWarning("<Color=Red><b>Missing</b></Color> PlayerUiPrefab reference on player Prefab.", this);
            }


            UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
        }
Example #3
0
{    // Start is called before the first frame update
    void Start()
    {
        CameraWork _cameraWork = GetComponent <CameraWork>();

        if (null != _cameraWork)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }

        Material a = GetComponentInChildren <Renderer>().material;

        if (null == a)
        {
            Debug.LogError("Player Manager Material is null");
            //Debug.Log(a);
        }

        Player    player = photonView.Owner;
        Hashtable h      = player.CustomProperties;

        if (null == h)
        {
            Debug.LogError("Player Hashtable is Null");
        }

        int index = (int)h["index"];

        a.color = GameInstance.Instance.Colors[index];
    }
Example #4
0
    private void Start()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (null != _cameraWork)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<color=red><a>Missing</a></color> CameraWork Component on playerPrefab", this);
        }

        if (null != playerUiPrefab)
        {
            GameObject _uiGo = Instantiate(playerUiPrefab);
            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.LogWarning("<color=red><a>Missing</a></color> PlayerUIPrefab reference on player Prefab", this);
        }

        #if UNITY_5_4_OR_NEWER
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
        #endif
    }
Example #5
0
    void Start()
    {
        if (PlayerUIPrefab != null)
        {
            InstantiateUIGameObject();
        }
        else
        {
            Debug.LogWarning("<Color=Red><a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this);
        }

        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (_cameraWork != null)
        {
            if (photonView.IsMine || !PhotonNetwork.IsConnected)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }

        UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
    }
Example #6
0
    // Start is called before the first frame update
    void Start()
    {
        //Setup movement
        //animator = GetComponent<Animator>();
        //if (!animator)
        //{
        //    Debug.LogError("PlayerAnimatorManager is Missing Animator Component", this);
        //}

        //Verify UI
        if (PlayerUIPrefab != null)
        {
            GameObject _uiGo = Instantiate(PlayerUIPrefab);
            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.LogWarning("<Color=Red><a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this);
        }

        //Camera work
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
    }
Example #7
0
    private void Start()
    {
        CameraWork cameraWork = gameObject.GetComponent <CameraWork>();

        if (cameraWork != null)
        {
            if (photonView.isMine)
            {
                cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork on playerPrefab.", this);
        }

        if (playerUIPrefab != null)
        {
            GameObject uiGo = Instantiate(playerUIPrefab) as GameObject;
            uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.Log("playerUIPrefab is null");
        }

#if UNITY_MIN_5_4
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += (scene, loadingMode) =>
        {
            this.CalledOnLevelWasLoaded(scene.buildIndex);
        };
#endif
    }
Example #8
0
    //public GameObject lineRend;
    void Start()
    {
        //lineRend.SetActive(true);
        //lineRend.GetComponent<LineRenderer>().SetPosition(0, this.transform.position);
        //lineRend.GetComponent<LineRenderer>().SetPosition(1, this.transform.position+new Vector3(10,10,0));

        //initial player UI
        createNameUI();

        _cameraWork = this.gameObject.GetComponent <CameraWork>();


        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
        // Debug.Log("Starting Player Script");
    }
 // Start is called before the first frame update
 void Start()
 {
     if (photonView.IsMine)
     {
         _cameraWork.OnStartFollowing();
     }
 }
 private void Start()
 {
     networkManager = GameObject.Find("NetworkManager").GetComponent <NetworkManager>();
     view           = GetComponent <PhotonView>();
     gameManager    = GameManager.Instance;
     soundManager   = SoundManager.Instance;
     animator       = GetComponent <Animator>();
     rigid          = GetComponent <Rigidbody>();
     cameraWork     = this.gameObject.GetComponent <CameraWork>();
     poisnGas       = transform.Find("PoisonGas").gameObject;
     particle       = poisnGas.GetComponent <ParticleSystem>();
     if (cameraWork != null)
     {
         if (photonView.IsMine)
         {
             cameraWork.OnStartFollowing();
             deading = false;
         }
     }
     else
     {
         Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
     }
     PlayerSetState(PlayerState.Normal);
 }
Example #11
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }

        if (playerUiPrefab != null)
        {
            GameObject _uiGo = Instantiate(playerUiPrefab);
            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.LogWarning("<Color=Red><a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this);
        }

#if UNITY_5_4_OR_NEWER
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += (SceneManagerHelper, loadingMode) =>
        {
            this.CalledOnLevelWasLoaded(SceneManagerHelper.buildIndex);
        };
#endif
    }
Example #12
0
    /// <summary>
    /// MonoBehaviour method called on GameObject by Unity during initialization phase.
    /// </summary>
    void Start()
    {
        CameraWork _cameraWork = GetComponent <CameraWork>();


        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
            else
            {
                Debug.Log("photon is not mine");
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }

#if UNITY_5_4_OR_NEWER
        // Unity 5.4 has a new scene management. register a method to call CalledOnLevelWasLoaded.
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
#endif
    }
Example #13
0
    // Start is called before the first frame update
    void Start()
    {
        col             = GetComponent <CircleCollider2D>();
        particleSystems = GetComponentsInChildren <ParticleSystem>();
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();



        foreach (Player p in PhotonNetwork.PlayerList)
        {
            if (photonView.Owner.ActorNumber == p.ActorNumber)
            {
                ExitGames.Client.Photon.Hashtable h = p.CustomProperties;
                //Debug.Log(h["PlayerColorRed"]);
                mat.SetFloat("RED", (float)h["PlayerColorRed"]);
                mat.SetFloat("GREEN", (float)h["PlayerColorGreen"]);
                mat.SetFloat("BLUE", (float)h["PlayerColorBlue"]);
                mat.SetInt("HardMix", (int)h["PlayerColorHardMix"]);
            }
        }


        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                photonView.RPC("SetUIElement", RpcTarget.All, (string)PlayerPrefs.GetString("PlayerName"));
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            //Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
    }
Example #14
0
        /// <summary>
        /// MonoBehaviour method called on GameObject by Unity during initialization phase.
        /// </summary>
        public void Start()
        {
            CameraWork _cameraWork = gameObject.GetComponent <CameraWork>();

            if (_cameraWork != null)
            {
                if (photonView.IsMine)
                {
                    _cameraWork.OnStartFollowing();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><b>Missing</b></Color> CameraWork Component on player Prefab.", this);
            }

            // Create the UI
            if (this.playerUiPrefab != null)
            {
                GameObject _uiGo = Instantiate(this.playerUiPrefab.gameObject);
                _uiGo.GetComponent <NetPlayerUI>().SetTarget(this);
            }
            else
            {
                Debug.LogWarning("<Color=Red><b>Missing</b></Color> PlayerUiPrefab reference on player Prefab.", this);
            }

#if UNITY_5_4_OR_NEWER
            // Unity 5.4 has a new scene management. register a method to call CalledOnLevelWasLoaded.
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
#endif
        }
Example #15
0
    void Start()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (PlayerUiPrefab != null)
        {
            GameObject _uiGo = Instantiate(PlayerUiPrefab);
            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.LogWarning("<Color=Red></a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this);
        }

        if (_cameraWork != null)
        {
            if (m_PhotonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a/></Color> Camera Work Component on playerPrefab.", this);
        }
    }
Example #16
0
    private void Start()
    {
        CameraWork cam = this.GetComponent <CameraWork>();

        if (cam != null)
        {
            if (photonView.isMine)
            {
                cam.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing camera work</a></Color>", this);
        }

#if UNITY_MIN_5_4
        //subscribing to event that the scene was loaded
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += (scene, loading) =>
        {
            this.CalledOnLevelWasLoaded(scene.buildIndex);
        };
#endif

        if (PlayerUIPrefab != null)
        {
            GameObject uiGameObj = Instantiate(PlayerUIPrefab) as GameObject;
            uiGameObj.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.Log("No player ui prefab");
        }
    }
Example #17
0
    // Start is called before the first frame update
    void Start()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        animator = GetComponent <Animator>();
        if (photonView.IsMine)
        {
            tempG          = this.transform.GetChild(0).gameObject;
            nickText       = tempG.transform.GetChild(0).GetComponent <Text>();
            chatBox        = tempG.transform.GetChild(1).gameObject;
            nickText.text  = PhotonNetwork.NickName;
            nickText.color = Color.white;
        }
        else
        {
            tempG          = this.transform.GetChild(0).gameObject;
            nickText       = tempG.transform.GetChild(0).GetComponent <Text>();
            chatBox        = tempG.transform.GetChild(1).gameObject;
            nickText.text  = this.photonView.Owner.NickName;
            nickText.color = Color.green;
        }


        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
    }
Example #18
0
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 0; i < 5; i++)
        {
            latBuffer[i]  = zerolat;
            longBuffer[i] = zerolong;
        }
        resettable      = new Hashtable();
        my_point_text   = GameObject.Find("myPoints").GetComponent <Text>();
        team_point_text = GameObject.Find("teamPoints").GetComponent <Text>();
        PlayerPrefs.SetInt("dead", 0);
        PlayerPrefs.SetInt("tutorialIndex", 0);
        tutorialIndex = 0;

        myPoints              = 0;
        teampoints            = 0;
        enemypoints           = 0;
        startPos              = transform.position;
        ball_present          = false;
        rubber_strain         = 0f;
        rubber_force          = 1f;
        Input.gyro.enabled    = true;
        Input.compass.enabled = true;
        Input.location.Start();

        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
        rubber    = this.transform.Find("SlingShot/Rubber").gameObject;
        holder    = this.transform.Find("SlingShot/Rubber/holder").gameObject;
        healhtbar = this.transform.Find("Healthbar").gameObject;

        GameObject o = GameObject.Find("pointsBar");

        pointsBarScript = o.GetComponent <pointsBar>();

        if (rubber == null)
        {
            Debug.LogError("Find function does not work correctly.");
        }
        fork = this.transform.Find("SlingShot/Fork_default").gameObject;
        if (fork == null)
        {
            Debug.Log("Find FORK function does not work correctly.");
        }

        audioSrc = GetComponent <AudioSource>();
    }
Example #19
0
    void Update()
    {
        if (photonView.IsMine && !imDie)
        {
            // move player direction to the cursor
            Vector2 positionOnScreen = Camera.main.WorldToViewportPoint(transform.position);
            Vector2 mouseOnScreen    = (Vector2)Camera.main.ScreenToViewportPoint(Input.mousePosition);
            float   angle            = AngleBetweenTwoPoints(positionOnScreen, mouseOnScreen);
            transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, angle + 90));
            // Debug.Log("sending out ray");
            // RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
            // GameObject target = hit.collider.gameObject;
            PlayerManager plyManager = this.gameObject.GetComponent <PlayerManager>();
            if (Input.GetMouseButton(0) && canShoot && plyManager.energy >= plyManager.defaultShootingEnergyConsuming)
            {
                canShoot           = false;
                plyManager.energy -= plyManager.defaultShootingEnergyConsuming;
                nextShotTimestamp  = Time.time + shootCooldown;
                // if (Time.time >= shootTimeStamp + shootCooldown)
                // {
                // shootTimeStamp = Time.time;
                Vector2  currentMouseVector = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                object[] myCustomInitData   = new object[] { color };

                GameObject bullet          = PhotonNetwork.Instantiate(this.bulletPrefabs[color].name, transform.position, Quaternion.Euler(0, 0, angle + 90), 0, myCustomInitData);
                Vector2    shootDirection  = (Vector2)Vector3.Normalize(currentMouseVector - (Vector2)bullet.transform.position);
                Vector2    shootDirection2 = (Vector2)Vector3.Normalize(currentMouseVector - (Vector2)transform.position);


                bullet.GetComponent <ProjectileController_Network>().parentObject = gameObject;
                bullet.GetComponent <ProjectileController_Network>().moveToTarget(shootDirection);
                // }
            }
            //GameObject manager = GameObject.Find("Game Manager");



            if (Time.time >= nextShotTimestamp)
            {
                canShoot = true;
            }
        }
        if (imDie && photonView.IsMine)
        {
            if (Input.GetKeyDown("space"))
            {
                _cameraWork.StopFollowing();
                watchingPlayer = (watchingPlayer + 1) % Players.Length;
                if (Players[watchingPlayer] == null)
                {
                    watchingPlayer = (watchingPlayer + 1) % Players.Length;
                }
                _cameraWork = Players[watchingPlayer].GetComponent <CameraWork>();
                _cameraWork.OnStartFollowing();
            }
        }
    }
Example #20
0
    // Use this for initialization
    void Start()
    {
        CameraWork _cameraWork = GetComponent <CameraWork>();

        if (_cameraWork != null && photonView.IsMine)
        {
            _cameraWork.OnStartFollowing();
        }
        defendEffectPrefab.SetActive(false);
    }
Example #21
0
    void Awake()
    {
        if (photonView.IsMine)
        {
            PlayerManager.LocalPlayerInstance = this.gameObject;

            // setup camera on 'my' controllable character only
            playerCam = gameObject.AddComponent <CameraWork>();
            playerCam.OnStartFollowing();
        }
        DontDestroyOnLoad(this.gameObject);
    }
Example #22
0
    private void Start()
    {
        animator = GetComponent <Animator>();

        if (cameraWork != null)
        {
            if (photonView.isMine)
            {
                cameraWork.OnStartFollowing();
            }
        }
    }
Example #23
0
    void CameraWork()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork> ();

        if (_cameraWork != null)
        {
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
                transformCam = Camera.main.transform;
            }
        }
    }
Example #24
0
    private int count   = -1;//间隔时间操作
    // Use this for initialization
    void Start()
    {
        Debug.Log(PlayerDoll_Path);
        CameraWork _cameraWork = this.GetComponent <CameraWork>();

        animator = this.GetComponent <Animator>();
        rigbody  = this.GetComponent <Rigidbody>();
        if (role == null)
        {
            role = this.GetComponent <Role>();
        }
        if (_cameraWork != null)
        {
            if (photonView.isMine)
            {
                _cameraWork.OnStartFollowing(role.LocalPos);
            }
        }
        else
        {
            Debug.LogError("<Color=Red><b>Missing</b></Color> CameraWork Component on player Prefab.", this);
        }

        // Create the UI
        if (this.PlayerUiPrefab != null)
        {
            GameObject _uiGo = Instantiate(this.PlayerUiPrefab) as GameObject;
            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);
        }
        else
        {
            Debug.LogWarning("<Color=Red><b>Missing</b></Color> PlayerUiPrefab reference on player Prefab.", this);
        }

        if (photonView.isMine)
        {
            for (int i = 0; i < 3; i++)
            {
                PS[i] = new List <GameObject>();
            }
            if (PlayerPrefs.GetInt("ID") == 1)
            {
                this.photonView.RPC("SetType", PhotonTargets.All, 1);
            }
            else
            {
                this.photonView.RPC("SetType", PhotonTargets.All, 2);
            }
            IniEffectName();
        }
    }
Example #25
0
        void Start()
        {
            CameraWork _canmeraWork = GetComponent <CameraWork>();

            if (_canmeraWork != null)
            {
                if (photonView.IsMine)
                {
                    _canmeraWork.OnStartFollowing();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        CameraWork camera = this.gameObject.GetComponent <CameraWork>();

        try
        {
            if (photonView.IsMine)
            {
                camera.OnStartFollowing();
            }
        }

        catch (Exception e)
        {
            Debug.Log(e.Message);
        }
    }
        void Start()
        {
            CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();

            Debug.Assert(_cameraWork != null);
            if (photonView.IsMine)
            {
                _cameraWork.OnStartFollowing();
            }

            Debug.Assert(playerUiPrefab != null);
            GameObject _uiGo = Instantiate(playerUiPrefab);

            _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver);

            UnityEngine.SceneManagement.SceneManager.sceneLoaded += (scene, loadingMode) => {
                this.CalledOnLevelWasLoaded(scene.buildIndex);
            };
        }
Example #28
0
        private void Start()
        {
            CameraWork _cameraWork = this.gameObject.GetComponent<CameraWork>();

            if (_cameraWork != null)
            {
                if (photonView.IsMine)
                {
                    _cameraWork.OnStartFollowing();
                }
            }
            else
            {
                Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
            }

            // Unity 5.4 has a new scene management. register a method to call CalledOnLevelWasLoaded.
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
        }
Example #29
0
    void Start()
    {
        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();


        if (_cameraWork != null)
        {
            if (photonView.isMine)
            {
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }

        SceneManager.sceneLoaded += this.CalledOnLevelWasLoaded;
    }
    private void Start()
    {
        hp = 200;

        CameraWork _cameraWork = this.gameObject.GetComponent <CameraWork>();


        if (_cameraWork != null)
        {
            if (photonView.isMine)
            {
                Game.Managers.GameManager.Instance.MatchController.PlayerController = this;
                _cameraWork.OnStartFollowing();
            }
        }
        else
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> CameraWork Component on playerPrefab.", this);
        }
    }