public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUILayout.Button("Randomize Clump", GUILayout.Width(150))) { HexClump clump = target as HexClump; clump.CreateClump(); } }
private void SpawnClump() { HexClump clump = Instantiate(HexClumpPrefab, transform.position, Quaternion.identity); bool spawnLaser = Random.Range(0, MinimumLaserFrequency) == 0; if (++_numSpawns % MinimumLaserFrequency == 0 || spawnLaser) { clump.CreateLaser(); } else { clump.CreateClump(); } if (spawnLaser) // Laser was manually spawned, reset laser spawn count. { _numSpawns = 0; } clump.Deploy(); }