public override IEnumerator CloseSequence(UIAnimationCallback callback) { yield return(null); callback(); //return base.CloseSequence(callback); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { //backSprite.GetComponent<UIRect>().alpha = 0; //backSprite.SetActive(true); btnTable.SetActive(false); titleLabel.GetComponent <UIRect>().alpha = 0; copyLabel.SetActive(false); versionLabel.SetActive(false); return(base.OpenSequence(() => { StartCoroutine(ShowText()); StartCoroutine(ShowBtn()); callback(); })); //panel.alpha = 1; //float x = 0; //while (x < 1) //{ // x = Mathf.MoveTowards(x, 1, 1 / openTime * Time.deltaTime); // backSprite.GetComponent<UIRect>().alpha = x; // yield return null; //} //StartCoroutine(ShowText()); //StartCoroutine(ShowBtn()); //callback(); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { // 飞出按钮 AnimationCurve ac = AniCurveManager.GetInstance().Curve84; btnTable.GetComponent <CanvasGroup>() .DOFade(0, 0.5f) .OnStart(() => { btnTable.SetActive(true); }); for (int i = 0; i < btnTable.transform.childCount; i++) { Transform tr = btnTable.transform.GetChild(i); tr.GetComponent <RectTransform>() .DOAnchorPosX(1710 + 280, 0.5f) .SetEase(ac) .SetDelay(0.05f * i); } yield return(new WaitForSeconds(0.2f)); yield return(base.CloseSequence(() => { //particleCon.SetActive(false); callback(); })); }
public void SwitchTo_VerifyIterative(string next, UIAnimationCallback closeCallback, UIAnimationCallback openCallback) { //Debug.Log(next); //计算板块链:共有链,关闭链,开启链 //例:Avg切换到Enqurie:关闭DialogBox 打开Enquire 共有Avg List <string>[] result = GetListIntersectAndDifference(currentPanelPath, iterator.pathTable[next]); List <string> sameChain = result[0], closeChain = result[1], openChain = result[2]; //自己切换自己的情形 if (openChain.Count == 0 && closeChain.Count == 0) { closeChain = sameChain.GetRange(sameChain.Count - 1, 1); openChain = sameChain.GetRange(sameChain.Count - 1, 1); } //Debug.Log("currentPath:" + ConvertToStringPath(currentPanelPath)); //Debug.Log("sameChain:" + ConvertToStringPath(sameChain)); //Debug.Log("closeChain:" + ConvertToStringPath(closeChain)); //Debug.Log("openChain:" + ConvertToStringPath(openChain)); CloseChain(new Stack <string>(closeChain), () => { SetActiveChain(false, closeChain); SetActiveChain(true, openChain); //可能需要设置打开时初始条件 closeCallback(); OpenChain(new Queue <string>(openChain), openCallback); }); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { return(base.CloseSequence(() => { transform.Find("Main_Container").gameObject.SetActive(false); callback(); })); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { return(base.OpenSequence(() => { transform.Find("Main_Container").gameObject.SetActive(true); transform.Find("Click_Container").gameObject.SetActive(true); callback(); })); }
//TODO:读档的预处理? //public override IEnumerator OpenSequence(UIAnimationCallback callback) //{ // return base.OpenSequence(() => // { // transform.Find("Background_Panel").gameObject.SetActive(true); // transform.Find("CharaGraph_Panel").gameObject.SetActive(true); // callback(); // }); //} public override IEnumerator CloseSequence(UIAnimationCallback callback) { return(base.CloseSequence(() => { //TODO: 也许需要清除所有的背景 transform.Find("Background_Panel/BackGround_Sprite").gameObject.GetComponent <UI2DSprite>().sprite2D = null; transform.Find("CharaGraph_Panel").gameObject.transform.DestroyChildren(); callback(); })); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { Debug.Log("Message Animation Before Out"); selectCon.SetActive(false); GetComponent <MessageUIManager>().ClearText(); return(base.CloseSequence(() => { callback(); })); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { Debug.Log("AVG Animation Init"); selectCon.SetActive(false); backCon.SetActive(true); charaCon.SetActive(true); return(base.OpenSequence(() => { callback(); })); }
//TODO:读档的预处理? //public override IEnumerator OpenSequence(UIAnimationCallback callback) //{ // return base.OpenSequence(() => // { // transform.Find("Background_Panel").gameObject.SetActive(true); // transform.Find("CharaGraph_Panel").gameObject.SetActive(true); // callback(); // }); //} public override IEnumerator CloseSequence(UIAnimationCallback callback) { return(base.CloseSequence(() => { //清除背景与前景 transform.Find("Background_Panel/BackGround_Sprite").gameObject.GetComponent <UI2DSprite>().sprite2D = null; transform.Find("CharaGraph_Panel").gameObject.transform.DestroyChildren(); //关闭其他panel transform.Find("Selection_Panel").gameObject.SetActive(false); callback(); })); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { float x = 0; while (x < 1) { x = Mathf.MoveTowards(x, 1, 1 / openTime * Time.deltaTime); panel.alpha = x; yield return(null); } StartCoroutine(ShowOpen()); callback(); }
/// <summary> /// 自定义进入界面动效 /// </summary> public override IEnumerator OpenSequence(UIAnimationCallback callback) { Debug.Log("Animation Open Sequence"); InitBtn(); BlockBtn(false); //InitLabel(); return(base.OpenSequence(() => { //StartCoroutine(ShowText()); Debug.Log("Animation Opened"); callback(); })); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { StartCoroutine(ShowClose()); float x = 1; while (x > 0) { x = Mathf.MoveTowards(x, 0, 1 / closeTime * Time.fixedDeltaTime); backgroundContainer.GetComponent <UIWidget>().alpha = x; yield return(null); } backgroundContainer.SetActive(false); callback(); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { return(base.OpenSequence(() => { //transform.Find("Main_Container").gameObject.SetActive(true); if (DataManager.GetInstance().tempData.isDiaboxRecover) { GetComponent <DialogBoxUIManager>().ShowWindow(); DataManager.GetInstance().tempData.isDiaboxRecover = false; } //transform.Find("Click_Container").gameObject.SetActive(true); callback(); })); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { InitBtn(); BlockBtn(false); InitLabel(); return(base.OpenSequence(() => { StartCoroutine(ShowText()); callback(); })); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { StartCoroutine(ShowClose()); float x = 1; while (x > 0) { x = Mathf.MoveTowards(x, 0, 1 / closeTime * Time.deltaTime); panel.alpha = x; yield return(null); } //panel.gameObject.SetActive(false); callback(); }
public virtual IEnumerator OpenSequence(UIAnimationCallback callback) { //Debug.Log(Time.time + " Open Panel:" + panel.name); panel.alpha = minAlpha; float fadeSpeed = Math.Abs(maxAlpha - minAlpha) / openTime; while (panel.alpha < maxAlpha) { panel.alpha = Mathf.MoveTowards(panel.alpha, maxAlpha, fadeSpeed * Time.fixedDeltaTime); yield return(null); } callback(); }
/// <summary> /// 自定义进入界面动效 /// </summary> public override IEnumerator OpenSequence(UIAnimationCallback callback) { //Debug.Log("Animation Before Open"); BlockBtn(true); InitLabel(); GetComponent <TitleUIManager>().Init(); //yield return StartCoroutine(tve.Init()); yield return(base.OpenSequence(() => { StartCoroutine(EnterAnimation()); callback(); })); }
/// <summary> /// Panel关闭动画 /// </summary> /// <param name="callback">回调函数</param> /// <returns></returns> public virtual IEnumerator CloseSequence(UIAnimationCallback callback) { //Debug.Log(Time.time + " Close Panel:" + panel.name); panel.alpha = maxAlpha; float fadeSpeed = Math.Abs(maxAlpha - minAlpha) / closeTime; while (panel.alpha > minAlpha) { panel.alpha = Mathf.MoveTowards(panel.alpha, minAlpha, fadeSpeed * Time.deltaTime); //Debug.Log(Time.time + " " + panel.alpha); yield return(null); } callback(); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { panel.alpha = 1; backgroundContainer.SetActive(true); backgroundContainer.GetComponent <UIWidget>().alpha = 0; float x = 0; while (x < 1) { x = Mathf.MoveTowards(x, 1, 1 / openTime * Time.fixedDeltaTime); backgroundContainer.GetComponent <UIWidget>().alpha = x; yield return(null); } StartCoroutine(ShowOpen()); callback(); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { // y = Mathf.MoveTowards(y, -310, 100 / 0.2f * Time.deltaTime); // this.transform.localPosition = new Vector3(-350,y); //return base.CloseSequence(callback); panel.alpha = 1; float y = transform.localPosition.y; float x = transform.localPosition.x; while (y > origin) { y = Mathf.MoveTowards(y, origin, Math.Abs(origin - final) / closeTime * Time.fixedDeltaTime); this.transform.localPosition = new Vector3(x, y); yield return(null); } callback(); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { //yield return new WaitForSeconds(1f); //BlockBtn(false); //panel.alpha = 1; //float x = 1; //while (x > 0) //{ // x = Mathf.MoveTowards(x, 0, 1 / closeTime * Time.deltaTime); // panel.alpha = x; // Debug.Log(x); // yield return null; //} //callback(); return(base.CloseSequence(() => { callback(); })); }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { panel.alpha = 1; InitPosition(); float showtime = 0.2f; while (!AllAriveFinialDest()) { for (int i = 0; i < transform.childCount; i++) { float y = Mathf.MoveTowards(transform.GetChild(i).localPosition.y, destinations[i], (360 - destinations[i]) / showtime * Time.fixedDeltaTime); transform.GetChild(i).localPosition = new Vector3(0, y); } yield return(null); } callback(); }
public override IEnumerator CloseSequence(UIAnimationCallback callback) { return(base.CloseSequence(() => { //清除背景与前景 foreach (Transform child in transform.Find("Background_Panel")) { DestroyImmediate(child.gameObject); } for (int i = 0; i < transform.Find("CharaGraph_Panel").childCount; i++) { Destroy(transform.Find("CharaGraph_Panel").GetChild(i).gameObject); } //关闭其他panel selectCon.SetActive(false); callback(); })); }
private void CloseChain(Stack <string> closeStack, UIAnimationCallback closeFinishCallback) { if (closeStack.Count == 0 || closeStack.Peek() == null) { //已将所有面板关闭 closeFinishCallback(); return; } else { string close = closeStack.Pop(); currentPanelPath.Remove(close); //Debug.Log("path update:" + ConvertToStringPath(currentPanelPath)); iterator.satellightTable[close].Close(() => { CloseChain(closeStack, closeFinishCallback); }); } }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { //Debug.Log("panel == null?" + panel == null + "alpha?" + panel.alpha); //UIWidget wi = (UIWidget)panel; panel.alpha = 1; float y = transform.localPosition.y; float x = transform.localPosition.x; while (y < final) { y = Mathf.MoveTowards(y, final, Math.Abs(origin - final) / openTime * Time.fixedDeltaTime); this.transform.localPosition = new Vector3(x, y); yield return(null); } move.enabled = true; dialog.enabled = true; invest.enabled = true; callback(); }
private void OpenChain(Queue <string> openQueue, UIAnimationCallback openFinishCallback) { if (openQueue.Count == 0 || openQueue.Peek() == null) { //已将所有面板开启 openFinishCallback(); return; } else { string open = openQueue.Dequeue(); currentPanelPath.Add(open); //Debug.Log("path update:" + ConvertToStringPath(currentPanelPath)); iterator.satellightTable[open].Open(() => { OpenChain(openQueue, openFinishCallback); }); } }
public override IEnumerator OpenSequence(UIAnimationCallback callback) { Debug.Log("Message Animation Init"); selectCon.SetActive(false); return(base.OpenSequence(() => { if (DataManager.GetInstance().tempData.isDiaboxRecover) { GetComponent <MessageUIManager>().ShowWindow( new Action(() => { callback(); }) ); DataManager.GetInstance().tempData.isDiaboxRecover = false; } else { callback(); } })); }
/// <summary> /// 自定义退出界面动效 /// </summary> public override IEnumerator CloseSequence(UIAnimationCallback callback) { // 飞出按钮 AnimationCurve ac = AniCurveManager.GetInstance().Curve84; if (twq != null) { twq.Kill(); } twq = DOTween.Sequence(); //videoSprite.GetComponent<RectTransform>() // .DOAnchorPosX(-45f, 0.66f); twq.Append( btnCon.GetComponent <CanvasGroup>() .DOFade(0, 0.5f) .OnStart(() => { btnCon.SetActive(true); }) ); for (int i = 0; i < btnCon.transform.childCount; i++) { Transform tr = btnCon.transform.GetChild(i); twq.Join( tr.GetComponent <RectTransform>() .DOAnchorPosX(280, 0.5f) .SetEase(ac) .SetDelay(0.05f * i) ); } twq.Play(); yield return(new WaitForSeconds(0.2f)); yield return(base.CloseSequence(() => { //particleCon.SetActive(false); videoCon.SetActive(false); callback(); })); }
public void SwitchTo_VerifyIterative_WithOpenCallback(string next, UIAnimationCallback openCallback) { SwitchTo_VerifyIterative(next, () => { }, openCallback); }