/// <summary> /// 显示提示内容 /// </summary> /// <param name="msg">Message.</param> public void ShowNoteMsg(string msg) { _labelNoteMsg.text = msg; _tweenPosNoteMsg.ResetToBeginning(); _tweenAlphaNoteMsg.ResetToBeginning(); _tweenPosNoteMsg.gameObject.SetActive(true); _tweenPosNoteMsg.enabled = true; _tweenAlphaNoteMsg.enabled = true; _tweenPosNoteMsg.PlayForward(); _tweenAlphaNoteMsg.PlayForward(); }
public void PlayTweenAlpha(GameObject go, float from, float to, float time, EventDelegate.Callback callBack = null) { TweenAlpha ta = go.GetComponent <TweenAlpha>(); ta.from = from; ta.to = to; ta.duration = time; ta.ResetToBeginning(); if (callBack != null) { ta.AddOnFinished(callBack); } ta.PlayForward(); }
private void PlayHpFlying() { UILabel label = null; if (_queueHpLabel.Count > 0) { label = _queueHpLabel.Dequeue(); } else { label = ResourceMgr.Instance.LoadAndInstanceGameObjectFromPreload(FightDefine.LabelHPFlying).GetComponent <UILabel>(); } TweenAlpha tweenAlpha = label.GetComponent <TweenAlpha>(); tweenAlpha.ResetToBeginning(); TweenPosition tweenPos = label.GetComponent <TweenPosition>(); tweenPos.ResetToBeginning(); label.text = (-ModuleFight.CLEINT_DAMAGE).ToString(); label.transform.SetParent(TransHpFlyPos); label.transform.localPosition = new Vector3(0, -0.3f, 0); label.transform.localScale = Vector3.one * 0.005f; label.depth = 213; // Color color = label.color; // color.a = 1f; // label.color = color; tweenPos.delay = Random.Range(0, 500) / 1000f; tweenPos.enabled = true; tweenAlpha.enabled = true; tweenPos.PlayForward(); tweenAlpha.PlayForward(); tweenAlpha.SetOnFinished( () => { label.transform.parent = null; if (_transHpFly != null) { _queueHpLabel.Enqueue(label); } else { Destroy(label.gameObject); } }); }
private void ShowTextAfterTp() { writer.enabled = true; canUseE = true; if (data.cout > 0) { //if (dataList[0].spriteName != eventSpriteName) //{ // eventSpriteName = dataList[0].spriteName; //} string text = data.SpeakList[data.index]; if (text.Contains("*")) { string[] sArrary = text.Split('*'); text = sArrary[0]; } if (text.Length > 60) { addText = text.Substring(60, text.Length - 61); text = text.Substring(0, 60); } //nameLabel.text = dataList[index].name; speakLabel.text = text; } //else if (data != null) //{ // string text = data.SpeakList[data.index]; // if (text.Length > 40) // { // addText = text.Substring(40, text.Length - 41); // text = text.Substring(0, 40); // } // //nameLabel.text = data.name; // speakLabel.text = text; //} if (bg_GameObject.activeSelf == false) { bg_GameObject.SetActive(true); TweenAlpha ta = bg_GameObject.GetComponent <TweenAlpha>(); ta.enabled = true; ta.ResetToBeginning(); } writer.ResetToBeginning(); IEnumeratorManager.Instance.StartCoroutine(SetAcitveSpeakLabel_Delay()); curData = data; }
private void AddTween(bool isadd) { for (int i = 0; i < transform.childCount; i++) { TweenAlpha alpha = transform.GetChild(i).GetComponent <TweenAlpha>(); //TweenPosition positon=transform; if (isadd) { alpha.duration = Duration; alpha.from = 0; alpha.to = 1; alpha.ResetToBeginning(); alpha.PlayForward(); } else { alpha.duration = Duration; alpha.from = 1; alpha.to = 0; alpha.ResetToBeginning(); alpha.PlayForward(); } } }
/// <summary> /// 淡出 /// </summary> public void FadeOut(float duration = 1.5f) { mask.SetActive(true); TweenAlpha ta = mask.GetComponent <TweenAlpha>(); isActive = true; ta.enabled = true; ta.from = 0f; ta.to = 1f; ta.duration = duration; ta.ResetToBeginning(); ta.PlayForward(); ta.onFinished.Clear(); EventDelegate.Add(ta.onFinished, OnFinshed); }
private void Show(Type type) { TwPos.ResetToBeginning(); TwAlpha.ResetToBeginning(); if (type == Type.TankerLost) { TwPos.from = TankerLostPos; } else { TwPos.from = DamagePos; } TwPos.PlayForward(); TwAlpha.PlayForward(); }
public static void ShowChangePressureSlider(PropEventDelegate hander = null) { CharacterPropBase propData = CharacterPropManager.Instance.GetPlayerProp(); CharacterPropBase currentData = CharacterPropManager.Instance.GetPlayerCureentProp(); float sliderValue = currentData.Pressure / propData.Pressure; float needvalue = sliderValue - pressureSlider.value; pressureSlider.gameObject.SetActive(true); TweenAlpha ta = pressureSlider.GetComponent <TweenAlpha>(); ta.onFinished.Clear(); ta.enabled = true; ta.ResetToBeginning(); IEnumeratorManager.Instance.StartCoroutine(ChangePressureSlider_IEnumerator(needvalue, hander)); }
/// <summary> /// 淡入 /// </summary> /// <param name="duration"></param> public void FadeIn(float duration = 1.5f) { //Init(); mask.SetActive(true); TweenAlpha ta = mask.GetComponent <TweenAlpha>(); isActive = true; ta.enabled = true; ta.from = 1; ta.to = 0; ta.duration = duration; ta.ResetToBeginning(); ta.PlayForward(); }
private void OnEvent_EquipSkillAnim(IEvent ievent) { var e = ievent as SkillEquipMainUiAnime; var skillId = e.SkillId; var index = e.Index; if (index < 0 || index >= 4) { Logger.Error("OnSkillEquipMainUiAnime Error Index = {0}", index); } learnSkillID = skillId; var tbSkill = Table.GetSkill(skillId); GameUtils.SetSpriteIcon(SkillMove, tbSkill.Icon); SkillMove.gameObject.SetActive(true); SkillName.text = tbSkill.Name; var tween = SkillMove.GetComponent <TweenPosition>(); tween.to = SkillList[index].transform.localPosition; tween.ResetToBeginning(); tween.PlayForward(); SkillNameTween.ResetToBeginning(); SkillNameTween.PlayForward(); if (GameSetting.Instance.EnableNewFunctionTip) { BlockMainScreen(true); } tween.onFinished.Clear(); tween.onFinished.Add(new EventDelegate(() => { learnSkillID = -1; PlayerDataManager.Instance.LearnSkill(skillId); SkillMove.gameObject.SetActive(false); BlockMainScreen(false); })); if (null != SkillEffectAni) { // var spr = SkillEffectAni.GetComponent<UISprite>(); // if(null!=spr) // { // spr.enabled = true; // } SkillEffectAni.Play(); } }
//播放移动动画 void PlayMoveAnimation(FightRoleAllElement Allelement, FightRoleSelecteElement Selectelement, bool VtoHOrHtoV) { if (!moveCell.gameObject.activeSelf) { moveCell.gameObject.SetActive(true); } Vector3?startPos = null; Vector3?endPos = null; TMovealpaha.ResetToBeginning(); TMovepostion.ResetToBeginning(); if (VtoHOrHtoV) { startPos = GetPosAtMovePanel(Allelement.gameObject); endPos = GetPosAtMovePanel(Selectelement.gameObject); UISprite s = TMovealpaha.GetComponent <UISprite>(); if (s != null) { s.alpha = 0; } TMovealpaha.from = 0; TMovealpaha.to = 1f; TMovealpaha.PlayForward(); } else { startPos = GetPosAtMovePanel(Selectelement.gameObject); endPos = GetPosAtMovePanel(Allelement.gameObject); UISprite s = TMovealpaha.GetComponent <UISprite>(); if (s != null) { s.alpha = 1f; } TMovealpaha.from = 1f; TMovealpaha.to = 0; TMovealpaha.PlayForward(); } TMovepostion.transform.localPosition = (Vector3)startPos; TMovepostion.from = (Vector3)startPos; TMovepostion.to = (Vector3)endPos; TMovepostion.PlayForward(); StartCoroutine(OnPlayMoveAnimationFinished(Allelement, Selectelement, VtoHOrHtoV)); }
public void ShowMsg(string _msg) { //show message label.text = _msg; waitTime = Time.time + tween.duration; if (co != null) { StopCoroutine(co); } co = StartCoroutine(CoShowMessage(_msg)); //tween tween.enabled = true; tween.ResetToBeginning(); tween.PlayForward(); }
public void Invoke_BTN_Alpha(TweenAlpha _target) { GameObject _goTarget = _target.gameObject; if (_goTarget.activeSelf) { _goTarget.SetActive(false); } else { _goTarget.SetActive(true); _target.ResetToBeginning(); _target.PlayForward(); EventDelegate.Add(_target.onFinished, OnAlpahFinishedTrue); } }
public void ShowTip(string str = "") { if (mShowTips == null) { AddShowTips(); } if (mShowTips != null && !mShowTips.activeSelf) { mShowTips.gameObject.SetActive(true); if (!string.IsNullOrEmpty(str)) { mShowTips.GetComponentInChildren <UILabel>().text = str; } mShowTipsTween.ResetToBeginning(); } }
public override void OnOpen(params object[] args) { mode = 1; if (args.Length > 0) { mode = (int)args[0]; } textureGroup.SetActive(mode == MODE_TEXTURE); darkGroup.SetActive(mode == MODE_DARK); if (mode == MODE_DARK) { darkTween.ResetToBeginning(); darkTween.PlayForward(); } }
public ValueData(byte type, ulong now, ulong max, UILabel t) { RunTime = 0; Type = type; NowValue = now; MaxValue = max; Text = t; Text.gameObject.SetActive(true); TweenAlpha alpha = Text.gameObject.GetComponent <TweenAlpha>(); alpha.ResetToBeginning(); Text.alpha = 1; alpha.Play(true); Text.text = "0"; }
public void StartSingleGame() { TweenAlpha ta = gameObject.GetComponent <TweenAlpha>(); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha>(); } ta.ResetToBeginning(); ta.from = 1f; ta.to = 0; ta.duration = 0.5f; ta.SetOnFinished(() => { EventSystem.Instance.FireEvent(EventId.UpdateChaptersView, 1); }); }
public void Invoke_BTN_AlphaScript(GameObject _goTarget) { if (_goTarget.activeSelf) { _goTarget.SetActive(false); } else { _goTarget.SetActive(true); TweenAlpha _t = TweenAlpha.Begin(_goTarget, 0.2f, 1f); _t.from = 0.0f; _t.to = 1f; _t.ResetToBeginning(); EventDelegate.Add(_t.onFinished, OnAlpahFinishedTrue); } }
public void FadeOut(EventDelegate.Callback OnFadeOutFinished = null) { TweenAlpha tween = maskLayerUI.GetComponent <TweenAlpha>(); tween.enabled = true; tween.from = 1.0f; tween.to = 0.0f; tween.ResetToBeginning(); tween.duration = 0.5f; tween.PlayForward(); tween.onFinished.Clear(); if (OnFadeOutFinished != null) { EventDelegate.Add(tween.onFinished, OnFadeOutFinished); } }
public static void resetCellTweenAlpha(int index, object gridObj, GameObject cell, float tweenSpeed, float duration = 0.5f, UITweener.Method method = UITweener.Method.EaseInOut) { TweenAlpha tween = cell.GetComponent <TweenAlpha> (); tween = tween == null?cell.AddComponent <TweenAlpha> () : tween; tween.method = method; tween.enabled = false; tween.from = 0; tween.to = 1; tween.duration = duration; tween.ResetToBeginning(); tween.delay = index * tweenSpeed; tween.Play(); }
void GiveUp() { TweenAlpha ta = gameObject.GetComponent <TweenAlpha> (); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha> (); } ta.ResetToBeginning(); ta.from = 1; ta.to = 0; ta.duration = 0.2f; ta.SetOnFinished(() => { BattleSystem.Instance.PlayerGiveUp(); }); ta.Play(true); }
private IEnumerator CreateBuddyModel(string modelName) { CreateModelFx.CustomSetActive(false); yield return(new WaitForEndOfFrame()); yield return(null); CreateModelFx.CustomSetActive(true); if (mTweenAlpha == null) { if (LobbyTexture == null) { yield break; } mTweenAlpha = LobbyTexture.GetComponent <TweenAlpha>(); } mTweenAlpha.ResetToBeginning(); mTweenAlpha.PlayForward(); if (string.IsNullOrEmpty(modelName) || ModelName == modelName) { yield break; } ModelName = modelName; if (Lobby == null && Loader == null) { Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject); UI3DLobby.Preload(ModelName); yield return(Loader); if (Loader.Success) { Loader.Instance.transform.parent = LobbyTexture.transform; Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>(); Lobby.ConnectorTexture = LobbyTexture; Lobby.SetCameraMode(2, true); } } if (Lobby != null) { Lobby.VariantName = ModelName; } yield break; }
public void ChangeCombo(int digit = 1) { timer = 3f; count += digit; ta.ResetToBeginning(); ts.ResetToBeginning(); if (count == 0) { txt.text = ""; } else { txt.text = count + ""; ta.PlayForward(); ts.PlayForward(); } }
public void InitScoreMark(string text, Color color, GameObject target, float duration, Vector3 offset) { transform.OverlayPosition(target.transform); TweenPosition.Begin(gameObject, duration, tweenPos.value + offset); GetComponent <UILabel>().depth = 999; tweenAlpha.duration = duration; tweenAlpha.ResetToBeginning(); tweenAlpha.PlayForward(); textLabel.color = color; textLabel.effectColor = color; textLabel.text = text; Destroy(gameObject, duration); }
public override void Show(object data = null) { base.Show(data); logoImg.gameObject.SetActive(true); TweenAlpha tween = logoImg.GetComponent <TweenAlpha>(); tween.ResetToBeginning(); tween.enabled = true; tween.PlayForward(); if (!UserManager.GetInstance().HasUser()) { loadBtn.isEnabled = false; } SoundManager.GetInstance().PlayBackgroundMusic(AudioRepository.BG_LOGIN.AsAudioClip(), 1.0f); }
void NextStep() { isKeyPressed = false; //orgPlayerPos = GameMain.instance.mainPlayer.objectbase.realLocalPos; isSKill2BtnClicked = false; isSKillTipsShowd = false; timer = 0f; //前一个的动画暂停 if (curStep >= 0) { TutorialData data = stepArray[curStep]; TweenScale ts = data.content.GetComponent <TweenScale>(); if (ts != null) { ts.enabled = false; ts.transform.localScale = Vector3.one; } tipTextGroup.SetActive(false); if (data.step == EmTutorialStep.ComboSKills1 || data.step == EmTutorialStep.ComboSKills2 || data.step == EmTutorialStep.End) { data.content.SetActive(false); } } curStep++; //新的出现 if (curStep < stepArray.Length) { TutorialData data = stepArray[curStep]; TweenAlpha ta = data.content.GetComponent <TweenAlpha>(); if (ta != null) { ta.ResetToBeginning(); ta.PlayForward(); } data.content.SetActive(true); tipTextGroup.SetActive(true); tipTextLabel.text = data.tipText; } }
void TweenSpriteAlpha(GameObject father) { GameObject goBack = null; UIProgressBar progressBar = null; if (null != father) { progressBar = father.GetComponent <UIProgressBar>(); Transform trans = father.transform.Find("white"); if (trans != null) { goBack = trans.gameObject; } } if (goBack == null) { return; } UISprite spBack = null; if (null != goBack) { spBack = goBack.GetComponent <UISprite>(); } if (null != spBack && null != progressBar) { if (spBack.fillAmount <= progressBar.value) { spBack.fillAmount = progressBar.value; SetCastFlag(true); } else { TweenAlpha tween = goBack.GetComponent <TweenAlpha>(); if (null == tween) { return; } tween.enabled = true; tween.ResetToBeginning(); tween.PlayForward(); } } }
private void Close() { TweenAlpha ta = gameObject.GetComponent <TweenAlpha>(); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha>(); } ta.ResetToBeginning(); ta.from = 1; ta.to = 0f; ta.duration = 1.2f; ta.SetOnFinished(() => { GameObject.Destroy(gameObject); }); Invoke("showLogoWindow", 0.8f); }
/// <summary> /// 延迟名称显示 /// </summary> /// <returns></returns> private System.Collections.IEnumerator DelayHold() { yield return(new WaitForSeconds(3f)); if (null != m_label_MapName && m_label_MapName.gameObject.activeSelf) { TweenAlpha ta = m_label_MapName.gameObject.GetComponent <TweenAlpha>(); ta.from = 1f; ta.to = 0f; ta.ResetToBeginning(); ta.onFinished.Clear(); EventDelegate.Callback callback = () => { ResetMapDisplay(); }; EventDelegate.Set(ta.onFinished, callback); ta.PlayForward(); } }
public void InvokePupup(GameObject _go) { if (_go.activeSelf) { _go.SetActive(false); } else { _go.SetActive(true); TweenScale _ts = _go.GetComponent <TweenScale>(); _ts.ResetToBeginning(); _ts.PlayForward(); TweenAlpha _ta = _go.GetComponent <TweenAlpha>(); _ta.ResetToBeginning(); _ta.PlayForward(); } }
public void FadeOut() { Camera mainCamera = Camera.main; AudioSource musicPlayer = mainCamera.GetComponent(typeof(AudioSource)) as AudioSource; TweenVolume volTween = mainCamera.gameObject.AddComponent<TweenVolume>() as TweenVolume; volTween.from = musicPlayer.volume; volTween.to = 0f; volTween.delay = 2.0f; volTween.duration = 2.5f; panel.gameObject.SetActive(true); tween = panel.GetComponent<TweenAlpha>() as TweenAlpha; tween.from = 0f; tween.to = 1f; tween.duration = 3.0f; tween.delay = 2.0f; tween.ResetToBeginning(); tween.Play(true); volTween.Play(true); }