Example #1
0
    private void AddSpecialTip()
    {
        if (NewbieGuideScriptControl.FormGuideMask != null)
        {
            GameObject gameObject = NewbieGuideScriptControl.FormGuideMask.transform.FindChild("GuideTextStatic").transform.gameObject;
            gameObject.CustomSetActive(false);
        }
        if (this.currentConf.wSpecialTip != 0)
        {
            if (NewbieGuideScriptControl.FormGuideMask == null)
            {
                NewbieGuideScriptControl.OpenGuideForm();
            }
            GameObject gameObject2 = NewbieGuideScriptControl.FormGuideMask.transform.FindChild("GuideTextStatic").transform.gameObject;
            gameObject2.CustomSetActive(false);
            NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)this.currentConf.wSpecialTip);

            if (specialTipConfig != null && specialTipConfig.bGuideTextPos == 0)
            {
                gameObject2.CustomSetActive(true);
                GameObject gameObject3 = gameObject2.transform.FindChild("RightSpecial/Text").transform.gameObject;
                Text       component   = gameObject3.GetComponent <Text>();
                component.set_text(StringHelper.UTF8BytesToString(ref specialTipConfig.szTipText));
            }
        }
    }
Example #2
0
    protected virtual void Update()
    {
        CUIFormScript formGuideMask = NewbieGuideScriptControl.FormGuideMask;

        if (NewbieGuideBaseScript.ms_originalForm != null && formGuideMask != null)
        {
            int count = NewbieGuideBaseScript.ms_highlitGo.get_Count();
            DebugHelper.Assert(count <= NewbieGuideBaseScript.ms_originalGo.get_Count());
            for (int i = 0; i < count; i++)
            {
                GameObject gameObject  = NewbieGuideBaseScript.ms_highlitGo.get_Item(i);
                GameObject gameObject2 = NewbieGuideBaseScript.ms_originalGo.get_Item(i);
                GameObject gameObject3 = null;
                if (NewbieGuideBaseScript.ms_highlighter.get_Count() > i)
                {
                    gameObject3 = NewbieGuideBaseScript.ms_highlighter.get_Item(i);
                }
                if (!(gameObject == null) && !(gameObject2 == null))
                {
                    gameObject.CustomSetActive(gameObject2.activeSelf);
                    Image component  = gameObject2.GetComponent <Image>();
                    Image component2 = gameObject.GetComponent <Image>();
                    if (component != null && component2 != null)
                    {
                        component2.set_color(component.get_color());
                    }
                    RectTransform rectTransform  = gameObject.transform as RectTransform;
                    RectTransform rectTransform2 = gameObject2.transform as RectTransform;
                    rectTransform.localScale = rectTransform2.localScale;
                    rectTransform.pivot      = rectTransform2.pivot;
                    rectTransform.sizeDelta  = rectTransform2.sizeDelta;
                    LayoutElement component3 = rectTransform2.GetComponent <LayoutElement>();
                    if (component3 != null && rectTransform.sizeDelta == Vector2.zero)
                    {
                        rectTransform.sizeDelta = new Vector2(component3.get_preferredWidth(), component3.get_preferredHeight());
                    }
                    rectTransform.position = rectTransform2.position;
                    Vector2 screenPoint = CUIUtility.WorldToScreenPoint(NewbieGuideBaseScript.ms_originalForm.GetCamera(), rectTransform2.position);
                    Vector3 vector      = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, rectTransform.position.z);
                    if (i < NewbieGuideBaseScript.ms_guideTextList.get_Count())
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)this.currentConf.wSpecialTip);

                        if (specialTipConfig != null && specialTipConfig.bGuideTextPos > 0)
                        {
                            if (gameObject3 != null)
                            {
                                NewbieGuideBaseScript.ms_guideTextList.get_Item(i).CustomSetActive(gameObject3.activeSelf);
                            }
                            NewbieGuideBaseScript.UpdateGuideTextPos(specialTipConfig, gameObject2, formGuideMask, NewbieGuideBaseScript.ms_originalForm, NewbieGuideBaseScript.ms_guideTextList.get_Item(i));
                        }
                    }
                }
            }
        }
    }
Example #3
0
    public NewbieGuideSpecialTipConf GetSpecialTipConfig(uint id)
    {
        int length = this.mSpecialTipCacheArr.Length;

        for (int i = 0; i < length; i++)
        {
            NewbieGuideSpecialTipConf conf = this.mSpecialTipCacheArr[i];
            if (conf.dwID == id)
            {
                return(conf);
            }
        }
        return(null);
    }
