add some extra assets FX and SFX
This commit is contained in:
@@ -132,6 +132,7 @@ public class explosiveBarrel : MonoBehaviour
|
||||
|
||||
int colorID;
|
||||
|
||||
|
||||
private void InitializeAudioElements ()
|
||||
{
|
||||
if (explosionSound != null) {
|
||||
@@ -174,12 +175,14 @@ public class explosiveBarrel : MonoBehaviour
|
||||
currentMaterial = rendererParts [i];
|
||||
|
||||
if (currentMaterial.HasProperty (colorID)) {
|
||||
Color alpha = currentMaterial.color;
|
||||
Color alpha = currentMaterial.GetColor (colorID);
|
||||
|
||||
alpha.a -= Time.deltaTime / 5;
|
||||
currentMaterial.color = alpha;
|
||||
|
||||
currentMaterial.SetColor (colorID, alpha);
|
||||
|
||||
//once the alpha is 0, remove the gameObject
|
||||
if (currentMaterial.color.a > 0) {
|
||||
if (alpha.a > 0) {
|
||||
allPiecesFaded = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user