rodrigoueda / com.rodrigoueda.unitybasecode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity Base Code

Installation

https://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.1/manual/index.html

{
    "dependencies": {
        "com.rodrigoueda.unitybasecode": "https://github.com/rodrigoueda/com.rodrigoueda.unitybasecode.git#0.2.0"
    }
}

Unique identifier for every MonoBehaviour

Use BaseBehaviour instead of the usual MonoBehaviour.

using UnityEngine;
using UnityBaseCode;

public class TestScript : BaseBehaviour
{
    protected override void Awake()
    {
        base.Awake();

        print(guid);
    }
}

Singleton usage

using UnityEngine;
using UnityBaseCode;

public class TestSingleton : Singleton<TestSingleton>
{
    public void PrintTest()
    {
        print("Test");
    }
}
using UnityEngine;
using UnityBaseCode;

public class TestScript : BaseBehaviour
{
    private void Start()
    {
        TestSingleton.Instance.PrintTest();
    }
}

Hierarchy Header

You can create custom Headers for your hierarchy through Project Settings menu.

Hierarchy Header

By default, any GameObject with the name starting with "---" will be filter as a header. You can create additional filters each with a custom style.

Filter Query and Replace Query uses Regex

About

License:MIT License


Languages

Language:C# 100.0%