AxisBox
Introduction
Axis Box is a PropertyAttribute, shown in the image below as Input Conditions and Target Settings. This feature groups all the properties of a Serializable object into an expandable panel. This means you can hide or show these properties as needed, making everything more organized.
Non-programmers, like designers or artists, can easily understand and use the inspector without needing to dive into the code. Using Axis Box helps keep your workspace tidy and accessible, improving the overall workflow for everyone involved.
PropertyAttribute use:
[AxisBox]
public ObjActionTarget_Restriction TargetSettings = new ObjActionTarget_Restriction();
ObjActionTarget_Restriction class:
[Serializable]
public class ObjActionTarget_Restriction : object
{
[Header("- Restriction")]
public string TargetLabel = string.Empty;
public int MaxTargets = 1;
[Header("- Effect")]
[Range(-100, 100)]
public int DamagesTarget = 0;
[ObjectSelector("t:Prefab fw")]
public AxisFirework FireworkOnTarget;
}
Nested AxisBoxes
It can also be nested inside another AxisBox. The inspector becomes less cluttered and easier to navigate, by keeping related properties together helps manage data more efficiently.
PropertyAttribute use:
[AxisBox]
public AxisFirework_SoundEffect BurstSound = new AxisFirework_SoundEffect();
ObjActionTarget_Restriction class:
[Serializable]
public class AxisFirework_SoundEffect : object
{
public AudioClip SoundEffect;
[InstanceSelector(true, "Source On Each Target")]
public AudioSource SoundSource;
[Range(0.05f, 2f)]
public float Volume = 1f;
[AxisBox]
public AxisFirework_Randomness Randomness = new AxisFirework_Randomness();
[AxisBox]
public AxisFirework_PitchProgress PitchProgression = new AxisFirework_PitchProgress();
}