Skip to content

Repository files navigation

Jamal Arouna Unity Library

A focused collection of reusable runtime utilities, extensions, components, and editor diagnostics for Unity 6.

Installation

In Unity, open Window > Package Manager, choose Add package from Git URL, and enter:

https://github.com/Jamal2911/JamalArouna-Unity-Library.git?path=Assets/JamalArouna.Library

Structure

JamalArouna.Library/
├── Runtime/
│   ├── Async/
│   ├── Collections/
│   ├── Components/
│   ├── Diagnostics/
│   ├── Execution/
│   ├── Extensions/
│   ├── Math/
│   ├── Physics/
│   ├── StateMachine/
│   └── Systems/
└── Editor/
    └── Diagnostics/

The folder structure and namespaces match. Runtime code is compiled into JamalArouna.Library; editor-only code is isolated in JamalArouna.Library.Editor.

Main APIs

  • JamalArouna.Library.Async.AwaitableUtility
  • JamalArouna.Library.Collections.CollectionExtensions
  • JamalArouna.Library.Components
  • JamalArouna.Library.Diagnostics.JLog
  • JamalArouna.Library.Execution
  • JamalArouna.Library.Extensions
  • JamalArouna.Library.Math
  • JamalArouna.Library.Physics
  • JamalArouna.Library.StateMachine
  • JamalArouna.Library.Systems.LockSystem<TLock>

Version 2 migration

Version 2 intentionally removes compatibility aliases. Replace the former JamalArouna.Library.Utilities imports with the focused namespaces above. GameUtilities was removed and its useful operations moved to dedicated utility and extension classes.

The unfinished GameObject Picker and its reflection-based global key hook were removed. Odin is no longer an optional compile-time dependency. The small DOTween extension API is available again, but remains fully optional and is only compiled when DOTWEEN is defined.

Restored optional DOTween helpers

After installing DOTween, add DOTWEEN under Project Settings > Player > Scripting Define Symbols. If DOTween generates an assembly definition, also add its runtime assembly as a reference to JamalArouna.Library.asmdef.

Import JamalArouna.Library.Extensions to use:

tween.KillIfActive();
sequence.KillIfActive();
DOTweenExtensions.KillAndGetNewSequence(ref sequence);

The optional API contains:

KillIfActive(this Tween tween, bool completeTween = true)
KillIfActive(this Sequence sequence, bool completeSequence = true)
KillAndGetNewSequence(ref Sequence sequence, bool completeSequence = true)

Scene view camera range

SceneViewUtility.IsSceneViewCameraInRange is available in the editor-only namespace JamalArouna.Library.Editor.Diagnostics. It checks that a point is inside the Scene view camera viewport, in front of the camera, and nearer than the supplied forward distance.

#if UNITY_EDITOR
using JamalArouna.Library.Editor.Diagnostics;

bool isVisible = SceneViewUtility.IsSceneViewCameraInRange(position, 50f);
#endif

It is editor-only because UnityEditor.SceneView does not exist in a player build. The implementation also safely handles the absence of an active Scene view camera.

Removed v1 methods and their replacements

The v2 commit documents the general API cleanup, but not an individual reason for every deleted method. The explanations below are derived from the v1-to-v2 code changes.

Methods moved or renamed during the split of GameUtilities:

Version 1 Version 2
WhileWithDuration AwaitableUtility.ForDuration
IsInAnimation AnimatorExtensions.IsPlaying
SetTriggerAndAwaitRefresh AnimatorExtensions.SetTriggerAndWaitForEndOfFrame
RotateVectorAroundPivot MathUtility.RotateAroundPivot
AdjustIndex MathUtility.WrapIndex
GetRandomElement CollectionExtensions.RandomElement
SelectRandomElement CollectionExtensions.RandomEnumValue
RemoveAllChildren TransformExtensions.DestroyChildren
SetLayerForGameObjectsAndChildren GameObjectExtensions.SetLayerRecursively
FindObjectWithTag GameObjectExtensions.FindDescendantWithTag
TryGetComponentUpAndDown GameObjectExtensions.TryGetComponentInHierarchy
GetNormalizedTime MathUtility.InverseLerp
SetAlpha ColorExtensions.WithAlpha
CheckDelta VectorExtensions.ExceedsDelta
PhysicsUtilities.OverlapCollider PhysicsUtility.GetOverlaps
TryGetComponentOutOfColliders PhysicsUtility.TryGetComponent
ExecuteOnce.Clear ExecuteOnce.Reset
CallCooldown.ResetCooldown CallCooldown.Reset

The following operations were moved without a meaningful method-name change: WaitUntil, WaitWhile, Shuffle, NormalizeAngle, GetRendererBounds, GetColliderBounds, TryGetComponentInChildren, SetWorldScale, FlatXZ, ToVector2XZ, OnlyY, WithY, WithRandomOffset, Multiply, Clamp, ToHex, SplitCamelCase, SplitAndCapitalizeCamelCase, and Capitalize.

Additional restored v1 helpers:

Restored API Location and note
ConvertRGB ColorExtensions; converts 0–255 RGBA values to normalized components.
Both SetIfNull overloads GeneralUtility; includes Unity's destroyed-object null semantics.
GetMeshBounds GameObjectExtensions; requires readable meshes and can be expensive because it transforms every vertex.
GetWorldPointFromLocalOffset TransformExtensions; convenience wrapper around TransformPoint.
GetRandomBetween(Vector2) VectorExtensions; convenience wrapper around Random.Range.
GetRandomBetweenInt(Vector2Int) VectorExtensions; preserves the former float return type for API compatibility.

Methods that remain removed:

Removed API Reason or direct replacement
SetObjectIfDifferent Removed as a broad generic setter; compare with EqualityComparer<T>.Default at the call site when needed.
SetPropertyIfDifferent Removed as a broad generic setter; compare first and invoke the setter at the call site.

IsSceneViewCameraInRange, the three DOTween helpers, and the additional v1 helpers listed above were restored in v2 after the cleanup. Singleton aliases Inst and I remain removed; use Instance. Vector3Mask.Invert and the combined XY, XZ, and YZ presets also remain removed.

See CHANGELOG.md for the detailed breaking-change summary.

License

Copyright © Jamal Arouna.

About

Utilities Library for Unity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages