I basically made a lot of research and wasn´t able to find any solution.
So my problem: I´ve made some variables disappear/appear depending on an enum with a custom editor script. But if they appear they do not appear at the position where the normal editor variables would appear
override public void OnInspectorGUI()
{
base.OnInspectorGUI();
GunCard myScript = target as GunCard;
EditorGUI.indentLevel++;
switch (myScript.aimingControlType)
{
case AimingControlType.Manual:
myScript.hasAimAssistance = EditorGUILayout.Toggle("Has aim assistance", myScript.hasAimAssistance);
break;
case AimingControlType.AutoTargeting:
myScript.targetPreference = (TargetTypes)EditorGUILayout.EnumPopup("Target preference", myScript.targetPreference);
myScript.requiresLineOfSight = EditorGUILayout.Toggle("Requires line of sight", myScript.requiresLineOfSight);
myScript.requiresPossibleTargetOnScreen = EditorGUILayout.Toggle("requires possible target on screen", myScript.requiresPossibleTargetOnScreen);
break;
}
EditorGUI.indentLevel--;
}
That are the raw variables in the scriptable object
[Header("Aiming Controls")]
public AimingControlType aimingControlType;
[HideInInspector] public bool hasAimAssistance;
[HideInInspector] public bool requiresLineOfSight; //TODO: implement -> requires 180
[HideInInspector] public bool requiresPossibleTargetOnScreen; //TODO: implement -> requires 180
[HideInInspector] public TargetTypes targetPreference;
[HideInInspector] public bool isAutoShootWhenAimOnTarget;
I know I´m basically adding new variables to the inspector in my editor Script but it would be really useful to order them. Is there a way to do that?
P.S sorry for the funny typo in the picture :)