예제 #1
0
    /// <summary>
    ///     Starts the game.
    /// </summary>
    /// <param name="data">Information data.</param>
    public void StartGame(StartData data)
    {
        // reset data
        _hits = 1;

        _power       = 0.4f;
        _powerBarDir = 1;
        _curLevel    = data.Level;

        // instantiate target + club
        _targetSpot = (GameObject)Instantiate(TargetSpot);
        _targetSpot.transform.parent = transform.parent;

        _golfClub = (GameObject)Instantiate(GolfClub);
        _golfClub.transform.parent = transform.parent;

        _clubScript = _golfClub.GetComponent <ClubScript>();
        _clubScript.SetScript(this);

        _tutScript = data.TutScript;

        // let's go
        _vectorLine.ForceClear();
        _gameState = States.FirstRun;
    }
예제 #2
0
    public void SetCurrentClub(ClubScript clubScript)
    {
        //Instantiate the new Club with the properties of the old one
        GameObject club = Club.InstantiateNewClub(clubScript.gameObject);

        Club = club.GetComponent <ClubScript>();
        Player.SetCurrentClub(club);

        AnalyticsGame.ChangeClub(clubScript.GetName());
    }
예제 #3
0
 public void SelectClub(ClubScript script)
 {
     MainScript.SetCurrentClub(script);
 }