Skip to content

Repository files navigation

SloneUtil

Miscellaneous helpers and utilities for making games with Unity Engine. Distributed as a Unity package (com.slonersoft.slone-util).

License

MIT License

Installation

In Unity, open the Package Manager, click the + button, and select Install package from git URL. Enter:

git@github.com:slonermike/SloneUtil.git

Modules

General-purpose static utilities and extension methods.

  • CoreUtils (Slonersoft.SloneUtil.Core) — Math helpers (lerp, smooth lerp, advance-toward-goal for floats/vectors/colors/angles), distance/rotation utilities, camera projection, date packing, array shuffling, enum parsing, and more. All public methods have XML doc comments for IntelliSense.
  • GameObjectExtensions — Extension methods: GetOrAddComponent<T>(), IsAheadOf(), IsFacing(), DoAfterTime().
  • SloneUtil2D — 2D-specific camera and input helpers (camera bounds, mouse world position, 2D facing/turning).

Drop-on components for animating transforms without code.

ComponentWhat it does
MoverOscillatorOscillates position back and forth
MoverRotateOscillatorOscillates rotation back and forth
MoverScaleOscillatorOscillates scale back and forth
MoverRotatorContinuous rotation at a specified speed
MoverScalerScales over time
MoverTranslatorMoves at a constant rate per axis
MoverPositionerMoves toward a target position
MoverRotationPositionerRotates toward a target rotation
MoveTo / RotateToOne-shot move/rotate to a destination
ShakerApplies random shake to position
UVScrollerScrolls UVs on a mesh (creates material copy)
OrientByMotion2DOrients sprite by movement direction
FollowObjectPathFollows a sequence of waypoints

Runtime material manipulation without touching source assets.

  • MaterialInstancer / SharedMaterialInstance / SpriteMaterialInstance — Safe per-object material copies.
  • MaterialColorChanger / MaterialValueChanger — Animate shader properties over time.
  • MaterialFlasher / ShaderPulse — Flash or pulse a shader value.

Lightweight event/message system for game object communication.

  • Blip — Event types: DAMAGED, DIED, DESTROYED, CREATED, ARRIVED, ACTIVATE, DEACTIVATE, FORCE.
  • Activators — Trigger blips automatically (ObjActivator_Auto), on interval (ObjActivator_Interval), or on physics trigger (ObjActivator_Trigger, ObjActivator_Trigger2D).
  • OnEvent handlers — React to blips by spawning objects, toggling emitters, flashing materials, moving objects, etc.
  • LifecycleDestroyAfterTime, SpawnOnCreation, PrefabPool.

Combat building blocks for health, damage, targeting, and weapons.

  • Health / Damageable — HP tracking with heal rate, damage callbacks.
  • DamageOnCollision / DamageDelegate — Apply damage on physics contact.
  • Weapon / WeaponDamager / Warrior — Weapon firing and warrior state.
  • TeamAssignment / Targeting / TargetFinder / FaceEnemy — Team-based target acquisition.
  • FlashOnDamage / ExpandOnDamage / SpawnOnDeath / DetachOnParentDeath — Visual/lifecycle reactions.
  • DestroyBeyondBounds / DestroyIfStuck — Cleanup helpers.
  • WarKitSettings — Global configuration.
  • ObjectPool — Generic object pooling with automatic page-based expansion.

About

Unity Engine game development helpers and utilities.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages