iTween static methods
(1) MoveTo: Move from the original position to the target position
(2) MoveFrom: Move from the target position to the original position
(3) MoveAdd: Move the position of the game object over time, according to the amount provided
(4) MoveBy: Increase the provided coordinates To the position of the game object, refer to the blog link like MoveAdd
Use a hash table to add parameters (moveTo as an example)
iTween.MoveTo(gameObject, iTween.Hash
(
"x",1.91f,
"y", 1.6f,
"z",0f, //目标位置
"speed", 18f,//移动的速度
"time", 120f,//移动的时间
"easeType",iTween.EaseType.easeOutCubic,//动画类型
"oncomplete", "End" //移动结束调用时调用End方法
)
);
- ("onstart", "Start") //Call the Start method when starting to move
- ("onupdate". "On") //Call the "On" method during the movement
- Facing a point while moving: args.Add("looktarget", Vector3.zero);
- The speed at which the game object looks at the "looktarget": args.Add("looktime",0.8);
- Provide both "time" and "speed" parameters, the "speed" parameter will be used
- The target position represented by the three parameters "x", "y", and "z" can be replaced by "position", Vector3()
movement mode of easetype
When using: args.Add("easeType", iTween.EaseType.easeOutCubic)