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); }
// 刷新所有角色的行动 public void RefreshActions(ECharacterRelation relation) { List <Character> list = GetChList(relation); foreach (Character ch in list) { ch.RefreshAction(); } }
// 得到能行动的角色的数量 public int GetCanActCount(ECharacterRelation relation) { List <Character> list = GetChList(relation); int count = 0; foreach (Character ch in list) { if (ch.HasAction) { count++; } } return(count); }
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); }
public int CS_GetCanActCount(ECharacterRelation relation) { return(m_CharacterSystem.GetCanActCount(relation)); }
public void CS_RefreshActions(ECharacterRelation relation) { m_CharacterSystem.RefreshActions(relation); }
public Character CS_CreateCharacterAtPoint(ECharacterRelation relation, int id) { return(m_CharacterSystem.CreateCharacterAtPoint(relation, id)); }