예제 #1
0
	void Start()
	{
		//_ancestor = FindObjectOfType<Ancestor>();
		foreach(Ancestor ancestor in FindObjectsOfType<Ancestor>())
		{
			if (ancestor._isPlayer==true)
			{
				_ancestor = ancestor;
			}
		}
		_ancestor.PassUI(this);
		_hero = FindObjectOfType<HeroController>();
		_hero.PassUI(this);
		_enemy = FindObjectOfType<EnemyController>();
		_enemy.PassUI(this);
		_enemyManager = FindObjectOfType<EnemyManager>();
		_enemyManager.PassUI(this);

		VictoryScreen.SetActive (false);
		LossScreen.SetActive (false);
		
		//_intervalIndicator.value = 0;
		_heroHealth.value = 1;
		_enemyHealth.value = 1;
		
		_playerIcon.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorIcon;
		_playerIcon.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button1.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action1._actionIcon;
		_button1.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button2.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action2._actionIcon;
		_button2.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button3.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action3._actionIcon;
		_button3.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		ExitButton.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;



	}