Browse Source

Specialised Editors correctly call base OnEnable

master
desktop-maesty/steve 7 years ago
parent
commit
985eae4199
  1. 5
      Assets/Fungus/Scripts/Editor/CallEditor.cs
  2. 3
      Assets/Fungus/Scripts/Editor/CommandEditor.cs
  3. 5
      Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs
  4. 5
      Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs
  5. 5
      Assets/Fungus/Scripts/Editor/LabelEditor.cs
  6. 5
      Assets/Fungus/Scripts/Editor/MenuEditor.cs
  7. 5
      Assets/Fungus/Scripts/Editor/MenuTimerEditor.cs
  8. 5
      Assets/Fungus/Scripts/Editor/PortraitEditor.cs
  9. 5
      Assets/Fungus/Scripts/Editor/SayEditor.cs
  10. 5
      Assets/Fungus/Scripts/Editor/SetVariableEditor.cs
  11. 5
      Assets/Fungus/Scripts/Editor/StageEditor.cs
  12. 5
      Assets/Fungus/Scripts/Editor/VariableConditionEditor.cs
  13. 4
      Assets/Fungus/Scripts/Editor/VariableEditor.cs
  14. 5
      Assets/Fungus/Scripts/Editor/WriteEditor.cs

5
Assets/Fungus/Scripts/Editor/CallEditor.cs

@ -15,10 +15,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty startIndexProp; protected SerializedProperty startIndexProp;
protected SerializedProperty callModeProp; protected SerializedProperty callModeProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
targetFlowchartProp = serializedObject.FindProperty("targetFlowchart"); targetFlowchartProp = serializedObject.FindProperty("targetFlowchart");
targetBlockProp = serializedObject.FindProperty("targetBlock"); targetBlockProp = serializedObject.FindProperty("targetBlock");

3
Assets/Fungus/Scripts/Editor/CommandEditor.cs

@ -40,6 +40,9 @@ namespace Fungus.EditorUtils
public virtual void OnEnable() public virtual void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance
return;
reorderableLists = new Dictionary<string, ReorderableList>(); reorderableLists = new Dictionary<string, ReorderableList>();
} }

5
Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs

@ -17,10 +17,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty fadeDurationProp; protected SerializedProperty fadeDurationProp;
protected SerializedProperty waitUntilFinishedProp; protected SerializedProperty waitUntilFinishedProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
controlProp = serializedObject.FindProperty("control"); controlProp = serializedObject.FindProperty("control");
audioSourceProp = serializedObject.FindProperty("_audioSource"); audioSourceProp = serializedObject.FindProperty("_audioSource");

5
Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs

@ -21,10 +21,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty stringParameterProp; protected SerializedProperty stringParameterProp;
protected SerializedProperty stringEventProp; protected SerializedProperty stringEventProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
descriptionProp = serializedObject.FindProperty("description"); descriptionProp = serializedObject.FindProperty("description");
delayProp = serializedObject.FindProperty("delay"); delayProp = serializedObject.FindProperty("delay");

5
Assets/Fungus/Scripts/Editor/LabelEditor.cs

@ -51,10 +51,9 @@ namespace Fungus.EditorUtils
property.objectReferenceValue = labelObjects[selectedIndex]; property.objectReferenceValue = labelObjects[selectedIndex];
} }
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
keyProp = serializedObject.FindProperty("key"); keyProp = serializedObject.FindProperty("key");
} }

5
Assets/Fungus/Scripts/Editor/MenuEditor.cs

@ -17,10 +17,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty setMenuDialogProp; protected SerializedProperty setMenuDialogProp;
protected SerializedProperty hideThisOptionProp; protected SerializedProperty hideThisOptionProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
textProp = serializedObject.FindProperty("text"); textProp = serializedObject.FindProperty("text");
descriptionProp = serializedObject.FindProperty("description"); descriptionProp = serializedObject.FindProperty("description");

5
Assets/Fungus/Scripts/Editor/MenuTimerEditor.cs

@ -12,10 +12,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty durationProp; protected SerializedProperty durationProp;
protected SerializedProperty targetBlockProp; protected SerializedProperty targetBlockProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
durationProp = serializedObject.FindProperty("_duration"); durationProp = serializedObject.FindProperty("_duration");
targetBlockProp = serializedObject.FindProperty("targetBlock"); targetBlockProp = serializedObject.FindProperty("targetBlock");

