mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Using draw default inspector (#1559)
* adding IsParameterControlledByCurve check * using DrawDefaultInspector Now that SyncVar has a drawer this code is redundant
This commit is contained in:
parent
e946c79194
commit
b4ff4f2ce1
@ -17,6 +17,8 @@ public class NetworkBehaviourInspector : Editor
|
|||||||
bool syncsAnything;
|
bool syncsAnything;
|
||||||
bool[] showSyncLists;
|
bool[] showSyncLists;
|
||||||
|
|
||||||
|
// this might be able to be removed right away as it is internal and has no references
|
||||||
|
[System.Obsolete("Override OnInspectorGUI instead")]
|
||||||
internal virtual bool HideScriptField => false;
|
internal virtual bool HideScriptField => false;
|
||||||
|
|
||||||
// does this type sync anything? otherwise we don't need to show syncInterval
|
// does this type sync anything? otherwise we don't need to show syncInterval
|
||||||
@ -95,35 +97,7 @@ public override void OnInspectorGUI()
|
|||||||
Init(targetScript);
|
Init(targetScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
DrawDefaultInspector();
|
||||||
serializedObject.Update();
|
|
||||||
|
|
||||||
// Loop through properties and create one field (including children) for each top level property.
|
|
||||||
SerializedProperty property = serializedObject.GetIterator();
|
|
||||||
bool expanded = true;
|
|
||||||
while (property.NextVisible(expanded))
|
|
||||||
{
|
|
||||||
if (property.name == "m_Script")
|
|
||||||
{
|
|
||||||
if (HideScriptField)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
EditorGUI.BeginDisabledGroup(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(property, true);
|
|
||||||
|
|
||||||
if (property.name == "m_Script")
|
|
||||||
{
|
|
||||||
EditorGUI.EndDisabledGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
expanded = false;
|
|
||||||
}
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
|
||||||
EditorGUI.EndChangeCheck();
|
|
||||||
|
|
||||||
// find SyncLists.. they are not properties.
|
// find SyncLists.. they are not properties.
|
||||||
int syncListIndex = 0;
|
int syncListIndex = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user