static void WriteTower() { LoadCurSelection(); foreach (GameObject obj in curSelections) { if (obj.GetComponent <SavePath>() == null) { obj.AddComponent <SavePath>(); } SavePath path = obj.GetComponent <SavePath>(); path.PaintTower(); path.ClearOtherSavePath(); path.enabled = true; } }