Every single thing I’ve tried failed. I have a class called CrabScript>
public enum SpecialAbilities{Sleeper,Teleporter};
public SpecialAbilities SpecialAbility;
That’s a declaration inside it. I made an editor for it which works fine for the other variable. For some reason, It’s not working when I tried adding an enumpopup for the SpecialAbility variable.
crabScript.SpecialAbility = (crabScript.SpecialAbilities)EditorGUILayout.EnumPopup("Special Ability",crabScript.SpecialAbility);
That gives me the error: CrabScriptEditor.crabScript is a field but a type is expected.
crabScript.SpecialAbility = EditorGUILayout.EnumPopup("Special Ability",crabScript.SpecialAbility) as SpecialAbilities;
Above code gives me the error: The type or namespace name `SpecialAbilities’ could not be found. Are you missing a using directive or an assembly reference?
I tried doing using CrabScript; but of course that doesn’t work either.
The reason I did (crabScript.SpecialAbilities) instead of just SpecialAbilities in the first one is because it didn’t have a variable for SpecialAbilities. Even if I use crabScript.SpecialAbilities the SpecialAbilities enum doesn’t show up, I had to manually typed it in. Doing (typeof(crabScript.SpecialAbilities)) also doesn’t work.
I didn’t know it was going to be this difficult to simply add an EnumPopup.
Nobody has experience with editor scripting?
– Paparakas