Ejemplo n.º 1
0
        public static void RefreshSymbolItem(ResSymbolInfo symbolInfo, GameObject widget, CUIFormScript form)
        {
            if ((symbolInfo != null) && (widget != null))
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    CUseable useableByBaseID = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableByBaseID(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, symbolInfo.dwID);
                    Image    component       = widget.transform.Find("iconImage").GetComponent <Image>();
                    Text     text            = widget.transform.Find("countText").GetComponent <Text>();
                    Text     text2           = widget.transform.Find("nameText").GetComponent <Text>();
                    Text     text3           = widget.transform.Find("descText").GetComponent <Text>();
                    component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbolInfo.dwIcon), form, true, false, false);
                    text.text  = (useableByBaseID == null) ? string.Empty : useableByBaseID.m_stackCount.ToString();
                    text2.text = symbolInfo.szName;
                    text3.text = CSymbolSystem.GetSymbolAttString(symbolInfo.dwID, true);
                    CUIEventScript script = widget.GetComponent <CUIEventScript>();
                    if (script != null)
                    {
                        stUIEventParams eventParams = new stUIEventParams();
                        eventParams.symbolTransParam.symbolCfgInfo = symbolInfo;
                        script.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams);
                    }
                    if (useableByBaseID != null)
                    {
                        CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
                    }
                    else
                    {
                        CUICommonSystem.PlayAnimator(widget, "Symbol_Disabled");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void RefreshSymbolItem(ResSymbolInfo symbolInfo, GameObject widget, CUIFormScript form, enSymbolMakeSource source = enSymbolMakeSource.SymbolManage)
        {
            if (symbolInfo == null || widget == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
            CUseable          useableByBaseID  = useableContainer.GetUseableByBaseID(5, symbolInfo.dwID);
            Image             component        = widget.transform.Find("iconImage").GetComponent <Image>();
            Text      component2 = widget.transform.Find("countText").GetComponent <Text>();
            Text      component3 = widget.transform.Find("nameText").GetComponent <Text>();
            Text      component4 = widget.transform.Find("descText").GetComponent <Text>();
            Transform transform  = widget.transform.Find("Price");

            if (transform != null)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(transform.gameObject, "Text");
                if (componetInChild != null)
                {
                    componetInChild.text = symbolInfo.dwMakeCoin.ToString();
                }
                CUIEventScript component5 = transform.GetComponent <CUIEventScript>();
                if (component5 != null)
                {
                    stUIEventParams eventParams = default(stUIEventParams);
                    eventParams.symbolTransParam.symbolCfgInfo = symbolInfo;
                    component5.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams);
                }
            }
            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbolInfo.dwIcon), form, true, false, false, false);
            component2.text = ((useableByBaseID == null) ? "0" : useableByBaseID.m_stackCount.ToString());
            component3.text = symbolInfo.szName;
            component4.text = CSymbolSystem.GetSymbolAttString(symbolInfo.dwID, true);
            CUIEventScript component6 = widget.GetComponent <CUIEventScript>();

            if (component6 != null)
            {
                stUIEventParams eventParams2 = default(stUIEventParams);
                eventParams2.symbolTransParam.symbolCfgInfo = symbolInfo;
                component6.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams2);
            }
            if (source == enSymbolMakeSource.Mall)
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
            }
            else if (useableByBaseID != null)
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
            }
            else
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Disabled");
            }
        }
Ejemplo n.º 3
0
        private void PlaySingleBreakAnimator()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_symbolTransformPath);

            if (null != form)
            {
                CUICommonSystem.PlayAnimator(form.transform.Find("Panel_SymbolTranform/Panel_Content/iconImage").gameObject, "FenjieAnimation");
                Singleton <CSoundManager> .GetInstance().PostEvent("UI_fuwen_fenjie_dange", null);
            }
        }
Ejemplo n.º 4
0
        public void OnPlayMishuAnimation(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form != null)
            {
                Transform transform = form.transform.Find("LobbyBottom/Newbie/Image_DaJi");
                if (transform != null)
                {
                    CUICommonSystem.PlayAnimator(transform.gameObject, "Blink_0" + UnityEngine.Random.Range(1, 3));
                }
            }
        }
