public static void Initialize() { if (WorldHeightmap.instance == null) { WorldHeightmap.AddWorldHeightmap(); } }
private static void AddWorldHeightmap() { if (GameObject.Find("World Heightmap") == null) { GameObject gameObject = new GameObject("World Heightmap"); WorldHeightmap.instance = gameObject.AddComponent<WorldHeightmap>(); } else { Debug.Log("World Heightmap already added. :)"); } }
private void Awake() { if (WorldHeightmap.instance) { UnityEngine.Object.Destroy(this); } else { WorldHeightmap.instance = this; } }