private IEnumerator showMenuCoroutine() { CameraTool.Lock(true); TweenAlpha.Begin(m_StartUpBtn.gameObject, 0.5f, 0); yield return(new WaitForSeconds(0.5f)); m_StartUpBtn.gameObject.SetActive(false); m_MenuGroup.SetActive(true); foreach (var btn in m_MenuBtn) { Vector3 position = btn.transform.localPosition - Vector3.right * 1100; TweenPosition.Begin(btn.gameObject, 0.5f, position); btn.GetComponent <TweenPosition>().method = NGUITweener.Method.CubicOut; yield return(new WaitForSeconds(0.3f)); } yield return(new WaitForSeconds(0.5f)); CameraTool.Lock(false); }
private IEnumerator showPanelCoroutine(string name) { m_FadeBlack.enabled = true; if (curPanel != null) { m_FadeBlack.alpha = 0; TweenAlpha.Begin(m_FadeBlack.gameObject, 1, 1); yield return(new WaitForSeconds(1f)); Destroy(curPanel); } yield return(null); m_FadeBlack.alpha = 1; foreach (var p in instance.panels) { if (p.name == name) { Transform t = Instantiate(p, Vector3.zero, Quaternion.identity) as Transform; t.parent = transform; t.localScale = Vector3.one; t.name = name; curPanel = t.gameObject; break; } } TweenAlpha.Begin(m_FadeBlack.gameObject, 1, 0); yield return(new WaitForSeconds(1f)); m_FadeBlack.enabled = false; CameraTool.Lock(false); }
public static void ShowPanel(string name) { CameraTool.Lock(true); instance.StartCoroutine(instance.showPanelCoroutine(name)); }