Ejemplo n.º 5
0
        private static void GoToStarAnimState(CUIFormScript starForm, ref StarCondition[] starArr, string animSuffix = "")
        {
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            for (int i = 0; i < 3; i++)
            {
                if (starArr[i].bCompelete)
                {
                    if (i == 1)
                    {
                        flag2 = true;
                    }
                    if (i == 2)
                    {
                        flag3 = true;
                    }
                }
                if (!starArr[i].bCompelete && i == 0)
                {
                    flag = true;
                }
            }
            GameObject gameObject = starForm.transform.Find("Root").gameObject;

            if (flag)
            {
                CUICommonSystem.PlayAnimator(gameObject, string.Format("Star_3{0}", animSuffix));
            }
            else if (flag2)
            {
                if (flag3)
                {
                    CUICommonSystem.PlayAnimator(gameObject, string.Format("Star_3{0}", animSuffix));
                }
                else
                {
                    CUICommonSystem.PlayAnimator(gameObject, string.Format("Star_2{0}", animSuffix));
                }
            }
            else if (flag3)
            {
                CUICommonSystem.PlayAnimator(gameObject, string.Format("Star_1_3{0}", animSuffix));
            }
            else
            {
                CUICommonSystem.PlayAnimator(gameObject, string.Format("Star_1{0}", animSuffix));
            }
        }
Ejemplo n.º 6
0
        public static void GetRollDiscount(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            byte bZheKou = msg.stPkgData.stAkaliShopZheKouRsp.bZheKou;

            Singleton <CMallMysteryShop> .GetInstance().Discount = (uint)(bZheKou * 10);

            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(MYSTERY_ROLL_DISCOUNT_FORM_PATH, false, true);

            DebugHelper.Assert(script != null, "获得随机折扣form失败");
            if (script != null)
            {
                CUICommonSystem.PlayAnimator(Utility.FindChild(script.gameObject, "Panel_NewDiscount/Content/Discount"), string.Format("Discount_{0}", bZheKou));
            }
        }
Ejemplo n.º 7
0
        private void PlayBatchBreakAnimator()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_symbolBreakPath);

            if (null != form)
            {
                Transform transform = form.transform.Find("Panel_SymbolBreak/Panel_Content");
                for (int i = 0; i < s_maxSymbolBreakLevel; i++)
                {
                    GameObject gameObject = transform.Find(string.Format("breakElement{0}", i)).gameObject;
                    Transform  transform2 = gameObject.transform.Find("OnBreakBtn/Checkmark");
                    if ((transform2 != null) && transform2.gameObject.activeSelf)
                    {
                        CUICommonSystem.PlayAnimator(gameObject.transform.Find("Img_Lv").gameObject, "FenjieAnimation");
                    }
                }
                Singleton <CSoundManager> .GetInstance().PostEvent("UI_fuwen_fenjie_piliang", null);
            }
        }
Ejemplo n.º 8
0
        public static void ReceiveDiscount(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if (msg.stPkgData.stAkaliShopFlagRsp.iResult == 0)
            {
                Singleton <MySteryShop> .GetInstance().m_bRequestDiscount = 1;

                Singleton <MySteryShop> .GetInstance().UpdateUI();

                CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(MySteryShop.MYSTERY_ROLL_DISCOUNT_FORM_PATH, false, true);

                DebugHelper.Assert(cUIFormScript != null, "获得随机折扣form失败");
                if (cUIFormScript == null)
                {
                    return;
                }
                CUICommonSystem.PlayAnimator(Utility.FindChild(cUIFormScript.gameObject, "Panel_NewDiscount/Content/Discount"), string.Format("Discount_{0}", Singleton <MySteryShop> .GetInstance().m_AkaliShopDetail.iShowDiscount / 10));
            }
        }
