Beispiel #1
0
    //bool showFrameText = false;
    // Use this for initialization
    void Start()
    {
        audio.Stop();

        okButtonRect     = new Rect(360, 335, buttonBG.width, buttonBG.height);
        cancelButtonRect = new Rect(530, 335, buttonBG.width, buttonBG.height);

        script                  = this;
        puck                    = GameObject.FindGameObjectWithTag("Puck").GetComponent <PuckBehaviour>();
        Aiplayer                = GameObject.FindGameObjectWithTag("AIPlayer").GetComponent <PlayerController>();
        wonRect                 = new Rect(470, 340, 50, 50);
        wonRect_Tickets         = new Rect(465, 330, 50, 50);
        gameMode                = Properties.GameType;
        challengeMode           = Properties.ChallengeMode;
        Properties.GameWonState = "IsPlaying";
        Properties.isPopUpShown = false;
        Actualtime              = System.DateTime.Now;

        totaltryCount = 1;

        List <int> playerScoreList = new List <int> ();

        for (int i = 0; i < 10; i++)
        {
            if (PlayerPrefs.HasKey("PlayerScore" + i))
            {
                playerScoreList.Add(int.Parse(PlayerPrefs.GetString("PlayerScore" + i)));
            }
        }

        if (playerScoreList.Count != 0)
        {
            Properties.playerScores = playerScoreList;
        }
    }
Beispiel #2
0
 // Use this for initialization
 //  AI approach
 //  1. Move to defensive position.
 //	2. Move to an attacking position.
 //	3. Strike the puck
 //  Have to move this code to a state manager for better display of what we are doing.
 void Start()
 {
     // AI Player Initial Spawning Position
     this.InitialPosition    = new Vector3(0f, 0f, 3.6f);
     this.transform.position = InitialPosition;
     Puck = GameObject.FindGameObjectWithTag("Puck").GetComponent <PuckBehaviour> ();
 }