static public void Spawn() { if (mInst == null) { mInst = FindObjectOfType <NJGMapMono>(); if (mInst == null) { GameObject go = GameObject.Find("_NJGMap"); if (go == null) { go = new GameObject("_NJGMap"); //DontDestroyOnLoad(go); go.AddComponent <NJGMapMono>(); } mInst = go.GetComponent <NJGMapMono>(); } } }
/// <summary> /// Need to re-generate the texture map? Use this method at will. /// </summary> static public void GenerateMap() { NJGMapMono.Spawn(); MapRenderer.instance.Render(); }