mirror of
https://github.com/ConjureETS/Labo_2_equ_2_a15.git
synced 2026-03-24 01:21:07 +00:00
23 lines
477 B
C#
23 lines
477 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class Destroyer : MonoBehaviour
|
|
{
|
|
public bool destroyOnAwake; // Whether or not this gameobject should destroyed after a delay, on Awake.
|
|
public float awakeDestroyDelay; // The delay for destroying it on Awake.
|
|
|
|
|
|
|
|
|
|
void Awake ()
|
|
{
|
|
// If the gameobject should be destroyed on awake,
|
|
if(destroyOnAwake)
|
|
{ // ... destroy the gameobject after the delay.
|
|
Destroy(gameObject, awakeDestroyDelay);
|
|
}
|
|
|
|
}
|
|
|
|
}
|