- Home /
Awake() for Editor- Custom Inspector
Any reason this doesn't work? I don't see why it wouldn't...
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(TargetClass))]
public class TargetClassEditor : Editor
{
public void Awake()
{
Debug.Log("I'm Awake");
}
}
EDIT FOR CLARITY: How do I set my default values and such when extending the editor class for a custom inspector?
Answer by Straight Rainbow · Dec 29, 2012 at 11:31 PM
I am pretty sure you should be using OnEnable() instead of Awake(). Since you are extending the Editor class.
Actually, it looks like OnEnable() plus [ExecuteInEdit$$anonymous$$ode] does work.
:) Awake() is only inherited by $$anonymous$$onoBehavior
Your answer
Follow this Question
Related Questions
Strange Unity state machine behaviour: OnEnable - OnDisable before awake??? 1 Answer
does finction start or awake run when the object or script is enabled mid game 3 Answers
Should I start instantiating my game objects in Start or Awake function when I load my scene? 1 Answer
TransformPoint - different results in Awake() and Start() 0 Answers
Why wouldn't Debug.Log show up in Start or Awake ? 3 Answers