Skip to content

Releases: ltsLumina/Lumina-Essentials

Lumina Essentials ver. 3.0.4

23 Aug 18:53
Compare
Choose a tag to compare

Final Version (for some time)

If all goes according to plan, this will be the final version for some time.

If any issues arise, please make an issue on the Github page.

Known Issues

  • The "Last Update Check" string shows the incorrect amount of weeks since last update check.
  • The "Last Update Check" string sometimes shows "One Week Ago" in red text after an unknown amount of time.
  • After installing modules, the "Setup Required" warning doesn't automatically disappear until closing and re-opening the Utility Panel.

Lumina Essentials ver. 3.0.4 MEMEZ

30 Aug 19:32
Compare
Choose a tag to compare

Just a funny joke version.

Lumina Essentials ver. 3.0.3

19 Aug 00:28
Compare
Choose a tag to compare

Hotfixes to support laptop screens better.

Lumina Essentials ver. 3.0.2

16 Aug 23:07
Compare
Choose a tag to compare

Some small changes, mostly to READMEs

Lumina Essentials ver. 3.0.1

15 Aug 22:23
Compare
Choose a tag to compare

Lumina's Unity Essentials Package

Unity Version

Table of Contents

Overview

Welcome to Lumina's Unity Essentials Package, a collection of scripts designed to improve your Unity workflow and enhance your project development.

This package includes various utility features, shortcuts, and extensions to make your life with Unity a little more bearable. From a powerful Sequencer module to a convenient Utility Window, these essentials are designed to boost your productivity and streamline your game development process.

The package also features contributions from Joel's Essentials, providing additional handy tools to complement the collection.

TL;DR Features

  • A utility window with features to enhance your Unity workflow, such as creating default project directories for new projects and converting image settings for different scenarios.
  • Quick access to enable "Enter Play Mode" options, allowing you to enter play mode much quicker.
  • An auto-save feature for Unity that isn't normally available.
  • A powerful Sequencer module to create sequences of methods, events, or any other actions, with support for running methods after a specified delay.
  • Various attributes, including ReadOnly and Ranged Float features, for customizing variable display in the Unity inspector.
  • A collection of useful Unity shortcuts, such as ClearConsole() and ReloadScene(), for performing common tasks more efficiently.
  • A Helper Class with miscellaneous methods, such as caching Camera.main and playing audio with random pitches.

Installation

  1. Open your Unity project.
  2. Choose whether to install the package from GitHub, or directly from Unity's package manager (UPM).
    • Install the package from the Releases page on GitHub.
    • Or from the Package Manager under "Add Package from git URL" and enter https://github.com/ltsLumina/Lumina-Essentials.git
  3. Download the latest release of the package as a .unitypackage.
  4. In Unity, either open the package or drag and drop it in from wherever you saved it.
  5. Ensure that all files are selected and click "Import."

Getting Started

To access the utility window, go to "Tools" -> "Lumina" -> "Open Utility Window" in the Unity editor. From there, you can explore and utilize various features, including project initialization, enter play mode options, and auto-save.

All the Essentials are under the Lumina.Essentials namespace, with the Sequencer and Attributes being sub-namespaces.
Simply add the namespace(s) to any script you are writing and start using the methods provided!

For details on the available methods, attributes, and shortcuts provided by the package, check out the documentation.

Essentials Overview

Sequencer

The Sequencer module allows you to create sequences of methods, events, or any other actions you can think of. It supports running a method after a specified delay, performing callback actions, as well as various other functions. The implementation is designed through extension methods for ease of use. For example, you can create a sequence like this:

Sequence mySequence = Sequencing.CreateSequence(this)
mySequence().Execute(ExampleMethod).WaitForSeconds(3f).ContinueWith(() => Debug.Log("Finished!"));

The provided example will function exactly as you expect. It will run the "ExampleMethod" function, then wait for 3 seconds using a coroutine, then once it has finished waiting it prints a "Finished!" message to the Unity console.

  • Note: The "this" inside of CreateSequence() is the 'host' of the coroutine. Unless you want a different MonoBehaviour to run your coroutine, always use 'this'.

