holopy3/Assets/Plugins/RootMotion/Editor/FinalIK/VRIKInspector.cs
2020-12-10 15:25:12 +01:00

34 lines
No EOL
890 B
C#

using UnityEditor;
using UnityEngine;
using System.Collections;
namespace RootMotion.FinalIK {
/*
* Custom inspector for VRIK.
* */
[CustomEditor(typeof(VRIK))]
public class VRIKInspector : Editor {
private VRIK script { get { return target as VRIK; }}
private MonoScript monoScript;
void OnEnable() {
if (serializedObject == null) return;
// Changing the script execution order
if (!Application.isPlaying) {
monoScript = MonoScript.FromMonoBehaviour(script as MonoBehaviour);
int currentExecutionOrder = MonoImporter.GetExecutionOrder(monoScript);
if (currentExecutionOrder != 9998) MonoImporter.SetExecutionOrder(monoScript, 9998);
if (script.references.isEmpty) script.AutoDetectReferences();
script.solver.DefaultAnimationCurves();
script.solver.GuessHandOrientations(script.references, true);
// TODO Set dirty
}
}
}
}