예제 #1
0
    public void RefreshCellG()
    {
        List <EntityBaseController> characters = SoldierManager.Instance.GetCharacters();

        if (characters == null || characters.Count == 0)
        {
            return;
        }

        foreach (var cell in cells)
        {
            cell.ResetPassableDifficulty();
        }

        foreach (var character in characters)
        {
            if (character == null)
            {
                continue;
            }

            BaseCell cell = GetCellByID(character.CurrentCellId);
            if (cell == null)
            {
                continue;
            }

            float passableDifficulty = 0;
            if (m_PassableDifficulty == EPassableDifficulty.High)
            {
                passableDifficulty = GameBlackBoard.CELL_PASSABLE_DIFFICULTY_ADD_PER_CHARACTER_HIGH;
            }
            else if (m_PassableDifficulty == EPassableDifficulty.Medium)
            {
                passableDifficulty = GameBlackBoard.CELL_PASSABLE_DIFFICULTY_ADD_PER_CHARACTER_MEDIUM;
            }
            else if (m_PassableDifficulty == EPassableDifficulty.Low)
            {
                passableDifficulty = GameBlackBoard.CELL_PASSABLE_DIFFICULTY_ADD_PER_CHARACTER_LOW;
            }

            cell.SetPassableDifficulty(cell.PassableDifficulty + passableDifficulty);
        }
    }