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[] 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;
|
||||
|
||||
// does this type sync anything? otherwise we don't need to show syncInterval
|
||||
@ -95,35 +97,7 @@ public override void OnInspectorGUI()
|
||||
Init(targetScript);
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
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();
|
||||
DrawDefaultInspector();
|
||||
|
||||
// find SyncLists.. they are not properties.
|
||||
int syncListIndex = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user