Attributes

The Attributes Package includes two essential attributes:

  • ReadOnly Attribute: Allows you to add '[ReadOnly]' before a variable so that it is shown but not editable in the inspector. Use it like this: [SerializeField, ReadOnly] bool readOnlyBool;.
  • Ranged Float Attribute: Allows you to add a range to a float variable in the inspector. It has various different uses so refer to the "Examples" folder in the package for help on how to use it.

The RangedFloat attribute provides a useful class for defining a range with min and max values. Additionally, an implicit operator is included, allowing you to fetch a random value within the range when a RangedFloat is used as a float. The RangedFloatAttribute provides options for how the range is displayed in the inspector, including locked ranges, editable ranges, and hidden ranges.

Helpers

The Helpers class provides miscellaneous helper methods that don't fit into any other category. Some of the essential helper methods include:

  • CameraMain: A property that allows you to call Camera.main without it being an expensive call, as it caches the main camera after the first use. Use it like this: Helpers.CameraMain.transform.position.
  • PlayRandomPitch: A method that plays an audio clip on the given audio source with a random pitch between the provided minimum and maximum values. This can add variation to your audio playback.
  • DestroyAllChildren: A method that destroys all children of a given transform. This can be used as an extension method, making it easy to clean up child objects.
  • RandomVector: Two overloads of the method that generate a random Vector2 or Vector3 within specified minimum and maximum values. This can be useful for generating random positions or directions in your game.

Shortcuts

The Shortcuts Class includes a collection of useful Unity shortcuts, making it easier to perform common tasks more efficiently.

Some of the included shortcuts are ClearConsole() and ReloadScene(), allowing you to clear the console or reload the scene with a hotkey.
These methods can also be used as normal in your code, they aren't limited as hotkeys.

Utility Window

The Utility Window provides quick access to various features that enhance your Unity workflow, including:

  • Creating default project directories for new projects, helping you to maintain a standardized project structure.
  • Converting image settings in Unity to be appropriate for any given scenario, simplifying the process of setting up image assets for different platforms or quality levels.
  • Enabling "Enter Play Mode" options", allowing you to enter play mode much quicker and avoid unnecessary manual steps.
  • Auto-save feature for Unity that isn't normally available, providing an added layer of protection against data loss.

Joel's Essentials

Joel's Essentials is a set of additional handy tools that complement Lumina's Unity Essentials Package. It includes the following features:

  • Singleton Class: Lets you turn any MonoBehaviour into a singleton, ensuring that only one instance of the script exists in the scene.

  • Object Pooling System: Allows you to easily create object pools for your Unity game, improving performance by reusing objects instead of instantiating and destroying them frequently.

  • SceneManagerExtended: Extends the SceneManager class with various methods to easily load scenes, reload the current scene, load the next or previous scene, or even load a scene asynchronously.

  • Music System: Streamlines the process of adding music to your game and includes a MusicTrigger system to play music upon touching a collider.

Note: The Joel's Essentials part of the package is only available when selecting "Full Package" in the Utility Window's Setup menu.

Contribution and Bug Reporting

This essentials package has been tested on various projects, but if you encounter any issues or have suggestions for improvements, please don't hesitate to submit an issue. Your feedback is valuable and helps in making this package even better!

License

This package is distributed under the MIT License, allowing you to use and modify it freely in your projects. If you find it helpful, consider giving credit by mentioning "Lumina's Unity Essentials Package" in your project's acknowledgments.

Happy developing! 🚀

Lumina Essentials ver. 3.0.0

15 Aug 22:05
Compare
Choose a tag to compare

had to hotfix this release. please use 3.0.1 :)

Lumina Essentials ver. 3.0.0 Beta4

15 Aug 18:24
Compare
Choose a tag to compare
Pre-release

Should be the final beta before release!

Lumina Essentials ver. 3.0.0 Beta3

30 Jul 02:10
Compare
Choose a tag to compare
Pre-release

