x


Inspecting C# Properties with Unity 3.4

I have some private fields that are exposed with public properties, in C#. I could have sworn that with Unity 3.3, the public properties showed up in the inspector. It doesn't seem to be occurring anymore with Unity 3.4. Does that make sense to anybody?

more ▼

asked Aug 24 '11 at 03:35 AM

mighty_ernie gravatar image

mighty_ernie
46 3 3 4

Properties (in the C# sense) never show in the Inspector, only fields. In Inspector Normal mode, only public fields are shown, in Debug mode, privates are also shown (but can't be edited).

Some caveats apply -- see SerializeField, Nonserialized, and HideInInspector attributes for exceptions. Also, if you create a custom editor, you can show anything you like in the Inspector.

Feb 03 '12 at 05:56 AM yoyo
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

If the property is a class or a generic collection it wont show up.

more ▼

answered Aug 24 '11 at 04:07 AM

Talimar gravatar image

Talimar
146 4 4 7

Ah, yeah, mine are List<>'s. Is that a new behavior? I could have sworn it worked in 3.3...

Aug 24 '11 at 04:24 AM mighty_ernie
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4152
x466
x76
x37

asked: Aug 24 '11 at 03:35 AM

Seen: 1225 times

Last Updated: Feb 03 '12 at 05:56 AM