Exemplo n.º 1
0
	void Start(){
		spawner = GameObject.Find ("PersonSpawner").GetComponent<PersonSpawn>();
	}
Exemplo n.º 2
0
	// Use this for initialization
	void Start () {
		text.text = "";

		//Reset Score
		GameController.Instance.score = 0;

		playerInputList = new List<GameObject>();
		clearBtns = new List<ButtonController>();
		btns = new List<ButtonController>();

		for(int y = 0; y < maxY; y++){
			for(int x = 0; x < maxX; x++){
				GameObject obj = (GameObject)GameObject.Instantiate(btnPref);
				obj.transform.SetParent(rootObj.transform);
				float setx = (float)x * width + bufx;
				float sety = (float)y * high + buff;
				obj.transform.SetLocalPosition(setx, sety, 0.0f);
				obj.SetActive(true);
				ButtonController ctr = obj.GetComponent<ButtonController>();
				ctr.Init(x, y, EnumCommon.Random<STR>().ToString(), this.SetList);

				btns.Add(ctr);
			}
		}

		timeIndex = 0;
		daynight = GameObject.Find ("DayNight").GetComponent<Text>();
		daynight.text = "Morning";

		currentLife = maxLife;

		//bg = GameObject.Find ("Background");
        cam = GameObject.Find("BG_Camera");

		if(GameController.Instance.state == GameController.STATE.START){
			GameController.Instance.state = GameController.STATE.PLAY;
		}

		spawnObj = GameObject.Find ("PersonSpawner").GetComponent<PersonSpawn>();
	}