Ejemplo n.º 9
0
        public void CheckWifi()
        {
            if (((this.m_wifiIcon != null) && (this.m_wifiIcon != null)) && (this.m_ping != null))
            {
                int lobbyPing = (int)Singleton <NetworkModule> .GetInstance().lobbyPing;

                lobbyPing = (lobbyPing <= 100) ? lobbyPing : ((((lobbyPing - 100) * 7) / 10) + 100);
                lobbyPing = Mathf.Clamp(lobbyPing, 0, 460);
                uint index = 0;
                if (lobbyPing < 100)
                {
                    index = 2;
                }
                else if (lobbyPing < 200)
                {
                    index = 1;
                }
                else
                {
                    index = 0;
                }
                if (Application.internetReachability == NetworkReachability.NotReachable)
                {
                    CUICommonSystem.PlayAnimator(this.m_wifiIcon, s_noNetStateName);
                }
                else if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
                {
                    CUICommonSystem.PlayAnimator(this.m_wifiIcon, s_wifiStateName[index]);
                }
                else if (Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork)
                {
                    CUICommonSystem.PlayAnimator(this.m_wifiIcon, s_netStateName[index]);
                }
                if ((this.m_wifiInfo != null) && this.m_wifiInfo.activeInHierarchy)
                {
                    this.m_ping.text = lobbyPing + "ms";
                }
            }
        }
Ejemplo n.º 10
0
        public static void SetStarFormData(CUIFormScript form, COMDT_SETTLE_RESULT_DETAIL settleData, ref StarCondition[] starArr)
        {
            GameObject gameObject = form.transform.Find("Root").gameObject;
            int        num        = 0;

            for (int i = 1; i < 4; i++)
            {
                GameObject gameObject2 = form.transform.Find(string.Format("Root/Condition{0}", i)).gameObject;
                Text       component   = gameObject2.transform.Find("Condition_text").gameObject.GetComponent <Text>();
                component.text = starArr[i - 1].ConditionName;
                if (!starArr[i - 1].bCompelete)
                {
                    string name = string.Empty;
                    if (i == 2)
                    {
                        name = "Condition_Star1";
                    }
                    else
                    {
                        name = "Condition_Star";
                    }
                    gameObject2.transform.Find(name).gameObject.CustomSetActive(false);
                    component.color = CUIUtility.s_Color_Grey;
                }
                else
                {
                    num++;
                }
            }
            for (int j = 1; j < 4; j++)
            {
                if (num < j)
                {
                    form.transform.Find(string.Format("Root/Panel_Star/Star{0}", j)).gameObject.CustomSetActive(false);
                }
            }
            CUICommonSystem.PlayAnimator(gameObject, "Win_Show");
        }
