现在的位置: 首页 > 综合 > 正文

简单的iTween按路径移动

2014年09月13日 ⁄ 综合 ⁄ 共 347字 ⁄ 字号 评论关闭
using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour
{
    public iTweenPath path;
    public Vector3[] paths;
    void Start()
    {
        paths = new Vector3[path.nodeCount];
        for (int i = 0; i < path.nodeCount; i++)
        {
            paths[i] = path.nodes[i];
        }

        iTween.MoveTo(gameObject, iTween.Hash("path", paths, "speed", 5f, "easeType", iTween.EaseType.linear));
    }
     
    void OnGUI()
    {

    }

    void Update()
    {
        
    }
}

点击这里下载

【上篇】
【下篇】

抱歉!评论已关闭.