Example #4
0
    public void Update()
    {
        if (this.m_conf == null || this.m_parentObj == null || this.m_guideTextObj == null || this.m_originalForm == null)
        {
            if (this.m_guideTextStatic != null || this.m_guideTextObj != null)
            {
                this.ClearEffectText();
            }
            return;
        }
        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)this.m_conf.wSpecialTip);

        if (specialTipConfig != null && specialTipConfig.bGuideTextPos > 0)
        {
            this.m_guideTextObj.CustomSetActive(this.m_parentObj.activeInHierarchy && !this.m_originalForm.IsHided());
            NewbieGuideBaseScript.UpdateGuideTextPos(specialTipConfig, this.m_parentObj, this.m_formWeakGuide, this.m_originalForm, this.m_guideTextObj);
        }
    }
    protected virtual void Update()
    {
        CUIFormScript formGuideMask = NewbieGuideScriptControl.FormGuideMask;

        if ((ms_originalForm != null) && (formGuideMask != null))
        {
            int count = ms_highlitGo.Count;
            DebugHelper.Assert(count <= ms_originalGo.Count);
            for (int i = 0; i < count; i++)
            {
                GameObject obj2        = ms_highlitGo[i];
                GameObject inParentObj = ms_originalGo[i];
                if ((obj2 != null) && (inParentObj != null))
                {
                    obj2.CustomSetActive(inParentObj.activeSelf);
                    RectTransform transform  = obj2.transform as RectTransform;
                    RectTransform transform2 = inParentObj.transform as RectTransform;
                    transform.localScale = transform2.localScale;
                    transform.pivot      = transform2.pivot;
                    transform.sizeDelta  = transform2.sizeDelta;
                    LayoutElement component = transform2.GetComponent <LayoutElement>();
                    if ((component != null) && (transform.sizeDelta == Vector2.zero))
                    {
                        transform.sizeDelta = new Vector2(component.preferredWidth, component.preferredHeight);
                    }
                    transform.position = transform2.position;
                    Vector2 screenPoint = CUIUtility.WorldToScreenPoint(ms_originalForm.GetCamera(), transform2.position);
                    Vector3 vector2     = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, transform.position.z);
                    if (i < ms_guideTextList.Count)
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig(this.currentConf.wSpecialTip);

                        if ((specialTipConfig != null) && (specialTipConfig.bGuideTextPos > 0))
                        {
                            ms_guideTextList[i].CustomSetActive(obj2.activeSelf);
                            UpdateGuideTextPos(specialTipConfig, inParentObj, formGuideMask, ms_originalForm, ms_guideTextList[i]);
                        }
                    }
                }
            }
        }
    }
Example #6
0
    private void AddEffectText(NewbieGuideWeakConf conf, GameObject inParentObj, CUIFormScript inOriginalForm)
    {
        this.ClearEffectText();
        if (conf != null && conf.wSpecialTip > 0)
        {
            NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)conf.wSpecialTip);

            if (specialTipConfig != null)
            {
                if (specialTipConfig.bGuideTextPos == 0)
                {
                    if (this.m_guideTextStatic != null)
                    {
                        this.m_guideTextStatic.CustomSetActive(true);
                        Transform transform = this.m_guideTextStatic.transform.FindChild("RightSpecial/Text");
                        if (transform != null)
                        {
                            Text component = transform.GetComponent <Text>();
                            if (component != null)
                            {
                                component.text = StringHelper.UTF8BytesToString(ref specialTipConfig.szTipText);
                            }
                        }
                    }
                }
                else
                {
                    this.m_guideTextObj = NewbieGuideBaseScript.InstantiateGuideText(specialTipConfig, inParentObj, this.m_formWeakGuide, inOriginalForm);
                }
            }
        }
        this.m_conf         = conf;
        this.m_parentObj    = inParentObj;
        this.m_originalForm = inOriginalForm;
        if (this.m_formWeakGuide != null)
        {
            this.m_formWeakGuide.SetPriority(this.m_originalForm.m_priority + 1);
        }
    }
Example #7
0
    private void AddBubbleText(NewbieGuideWeakConf conf, NewbieWeakGuideControl inControl)
    {
        GameObject gameObject = this.m_formWeakGuide.transform.FindChild("GuideText").gameObject;

        gameObject.CustomSetActive(true);
        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)conf.wSpecialTip);

        CUICommonSystem.SetTextContent(gameObject.transform.FindChild("RightSpecial/Text"), specialTipConfig.szTipText);
        RectTransform rectTransform = gameObject.transform as RectTransform;

        rectTransform.anchoredPosition = new Vector2
        {
            x = (float)specialTipConfig.iOffsetX,
            y = (float)specialTipConfig.iOffsetY
        };
        CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(gameObject, "Timer");

        if (conf.Param[0] != 0u)
        {
            componetInChild.SetTotalTime(conf.Param[0]);
        }
        componetInChild.StartTimer();
    }
    public static GameObject InstantiateGuideText(NewbieGuideSpecialTipConf tipConf, GameObject inParentObj, CUIFormScript inGuideForm, CUIFormScript inOriginalForm)
    {
        if (((tipConf == null) || (inParentObj == null)) || ((inGuideForm == null) || (inOriginalForm == null)))
        {
            return(null);
        }
        GameObject gameObject = inGuideForm.gameObject.transform.Find("GuideText").gameObject;

        if (gameObject != null)
        {
            Transform transform = gameObject.transform.FindChild("RightSpecial/Text").transform;
            if (transform != null)
            {
                Text component = transform.gameObject.GetComponent <Text>();
                if (component != null)
                {
                    component.text = StringHelper.UTF8BytesToString(ref tipConf.szTipText);
                }
            }
            gameObject.CustomSetActive(true);
        }
        return(gameObject);
    }
