Exemplo n.º 1
0
 private void release()
 {
     if (PoolMan.IsSpawned(transform))
     {
         PoolMan.Despawn(transform);
     }
     else if (!PoolMan.Contains(transform))
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    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);
        });
    }