在unity写了一个编辑类,基于iTweenpath插件,为了更方便的操作iTweenpath,顺便练习UnityEditor的操作,写了一个CreateiTweenPath,放在Editor文件夹中。
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public class CreateiTweenPath :EditorWindow
{
[MenuItem("GameObject/CreatePath")]
static void main()
{
EditorWindow.GetWindow<CreateiTweenPath>("CreatePath");
}
private Vector2 scrollVec2;
private Transform target=null;
private string pathName="new path 1";
private int nodeCount=2;
private int speed=7;
private Vector3[] nodes = new Vector3[]{Vector3.zero,new Vector3(10,0,0)};
private PathLoopType loopType=PathLoopType.once;
private Color pathColor = Color.cyan;
void OnGUI()
{