public void Appear(int sequence, int openOrder, WindowContext context) { if (!this.m_isInitialized) { return; } if (IsActivied()) { return; } this.m_sequence = sequence; this.m_isPlayClose = false; this.m_isPlayHide = false; this.m_isPlayOpen = false; this.m_isHided = false; this.m_isClosed = false; this.m_isActivied = true; m_appearAnimClipTime = 0; windowState = enWindowState.Appear; this.SetDisplayOrder(openOrder); PlayAppearMusic(); if (m_openAnimClip != null) { var animation = GetComponent <Animation>(); if (animation != null) { animation.Play(m_openAnimClip.name); m_appearAnimClipTime = m_openAnimClip.length; this.m_isPlayOpen = true; } else { Debuger.LogError("设置了OpenAniClip,但是未找到 Animation组件!"); } } if (this.m_canvas != null) { this.m_canvas.enabled = true; } this.TryEnableInput(true); AppearComponent(); OnAppear(sequence, openOrder, context); Debug.Log("<color=#FFFF00>" + "Appear " + WindowInfo.Name + " ................." + "</color>"); }
public void Init(Camera UICamera) { if (this.m_isInitialized) { return; } this.InitializeCanvas(); this.SetCanvasMode(UICamera); this.m_components = new List <UIComponent>(); this.m_isClosed = false; this.m_isHided = false; this.m_isActivied = false; windowState = enWindowState.Init; this.m_defaultPriority = this.WindowInfo.Priority; this.InitUIComponent(gameObject); OnInit(UICamera); this.m_isInitialized = true; Debug.Log("<color=#FFFF00>" + "Init " + WindowInfo.Name + " ................." + "</color>"); }
public void Hide(bool force, WindowContext context) { if (this.WindowInfo.AlwaysKeepVisible && force == false) { return; } if (IsHided()) { return; } this.m_isHided = true; this.m_isClosed = false; this.m_isActivied = false; windowState = enWindowState.Hide; PlayHideMusic(); m_hideAnimClipTime = 0; this.m_isPlayClose = false; this.m_isPlayHide = false; this.m_isPlayOpen = false; OnHide(context); this.TryEnableInput(false); if (m_hideAnimClip != null) { var animation = GetComponent <Animation>(); if (animation != null) { animation.Play(m_hideAnimClip.name); m_hideAnimClipTime = m_hideAnimClip.length; this.m_isPlayHide = true; } else { Debuger.LogError("设置了CloseAniClip,但是未找到 Animation组件!"); } } else { HideWorker(); } Debug.Log("<color=#FFFF00>" + "Hide " + WindowInfo.Name + " ................." + "</color>"); }