Ejemplo n.º 11
0
    private void AddHighlightInternal(GameObject baseGo, CUIFormScript inOriginalForm, bool cloneEvent, bool bShowFinger)
    {
        this.PreHighlight();
        if (baseGo != null)
        {
            NewbieGuideBaseScript.ms_originalGo.Add(baseGo);
        }
        NewbieGuideBaseScript.ms_originalForm = inOriginalForm;
        this.OpenGuideForm();
        if (NewbieGuideScriptControl.FormGuideMask == null)
        {
            NewbieGuideScriptControl.OpenGuideForm();
        }
        List <GameObject> .Enumerator enumerator = NewbieGuideBaseScript.ms_originalGo.GetEnumerator();
        int num = 0;

        while (enumerator.MoveNext())
        {
            GameObject current = enumerator.get_Current();
            if (!(current == null))
            {
                GameObject gameObject = Object.Instantiate(current) as GameObject;
                if (!(gameObject == null))
                {
                    RectTransform rectTransform = gameObject.transform as RectTransform;
                    rectTransform.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                    rectTransform.SetSiblingIndex(1);
                    rectTransform.localScale = current.transform.localScale;
                    RectTransform rectTransform2 = current.transform as RectTransform;
                    rectTransform.pivot     = rectTransform2.pivot;
                    rectTransform.sizeDelta = rectTransform2.sizeDelta;
                    LayoutElement component = current.GetComponent <LayoutElement>();
                    if (component != null && rectTransform.sizeDelta == Vector2.zero)
                    {
                        rectTransform.sizeDelta = new Vector2(component.get_preferredWidth(), component.get_preferredHeight());
                    }
                    rectTransform.position = current.transform.position;
                    Vector2 screenPoint   = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), current.transform.position);
                    Vector3 worldPosition = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, rectTransform.position.z);
                    NewbieGuideScriptControl.FormGuideMask.InitializeWidgetPosition(gameObject, worldPosition);
                    gameObject.CustomSetActive(false);
                    if (cloneEvent)
                    {
                        CUIEventScript component2 = current.GetComponent <CUIEventScript>();
                        CUIEventScript component3 = gameObject.GetComponent <CUIEventScript>();
                        if (component2 && component3)
                        {
                            component3.m_onDownEventParams      = component2.m_onDownEventParams;
                            component3.m_onUpEventParams        = component2.m_onUpEventParams;
                            component3.m_onClickEventParams     = component2.m_onClickEventParams;
                            component3.m_onHoldStartEventParams = component2.m_onHoldStartEventParams;
                            component3.m_onHoldEventParams      = component2.m_onHoldEventParams;
                            component3.m_onHoldEndEventParams   = component2.m_onHoldEndEventParams;
                            component3.m_onDragStartEventParams = component2.m_onDragStartEventParams;
                            component3.m_onDragEventParams      = component2.m_onDragEventParams;
                            component3.m_onDragEndEventParams   = component2.m_onDragEndEventParams;
                            component3.m_onDropEventParams      = component2.m_onDropEventParams;
                            component3.m_closeFormWhenClicked   = component2.m_closeFormWhenClicked;
                            component3.m_belongedFormScript     = component2.m_belongedFormScript;
                            component3.m_belongedListScript     = component2.m_belongedListScript;
                            component3.m_indexInlist            = component2.m_indexInlist;
                        }
                        CUIMiniEventScript component4 = current.GetComponent <CUIMiniEventScript>();
                        CUIMiniEventScript component5 = gameObject.GetComponent <CUIMiniEventScript>();
                        if (component4 && component5)
                        {
                            component5.m_onDownEventParams    = component4.m_onDownEventParams;
                            component5.m_onUpEventParams      = component4.m_onUpEventParams;
                            component5.m_onClickEventParams   = component4.m_onClickEventParams;
                            component5.m_closeFormWhenClicked = component4.m_closeFormWhenClicked;
                            component5.m_belongedFormScript   = component4.m_belongedFormScript;
                            component5.m_belongedListScript   = component4.m_belongedListScript;
                            component5.m_indexInlist          = component4.m_indexInlist;
                        }
                    }
                    else
                    {
                        CUIEventScript component6 = gameObject.GetComponent <CUIEventScript>();
                        if (component6)
                        {
                            component6.enabled = false;
                        }
                        CUIMiniEventScript component7 = gameObject.GetComponent <CUIMiniEventScript>();
                        if (component7)
                        {
                            component7.enabled = false;
                        }
                    }
                    gameObject.CustomSetActive(true);
                    CUIAnimatorScript component8 = current.GetComponent <CUIAnimatorScript>();
                    if (component8 != null)
                    {
                        CUICommonSystem.PlayAnimator(gameObject, component8.m_currentAnimatorStateName);
                    }
                    NewbieGuideBaseScript.ms_highlitGo.Add(gameObject);
                    if (bShowFinger)
                    {
                        GameObject gameObject2 = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                        if (gameObject2 != null)
                        {
                            GameObject gameObject3 = Object.Instantiate(gameObject2) as GameObject;
                            if (gameObject3 != null)
                            {
                                gameObject3.transform.SetParent(gameObject.transform);
                                Transform transform = gameObject3.transform;
                                switch (this.currentConf.wFlipType)
                                {
                                case 0:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipNone;
                                    break;

                                case 1:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipX;
                                    break;

                                case 2:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipY;
                                    break;

                                case 3:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipXY;
                                    break;
                                }
                                gameObject3.transform.position = gameObject.transform.position;
                                (gameObject3.transform as RectTransform).anchoredPosition = new Vector2((float)this.currentConf.iOffsetHighLightX, (float)this.currentConf.iOffsetHighLightY);
                                if (!this.DoesShowArrow())
                                {
                                    gameObject3.transform.FindChild("Panel/ImageFinger").gameObject.CustomSetActive(false);
                                }
                                NewbieGuideBaseScript.ms_highlighter.Add(gameObject3);
                            }
                        }
                    }
                    if (num == 0 && this.currentConf.wSpecialTip != 0)
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)this.currentConf.wSpecialTip);

                        if (specialTipConfig != null && specialTipConfig.bGuideTextPos > 0)
                        {
                            GameObject gameObject4 = NewbieGuideBaseScript.InstantiateGuideText(specialTipConfig, gameObject, NewbieGuideScriptControl.FormGuideMask, inOriginalForm);
                            if (gameObject4 != null)
                            {
                                NewbieGuideBaseScript.ms_guideTextList.Add(gameObject4);
                                gameObject4.CustomSetActive(false);
                            }
                        }
                    }
                    num++;
                }
            }
        }
    }
