예제 #1
0
 internal void ChangeHole()
 {
     if (holeManager)
     {
         holeManager.ChangeHole(false);
     }
     else
     {
         Debug.LogError("Could not find hole manager");
     }
 }
예제 #2
0
파일: Hole.cs 프로젝트: Staszk/Just-Golf
    private IEnumerator DelayedBallDespawn(GolfBall gb, float lifetime)
    {
        yield return(new WaitForSeconds(lifetime));

        int team = nStoredData ? nStoredData.GetTeam(gb.GetLastShotId()) : 0;

        if (network && network.IsHost())
        {
            EventController.FireEvent(new PersonalScoreMessage(gb.GetLastShotId(), PersonalScoreManager.TYPE.SCORE_BALL));
            gb.EndLifetime();
            EventController.FireEvent(new NetworkSendBallRespawn(gb, team));
        }

        if (!network)
        {
            gb.EndLifetime();
            EventController.FireEvent(new TeamScoreMessage());
        }

        holeManager.ChangeHole();
        dbsRoutine = null;
    }