Esempio n. 1
0
    private void LocalInitialize(int[] initializeData)
    {
        int barViewID  = initializeData[0];
        int goalViewID = initializeData[1];
        int playerID   = initializeData[2];

        _myBar    = PhotonView.Find(barViewID).GetComponent <BarController>();
        _myGoal   = PhotonView.Find(goalViewID).GetComponent <GoalController>();
        _point    = 0;
        _playerID = playerID;

        _myBar.LocalInitialize();
        _myGoal.LocalInitialize();

        _myGoal.OnGoalBall += () =>
        {
            var otherPlayerController = FindObjectsOfType <PlayerController>()
                                        .FirstOrDefault(p => p != this);
            otherPlayerController.RpcAddPoint(deltaPoint: +1);
        };
    }