Esempio n. 1
0
 void Awake()
 {
     instance = this;
     //Container = ballContainer [0];
     if (PlayerPrefs.GetInt("Controller") == 1)           //to use CNinput control for movement of bucket
     {
         controller = 1;
     }
     else if (PlayerPrefs.GetInt("Controller") == 2)         //to use Acceleration control for movement of bucket
     {
         controller = 2;
         cnInput.SetActive(false);
     }
     if (PlayerPrefs.GetInt("bucket") == 1)
     {         //bucket 1 is selected
         Container = ballContainer [0];
         ballContainer [1].SetActive(false);
         ballContainer [2].SetActive(false);
     }
     else if (PlayerPrefs.GetInt("bucket") == 2)
     {         //Bucket 2 is selected
         Container = ballContainer [1];
         ballContainer [2].SetActive(false);
         ballContainer [0].SetActive(false);
     }
     else if (PlayerPrefs.GetInt("bucket") == 3)
     {         //Bucket 3 is selected
         Container = ballContainer [2];
         ballContainer [1].SetActive(false);
         ballContainer [0].SetActive(false);
     }
 }
Esempio n. 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
                CurrentGame = new BallCatcher(DifficultySettings.createByDifficulty((DifficultySettings.DIFFICULTY)e.Parameter));
            else
                CurrentGame = new BallCatcher(DifficultySettings.createByDifficulty(DifficultySettings.DIFFICULTY.EASY));

            CurrentGame.GameEvent += CurrentGame_GameEvent;

            worker.DoWork += Worker_DoWork;
            worker.RunWorkerAsync();

            timer.Start();

            if (ApplicationData.Current.LocalSettings.Values["username"] != null)
                CurrentGame.CMan.CurrentCharacter.Name = (string)ApplicationData.Current.LocalSettings.Values["username"];

            initWorker();

            base.OnNavigatedTo(e);
        }