void ClearFloatingIcon() { for (int i = 0; i < floatingIconTrans.childCount; i++) { GameObject iconGo = floatingIconTrans.GetChild(0).gameObject; IPoolUnit iPoolUnit = iconGo.GetComponent <IPoolUnit>(); iPoolUnit.Restore(); } }
void HideHud() { foreach (HudInfo info in hudInfoList) { if (info.hudGo != null) { IPoolUnit unit = info.hudGo.GetComponent <IPoolUnit>(); unit.Restore(); info.hudGo = null; } } }
public void RemoveHud(HudType type) { for (int i = hudInfoList.Count - 1; i >= 0; i--) { HudInfo info = hudInfoList[i]; if (info.type == type) { if (info.hudGo != null) { IPoolUnit unit = info.hudGo.GetComponent <IPoolUnit>(); unit.Restore(); info.hudGo = null; } hudInfoList.RemoveAt(i); } } }