Exemplo n.º 1
0
        private void OnDestroy()
        {
            if (!photonView.IsMine)
            {
                return;
            }

            // Destroy singleton reference
            if (LocalPlayer == this)
            {
                LocalPlayer = null;
            }
        }
Exemplo n.º 2
0
        private void Awake()
        {
            // Parameters initialization
            RespawnInitialization();
            _animator = GetComponent <Animator>();

            if (!photonView.IsMine)
            {
                Destroy(virtualCamera.GetComponent <CinemachineVirtualCamera>());
                return;
            }

            // Singleton
            if (LocalPlayer != null)
            {
                Destroy(gameObject);
            }
            else
            {
                LocalPlayer = this;
            }
        }