예제 #1
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());
    }
예제 #2
0
    private void InitPlayer()
    {
        //Set the player on the first hole
        if (Global.LoadHoleNumber != -1)
        {
            Holes.SetHole(Global.LoadHoleNumber);
        }
        Ball.transform.position   = Holes.CurrentHole.BeginPosition.transform.position;
        Player.transform.position = Ball.transform.position;
        Bag.MoveToTheBall(Ball.transform.position, Holes.CurrentHole.transform.position);
        var rigidBody = Ball.GetComponent <Rigidbody> ();

        rigidBody.velocity    = new Vector3(0f, 0f, 0f);
        rigidBody.drag        = 100f;
        rigidBody.angularDrag = 100f;
        GetCurrentHole().Enable(true);

        AnalyticsGame.ChangeClub(Club.GetName());
        AnalyticsGame.BeginHole(GetCurrentHole().GetName());
    }