Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

ByteVault-Library

My complete Library for unity. It is ever expanding.. meaning never done. (I usually strip it down for the games purpose to keep clutter away.) NOTE: Also, this repo is not up-to-date.

Bellow is an example of implementing one of the benefits

using Bytevaultstudio.Utils; // Include the library

public static Manager instance = null; // Reference the object

void Awake() => nUtils.CreateSingleton<Manager>(ref instance, this, this.gameObject); // Create a singleton.

Preview of the method used above + description of what it does.

public static void CreateSingleton<T>(ref T instance, T _this, GameObject obj)
{
    if (instance == null) instance = _this; // If there is no instance, set it to current instance.
    if (!EqualityComparer<T>.Default.Equals(instance, _this)) MonoBehaviour.Destroy(obj); // If this instance is a new instance, destroy object.

    MonoBehaviour.DontDestroyOnLoad(obj); // If this instance was not destroyed it should persist.
}

This includes a lot more stuff. I will add to this readme doc at a later time

About

My complete Library for unity. It is ever expanding.. (I usually strip it down for the games purpose)

Resources

License

Stars

Watchers

Forks

Languages