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); } }
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++; } } } }