5
Assets/Fungus/Scripts/Editor/PortraitEditor.cs

@ -26,10 +26,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty moveProp; protected SerializedProperty moveProp;
protected SerializedProperty shiftIntoPlaceProp; protected SerializedProperty shiftIntoPlaceProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
stageProp = serializedObject.FindProperty("stage"); stageProp = serializedObject.FindProperty("stage");
displayProp = serializedObject.FindProperty("display"); displayProp = serializedObject.FindProperty("display");

5
Assets/Fungus/Scripts/Editor/SayEditor.cs

@ -83,10 +83,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty setSayDialogProp; protected SerializedProperty setSayDialogProp;
protected SerializedProperty waitForVOProp; protected SerializedProperty waitForVOProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
characterProp = serializedObject.FindProperty("character"); characterProp = serializedObject.FindProperty("character");
portraitProp = serializedObject.FindProperty("portrait"); portraitProp = serializedObject.FindProperty("portrait");

5
Assets/Fungus/Scripts/Editor/SetVariableEditor.cs

@ -30,10 +30,9 @@ namespace Fungus.EditorUtils
protected List<SerializedProperty> variableDataProps; protected List<SerializedProperty> variableDataProps;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
variableProp = serializedObject.FindProperty("variable"); variableProp = serializedObject.FindProperty("variable");
setOperatorProp = serializedObject.FindProperty("setOperator"); setOperatorProp = serializedObject.FindProperty("setOperator");

5
Assets/Fungus/Scripts/Editor/StageEditor.cs

@ -16,10 +16,9 @@ namespace Fungus.EditorUtils
protected SerializedProperty fadeDurationProp; protected SerializedProperty fadeDurationProp;
protected SerializedProperty waitUntilFinishedProp; protected SerializedProperty waitUntilFinishedProp;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
displayProp = serializedObject.FindProperty("display"); displayProp = serializedObject.FindProperty("display");
stageProp = serializedObject.FindProperty("stage"); stageProp = serializedObject.FindProperty("stage");

5
Assets/Fungus/Scripts/Editor/VariableConditionEditor.cs

@ -15,10 +15,9 @@ namespace Fungus.EditorUtils
protected Dictionary<System.Type, SerializedProperty> propByVariableType; protected Dictionary<System.Type, SerializedProperty> propByVariableType;
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
variableProp = serializedObject.FindProperty("variable"); variableProp = serializedObject.FindProperty("variable");
compareOperatorProp = serializedObject.FindProperty("compareOperator"); compareOperatorProp = serializedObject.FindProperty("compareOperator");

4
Assets/Fungus/Scripts/Editor/VariableEditor.cs

@ -12,8 +12,10 @@ namespace Fungus.EditorUtils
[CustomEditor (typeof(Variable), true)] [CustomEditor (typeof(Variable), true)]
public class VariableEditor : CommandEditor public class VariableEditor : CommandEditor
{ {
protected virtual void OnEnable() public override void OnEnable()
{ {
base.OnEnable();
Variable t = target as Variable; Variable t = target as Variable;
t.hideFlags = HideFlags.HideInInspector; t.hideFlags = HideFlags.HideInInspector;
} }

5
Assets/Fungus/Scripts/Editor/WriteEditor.cs

@ -30,10 +30,9 @@ namespace Fungus.EditorUtils
EditorGUILayout.SelectableLabel(tagsText, GUI.skin.GetStyle("HelpBox"), GUILayout.MinHeight(pixelHeight)); EditorGUILayout.SelectableLabel(tagsText, GUI.skin.GetStyle("HelpBox"), GUILayout.MinHeight(pixelHeight));
} }
protected virtual void OnEnable() public override void OnEnable()
{ {
if (NullTargetCheck()) // Check for an orphaned editor instance base.OnEnable();
return;
textObjectProp = serializedObject.FindProperty("textObject"); textObjectProp = serializedObject.FindProperty("textObject");
textProp = serializedObject.FindProperty("text"); textProp = serializedObject.FindProperty("text");

Loading…
Cancel
Save