Ejemplo n.º 1
0
    private void ShowNewFunction(string btnName, Action call = null)
    {
        Transform tm       = null;
        UIButton parentBtn = null;

        foreach (var group in mBtnController.ToggleList)
        {
            for (int i = 0; i < group.ToggleObj.transform.childCount; i++)
            {
                var btn = group.ToggleObj.transform.GetChild(i);
                if (btn.name.Equals(btnName))
                {
                    parentBtn = group.Btn;
                    tm        = btn;
                    break;
                }
            }

            if (null != tm && null != parentBtn)
            {
                break;
            }
        }

        if (null == tm || null == parentBtn)
        {
            return;
        }

        mBtnController.OnSubBtnClick(parentBtn, true);

        var spr  = tm.GetComponent <UISprite>();
        var go   = new GameObject();
        var spr1 = go.AddComponent <UISprite>();

        spr1.atlas      = spr.atlas;
        spr1.spriteName = spr.spriteName;
        spr1.width      = spr.width;
        spr1.height     = spr.height;

        go.transform.parent        = EffectlRoot;
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale    = Vector3.one;

        EffectlRoot.localPosition = Vector3.zero;

        var des = transform.root.InverseTransformPoint(tm.position) + new Vector3(0, -74, 0);


        PanelRoot.root.GetComponent <UIRoot>().StartCoroutine(MoveToPos(StayDelay, MoveTime, go.transform, des, tm, call));
    }