コード例 #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;
    }