Ejemplo n.º 12
0
    private void AddHighlightInternal(GameObject baseGo, CUIFormScript inOriginalForm, bool cloneEvent, params GameObject[] addGo)
    {
        this.PreHighlight();
        if (baseGo != null)
        {
            ms_originalGo.Add(baseGo);
        }
        if (addGo != null)
        {
            ms_originalGo.AddRange(addGo);
        }
        ms_originalForm = inOriginalForm;
        this.OpenGuideForm();
        if (NewbieGuideScriptControl.FormGuideMask == null)
        {
            NewbieGuideScriptControl.OpenGuideForm();
        }
        List <GameObject> .Enumerator enumerator = ms_originalGo.GetEnumerator();
        int num = 0;

        while (enumerator.MoveNext())
        {
            GameObject current = enumerator.Current;
            if (current != null)
            {
                GameObject widget = UnityEngine.Object.Instantiate(current) as GameObject;
                if (widget != null)
                {
                    RectTransform transform = widget.transform as RectTransform;
                    transform.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                    transform.SetSiblingIndex(1);
                    transform.localScale = current.transform.localScale;
                    RectTransform transform2 = current.transform as RectTransform;
                    transform.pivot     = transform2.pivot;
                    transform.sizeDelta = transform2.sizeDelta;
                    LayoutElement component = current.GetComponent <LayoutElement>();
                    if ((component != null) && (transform.sizeDelta == Vector2.zero))
                    {
                        transform.sizeDelta = new Vector2(component.preferredWidth, component.preferredHeight);
                    }
                    transform.position = current.transform.position;
                    Vector2 screenPoint   = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), current.transform.position);
                    Vector3 worldPosition = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, transform.position.z);
                    NewbieGuideScriptControl.FormGuideMask.InitializeWidgetPosition(widget, worldPosition);
                    widget.CustomSetActive(false);
                    if (cloneEvent)
                    {
                        CUIEventScript script  = current.GetComponent <CUIEventScript>();
                        CUIEventScript script2 = widget.GetComponent <CUIEventScript>();
                        if ((script != null) && (script2 != null))
                        {
                            script2.m_onDownEventParams      = script.m_onDownEventParams;
                            script2.m_onUpEventParams        = script.m_onUpEventParams;
                            script2.m_onClickEventParams     = script.m_onClickEventParams;
                            script2.m_onHoldStartEventParams = script.m_onHoldStartEventParams;
                            script2.m_onHoldEventParams      = script.m_onHoldEventParams;
                            script2.m_onHoldEndEventParams   = script.m_onHoldEndEventParams;
                            script2.m_onDragStartEventParams = script.m_onDragStartEventParams;
                            script2.m_onDragEventParams      = script.m_onDragEventParams;
                            script2.m_onDragEndEventParams   = script.m_onDragEndEventParams;
                            script2.m_onDropEventParams      = script.m_onDropEventParams;
                            script2.m_closeFormWhenClicked   = script.m_closeFormWhenClicked;
                            script2.m_belongedFormScript     = script.m_belongedFormScript;
                            script2.m_belongedListScript     = script.m_belongedListScript;
                            script2.m_indexInlist            = script.m_indexInlist;
                        }
                        CUIMiniEventScript script3 = current.GetComponent <CUIMiniEventScript>();
                        CUIMiniEventScript script4 = widget.GetComponent <CUIMiniEventScript>();
                        if ((script3 != null) && (script4 != null))
                        {
                            script4.m_onDownEventParams    = script3.m_onDownEventParams;
                            script4.m_onUpEventParams      = script3.m_onUpEventParams;
                            script4.m_onClickEventParams   = script3.m_onClickEventParams;
                            script4.m_closeFormWhenClicked = script3.m_closeFormWhenClicked;
                            script4.m_belongedFormScript   = script3.m_belongedFormScript;
                            script4.m_belongedListScript   = script3.m_belongedListScript;
                            script4.m_indexInlist          = script3.m_indexInlist;
                        }
                    }
                    else
                    {
                        CUIEventScript script5 = widget.GetComponent <CUIEventScript>();
                        if (script5 != null)
                        {
                            script5.enabled = false;
                        }
                        CUIMiniEventScript script6 = widget.GetComponent <CUIMiniEventScript>();
                        if (script6 != null)
                        {
                            script6.enabled = false;
                        }
                    }
                    widget.CustomSetActive(true);
                    CUIAnimatorScript script7 = current.GetComponent <CUIAnimatorScript>();
                    if (script7 != null)
                    {
                        CUICommonSystem.PlayAnimator(widget, script7.m_currentAnimatorStateName);
                    }
                    ms_highlitGo.Add(widget);
                    GameObject content = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                    if (content != null)
                    {
                        GameObject item = UnityEngine.Object.Instantiate(content) as GameObject;
                        if (item != null)
                        {
                            item.transform.SetParent(widget.transform);
                            Transform transform3 = item.transform;
                            switch (this.currentConf.wFlipType)
                            {
                            case 0:
                                transform3.localScale = s_FlipNone;
                                break;

                            case 1:
                                transform3.localScale = s_FlipX;
                                break;

                            case 2:
                                transform3.localScale = s_FlipY;
                                break;

                            case 3:
                                transform3.localScale = s_FlipXY;
                                break;
                            }
                            item.transform.position = widget.transform.position;
                            (item.transform as RectTransform).anchoredPosition = new Vector2((float)this.currentConf.iOffsetHighLightX, (float)this.currentConf.iOffsetHighLightY);
                            if (!this.DoesShowArrow())
                            {
                                item.transform.FindChild("Panel/ImageFinger").gameObject.CustomSetActive(false);
                            }
                            ms_highlighter.Add(item);
                        }
                    }
                    if ((num == 0) && (this.currentConf.wSpecialTip != 0))
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig(this.currentConf.wSpecialTip);

                        if ((specialTipConfig != null) && (specialTipConfig.bGuideTextPos > 0))
                        {
                            GameObject obj6 = InstantiateGuideText(specialTipConfig, widget, NewbieGuideScriptControl.FormGuideMask, inOriginalForm);
                            if (obj6 != null)
                            {
                                ms_guideTextList.Add(obj6);
                                obj6.CustomSetActive(false);
                            }
                        }
                    }
                    num++;
                }
            }
        }
    }
