How do I prevent variables being displayed in the inspector BUT not private ?

I want my variables to be publicly available to other scripts but NOT to show up in the inspector. How do I do this? At first I thought it was static but that doesnt seem to work.

or in C# instead of JS

[HideInInspector] public float x = 3.0f;

For the reference from the scripting site you can look here

Another road you could take is using internal as acces modifier. It is in the assembly scope but shows no inspector. But if the only purpose is to not see it in inspector I strongly recommend not doing so.

I just found the answer myself on a second search:

@HideInInspector
var myPublicVar = 0;

Howvere any ideas how I would create a block for this rather than writing it for each variable?

eg maybe something like...(but which doesnt work)

@HideInInspector
{
var myPublicVar1 = 0;
var myPublicVar1 = 0;
}

Use properties.

public float myPublicVar // It shows in inspector.
public float MyPublicVar { get; set; } // I doesn't show in inspector.

Reference: http://unity3d.com/learn/tutorials/modules/intermediate/scripting/properties