Exemple #1
0
		public override void Deactive() {
			if (monsterLifeBar != null) {
				stageController.stageUi.worldUi.RemoveWidgetLink(monsterAnime.lifeBarPos);
				GameObject.Destroy(monsterLifeBar.gameObject);
				monsterLifeBar = null;
			}
			if (monsterAnime != null) {
				GameObject.Destroy(monsterAnime.gameObject);
				monsterAnime = null;
			}
			base.Deactive();
		}
Exemple #2
0
		public override void Reset(RegionMeta meta, StageController stageController) {
			monsterInfo = new MonsterDataInst(meta.monsterMeta);

			monsterAnime = (GameObject.Instantiate(Resources.Load("Monster/monster_" + monsterInfo.raw.id)) as GameObject).GetComponent<MonsterAnimation>();
			monsterAnime.gameObject.transform.parent = this.transform;
			monsterAnime.gameObject.transform.localPosition = new Vector3(1.2f, GameConsts.Inst.monsterYOffset, 0);
			monsterAnime.anime.CrossFade("Idle");

			monsterLifeBar = stageController.stageUi.worldUi.CreateLifeBar(monsterAnime.lifeBarPos);
			monsterLifeBar.SetHp(monsterInfo.hp, monsterInfo.MaxHp);

			clickArea.gameObject.SetActive(true);
			text.text = "怪兽区域";
			this.stageController = stageController;
			charAnime = stageController.charAnime;
			isBattleEntered = false;
        }