public UHUDItem Jump(GameObject prefab, BaseUnit unit, Transform node = null) { if (prefab == null) { CLog.Error("没有这个prefab"); return(null); } if (spawnPool != null && spawnPool != null) { Transform temp = spawnPool.SpawnTrans(prefab, null, null, Trans); if (temp != null) { UHUDItem tempText = temp.GetComponent <UHUDItem>(); if (tempText != null) { tempText.Init(unit, node); tempText.OnLifeOver = OnLifeOver; tempText.PUIView = this; AddList.Add(tempText); } return(tempText); } } return(null); }
void OnLifeOver(UHUDItem item, float delay) { if (item == null) { return; } if (item.GO == null) { return; } spawnPool.Despawn(item.GO, delay); ClearList.Add(item); }