|
资源信息 Tutorial Information
教程名称: | NGUI控制Tween Scale实现动画效果(发帖教程) |
适用引擎: | (适用引擎,为空默认为Unity) |
教程语种: | 中文 |
教程等级: | 1 |
教程格式: | 图文(请用IE9以上浏览器访问本版块) |
教程作者: | 转载自互联网 (如有问题请短消息联系作者或发表回复) |
下载地址: | 无 (兑换积分) |
本帖最后由 小米 于 2013-3-30 21:17 编辑
- using UnityEngine;
- using System.Collections;
- public class NewBehaviourScript : MonoBehaviour
- {
- public Transform tweenTarget;
- public float duration = 0.2f;
- public Vector3 a = new Vector3(0,0,0);
- public Vector3 b = new Vector3(200, 200, 0);
- // Use this for initialization
- void Start () {
- a =new Vector3(50, 50, 0);
- Vector3 b = new Vector3(200,200,0);
- }
-
- // Update is called once per frame
- void Update () {
-
- }
- void Be()
- {
- TweenScale.Begin(tweenTarget.gameObject, duration, a);
- }
- void Be1()
- {
- TweenScale.Begin(tweenTarget.gameObject, duration, b);
- }
- }
复制代码
- public GameObject objPanelAvatarSetting;//对象
- public Vector3 a = new Vector3(1f, 1f, 1f);
- public Vector3 b = new Vector3(-2.204684e-05f, -213f, -76.05f);//声明
- //实现代码 利用scale 与position来实现动画
- objPanelAvatarSetting.gameObject.transform.localScale = new Vector3(0, 0, 0);
- TweenScale.Begin(objPanelAvatarSetting.gameObject, 0.5f, a);
- objPanelAvatarSetting.gameObject.transform.localPosition = new Vector3(-175.322f, 121.4104f, -76.05f);
- TweenPosition.Begin(objPanelAvatarSetting.gameObject,0.5f,b);
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
评分
-
查看全部评分
|