unity3d插件之 DoTween
2018-03-15 10:57
921 查看
胜利界面
有时候直接用transform.Doxxxx会重复播放,这时候就可以用Tweener来控制using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; public class TestDotween : MonoBehaviour { public Vector3 vec3; Tweener myTweener; // Use this for initialization void Start () { // "砰" 效果 myTweener = transform.DOPunchScale(new Vector3(1.3f, 1.3f, 0), 1f); myTweener.Pause(); } // Update is called once per frame void Update () { myTweener.Play(); } }
消失效果(文本)
void Update(){ if(Input.GetKey(KeyCode.K)){ killTips.text = string.Format("{0} 杀", ScoreManager.score1); killTips.color = new Color(0.94f,0.32f,0.32f,1); //print("k"); killTips.DOFade(0, 2); } }
控制流程
void Start() { myTweener2 = killTips.DOFade(0, 1f); myTweener2.SetAutoKill(false);// 不自动消失掉动画 myTweener2.Pause(); // 一播放就暂停 } // tip相当于触发点 void Update(){ if(tip){ tip = false; myTweener2.Restart(); myTweener2.Pause(); killTips.text = string.Format("{0} 杀", ScoreManager.score1); killTips.color = new Color(0.94f,0.32f,0.32f,1); //print("k"); StartCoroutine(SleepAndTips(2)); } } // 延迟函数 (延迟tips) IEnumerator SleepAndTips(float s) { yield return new WaitForSeconds(s); //killTips.DOFade(0, 1f); myTweener2.Play(); }
相关文章推荐
- 【Unity3D开发】DOTween 插件仿写
- unity3d DOTween插件学习笔记
- Unity3d Dotween插件的简单介绍及示例代码
- [Unity3d插件]2dtoolkit系列一 创建精灵 推荐
- Unity3d NGUI的使用(一)(插件参数说明及使用)
- Unity3d 曲线Curvy插件的学习使用
- 【Unity3D自学记录】插件之KGFMapSystem,小地图快速创建
- unity3d热更新插件uLua
- Unity3D常用插件下载及使用方法
- Unity3D 2D动画插件EasyMotion2D (之八)TileMap Editor
- Unity3D 画线插件 Vectrosity 画一个一直循环的正弦函数曲线
- Unity3D 程序报DOTween错误的解决方案
- Unity3D 制作UGUI上下文菜单 插件包
- 【DoTween】Unity插件DOTween教程(二)
- UNITY3D 2D物流流体插件下载|Liquid Physics 2D
- Unity3D游戏记录回放插件EZReplayManager(三)
- [Unity插件]DOTween基础
- Unity常用插件Dotween(四)
- Unity3D插件之FingerGestures:手势插件