Example #9
0
    private GameObject AddBubbleEffectInternal(GameObject effectParent, NewbieGuideWeakConf conf, NewbieWeakGuideControl inControl, CUIFormScript inOriginalForm)
    {
        if (effectParent == null)
        {
            return(null);
        }
        if (effectParent.transform.FindChild("WeakGuideBubble(Clone)") != null)
        {
            return(null);
        }
        GameObject original = Singleton <CResourceManager> .GetInstance().GetResource(NewbieWeakGuideImpl.WEAK_BUBBLE_PATH, typeof(GameObject), 4, false, false).m_content as GameObject;

        GameObject gameObject = Object.Instantiate(original) as GameObject;

        gameObject.transform.SetParent(effectParent.transform);
        RectTransform             rectTransform    = gameObject.transform.FindChild("Image") as RectTransform;
        RectTransform             rectTransform2   = gameObject.transform as RectTransform;
        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)conf.wSpecialTip);

        if (specialTipConfig != null)
        {
            CUICommonSystem.SetTextContent(rectTransform2.FindChild("Text"), specialTipConfig.szTipText);
        }
        Vector2 anchorMin        = default(Vector2);
        Vector2 anchorMax        = default(Vector2);
        Vector2 pivot            = default(Vector2);
        Vector3 one              = Vector3.one;
        Vector2 anchoredPosition = default(Vector2);

        switch (specialTipConfig.bSpecialTipPos)
        {
        case 0:
            anchorMin.x        = 0f;
            anchorMin.y        = 1f;
            anchorMax.x        = 0f;
            anchorMax.y        = 1f;
            one.y              = -1f;
            pivot.x            = 0f;
            pivot.y            = 0f;
            anchoredPosition.x = 10f;
            anchoredPosition.y = 15f;
            break;

        case 1:
            anchorMin.x        = 0f;
            anchorMin.y        = 0f;
            anchorMax.x        = 0f;
            anchorMax.y        = 0f;
            pivot.x            = 0f;
            pivot.y            = 0f;
            anchoredPosition.x = 10f;
            anchoredPosition.y = -15f;
            break;

        case 2:
            anchorMin.x        = 1f;
            anchorMin.y        = 1f;
            anchorMax.x        = 1f;
            anchorMax.y        = 1f;
            one.y              = -1f;
            pivot.x            = 1f;
            pivot.y            = 0f;
            anchoredPosition.x = -10f;
            anchoredPosition.y = 15f;
            break;

        case 3:
            anchorMin.x        = 1f;
            anchorMin.y        = 0f;
            anchorMax.x        = 1f;
            anchorMax.y        = 0f;
            pivot.x            = 1f;
            pivot.y            = 0f;
            anchoredPosition.x = -10f;
            anchoredPosition.y = -15f;
            break;
        }
        rectTransform2.position         = effectParent.transform.position;
        rectTransform2.anchoredPosition = Vector2.zero;
        Vector2 anchoredPosition2 = rectTransform2.anchoredPosition;

        anchoredPosition2.x            += (float)specialTipConfig.iOffsetX;
        anchoredPosition2.y            += (float)specialTipConfig.iOffsetY;
        rectTransform2.anchoredPosition = anchoredPosition2;
        rectTransform2.localScale       = Vector3.one;
        rectTransform.localScale        = one;
        rectTransform.anchorMin         = anchorMin;
        rectTransform.anchorMax         = anchorMax;
        rectTransform.pivot             = pivot;
        rectTransform.anchoredPosition  = anchoredPosition;
        CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(gameObject, "Timer");

        if (componetInChild != null)
        {
            if (conf.Param[0] != 0u)
            {
                componetInChild.SetTotalTime(conf.Param[0]);
            }
            componetInChild.StartTimer();
        }
        return(gameObject);
    }
