コード例 #1
0
    private void WaitForFood()
    {
        _isAte = _currentTarget.CounterComponent.IsAvailableRecipeCode();
        if (_isAte)
        {
            if (MultiPlayGameManager.GetInstance() != null)
            {
                MultiPlayGameManager.GetInstance().AddPlayerScore(_targetRecipeCode.Length * 1000);
            }

            _navMeshAgent.isStopped = false;
            _navMeshAgent.SetDestination(_defaultPosition);
            _currentState = GuestBehaviourState.ExitToDefaultPosition;
        }
    }
コード例 #2
0
    private void Awake()
    {
        Application.targetFrameRate = 90;
        // Check and Set Singleton Object
        if (_instance != null)
        {
            Debug.Log("MainSceneGameManager : Game Manager has Duplicated, Delete Another One");
            gameObject.SetActive(false);
        }
        else
        {
            _instance = this;
        }

        // Check Property Set Collectly and Instatiate by Player
        if (!CheckIsPropertySet())
        {
            Debug.Log("MainSceneGameManager : Gama Manager Property has Not Set, Check Properties");
            gameObject.SetActive(false);
            Application.Quit();
        }

        GameObject targetPrefab = XRDevice.isPresent ? VRPlayerInstance : KMPlayerInstance;

        if (!PhotonNetwork.IsConnected)
        {
            _playerInstance = Instantiate(targetPrefab,
                                          PlayerStartPoint.position,
                                          PlayerStartPoint.rotation);
        }
        else
        {
            PlayerStartPoint = PhotonNetwork.IsMasterClient ? PlayerStartPoint : SubPlayerStartPoint;
            _playerInstance  = PhotonNetwork.Instantiate(targetPrefab.name,
                                                         PlayerStartPoint.position,
                                                         PlayerStartPoint.rotation);
        }

        if (PhotonNetwork.IsMasterClient)
        {
            _BroadcastScoreData(_playerScore);
        }
        else
        {
            photonView.RPC("_RequestScoreData", RpcTarget.MasterClient, null);
        }
    }