Skip to main content
11 events
when toggle format what by license comment
Jan 11, 2013 at 22:35 vote accept zyeek
Jan 11, 2013 at 22:35 comment added zyeek Ok, I got it to show up how I wanted it for the visual appeal, probably not the best way, but my PlayerAttributes class inherits from nothing now, which is good and bad. My actual player with the script component has a warning on the inspector, but my CombatController, which is on my camera now shows my players class variables. I probably could just put my PlayerAtrribute class in an empty gameobject as a place holder and then put some "RealPlayer" script on to the player itself so the player is associated with its own values. public Robo as PlayerAttributes=PlayerAttributes() Combat script
Jan 11, 2013 at 21:59 comment added zyeek From looking around it will probably involving using the UnityEditor module. docs.unity3d.com/Documentation/ScriptReference/Editor.html
Jan 11, 2013 at 21:57 comment added zyeek That worked perfectly, just wasn't sure how to read the doc for this one, sometimes they just look confusing I suppose. Everything checks out fine, my only concern now is just with aesthetics, but is there any way possible to have my values to appear in the inspector. I am not sure if it is part of the @script notation for Unityscript, but if anyone happens to know would be much appreciated.
Jan 11, 2013 at 21:39 comment added DormoTheNord Then try doing Player = ScriptableObject.CreateInstance("PlayerAttributes") I think that will work.
Jan 11, 2013 at 21:20 comment added zyeek I inherited from ScriptableObject just to see what goes on and I get warning: "PlayerAttributes must be instantiated using the ScriptableObject.CreateInstance method instead of new PlayerAttributes."
Jan 11, 2013 at 16:31 comment added michael.bartnett Also note that you should not directly instantiate classes inherited from MonoBehaviour, they are added to game objects via gameObjectRef.AddComponent[of PlayerAttributes]().
Jan 11, 2013 at 12:33 history edited DormoTheNord CC BY-SA 3.0
added 51 characters in body
Jan 11, 2013 at 12:28 history undeleted DormoTheNord
Jan 11, 2013 at 12:26 history deleted DormoTheNord
Jan 11, 2013 at 12:24 history answered DormoTheNord CC BY-SA 3.0