Ejemplo n.º 13
0
        public static void SetRewardFormData(CUIFormScript form, COMDT_SETTLE_RESULT_DETAIL settleData)
        {
            Singleton <CUIManager> .GetInstance().LoadUIScenePrefab(CUIUtility.s_heroSceneBgPath, form);

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                return;
            }
            GameObject gameObject = form.transform.Find("Root/Panel_Interactable/Button_Next").gameObject;

            if (curLvelContext.IsGameTypeActivity())
            {
                gameObject.CustomSetActive(false);
            }
            else
            {
                int nextLevelId = CAdventureSys.GetNextLevelId(curLvelContext.m_chapterNo, (int)curLvelContext.m_levelNo, curLvelContext.m_levelDifficulty);
                if (nextLevelId != 0)
                {
                    if (Singleton <CAdventureSys> .GetInstance().IsLevelOpen(nextLevelId))
                    {
                        gameObject.CustomSetActive(true);
                    }
                    else
                    {
                        gameObject.CustomSetActive(false);
                    }
                }
                else
                {
                    gameObject.CustomSetActive(false);
                }
            }
            gameObject.CustomSetActive(false);
            PVESettleView.Show3DModel(form);
            GameObject gameObject2 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty1").gameObject;
            GameObject gameObject3 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty2").gameObject;
            GameObject gameObject4 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty3").gameObject;
            Text       component   = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaName").gameObject.GetComponent <Text>();

            if (curLvelContext.m_levelDifficulty == 1)
            {
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
            }
            else if (curLvelContext.m_levelDifficulty == 2)
            {
                gameObject2.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
            }
            else if (curLvelContext.m_levelDifficulty == 3)
            {
                gameObject3.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
            }
            component.text = string.Format(curLvelContext.m_levelName, new object[0]);
            PVESettleView._continueBtn1 = form.transform.Find("Root/Panel_Interactable/Button_Once").gameObject;
            PVESettleView._continueBtn2 = form.transform.Find("Root/Panel_Interactable/Button_ReturnLobby").gameObject;
            PVESettleView._continueBtn1.CustomSetActive(true);
            PVESettleView._continueBtn2.CustomSetActive(true);
            PVESettleView.ShowReward(form, settleData);
            CUICommonSystem.PlayAnimator(form.gameObject, "Box_Show_2");
        }
