added TNTC paint system shader

This commit is contained in:
André Cardoso
2021-02-22 19:20:18 +01:00
parent c34062c024
commit 687e053e5f
49 changed files with 17229 additions and 840 deletions

View File

@@ -0,0 +1,52 @@
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T: MonoBehaviour{
public static bool verbose = false;
public static bool keepAlive = true;
private static T _instance = null;
public static T instance {
get {
if(_instance == null){
_instance = GameObject.FindObjectOfType<T>();
if(_instance == null){
var singletonObj = new GameObject();
singletonObj.name = typeof(T).ToString();
_instance = singletonObj.AddComponent<T>();
}
}
return _instance;
}
}
static public bool isInstanceAlive{
get { return _instance != null; }
}
public virtual void Awake(){
if (_instance != null){
if(verbose)
Debug.Log("SingleAccessPoint, Destroy duplicate instance " + name + " of " + instance.name);
Destroy(gameObject);
return;
}
_instance = GetComponent<T>();
if(keepAlive){
DontDestroyOnLoad(gameObject);
}
if (_instance == null){
if(verbose)
Debug.LogError("SingleAccessPoint<" + typeof(T).Name + "> Instance null in Awake");
return;
}
if(verbose)
Debug.Log("SingleAccessPoint instance found " + instance.GetType().Name);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a81968a323aba6a44b0bb536a20ba0ce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: