MyBox is a set of tools and extensions for Unity. 99% of it made by me over the years of work with Unity and during The Final Station development.
Most of this stuff was made for specific cases and may or may not work for you. If you want to contribute or report a bug write me to [email protected]
ECS Tools, Helper Systems and Extentions
Tools such as Logger and TimeTest
public bool WanderAround;
[ConditionalField("WanderAround")] public float WanderDistance = 5;
public AIState NextState = AIState.None;
[ConditionalField("NextState", AIState.Idle)] public float IdleTime = 5;
[DefinedValues(1, 3, 5)]
public int AgentHeight;
Displays one inspector inside of another. It's handy if you'd like to store some settings in scriptable objects.
[DisplayInspector(displayScriptField:false)] to hide object field once assigned (useful for "single instance" settings)
[CreateAssetMenu]
public class AgentAIContextSettings : ScriptableObject
{
public bool WanderAround;
public float WanderDistance = 5;
}
[DisplayInspector]
public AgentAIContextSettings Settings;
Set displayScriptField to false (by default it's true) to hide property field once
[DisplayInspector(displayScriptField:false)]
public class InteractiveObject : MonoBehaviour
{
[Layer]
public int DefaultLayer;
}
by Richard Fine
RangedFloat may be used without MinMaxRange. Default is 0-1 range
public class RandomisedHealth : MonoBehaviour
{
[MinMaxRange(80, 120)]
public RangedFloat Health;
public RangedFloat Raito;
}
Previously I used a lot of Debug.Assert() in Awake to ensure that all desired values are assigned through inspector. Now I just use MustBeAssigned.
It triggers on value types with default values, null refs, empty arrays and strings
[MustBeAssigned]
public MonoBehaviour MyScript;
[MustBeAssigned]
public float MyFloat;
I use it in rare cases to debug things through inspector
public float InitialHealth = 100;
[ReadOnly]
public float CurrentHealth;
by incredible Ryan Hipple
public float InitialHealth = 100;
[ReadOnly]
public float CurrentHealth;
Decorative separator. May be with or without title