Example #1
0
    public void SetData(int godId, Action nextAction)
    {
        this.mNextAction = nextAction;
        this.mGodData    = DataReader <Artifact> .Get(godId);

        if (this.mGodData != null)
        {
            if (UIManagerControl.Instance.IsOpen("TownUI") && this.mGodData.areaIndex == 5)
            {
                Transform transform = WidgetSystem.FindWidgetOnUI(this.mGodData.widgetId, true);
                if (transform != null)
                {
                    transform.get_gameObject().SetActive(true);
                }
                TownUI.Instance.ForceOpenRightBottom();
            }
            this.RefreshDesc(this.mGodData);
            this.mFxIconId = FXSpineManager.Instance.PlaySpine(3907, this.mRectIcon.get_transform(), "TownUI", 14001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
            TimerHeap.AddTimer(500u, 0, delegate
            {
                this.mCanClick = true;
            });
            Debug.Log("=====神器[" + godId + "]开放指导!!!=====");
        }
        else
        {
            this.ExecuteNext();
        }
    }
Example #2
0
    public static Transform FindWidgetOnUI(int widgetId, bool activeSelf = true)
    {
        Transform result = null;
        string    text   = WidgetSystem.FindNameOfUIByWidget(widgetId);

        string[] array = WidgetSystem.FindNameOfWidgetById(widgetId);
        if (!string.IsNullOrEmpty(text) && array != null && array.Length >= 1)
        {
            UIBase uIIfExist = UIManagerControl.Instance.GetUIIfExist(text);
            if (uIIfExist != null)
            {
                if (activeSelf && !uIIfExist.get_gameObject().get_activeSelf())
                {
                    return(null);
                }
                if (array.Length == 1)
                {
                    result = WidgetSystem.FindTransformOfuibase(uIIfExist, GameDataUtils.SplitString4Dot0(array[0]));
                }
                else if (array.Length == 2)
                {
                    Transform transform = WidgetSystem.FindTransformOfuibase(uIIfExist, GameDataUtils.SplitString4Dot0(array[0]));
                    if (transform != null)
                    {
                        result = XUtility.RecursiveFindTransform(transform, GameDataUtils.SplitString4Dot0(array[1]));
                    }
                }
            }
        }
        return(result);
    }
Example #3
0
    public static string FindNameOfUIByWidget(int widgetId)
    {
        UIWidgetTable uIWidgetTable = DataReader <UIWidgetTable> .Get(widgetId);

        if (uIWidgetTable != null)
        {
            if (uIWidgetTable.uiId > 0)
            {
                return(WidgetSystem.FindNameOfUIById(uIWidgetTable.uiId));
            }
            Debug.LogError("GameData.UIWidgetTable no uiId, widgetId = " + widgetId);
        }
        return(string.Empty);
    }
    public static int GetIndexOfRightTop(int areaIndex)
    {
        int num = 1;

        for (int i = 0; i < SystemOpenManager.ButtonsOfRightTop.get_Count(); i++)
        {
            SystemOpen systemOpen = SystemOpenManager.ButtonsOfRightTop.get_Item(i);
            if (systemOpen.areaIndex < areaIndex && WidgetSystem.IsWidgetActiveSelf(systemOpen.widgetId))
            {
                num++;
            }
        }
        return(num);
    }
Example #5
0
    public static bool IsStaticWidget(int widgetId)
    {
        string text = WidgetSystem.FindNameOfUIByWidget(widgetId);

        string[] array = WidgetSystem.FindNameOfWidgetById(widgetId);
        if (!string.IsNullOrEmpty(text) && array != null && array.Length >= 1)
        {
            UIBase uIIfExist = UIManagerControl.Instance.GetUIIfExist(text);
            if (uIIfExist != null && array.Length == 1)
            {
                return(WidgetSystem.IsStatic(uIIfExist, GameDataUtils.SplitString4Dot0(array[0])));
            }
        }
        return(false);
    }
Example #6
0
    public static void OpenUI(int uiId)
    {
        UINameTable uINameTable = DataReader <UINameTable> .Get(uiId);

        if (uINameTable == null)
        {
            return;
        }
        Transform root           = WidgetSystem.GetRoot(uINameTable.parent);
        bool      hideTheVisible = false;

        if (uINameTable.hideTheVisible == 1)
        {
            hideTheVisible = true;
        }
        UIType type = (UIType)uINameTable.type;

        UIManagerControl.Instance.OpenUI(uINameTable.name, root, hideTheVisible, type);
    }
Example #7
0
    public static bool IsUIOpen(int uiId)
    {
        string prefabName = WidgetSystem.FindNameOfUIById(uiId);

        return(UIManagerControl.Instance.IsOpen(prefabName));
    }
Example #8
0
    public static bool IsWidgetActiveSelf(int widgetId)
    {
        Transform transform = WidgetSystem.FindWidgetOnUI(widgetId, true);

        return(!(transform == null) && transform.get_gameObject().get_activeSelf());
    }
 private static Transform GetWidget(int widgetId)
 {
     return(WidgetSystem.FindWidgetOnUI(widgetId, true));
 }
    public static bool GetTargetPosition(int areaId, int widgetId, ref Vector3 position, ref Vector2 offset)
    {
        offset = Vector2.get_zero();
        TownUI instance = TownUI.Instance;

        if (instance == null)
        {
            Debug.LogError("TownUI is null");
            return(false);
        }
        Transform transform = null;

        switch (areaId)
        {
        case 1:
            transform = instance.FindTransform("HeadIcon");
            break;

        case 2:
        {
            transform = instance.FindTransform("ButtonsLeftBase");
            int indexOfLeftMiddle = SystemOpenManager.GetIndexOfLeftMiddle(areaId);
            offset = new Vector2(0f, (float)(-(float)indexOfLeftMiddle * 110));
            break;
        }

        case 3:
            transform = WidgetSystem.FindWidgetOnUI(widgetId, true);
            if (transform != null)
            {
                transform.get_gameObject().SetActive(true);
            }
            instance.SwitchTopRightButtonToShow();
            break;

        case 5:
            transform = WidgetSystem.FindWidgetOnUI(widgetId, true);
            if (transform != null)
            {
                transform.get_gameObject().SetActive(true);
            }
            instance.ForceOpenRightBottom();
            break;

        case 6:
            transform = instance.FindTransform("BigFight");
            break;

        case 7:
            instance.CloseRightMoreButton();
            transform = instance.FindTransform("DailyTask");
            break;

        case 8:
            transform = instance.FindTransform("GodWeaponButton");
            break;
        }
        if (transform == null)
        {
            Debug.LogError(string.Concat(new object[]
            {
                "指导目标为空!!!区域:",
                areaId,
                ", 组件:",
                widgetId
            }));
            return(false);
        }
        position = transform.get_position();
        Debug.Log(string.Concat(new object[]
        {
            "指导目标:",
            transform.get_gameObject().get_name(),
            ", 坐标:",
            position
        }));
        return(true);
    }
Example #11
0
    public void OpenUI_Async(string prefabName, Action <UIBase> finish_callback = null, Transform parent = null)
    {
        int iD = UIID.GetID(prefabName);

        if (iD <= 0)
        {
            Debug.LogError("ui id is illegal, prefab name = " + prefabName);
            return;
        }
        WaitUI.OpenUI(0u);
        UINameTable dataNT = DataReader <UINameTable> .Get(iD);

        if (parent == null)
        {
            parent = WidgetSystem.GetRoot(dataNT.parent);
        }
        bool flag = false;

        if (dataNT.hideTheVisible == 1)
        {
            flag = true;
        }
        UIType type = (UIType)dataNT.type;

        if (this.IsOpen(dataNT.name))
        {
            UIBase uIIfExist = this.GetUIIfExist(dataNT.name);
            uIIfExist.get_transform().SetParent(parent);
            uIIfExist.get_transform().set_localPosition(Vector3.get_zero());
            uIIfExist.get_transform().set_localRotation(Quaternion.get_identity());
            uIIfExist.get_transform().set_localScale(Vector3.get_one());
            this.RefreshlistOpenUI(uIIfExist, true);
            WaitUI.CloseUI(0u);
            if (finish_callback != null)
            {
                finish_callback.Invoke(uIIfExist);
            }
            return;
        }
        if (!UIManagerControl.IsSpecialUI(dataNT.name))
        {
            UIStateSystem.LockOfWaitOpenUI(dataNT.name);
        }
        if (flag || type == UIType.FullScreen)
        {
            this.HideAllInNormalUIRoot(dataNT.name);
        }
        AssetManager.AssetOfTPManager.LoadAtlas(PreloadUIBaseSystem.GetPreloads(dataNT.name), delegate
        {
            this.LoadUI(dataNT.name, parent, type, delegate(UIBase ub)
            {
                if (ub == null)
                {
                    if (!UIManagerControl.IsSpecialUI(dataNT.name))
                    {
                        EventDispatcher.Broadcast <string>("UIManagerControl.UIOpenOfSuccess", dataNT.name);
                    }
                    Debug.LogError("加载失败 : " + dataNT.name);
                    WaitUI.CloseUI(0u);
                    if (finish_callback != null)
                    {
                        finish_callback.Invoke(null);
                    }
                    return;
                }
                if (!UIManagerControl.IsSpecialUI(dataNT.name))
                {
                    GuideManager.Instance.CheckQueue(false, false);
                }
                this.RefreshlistOpenUI(ub, true);
                ub.Show(true);
                if (!UIManagerControl.IsSpecialUI(dataNT.name))
                {
                    GuideManager.Instance.CheckQueue(true, false);
                    EventDispatcher.Broadcast("GuideManager.LevelNow");
                }
                WaitUI.CloseUI(0u);
                if (finish_callback != null)
                {
                    finish_callback.Invoke(ub);
                }
            });
        }, 0);
    }