holopy3/Assets/Plugins/RootMotion/Editor/Shared Demo Scripts/CameraControllerInspector.cs

23 lines
645 B
C#
Raw Permalink Normal View History

2020-12-10 14:25:12 +00:00
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace RootMotion {
// Just making sure the camera controller updates last
[CustomEditor(typeof(CameraController))]
public class CameraControllerInspector : Editor {
private CameraController script { get { return target as CameraController; }}
private MonoScript monoScript;
void OnEnable() {
if (!Application.isPlaying) {
monoScript = MonoScript.FromMonoBehaviour(script);
int currentExecutionOrder = MonoImporter.GetExecutionOrder(monoScript);
if (currentExecutionOrder != 10200) MonoImporter.SetExecutionOrder(monoScript, 10200);
}
}
}
}