/// <summary> /// 供外部调用的打开接口 by吴江 /// </summary> /// <returns></returns> public virtual GUIBase OpenUI(GUIType _baseOn = GUIType.NONE) { baseOn = _baseOn; if (!this.gameObject.activeSelf) { this.gameObject.SetActive(true); TweenAlphaAllChild x = this.gameObject.GetComponent <TweenAlphaAllChild>(); if (x != null) { x.ResetToBeginning(); x.enabled = true; } subWndDictionary.Clear(); for (int i = 0; i < subWndArray.Length; i++) { if (subWndArray[i] != null) { subWndDictionary[subWndArray[i].type] = subWndArray[i]; } } OnOpen(); } return(this); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenAlphaAllChild Begin(GameObject go, float duration, float alpha) { TweenAlphaAllChild comp = UITweener.Begin <TweenAlphaAllChild>(go, duration); comp.from = comp.alpha; comp.to = alpha; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// 供外部调用的打开接口 by吴江 /// </summary> /// <returns></returns> public virtual SubWnd OpenUI() { if (!this.gameObject.activeSelf) { this.gameObject.SetActive(true); TweenAlphaAllChild x = this.gameObject.GetComponent <TweenAlphaAllChild>(); if (x != null) { x.ResetToBeginning(); x.enabled = true; } OnOpen(); } return(this); }
//服务端与客服端文字提示 public IEnumerator StartShow(string text, bool showFrame = true) { labelText.text = text; if (!labelText.enabled || !labelText.gameObject.activeSelf) { labelText.enabled = true; labelText.gameObject.SetActive(true); } ordinary.SetActive(true); spriteFrame.gameObject.SetActive(showFrame); yield return(new WaitForSeconds(3)); isOnFinish = false; if (!isDestroyed) { Vector3 p = transform.localPosition; TweenPosition.Begin(gameObject, 0.4f, new Vector3(p.x, p.y + 20f, p.z)); TweenAlphaAllChild ta = TweenAlphaAllChild.Begin(gameObject, 0.4f, 0); EventDelegate.Add(ta.onFinished, OnFinishEnd); //ta.onFinished = OnFinishEnd; } }
void AddTween(float time) { if (time == 0) { End(); return; } if (data.showType.Contains(4)) { TweenAlphaAllChild ta = TweenAlphaAllChild.Begin(gameObject, time, 0); EventDelegate.Add(ta.onFinished, OnFinishEnd); //ta.onFinished = OnFinishEnd; } else if (data.showType.Contains(5)) { TweenAlphaAllChild ta = TweenAlphaAllChild.Begin(gameObject, time / 2, 1); ta.alpha = 0; ta.from = 0; ta.style = UITweener.Style.PingPong; CancelInvoke("End"); Invoke("End", time); } else if (data.showType.Contains(6)) { TweenScale ts = TweenScale.Begin(gameObject, time, new Vector3(1.1f, 1.1f, 1.1f)); ts.method = UITweener.Method.BounceIn; CancelInvoke("End"); Invoke("End", time); } else if (data.showType.Contains(7)) { Vector3 p = transform.localPosition; TweenPosition.Begin(gameObject, time, p + data.flowLocaV3); TweenScale ts = TweenScale.Begin(gameObject, time, Vector3.zero); EventDelegate.Add(ts.onFinished, OnFinishEnd); } }