MyBox is a set of attributes, tools and extensions for Unity
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AnimationClipReference
Attributes
ECS
Editor
Extensions
JsonDataManager
MyToolbox
SceneReference
Tools readme meta :) fake activity yay Sep 13, 2018
AnimationClipReference.meta AnimationStateReference type. Allows to assign Animation States of at… Sep 14, 2018
Attributes.meta
Billboard.cs
Billboard.cs.meta
ButtonImageBased.cs 2017 Update. I'll try to maintain it further :) Nov 18, 2017
ButtonImageBased.cs.meta
Cached.cs
Cached.cs.meta
ColliderGizmo.cs
ColliderGizmo.cs.meta
ColliderToMesh.cs
ColliderToMesh.cs.meta
ECS.meta
Editor.meta Meta commited for consistency Aug 26, 2018
Extensions.meta
GLDraw.cs
GLDraw.cs.meta
JsonDataManager.meta
LICENSE.md
LICENSE.md.meta
MyCollections.cs
MyCollections.cs.meta
MyCoroutine.cs Coroutine SkipFrame renamed to DelayedAction for consistency Sep 18, 2018
MyCoroutine.cs.meta
MyDebug.cs
MyDebug.cs.meta
MyDictionary.cs
MyDictionary.cs.meta Meta commited for consistency Aug 26, 2018
MyGizmo.cs
MyGizmo.cs.meta
MyGizmoHandler.cs
MyGizmoHandler.cs.meta
MyInput.cs
MyInput.cs.meta
MyLayers.cs
MyLayers.cs.meta
MyMath.cs
MyMath.cs.meta Meta commited for consistency Aug 26, 2018
MyScriptableObject.cs
MyScriptableObject.cs.meta
MyToolbox.meta
MyUI.cs
MyUI.cs.meta Meta commited for consistency Aug 26, 2018
README.md
README.md.meta
SceneReference.meta
Singleton.cs 2017 Update. I'll try to maintain it further :) Nov 18, 2017
Singleton.cs.meta Meta commited for consistency Aug 26, 2018
ToggleImageBased.cs
ToggleImageBased.cs.meta Meta commited for consistency Aug 26, 2018
Tools.meta
UIFollow.cs
UIFollow.cs.meta
Unique.cs
Unique.cs.meta
WaitForUnscaledSeconds.cs 2017 Update. I'll try to maintain it further :) Nov 18, 2017
WaitForUnscaledSeconds.cs.meta

README.md

MyBox

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 andrew@deadcow.ru

Entity Component System

ECS Tools, Helper Systems and Extentions

Tools

Tools such as Logger and TimeTest

Attributes

ConditionalField:

public bool WanderAround;
[ConditionalField("WanderAround")] public float WanderDistance = 5;

public AIState NextState = AIState.None;
[ConditionalField("NextState", AIState.Idle)] public float IdleTime = 5;

ConditionalField Example

DefinedValues:

[DefinedValues(1, 3, 5)]
public int AgentHeight;

DefinedValues Example

DisplayInspector:

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)]

DisplayInspector Example DisplayInspector Example2

Layer:

public class InteractiveObject : MonoBehaviour
{
	[Layer] 
	public int DefaultLayer;
}

Layer Example

MinMaxRange and RangedFloat:

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;
}

MinMaxRange Example

MustBeAssigned:

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;

MustBeAssigned Example

ReadOnly:

I use it in rare cases to debug things through inspector

public float InitialHealth = 100;
[ReadOnly]
public float CurrentHealth;

ReadOnly Example

SearchableEnum:

by incredible Ryan Hipple

public float InitialHealth = 100;
[ReadOnly]
public float CurrentHealth;

SearchableEnum Example

Separator:

Decorative separator. May be with or without title

Separator Example