public void Delete() { if (PatchBody != null) { PatchBodies.Remove(PatchBody); MainManager.GetInstance().Delete(PatchBody.Patch); WireDrawer.GetInstance().RemovePatch(PatchBody); Destroy(PatchBody.gameObject); PatchBody = null; } }
void Awake() { if (instance == null) { instance = this; lines = new Dictionary <int, LineRenderer>(); } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }