File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Components/NetworkTransform Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,9 @@ protected override void OnValidate()
148148 Configure ( ) ;
149149 }
150150
151+ // For NetworkBehaviourInspector
152+ internal override bool showSyncMethod ( ) => false ;
153+
151154 // initialization //////////////////////////////////////////////////////
152155 // forcec configuration of some settings
153156 protected virtual void Configure ( )
Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ public bool authority
121121 // NetworkBehaviourInspector needs to know if we have SyncObjects
122122 internal bool HasSyncObjects ( ) => syncObjects . Count > 0 ;
123123
124+ // NetworkBehaviourInspector needs to know if it should show SyncMethod dropdown
125+ internal virtual bool showSyncMethod ( ) => true ;
126+
124127 // NetworkIdentity based values set from NetworkIdentity.Awake(),
125128 // which is way more simple and way faster than trying to figure out
126129 // component index from in here by searching all NetworkComponents.
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ protected void DrawDefaultSyncSettings()
9696 EditorGUILayout . PropertyField ( serializedObject . FindProperty ( "syncMode" ) ) ;
9797
9898 // sync method: Don't show for NT-based components
99- if ( ! typeof ( NetworkTransformBase ) . IsAssignableFrom ( scriptClass ) )
99+ if ( ( ( NetworkBehaviour ) serializedObject . targetObject ) . showSyncMethod ( ) )
100100 {
101101 SerializedProperty syncMethod = serializedObject . FindProperty ( "syncMethod" ) ;
102102 EditorGUILayout . PropertyField ( syncMethod ) ;
You can’t perform that action at this time.
0 commit comments