holopy3/Assets/Plugins/RootMotion/Editor/FinalIK/FABRIKRootInspector.cs

36 lines
924 B
C#
Raw Normal View History

2020-12-10 14:25:12 +00:00
using UnityEditor;
using UnityEngine;
using System.Collections;
namespace RootMotion.FinalIK {
/*
* Custom inspector for FABRIKRoot.
* */
[CustomEditor(typeof(FABRIKRoot))]
public class FABRIKRootInspector : IKInspector {
private FABRIKRoot script { get { return target as FABRIKRoot; }}
private FABRIKChain selectedChain;
protected override MonoBehaviour GetMonoBehaviour(out int executionOrder) {
executionOrder = 9997;
return script;
}
protected override void AddInspector() {
// Draw the inspector for IKSolverFABRIKRoot
IKSolverFABRIKRootInspector.AddInspector(solver, !Application.isPlaying);
// Warning box
string message = string.Empty;
if (!script.solver.IsValid(ref message)) AddWarningBox(message);
}
void OnSceneGUI() {
// Draw the scene veiw helpers
IKSolverFABRIKRootInspector.AddScene(script.solver, Color.cyan, true, ref selectedChain);
}
}
}