您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
544 B
31 行
544 B
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
|
|
public class PathwayHandles
|
|
{
|
|
private PathwayConfigSO _pathway;
|
|
private Vector3 _tmp;
|
|
|
|
public PathwayHandles(PathwayConfigSO pathway)
|
|
{
|
|
_pathway = pathway;
|
|
}
|
|
|
|
public int DisplayHandles()
|
|
{
|
|
for (int i = 0; i < _pathway.Waypoints.Count; i++)
|
|
{
|
|
EditorGUI.BeginChangeCheck();
|
|
|
|
_tmp = Handles.PositionHandle(_pathway.Waypoints[i].waypoint, Quaternion.identity);
|
|
|
|
if (EditorGUI.EndChangeCheck())
|
|
{
|
|
_pathway.Waypoints[i].waypoint = _tmp;
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
}
|