var abc : float = 0;
This can be adjusted at inspector.
Also int too.
And boolean generate checkbox.
Then is there no radio button?
var abc : float = 0;
This can be adjusted at inspector.
Also int too.
And boolean generate checkbox.
Then is there no radio button?
Public var abc : float = 0;
Methinks
also make sure it is declared correctly within the function
Sorry but you don’t understand what I mean.
I haven’t too (that’s why I said nothing). Be more precise, please.
var that can generate Radio button at the inspector.
There isn’t any “radio button” variable type, because that would mean that the value of the variable would depend on and be affected by the value of other variables, which doesn’t make much sense in a programming environment.
–Eric
I think I know what he wants. He’s not looking for a radio button data type. He has a variable of enumerated type, and wants to select the value using a radio button instead of the drop list in the inspector. I think this can be done using an editor script, but I’m not too sure how to mimic radio button behaviour with the existing GUI controls. I think it just does checkboxes.
I could be wrong, though.
I think he was looking for something like this?!?
![]()
bool bToggleState = fontType == FontType.UnityFont;
bToggleState = GUILayout.Toggle( bToggleState, "Unity Font", (GUIStyle)"Radio" );
if( bToggleState ) fontType = FontType.UnityFont;
bToggleState = fontType == FontType.BitmapFont;
bToggleState = GUILayout.Toggle( bToggleState, "Bitmap Font", (GUIStyle)"Radio" );
if( bToggleState ) fontType = FontType.BitmapFont;
Sorry for Necro, but i looked around and didnt find a solution either. I hope someone running a search finds this a viable solution. ![]()