-
-
Notifications
You must be signed in to change notification settings - Fork 245
Types
ActivateOnStart Component — Set state of specific GO on game start
AnimationStateReference — Specify AnimationClip on object with Animator
AssetPath and AssetFolderPath — Inspector button to browse for folder or asset under Assets folder
Billboard Component — Force object to always face camera
ColliderGizmo Component — Highlight colliders and triggers in SceneView
ColliderToMesh Component — Generate Mesh from PolygonCollider2D data on the fly
Commentary Component — Add text commentary to your GameObjects
CoroutineGroup — Wraps up bunch of coroutines to know when they all is completed
FPSCounter Component — Display FPS counter on Playmode
Guid Component — Generate unique and persistent IDs
MinMaxInt and MinMaxFloat — Asserts that Max => Min with handy inspector drawer
MyCursor — Nice way to set cursor with hotspot
MyDictionary — Serializable Dictionary
PlayerPrefs and EditorPrefs wrappers — Save data locally with ease
Optional and OptionalMinMax — Optionally assignable values
Reorderable Collections — Reorder your collections in inspector
SceneReference Component — Reference scene with Scene asset in inspector
Singleton — Cache and access instance of MonoBehaviour
TransformData — Type to store and apply position, rotation and scale
UIFollow Component — RectTransform will follow specified Transform
UIImageBasedButton Component — Used to create toggle button behaviour
UIRelativePosition Component — Position one RectTransform relatively to another, regardless of hierarchy
UISizeBy Component — Size one RectTransform relatively to another
Toggles object active state on game start.
For instance, I use it with UI objects, to hide in editor and automatically show in playmode.
Use to specify some AnimationClip on assigned Animator.
Will automatically use Animator of current object, if any.
public AnimationStateReference JumpState;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space)) JumpState.Play();
}
String wrapper to display "Browse" button in inspector.
Allows to browse for folder or file path under Assets folder.
public AssetPath RequiredAsset;
public AssetPath MainScenePath = AssetPath.WithExtension("unity");
[Separator]
public AssetFolderPath GameplayTestsFolder;
Object with this component will always face camera
Visualize colliders on scene Works with Mesh, Box, Sphere, Edge, Box2d, Circle2d, Edge2d Colliders.
Also supports NavMeshObstacles!
This component allows to generate Mesh from PolygonCollider2D data
Edit PolygonCollider shape and use FillShape button, or generate mesh at runtime with FillShape() method
This type was used to create foregrounds in The Final Station game 🙂
You may add several comments with one component.
To enter edit mode just click on any existing commentary
Wraps up bunch of coroutines to know when they all is completed.
// Use current MonoBehaviour to create Coroutines
var group = new CoroutineGroup(this);
// Or start Coroutines without MonoBehaviours
var group = MyCoroutines.CreateGroup();
// Add Coroutines to group
group.StartCoroutine(...);
// Check how many is currently executing
group.ActiveCoroutinesAmount
// Or with
group.AnyProcessing
Add this to any object on scene to draw FPS counter in playmode.
Allows to specify ui position and target framerate. Target Framerate is used to indicate current performance with color.
Generates unique id no matter what (i.e. handles object duplication or prefab instances etc).
The most viable way to create Save Game System.
public MinMaxInt Damage;
public MyCursor Regular;
public MyCursor Interact;
...
Interact.ApplyAsConfinedCursor();
Interact.ApplyAsLockedCursor();
Interact.ApplyAsFreeCursor();
For now MyDictionary is not for inspector usage, but rather for caching.
I use it to preserve data in editor scripts on assembly reload.
[Serializable] public class AgentAgeDictionary : MyDictionary<Agent, int> {}
You may use predefined Optional types like OptionalFloat, OptionalString or OptionalComponent etc.
Or create your own with one line of code:
[Serializable] public class OptionalRigidBody : Optional<RigidBody> { }
Some predefined Optional Types have static WithValue(T value) method to set default values from code:
public OptionalKeyCode ResetGameKey = OptionalKeyCode.WithValue(KeyCode.P);
OptionalMinMax, well, is for optionally set min and max float values
You can use PlayerPrefsBool/Float/Int/String/Vector/VectorInt
In Editor – EditorPrefsBool/Float/Int/String/Vector3
It is possible to assign Prefs Key in declaration or in a constructor
Also, you may set the default value
// To assign Prefs Key in declaration use "WithKey" method:
public static readonly EditorPrefsBool SteamEnabledInEditor = EditorPrefsBool.WithKey("EditorSteamEnabled");
...
SteamEnabledInEditor.Value = !SteamEnabledInEditor.Value;
private PlayerPrefsVector2Int ScreenResolutionPref;
void Awake() {
ScreenResolutionPref =
new PlayerPrefsVector2Int("Settings_ScreenResolution", new Vector2Int(Screen.width, Screen.height));
}
...
ScreenResolutionPref.Value = new Vector2Int(Screen.width, Screen.height);
Reorderable and ReorderableList base types allow you to create reorderable collections.
Create your own with one line of code:
[Serializable] public class ReorderableNavMeshAgent : Reorderable<NavMeshAgent> { }
Allows to refer to Scene asset in inspector and access scene via SceneName or SceneIndex.
To access MonoBehaviour on scene simply use Singleton<MySingleMB>.Instance
.
This way Instance will be cached on first access
private void Update()
{
// Instance will be cached on first call
var position = Singleton<PlayerView>.Instance.transform.position;
}
Another way to use Singleton is to make it a base class for your MonoBehaviour:
public class PlayerView : Singleton<PlayerView>
{
private void Awake()
{
// Manually call this function to cache instance and mark it with DontDestroyOnLoad()
// Optionally, pass "false" to this method to disable DontDestroyOnLoad()
// Also on this step all duplicating instances will be destroyed
InitializeSingleton();
}
}
// Now you also may access Instance like this
var position = PlayerView.Instance.transform.position;
Allows to "Bake" current transform data and Restore it via inspector
Also comes with Save(transform) and Apply(transform) methods and with OnSaved and OnApplied events
public TransformData StartGamePosition;
public TransformData WakeUpPosition;
...
WakeUpPosition.Apply(transform);
Used on object with RectTransform to follow Transform on the scene
Set ToFollow and add desired Offset.
GameCamera will be filled automatically (fill it if you use several cameras).
This fields also accessible at runtime via code
Used with Button and Image components to create toggle button
Comes with OnToggled event (first button click is "true", second is "false")
Position one RectTransform relatively to another, regardless of hierarchy
Optionally, positioning is based on X and/or Y, with or without offsets and with cursom anchoring
Size one RectTransform relatively to another
Optionally, size is based on Width and/or Height, with or without offsets, with or without Min/Max restrictions
//ConditionallyColoredGUIBlock
//ConditionallyEnabledGUIBlock
//DraggableHandler
//EditorWithSubEditors ?
//IndentBlock ?
//ReorderableCollection
//SceneClickHandler
//ScrollViewBlock ?