public void Explode() { if (prefab != null) { GameObject vp = Instantiate(prefab, transform.position, transform.rotation); VoxelParticleExplode vpe = vp.GetComponent <VoxelParticleExplode>(); if (vpe != null) { vpe.Explode(); } } Destroy(this.gameObject); }
private void OnGUI() { if (voxParticle == null) { return; } if (GUILayout.Button("Reset")) { voxParticle.ResetParticles(); } if (voxExplode) { if (GUILayout.Button("Explode")) { voxExplode.Explode(); } } }