|
Hi guys, First: Sorry for my bad english ^.^ I am editing the base values for my Player's hitpoints via the Standard Inspector. But by doing this, I have a lot of public values that i do NOT want to have public! They are not going to be modified in any situation. So I want them to have the innermost scope they could have. Best would be private/const/readonly etc. Is there any way to edit private values via a Custom Inspector, because I really dont want them to be modify-able. I hope you all understood me :) greetz
(comments are locked)
|
|
Yes if you write a custom inspector and make some function or property to set those values you would be able to have them as private (but not const or readonly) - but that function will still exist so they could be set by it when called by another piece of the code. Thanks for your answer. I tried this: `using UnityEditor; using UnityEngine; using System.Collections; [CustomEditor(typeof(Mob))] public class MobInspector : Editor { void OnInspectorGUI() { GUILayout.Label("This is a Label in a Custom Editor"); } }` but it does not seem to work. I don't see any label, when I inspect my Mob Script that is attached to a gameobject. Can you give me a short introduction maybe?
Jul 19 '12 at 02:14 PM
lenny.myr
You need public override void OnInspectorGUI()
Jul 19 '12 at 02:27 PM
whydoidoit
That's what I messed up :D
Jul 20 '12 at 01:56 PM
lenny.myr
(comments are locked)
|
