예제 #1
0
	// Use this for initialization
	void Awake () {
		if (singleton == null) {
						singleton = this;
				} else {
						GameObject.Destroy(gameObject);
				}
	}
예제 #2
0
	public static TreeSaveManager getTreeSaveManager(){
		if (singleton == null) {
			GameObject TreeSaveManagerGo = new GameObject();
			singleton = TreeSaveManagerGo.AddComponent<TreeSaveManager>();
		}
		return singleton;
	}
예제 #3
0
	public static void deletSingleton(){
		if (singleton != null) {
			GameObject.Destroy(singleton.gameObject);
			singleton = null;
		}
	}