Beispiel #1
0
        private void InitFood()
        {
            Random rand = new Random();

            food       = new Food(world);
            uiFood     = new UIFood(food, world);
            food.Width = uiFood.Width / 2;
            food.InitPositionWithTile(world.GetTileAt(rand.Next(0, Context.Instance.TileWidth), rand.Next(0, Context.Instance.TileHeight)));
            food.Notify();
        }
Beispiel #2
0
 void InitializeFoods()
 {
     foreach (Food f in foods)
     {
         GameObject go     = Instantiate(foodButtonPrefab, foodParent);
         UIFood     uiFood = go.GetComponent <UIFood>();
         uiFood.SetFood(f);
         uiFood.manager = this;
     }
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     //Initialis the food, weapons and powerups vars, then update all UI.
     food     = GameObject.FindGameObjectWithTag("Statics").GetComponent <UIFood> ();
     weapons  = GameObject.FindGameObjectWithTag("Statics").GetComponent <UIWeapons> ();
     powerups = GameObject.FindGameObjectWithTag("Statics").GetComponent <Powerups> ();
     updateFoodUI();
     updateWeaponUI();
     updatePowerupGUI();
     ObjectiveHandler.inst.UpdateUI();
     //Object.DontDestroyOnLoad (transform.gameObject);
 }
Beispiel #4
0
	// Use this for initialization
	void Start () {
		//Initialis the food, weapons and powerups vars, then update all UI.
		food = GameObject.FindGameObjectWithTag ("Statics").GetComponent<UIFood> ();
		weapons = GameObject.FindGameObjectWithTag ("Statics").GetComponent<UIWeapons> ();
		powerups = GameObject.FindGameObjectWithTag ("Statics").GetComponent<Powerups> ();
		updateFoodUI ();
		updateWeaponUI ();
		updatePowerupGUI ();
		ObjectiveHandler.inst.UpdateUI ();
		//Object.DontDestroyOnLoad (transform.gameObject);
	}