// 轉生. public void GameRestart() { Maze.Animal animal = GlobalAsset.LastestAnimalOnLayerColor(Player.position.Z.value, Player.Color); AssignPlayer(animal); manager.RebindPlayer(); positionHint.ShowHintAt(manager.PlayerBind.binded.transform.position); UI_Skill.SetActive(true); }
// 指定 animal 給玩家操作. private void AssignPlayer(Maze.Animal animal) { Player = animal; // for test 主角強化. Player.Strong(200, 10, 10); playerHintVector.SetActive(true); }
public void UpdateByAnimal(Maze.Animal animal) { this.hp.text = animal.hp.ToString(); this.ep.text = animal.ep.ToString(); this.hungry.text = animal.hungry.ToString(); this.power.text = animal.Power.ToString(); this.armor.text = animal.Armor.ToString(); }
static public Maze.Animal LastestAnimalOnLayerColor(int layer, Color color) { Maze.Animal animal = null; int index = animals.Count - 1; while (index >= 0) { if (animals[index].position.Z.value == layer && animals[index].Color.Equals(color)) { animal = animals[index]; break; } --index; } return(animal); }
// MazeObjects 的 Clock. private void MazeClock() { // 地圖 行動. gameMap.Clock(); // 所有生物 行動. for (int i = 0; i < GlobalAsset.animals.Count; ++i) { Maze.Animal each = GlobalAsset.animals[i]; if (each.IsDead) { GlobalAsset.animals.RemoveAt(i); --i; continue; } if (each != Player) { each.AutoSurvey(); } each.Action(); each.Clock(); } // 所有生成器 行動. for (int i = 0; i < GlobalAsset.creaters.Count; ++i) { if (GlobalAsset.creaters[i].IsDead) { GlobalAsset.creaters.RemoveAt(i); --i; continue; } GlobalAsset.creaters[i].Clock(); } }
static public void Reset() { player = null; animals.Clear(); creaters.Clear(); }
public void UpdateFor(Maze.Animal animal) { HP.value = animal.hp.BarRate; EP.value = animal.ep.BarRate; Hungry.value = animal.hungry.BarRate; }