//显示并隐藏 private IEnumerator ShowHideFaceTalk(int faceId) { _labelTalk.text = FightMgr.GetFaceTxt(faceId); float timer = 0; _goFaceShow.transform.localScale = Vector3.zero; _goFaceShow.GetComponent <UISprite>().spriteName = FightMgr.GetFaceSpriteName(faceId); _goFaceShow.SetActive(true); while (timer <= 0.3f) { timer += Time.deltaTime; _goFaceShow.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, timer * 3.3f); yield return(0); } _goFaceShow.transform.localScale = Vector3.one; // yield return new WaitForSeconds(0.3f); _goTalkExpand.SetActive(true); //test // EventDispatcher.TriggerEvent<int>(UIOppFace.OnShowFaceEvent,faceId); yield return(new WaitForSeconds(2f)); _goTalkExpand.SetActive(false); _goFaceShow.SetActive(false); _btnFace.gameObject.SetActive(true); _isShowTalk = false; }
//显示并隐藏 private IEnumerator ShowHideFaceTalk(int faceId) { _labelTalk.text = FightMgr.GetFaceTxt(faceId); float timer = 0; _goFaceShow.transform.localScale = Vector3.zero; _goFaceShow.GetComponent <UISprite>().spriteName = FightMgr.GetFaceSpriteName(faceId); _goFaceShow.SetActive(true); while (timer <= 0.3f) { timer += Time.deltaTime; _goFaceShow.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, timer * 3.3f); yield return(0); } _goFaceShow.transform.localScale = Vector3.one; // yield return new WaitForSeconds(0.3f); _goTalkExpand.SetActive(true); yield return(new WaitForSeconds(2f)); _goTalkExpand.SetActive(false); _goFaceShow.SetActive(false); }