https://github.com/rodrigoueda/com.rodrigoueda.unitybasecode
https://github.com/rodrigoueda/com.rodrigoueda.unitybasecode
package unity unity3d
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rodrigoueda/com.rodrigoueda.unitybasecode
- Owner: rodrigoueda
- License: mit
- Created: 2020-09-16T18:45:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-28T04:31:53.000Z (almost 5 years ago)
- Last Synced: 2025-05-17T14:09:17.326Z (about 1 year ago)
- Topics: package, unity, unity3d
- Language: C#
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity Base Code
## Installation
```json
{
"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 ```.
```C#
using UnityEngine;
using UnityBaseCode;
public class TestScript : BaseBehaviour
{
protected override void Awake()
{
base.Awake();
print(guid);
}
}
```
## Singleton usage
```C#
using UnityEngine;
using UnityBaseCode;
public class TestSingleton : Singleton
{
public void PrintTest()
{
print("Test");
}
}
```
```C#
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.

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](https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex?view=netcore-3.1)