private void release() { if (PoolMan.IsSpawned(transform)) { PoolMan.Despawn(transform); } else if (!PoolMan.Contains(transform)) { Destroy(gameObject); } }
private void showOP(Dictionary <string, object> data, int left, int buyTimeCost = 10) { if (!PoolMan.IsSpawned(transform)) { return; } OPMono = OP.Spawn().GetComponent <OP>(); OPMono.StartWithCmds(data, left, buyTimeCost); Base.Circle.gameObject.SetActive(false); }
public static Transform Spawn() { if (instance == null) { var ins = PoolMan.Spawn("OP", G.UICvs.transform); instance = ins; } else { if (PoolMan.IsSpawned(instance)) { // skip } else { PoolMan.Spawn("OP", G.UICvs.transform); } } return(instance); }
public void Hide() { if (hided || !PoolMan.IsSpawned(transform)) { return; } hided = true; G.PlaySound("hechip"); TextNumber.gameObject.SetActive(false); transform.SetParent(G.UICvs.transform, true); var duration = 0.4f; GetComponent <Image>().DOFade(0.3f, duration); GetComponent <RectTransform>().DOAnchorPos(new Vector2(0, 350), duration) .OnComplete(() => { PoolMan.Despawn(transform); }); }