Exemplo n.º 1
0
 // 轉生.
 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);
 }
Exemplo n.º 2
0
    // 指定 animal 給玩家操作.
    private void AssignPlayer(Maze.Animal animal)
    {
        Player = animal;

        // for test 主角強化.
        Player.Strong(200, 10, 10);

        playerHintVector.SetActive(true);
    }
Exemplo n.º 3
0
    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();
    }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    // 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();
        }
    }
Exemplo n.º 6
0
 static public void Reset()
 {
     player = null;
     animals.Clear();
     creaters.Clear();
 }
Exemplo n.º 7
0
 public void UpdateFor(Maze.Animal animal)
 {
     HP.value     = animal.hp.BarRate;
     EP.value     = animal.ep.BarRate;
     Hungry.value = animal.hungry.BarRate;
 }