首页 > 其他 > 详细

ITween的概念学习,已 iTween.MoveTo为例

时间:2015-01-10 06:41:18      阅读:550      评论:0      收藏:0      [点我收藏+]

using UnityEngine;
using System.Collections;

public class MoveCube : MonoBehaviour
{

        public GameObject targetGameObject;
        public float time = 4f;
        public iTween.EaseType easeType;

        void Update ()
        {   
       
                if (Input.GetMouseButtonDown (0)) {
                        //iTween.MoveTo(targetGameObject,new Vector3(4,4,0),time);    


//            Hashtable args=new Hashtable();
//            args.Add("x",3);//只控制X的位置  前面是键 后面是指 
//            args.Add("y",5);
//            args.Add("time",4); //运动时间4秒
//            args.Add("delay",1);//延迟1秒
//            args.Add("oncomplete","onupdatefunction");//监测MOVETO回调函数
//            args.Add("looptype","pingpong");
                        Hashtable args = iTween.Hash ("x", 4, "time", 2, "easeType", easeType);
                        iTween.MoveTo (targetGameObject, args);
        
                }

                if (Input.GetMouseButtonDown (1)) {

                        Hashtable args = iTween.Hash ("x", 0, "time", 2, "easeType", easeType);
                        iTween.MoveTo (targetGameObject, args);
                }

        }

        public  void onupdatefunction ()
        {

                print ("执行了");

        }

}

本文出自 “计算机” 博客,请务必保留此出处http://5152481.blog.51cto.com/5142481/1601430

ITween的概念学习,已 iTween.MoveTo为例

原文:http://5152481.blog.51cto.com/5142481/1601430

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!