/// <summary> /// Set spawnunit depending on the localplayer and the ESpawnUnit of this /// </summary> protected virtual IEnumerator SetSpawnUnit() { string tag; if (m_type == ESpawnUnit.Top) { tag = Constant.ListOfTag.s_spawnUnit1; } else { tag = Constant.ListOfTag.s_spawnUnit2; } yield return(new WaitWhile(() => GameManager.Instance.GetSpawnUnitForPlayer(GameManager.Instance.GetLocalPlayer(), tag) == null)); m_spawnUnits = GameManager.Instance.GetSpawnUnitForPlayer(GameManager.Instance.GetLocalPlayer(), tag); m_spawnUnits.SetUISelectSpawnUnit(this); SetIcons(); }