Organizing Variables In the Inspector

I am having troubles with creating a menu in the inspector for my variables like how Vector 3 works. I have googled this and tried all the different ways of doing this and nothing works. Here is my code and im trying to make my variables organized in the inspector.

  class Animation
    {
    var walkingAnimation : AnimationClip;
    var sprintingAnimation : AnimationClip;
    var sprintingAnimationSpeed : float = 1.5;
    var jumpAnimation : AnimationClip;
    var airJumpAnimation : AnimationClip;
    var hoverIdleAnimation : AnimationClip;
    var hoverWalkAnimation : AnimationClip;
    var hoverWalkAnimationSpeed : float = 1;
    var hoverSprintAnimation : AnimationClip;
    var hoverSprintAnimationSpeed : float = 1;
    var fallingAnimation : AnimationClip;
    var idleAnimation : AnimationClip;
    var blockAnimation : AnimationClip;
    var airBlockAnimation : AnimationClip;
    }

Like I said. I have googled this and tried aolt of different ways in doing this. Also used the CharacterMotor script from the assets as a refference and still could not get this to work. Please help. I am running out of hair >.<

Not sure if I understand what you are asking but, if you are looking to make the variables visible in the inspector you need to declare them publicly.

C#
public float foo;

JavaScript I think is
public var foo : float = 0.0;

I do now know JavaScript though.
If this is not even close to what you are asking for my apologies.

That’s what your looking for!

Yes it is, and i have looked at that. But i couldnt get it to work for some reason. Is “test” the script name im using it in?

Got it to work. But i do not understand why i need the “var test = Test ();” at the bottom? Works without it.

class Animations extends System.Object 
{
	var p = 5;
	var c = Color.white;
}

var test = Test(); is creating an instance of test to use in your code. So in Unity’s example you could call,

class Test extends System.Object {
	var p = 5;
	var c = Color.white;
}
var test = Test ();
var test2 = Test();

Debug.Log(test.p); // output's 5
Debug.Log(test2.p); // output's 5

test.p = 20;

Debug.Log(test.p); // output's 20
Debug.Log(test2.p); // output's 5

You don’t need to extend an System.Object if you don’t need it.

(Tip) Don’t forget that arrays can clean up variables and help reduce the var name size. You can always place the detailed names in comments.

public var t : Test;

class Test {
	//------------//
	var p = 5;
	//------------//
	var c = Color.white;
	//------------//
	var animClip : AnimationClip[];
	//------------//
}

You’re aware that if you don’t declare it, it’s still the same?

public class MyClass { }

// and

public class MyClass : System.Object { }

// is exactly the same.

EDIT: Oups! Just noticed it’s not C#. In C#, everything derive from System.Object, even if not declared as such. I have no idea about other Unity language.

DexRobinson

Sorry but what is the point in making a class a variable? What can I do with it as a variable?

It is, for example, an easy way of organizing lots of related variables in the inspector without having to write a custom editor.