public void OnEnable() { behaviour = target as LevelItemBehaviour; behaviour.UpdateMaterial(); prevType = behaviour.Type; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (behaviour.Type != prevType) { behaviour.UpdateMaterial(); } prevType = behaviour.Type; }