Supercharged Vector2 Framework enhances Vector2s with events, helper methods, and components for health and timer management.
https://github.com/JacobHomanics/unity-timerThe framework is divided into three main components:Vector2 Class: A customizable and event-driven extension of Unity's Vector2. It supports event notifications for changes in its X and Y values, helper methods for comparing or modifying these values, and context menu shortcuts for quick adjustments in the Unity Editor.Health Class: A health management system built on the enhanced Vector2. The X component represents current health, while Y maps to maximum health. It provides utility methods to increase, decrease, or restore health while triggering relevant events such as health changes, deaths, or reaching maximum health.Timer Class: A timer system powered by the Vector2. The X component represents elapsed time, and Y denotes the duration. The timer supports multiple tick types, such as DeltaTime and FixedDeltaTime, and offers methods to track elapsed time, calculate time left, and reset the timer. Events notify when specific thresholds, such as duration completion, are met.Each component is designed to promote modularity and reuse, making it a perfect fit for Unity developers looking to enhance their projects with event-driven systemsVector2 ClassNamespace: JacobHomanics.Core.SuperchargedVector2Key Features:Properties: X (float) and Y (float).Event-driven notifications (OnXSet, OnYIncrease, etc.).Helper methods like GetDifferenceXY() and IsXZero().Editor shortcuts for quickly modifying X values.Use Cases:Creating dynamic behaviors triggered by changes in Vector2 values.Simplifying interactions with X and Y components.Health ClassNamespace: JacobHomanics.Core.SuperchargedVector2Key Features:Properties: Current (mapped to X) and Max (mapped to Y).Utility methods: Increase(), Decrease(), Restore().Events: OnHealthIncrease, OnDeath, OnHealthSetToMax.Use Cases:Managing player or entity health with built-in notifications for critical thresholds.Simplifying health logic in games, reducing repetitive coding.Timer ClassNamespace: JacobHomanics.Core.SuperchargedVector2Key Features:Properties: ElapsedTime (mapped to X) and Duration (mapped to Y).Tick Types: DeltaTime, UnscaledDeltaTime, SmoothDeltaTime, FixedDeltaTime, FixedUnscaledDeltaTime.Utility methods: Tick(), ResetElapsedTime(), GetTimeLeft().Events: OnTick, OnDurationElapsed, OnElapsedTimeReset.Use Cases:Creating timers for gameplay mechanics, such as cooldowns or time-based challenges.Triggering events at specific time intervals or durations.Given each prompt, I uploaded the main Timer.cs script to ChatGPT which gave me a summary, description, and key features.