111
This commit is contained in:
8
Assets/ThirdParty/Tools/SetFrame/Editor.meta
vendored
Normal file
8
Assets/ThirdParty/Tools/SetFrame/Editor.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb57a98b7c4419d45943d31b64b932f1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
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:
|
||||
8
Assets/ThirdParty/Tools/SetFrame/Runtime.meta
vendored
Normal file
8
Assets/ThirdParty/Tools/SetFrame/Runtime.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83430cc573152864a92d67919239dc41
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/ThirdParty/Tools/SetFrame/Runtime/KeyFrame.cs
vendored
Normal file
34
Assets/ThirdParty/Tools/SetFrame/Runtime/KeyFrame.cs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class KeyFrame : MonoBehaviour
|
||||
{
|
||||
public int index;
|
||||
public Transform[] points;
|
||||
public Transform viewPoint;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
//clip.
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
if(points.Length > 0)
|
||||
{
|
||||
for(int i = 0; i < points.Length - 1; ++i)
|
||||
{
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawLine(points[i].position, points[i + 1].position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/Tools/SetFrame/Runtime/KeyFrame.cs.meta
vendored
Normal file
11
Assets/ThirdParty/Tools/SetFrame/Runtime/KeyFrame.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d507793a016efd24aa0281024bcc41c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user