Ejemplo n.º 14
0
        public void RefreshForm(int effectIndex = -1)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_talentBuyFormPath);

            if (form != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    CHeroInfo          heroInfo           = masterRoleInfo.GetHeroInfo(this.m_heroID, false);
                    HeroTalentViewInfo heroTalentViewInfo = TalentView.GetHeroTalentViewInfo(this.m_heroID);
                    if (heroTalentViewInfo != null)
                    {
                        CUIListScript[] scriptArray = new CUIListScript[] { form.gameObject.transform.Find("Panel/PanelLeft/List1").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List2").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List3").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List4").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List5").GetComponent <CUIListScript>() };
                        for (int i = 0; i < 5; i++)
                        {
                            CUIListScript       script2 = scriptArray[i];
                            HeroTalentLevelInfo info4   = heroTalentViewInfo.m_heroTalentLevelInfoList[i];
                            ResTalentLib        lib     = info4.m_tarlentLibList[info4.m_tarlentLibList.Count - 1];
                            Button component            = script2.transform.Find("BtnBuyCoin").GetComponent <Button>();
                            Text   text  = script2.transform.Find("lblTips").GetComponent <Text>();
                            Text   text2 = text.transform.Find("Text").GetComponent <Text>();
                            Image  image = text.transform.Find("Image").GetComponent <Image>();
                            component.gameObject.CustomSetActive(false);
                            text2.gameObject.CustomSetActive(false);
                            image.gameObject.CustomSetActive(false);
                            if (!TalentView.IsHaveTalentBuyFunc(this.m_heroID))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_3");
                            }
                            else if ((heroInfo == null) && (i == 0))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Skin_NeedToBuyAHero");
                            }
                            else if (TalentView.IsBuyTalent(this.m_heroID, i))
                            {
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_2");
                            }
                            else if ((i > 0) && !TalentView.IsBuyTalent(this.m_heroID, i - 1))
                            {
                                int      num2 = heroTalentViewInfo.m_heroTalentLevelInfoList[i - 1].m_tarlentLibList.Count - 1;
                                string   str  = StringHelper.UTF8BytesToString(ref heroTalentViewInfo.m_heroTalentLevelInfoList[i - 1].m_tarlentLibList[num2].szName);
                                string[] args = new string[] { str };
                                text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_4", args);
                            }
                            else
                            {
                                if (heroInfo == null)
                                {
                                    continue;
                                }
                                string str2 = StringHelper.UTF8BytesToString(ref CHeroInfo.GetHeroProficiency(heroInfo.cfgInfo.bJob, heroInfo.m_ProficiencyLV).szTitle);
                                string str3 = StringHelper.UTF8BytesToString(ref CHeroInfo.GetHeroProficiency(heroInfo.cfgInfo.bJob, info4.m_levelDetail.bLvl3UnlockLvl).szTitle);
                                if (heroInfo.m_ProficiencyLV < info4.m_levelDetail.bLvl3UnlockLvl)
                                {
                                    component.gameObject.CustomSetActive(true);
                                    stUIEventParams eventParams = new stUIEventParams {
                                        tag     = info4.m_levelDetail.bLvl3LockCostType,
                                        tagUInt = info4.m_levelDetail.dwLvl3LockCostPrice,
                                        tag2    = i,
                                        tagStr  = StringHelper.UTF8BytesToString(ref lib.szName)
                                    };
                                    CMallSystem.SetPayButton(form, (RectTransform)component.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3LockCostType), info4.m_levelDetail.dwLvl3LockCostPrice, enUIEventID.Talent_Buy_BtnSellClick, ref eventParams);
                                    string[] textArray2 = new string[] { str3 };
                                    text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_7", textArray2);

                                    text2.gameObject.CustomSetActive(true);
                                    image.gameObject.CustomSetActive(true);
                                    CMallSystem.SetPayButton(form, (RectTransform)text.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3UnLockCostType), info4.m_levelDetail.dwLvl3UnLockCostPrice, enUIEventID.None, ref eventParams);
                                }
                                else
                                {
                                    component.gameObject.CustomSetActive(true);
                                    stUIEventParams params2 = new stUIEventParams {
                                        tag     = info4.m_levelDetail.bLvl3UnLockCostType,
                                        tagUInt = info4.m_levelDetail.dwLvl3UnLockCostPrice,
                                        tag2    = i,
                                        tagStr  = StringHelper.UTF8BytesToString(ref lib.szName)
                                    };
                                    CMallSystem.SetPayButton(form, (RectTransform)component.transform, CMallSystem.ResBuyTypeToPayType(info4.m_levelDetail.bLvl3UnLockCostType), info4.m_levelDetail.dwLvl3UnLockCostPrice, enUIEventID.Talent_Buy_BtnSellClick, ref params2);
                                    string[] textArray3 = new string[] { str2 };
                                    text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_8", textArray3);
                                }
                            }
                            script2.SetElementAmount(info4.m_tarlentLibList.Count);
                            for (int j = 0; j < info4.m_tarlentLibList.Count; j++)
                            {
                                GameObject     gameObject = script2.GetElemenet(j).gameObject.transform.Find("talentCell").gameObject;
                                Image          image2     = gameObject.transform.Find("imgIcon").GetComponent <Image>();
                                Image          image3     = gameObject.transform.Find("lock").GetComponent <Image>();
                                Text           text3      = gameObject.transform.Find("lblName").GetComponent <Text>();
                                CanvasGroup    group      = gameObject.GetComponent <CanvasGroup>();
                                CUIEventScript script3    = gameObject.GetComponent <CUIEventScript>();
                                ResTalentLib   lib2       = info4.m_tarlentLibList[j];
                                if (lib2 == null)
                                {
                                    return;
                                }
                                image2.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + lib2.dwIcon, form, true, false, false);
                                image2.color = CUIUtility.s_Color_White;
                                text3.text   = StringHelper.UTF8BytesToString(ref lib2.szName);
                                stTalentEventParams params3 = new stTalentEventParams {
                                    talentLevelIndex = (byte)i,
                                    talentInfo       = info4.m_tarlentLibList[j],
                                    isCanLearn       = false
                                };
                                if (TalentView.IsNeedBuy(i, j) && !TalentView.IsBuyTalent(this.m_heroID, i))
                                {
                                    params3.isHaveTalent = false;
                                    image3.gameObject.CustomSetActive(true);
                                    image2.color = CUIUtility.s_Color_GrayShader;
                                }
                                else
                                {
                                    params3.isHaveTalent = true;
                                    image3.gameObject.CustomSetActive(false);
                                    image2.color = CUIUtility.s_Color_White;
                                    if ((effectIndex == i) && (j == (info4.m_tarlentLibList.Count - 1)))
                                    {
                                        CUICommonSystem.PlayAnimator(gameObject, "UnLock_Anim");
                                    }
                                }
                                string strContent = StringHelper.UTF8BytesToString(ref lib2.szDesc);
                                CUICommonSystem.SetCommonTipsEvent(form, gameObject, strContent, enUseableTipsPos.enTop);
                            }
                        }
                    }
                }
            }
        }