Ask Your Question
0

Can static fields be displayed in the Unity Editor?

asked 2023-06-03 06:47:53 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-03 07:12:02 +0000

djk gravatar image

Yes, static fields can be displayed in the Unity Editor.

To do so, you can use the [SerializeField] attribute above the static field you want to display. This will expose the field in the Inspector window of the Editor.

However, keep in mind that static fields are shared between all instances of a class, so modifying them in the Editor can have unforeseeable consequences. Use caution when exposing static fields in the Editor.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-03 06:47:53 +0000

Seen: 15 times

Last updated: Jun 03 '23