public void RemoveUnit(Transform _transform, GV.MUSHROOM_TYPE _type) { switch (_type) { case GV.MUSHROOM_TYPE.PLAYER: RemoveUnitFromList(_transform, playerUnits); break; case GV.MUSHROOM_TYPE.AI: RemoveUnitFromList(_transform, aiUnits); break; } GameObject.Destroy(_transform.gameObject); }
public void SwitchTeam(Transform _transform, GV.MUSHROOM_TYPE _type, Mushroom _mushroom) { switch (_type) { case GV.MUSHROOM_TYPE.PLAYER: m_ai.Remove(_transform); m_player.Add(_transform, _mushroom); _transform.SetParent(playerParent); _transform.tag = GV.MUSHROOM_TAG_PLAYER; break; case GV.MUSHROOM_TYPE.AI: m_player.Remove(_transform); m_ai.Add(_transform, _mushroom); _transform.SetParent(aiParent); _transform.tag = GV.MUSHROOM_TAG_AI; break; } }