Example #10
0
    public static void UpdateGuideTextPos(NewbieGuideSpecialTipConf tipConf, GameObject inParentObj, CUIFormScript inGuideForm, CUIFormScript inOriginalForm, GameObject rootPanel)
    {
        if (tipConf == null || inParentObj == null || inGuideForm == null || inOriginalForm == null)
        {
            return;
        }
        RectTransform rectTransform  = (RectTransform)rootPanel.transform.FindChild("RightSpecial").transform;
        RectTransform rectTransform2 = (RectTransform)rootPanel.transform;
        Vector3       position       = inParentObj.transform.position;
        Vector2       vector         = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), position);
        float         num            = vector.x;
        float         num2           = vector.y;
        float         num3           = 142f;
        float         num4           = 85f;
        Vector2       vector2        = new Vector2(0f, 0f);

        switch (tipConf.bSpecialTipPos)
        {
        case 0:
            vector2 = new Vector2(-num3, num4);
            break;

        case 1:
            vector2 = new Vector2(-num3, -num4);
            break;

        case 2:
            vector2 = new Vector2(num3, num4);
            break;

        case 3:
            vector2 = new Vector2(num3, -num4);
            break;
        }
        if (tipConf.iOffsetX != 0)
        {
            vector2.x += (float)tipConf.iOffsetX;
        }
        if (tipConf.iOffsetY != 0)
        {
            vector2.y += (float)tipConf.iOffsetY;
        }
        vector2.x = inGuideForm.ChangeFormValueToScreen(vector2.x);
        vector2.y = inGuideForm.ChangeFormValueToScreen(vector2.y);
        rectTransform2.sizeDelta = rectTransform.sizeDelta;
        float num5 = rectTransform2.rect.width / 2f;

        num5  = inGuideForm.ChangeFormValueToScreen(num5);
        num5 += 3f;
        float num6 = rectTransform2.rect.height / 2f;

        num6  = inGuideForm.ChangeFormValueToScreen(num6);
        num6 += 3f;
        num  += vector2.x;
        num2 += vector2.y;
        if (num < num5)
        {
            num = num5;
        }
        else if (num + num5 > (float)Screen.width)
        {
            num = (float)Screen.width - num5;
        }
        if (num2 < num6)
        {
            num2 = num6;
        }
        else if (num2 + num6 > (float)Screen.height)
        {
            num2 = (float)Screen.height - num6;
        }
        num  = inGuideForm.ChangeScreenValueToForm(num);
        num2 = inGuideForm.ChangeScreenValueToForm(num2);
        rectTransform2.anchoredPosition = new Vector2(num, num2);
    }
Example #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++;
                }
            }
        }
    }
    public static void UpdateGuideTextPos(NewbieGuideSpecialTipConf tipConf, GameObject inParentObj, CUIFormScript inGuideForm, CUIFormScript inOriginalForm, GameObject rootPanel)
    {
        if (((tipConf != null) && (inParentObj != null)) && ((inGuideForm != null) && (inOriginalForm != null)))
        {
            CUIFormScript script     = inGuideForm;
            RectTransform transform  = (RectTransform)rootPanel.transform.FindChild("RightSpecial").transform;
            RectTransform transform2 = (RectTransform)rootPanel.transform;
            Vector3       position   = inParentObj.transform.position;
            Vector2       vector2    = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), position);
            float         x          = vector2.x;
            float         y          = vector2.y;
            float         num3       = 142f;
            float         num4       = 85f;
            Vector2       vector3    = new Vector2(0f, 0f);
            switch (tipConf.bSpecialTipPos)
            {
            case 0:
                vector3 = new Vector2(-num3, num4);
                break;

            case 1:
                vector3 = new Vector2(-num3, -num4);
                break;

            case 2:
                vector3 = new Vector2(num3, num4);
                break;

            case 3:
                vector3 = new Vector2(num3, -num4);
                break;
            }
            if (tipConf.iOffsetX != 0)
            {
                vector3.x += tipConf.iOffsetX;
            }
            if (tipConf.iOffsetY != 0)
            {
                vector3.y += tipConf.iOffsetY;
            }
            float num5 = Mathf.Max(transform2.rect.width, transform.rect.width) / 2f;
            num5 = script.ChangeFormValueToScreen(num5) + 3f;
            float num6 = Mathf.Max(transform2.rect.height, transform.rect.height) / 2f;
            num6 = script.ChangeFormValueToScreen(num6) + 3f;
            x   += vector3.x;
            y   += vector3.y;
            if (x < num5)
            {
                x = num5;
            }
            else if ((x + num5) > Screen.width)
            {
                x = Screen.width - num5;
            }
            if (y < num6)
            {
                y = num6;
            }
            else if ((y + num6) > Screen.height)
            {
                y = Screen.height - num6;
            }
            x = script.ChangeScreenValueToForm(x);
            y = script.ChangeScreenValueToForm(y);
            transform2.anchoredPosition = new Vector2(x, y);
        }
    }
    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++;
                }
            }
        }
    }