Пример #1
0
        public Character CreateCharacterAtPoint(ECharacterRelation relation, int id)
        {
            List <Character> list   = null;
            Transform        parent = null;

            switch (relation)
            {
            case ECharacterRelation.OwnSide:
                list   = m_OwnSideCharacters;
                parent = m_OwnSideRoot;
                break;

            case ECharacterRelation.Opposed:
                list   = m_OpposedCharacters;
                parent = m_OpposedRoot;
                break;

            case ECharacterRelation.Friendly:
                list   = m_FriendlyCharacters;
                parent = m_FriendlyRoot;
                break;
            }
            Character character = new Character(id, parent);

            character.GID = ++GameId;
            list.Add(character);
            return(character);
        }
Пример #2
0
        // 刷新所有角色的行动
        public void RefreshActions(ECharacterRelation relation)
        {
            List <Character> list = GetChList(relation);

            foreach (Character ch in list)
            {
                ch.RefreshAction();
            }
        }
Пример #3
0
        // 得到能行动的角色的数量
        public int GetCanActCount(ECharacterRelation relation)
        {
            List <Character> list = GetChList(relation);
            int count             = 0;

            foreach (Character ch in list)
            {
                if (ch.HasAction)
                {
                    count++;
                }
            }
            return(count);
        }
Пример #4
0
        private List <Character> GetChList(ECharacterRelation relation)
        {
            List <Character> list = null;

            switch (relation)
            {
            case ECharacterRelation.OwnSide:
                list = m_OwnSideCharacters;
                break;

            case ECharacterRelation.Opposed:
                list = m_OpposedCharacters;
                break;

            case ECharacterRelation.Friendly:
                list = m_FriendlyCharacters;
                break;
            }
            return(list);
        }
Пример #5
0
 public int CS_GetCanActCount(ECharacterRelation relation)
 {
     return(m_CharacterSystem.GetCanActCount(relation));
 }
Пример #6
0
 public void CS_RefreshActions(ECharacterRelation relation)
 {
     m_CharacterSystem.RefreshActions(relation);
 }
Пример #7
0
 public Character CS_CreateCharacterAtPoint(ECharacterRelation relation, int id)
 {
     return(m_CharacterSystem.CreateCharacterAtPoint(relation, id));
 }