Skip to main content

Unity: how How to create custom editor script only for one field of an object and leave the rest default in Unity?

added 35 characters in body
Source Link
mt_
  • 586
  • 4
  • 15

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write a complex custom editor script for those fields and leave the rest as is - public and visible in the Editor. I don't want to write lots of extra code to mimic what the editor does so far.

The perfect scenario would be to be able to define a custom editor script for a certain type (the type is not derived from MonoBehavior and cannot be). If a field of that type is public in any script attached to a GO I'd like the Editor to display it the way I've defined.

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write a complex custom editor script for those fields and leave the rest as is. I don't want to write lots of extra code to mimic what the editor does so far.

The perfect scenario would be to be able to define a custom editor script for a certain type (the type is not derived from MonoBehavior and cannot be). If a field of that type is public in any script attached to a GO I'd like the Editor to display it the way I've defined.

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write a complex custom editor script for those fields and leave the rest as is - public and visible in the Editor. I don't want to write lots of extra code to mimic what the editor does so far.

The perfect scenario would be to be able to define a custom editor script for a certain type (the type is not derived from MonoBehavior and cannot be). If a field of that type is public in any script attached to a GO I'd like the Editor to display it the way I've defined.

Source Link
mt_
  • 586
  • 4
  • 15

Unity: how to create custom editor script only for one field of an object and leave the rest default?

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write a complex custom editor script for those fields and leave the rest as is. I don't want to write lots of extra code to mimic what the editor does so far.

The perfect scenario would be to be able to define a custom editor script for a certain type (the type is not derived from MonoBehavior and cannot be). If a field of that type is public in any script attached to a GO I'd like the Editor to display it the way I've defined.