mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2026-01-07 23:19:10 +01:00
Reupload files
This commit is contained in:
parent
0baa262e7c
commit
a0ff58caf5
5661 changed files with 1382714 additions and 0 deletions
24
Assets/AstarPathfindingProject/Editor/AnimationLinkEditor.cs
Normal file
24
Assets/AstarPathfindingProject/Editor/AnimationLinkEditor.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pathfinding {
|
||||
[CustomEditor(typeof(AnimationLink))]
|
||||
public class AnimationLinkEditor : Editor {
|
||||
public override void OnInspectorGUI () {
|
||||
DrawDefaultInspector();
|
||||
|
||||
var script = target as AnimationLink;
|
||||
|
||||
EditorGUI.BeginDisabledGroup(script.EndTransform == null);
|
||||
if (GUILayout.Button("Autoposition Endpoint")) {
|
||||
List<Vector3> buffer = Pathfinding.Util.ListPool<Vector3>.Claim();
|
||||
Vector3 endpos;
|
||||
script.CalculateOffsets(buffer, out endpos);
|
||||
script.EndTransform.position = endpos;
|
||||
Pathfinding.Util.ListPool<Vector3>.Release(buffer);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue