Example #1
0
    public void SpawnSpike()
    {
        if (spawningSpike != null)
        {
            waitingSpike = spawningSpike;
            waitingSpike.Invoke("Fall", 1.5F);
        }

        spawningSpike = Spawn("Spike", transform.position, Quaternion.identity).GetComponent <Spike>();
        spawningSpike.transform.parent = transform;
        spawningSpike.spikeManager     = this;

        if (autoSpawn)
        {
            spawnDelay = randomGenerator.Range(spawnMinDelay, spawnMaxDelay);
            SpawnSpikeIn(spawnDelay);
        }
    }