示例#1
0
    IEnumerator WaitForSwing(GolfBall golfball, ClubStat clubStat, float power)
    {
        while (!swing)
        {
            yield return(new WaitForEndOfFrame());
        }

        if (clubStats.ClubName == "Putter")
        {
            SoundManager.PlaySoundAt("Putter Hit", golfball.transform.position);
        }
        if (clubStats.ClubName == "Wedge")
        {
            SoundManager.PlaySoundAt("Wedge Hit", golfball.transform.position);
            SoundManager.PlaySoundAt("Golf Swing", golfball.transform.position);
        }
        if (clubStats.ClubName == "Driver")
        {
            SoundManager.PlaySoundAt("Driver Hit", golfball.transform.position);
            SoundManager.PlaySoundAt("Golf Swing", golfball.transform.position);
        }

        EventController.FireEvent(new GolfStrokeMessage(power));
        golfball.HitBall(MyID, NetworkManager.instance == null);
        EventController.FireEvent(new TrackSuperlativeMessage(SuperlativeController.Superlative.TheHurricane, SuperlativeController.ConditionFlag.additive, 1));

        //For tutorial
        if (PlayerTutorialChecker.instance != null)
        {
            PlayerTutorialChecker.instance.ClubWasHit(clubStats.ClubName);
        }
        EndShot();
    }
示例#2
0
 public ClubChangedMessage(int index, ClubStat club)
 {
     this.index = index;
     stats      = club;
 }