111
This commit is contained in:
49
Assets/ThirdParty/Tools/SetFrame/Editor/KeyFrameEditor.cs
vendored
Normal file
49
Assets/ThirdParty/Tools/SetFrame/Editor/KeyFrameEditor.cs
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(KeyFrame))]
|
||||
public class KeyFrameEditor : Editor
|
||||
{
|
||||
KeyFrame inst;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
inst = target as KeyFrame;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
//
|
||||
if (GUILayout.Button("AddPoint", GUILayout.Height(50)))
|
||||
{
|
||||
Transform point = Instantiate(inst.points[inst.points.Length - 1], inst.points[inst.points.Length - 1].position, Quaternion.identity, inst.points[inst.points.Length - 1].parent).transform;
|
||||
List<Transform> listTemp = inst.points.ToList();
|
||||
listTemp.Add(point);
|
||||
inst.points = listTemp.ToArray();
|
||||
}
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
if (GUILayout.Button("SetKey", GUILayout.Height(50)))
|
||||
{
|
||||
if(inst.index < inst.points.Length - 1)
|
||||
{
|
||||
++inst.index;
|
||||
}
|
||||
else
|
||||
{
|
||||
inst.index = 0;
|
||||
}
|
||||
|
||||
//
|
||||
inst.viewPoint.position = inst.points[inst.index].position;
|
||||
|
||||
Debug.Log("N");
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/Tools/SetFrame/Editor/KeyFrameEditor.cs.meta
vendored
Normal file
11
Assets/ThirdParty/Tools/SetFrame/Editor/KeyFrameEditor.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 337fc62398f5de644bb189ab202c0124
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user