예제 #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("Randomize Clump", GUILayout.Width(150)))
        {
            HexClump clump = target as HexClump;
            clump.CreateClump();
        }
    }
예제 #2
0
    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();
    }