This will be the final beta for the 3.0.0 release.
Expect an official release soon.

ver.3.0.0-beta2.5

27 Jul 05:54
Compare
Choose a tag to compare
ver.3.0.0-beta2.5 Pre-release
Pre-release

Refer to README for full breakdown.

Essentials Ver. 2.7.0

16 Jul 02:33
Compare
Choose a tag to compare

Can't be asked to write a full summary so here's a short one from the README

Attributes Class

The Attributes class is a set of tools aimed at giving developers easy customization and control over fields in the inspector.

Authored, developed and updated by [@ltsLumina] on GitHub (https://github.com/ltsLumina)

All credit goes to [@heisarzola] on GitHub (https://github.com/heisarzola) for creating the RangedFloat attribute and the drawers. I simply added them to my essentials package for easy access.

Attributes Class:
Attributes Class

General Notes

  • ReadOnly Attribute is used to make a field visible but not editable in the inspector.
    • Usage: [ReadOnly] or [SerializeField, ReadOnly]
  • RangedFloat allows developers to assign a range between minimum and maximum float values.
    • Usage: [RangedFloat(min, max, RangeDisplayType)]
  • There are three types of display for the range: LockedRanges, EditableRanges, and HideRanges.
    • LockedRanges: range is not editable.
    • EditableRanges: user can edit the range.
    • HideRanges: range is not visible hence locked.
  • The GetRandomValue() method fetches a random value between the assigned min and max float values.

Example:

    [Header("ReadOnly Attribute")]
    [SerializeField, ReadOnly] private int readOnlyInt;

    [Header("Ranged Float Without Attribute")]
    [SerializeField] RangedFloat exampleOne;

    [Header("Ranged Float With Locked Limits")]
    [RangedFloat(5, 25, RangedFloatAttribute.RangeDisplayType.LockedRanges)]
    [SerializeField] RangedFloat exampleTwo;

    [Header("Ranged Float With Editable Limits")]
    [RangedFloat(0, 10, RangedFloatAttribute.RangeDisplayType.EditableRanges)]
    [SerializeField] RangedFloat exampleThree;

    [Header("Ranged Float With Hidden (But Locked) Limits")]
    [RangedFloat(5, 10, RangedFloatAttribute.RangeDisplayType.HideRanges)]
    [SerializeField] RangedFloat exampleFour;

If any doubt on how to use the attributes arises, please see the provided examples for reference. (Examples.cs)

Sequencer

The Sequencer is a tool that allows you to create a sequence of events that can be triggered by a single call.

Designed, created and maintained by [@ltsLumina] on GitHub (https://github.com/ltsLumina)

End Result:
Sequencer

General Notes

  • The Sequencer is a tool that allows you to create a sequence of events that can be triggered by a single call.
  • Don't forget to make use of anonymous methods and lambda expressions to make your code more readable.
  • All methods are executed in the same order they are called.
    • i.e. Execute(First).Execute(Second).Execute(Third) will execute First, then Second, then Third.
    • i.e. Execute(First).WaitForSeconds(2f).Execute(Second) will execute First, then wait 2 seconds, then execute Second.
  • Take a look at the provided examples script for reference. (Examples.cs)

Example:

        // Example 1 -- This is the recommended way to use Sequencing.
        Sequence sequenceOne = Sequencing.CreateSequence(this); // Creates a sequence.
        sequenceOne.Execute(FirstExample).WaitForSeconds(2f).Execute(SecondExample); 


        // Example 2 -- A longer example of how to create longer sequences.
        Sequence sequenceTwo = Sequencing.CreateSequence(this);
        sequenceTwo.WaitThenExecute(5f, ExampleMethod3).ContinueWith(() => Debug.Log("Finished!")).WaitForSeconds(2f).Execute(FirstExample);


        // Example 3 -- An example of how you can make a more readable sequence.
        Sequencing.CreateSequence(this)
                  .Execute(() => Debug.Log("Hello World!"))
                  .WaitForSeconds(3f)
                  .ContinueWith(() => Debug.Log("Goodbye World!"));

Ranged Float