private void CheckNext() { if (this.currentScriptIndex < this.mConfList.Count) { if (!Singleton <NetworkModule> .GetInstance().lobbySvr.connected) { MonoSingleton <NewbieGuideManager> .instance.ForceCompleteNewbieGuide(); } else { NewbieGuideScriptConf conf = this.mConfList[this.currentScriptIndex]; this.mCurrentScript = this.AddScript((NewbieGuideScriptType)conf.wType); if (null != this.mCurrentScript) { this.mCurrentScript.SetData(conf); this.mCurrentScript.CompleteEvent += new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.ScriptCompleteHandler); this.mCurrentScript.CheckSaveEvent += new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.ScriptCheckSaveHandler); this.mCurrentScript.onCompleteAll += new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.CompleteAll); } else { this.CompleteAll(); } } } else { this.CompleteAll(); } if ((this.mCurrentScript != null) && this.mCurrentScript.IsTimeOutSkip()) { this.m_timeOutTimer = 30f; } }
private void CheckNext() { if (this.currentScriptIndex < this.mConfList.get_Count()) { if (!Singleton <NetworkModule> .GetInstance().lobbySvr.connected&& this.curMainLineConf.bIndependentNet != 1) { MonoSingleton <NewbieGuideManager> .get_instance().ForceCompleteNewbieGuide(); } else { NewbieGuideScriptConf newbieGuideScriptConf = this.mConfList.get_Item(this.currentScriptIndex); this.mCurrentScript = this.AddScript((NewbieGuideScriptType)newbieGuideScriptConf.wType); if (null != this.mCurrentScript) { this.mCurrentScript.SetData(newbieGuideScriptConf); this.mCurrentScript.CompleteEvent += new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.ScriptCompleteHandler); this.mCurrentScript.onCompleteAll += new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.CompleteAll); } else { this.CompleteAll(); } } } else { this.CompleteAll(); } if (this.mCurrentScript != null && this.mCurrentScript.IsTimeOutSkip()) { this.m_timeOutTimer = 30f; } }
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)); } } } } } }
private void DestroyCurrentScript() { if (null != this.mCurrentScript) { this.mCurrentScript.CompleteEvent -= new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.ScriptCompleteHandler); this.mCurrentScript.onCompleteAll -= new NewbieGuideBaseScript.NewbieGuideBaseScriptDelegate(this.CompleteAll); Object.Destroy(this.mCurrentScript); this.mCurrentScript = null; } }
public bool NeedBattlePause() { if (null != this.mCurrentScriptControl) { NewbieGuideBaseScript currentScript = this.mCurrentScriptControl.currentScript; if (((null != currentScript) && (currentScript.currentConf != null)) && ((currentScript.currentConf.bStopGame == 2) && currentScript.isGuiding)) { return(true); } } return(false); }
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); } }
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++; } } } }