add some extra assets FX and SFX

This commit is contained in:
Robii Aragon
2026-03-29 23:03:14 -07:00
parent 6ef3eb1535
commit 24dc66a81e
10142 changed files with 2535978 additions and 36608 deletions

View File

@@ -27,7 +27,9 @@ public class crate : MonoBehaviour
public bool useCustomShader;
public Shader customShader;
[Space]
public string colorPropertyName = "_Color";
[Space]
[Header ("Debug")]
[Space]
@@ -54,8 +56,10 @@ public class crate : MonoBehaviour
Coroutine mainCoroutine;
int colorID;
private void InitializeAudioElements ()
private void InitializeAudioElements ()
{
if (brokenSound != null) {
brokenAudioElement.clip = brokenSound;
@@ -96,15 +100,19 @@ public class crate : MonoBehaviour
for (i = 0; i < rendererPartsCount; i++) {
currentMaterial = rendererParts [i];
Color alpha = currentMaterial.color;
alpha.a -= Time.deltaTime / 5;
currentMaterial.color = alpha;
if (currentMaterial.HasProperty (colorID)) {
Color alpha = currentMaterial.GetColor (colorID);
//once the alpha is 0, remove the gameObject
if (currentMaterial.color.a > 0) {
allPiecesFaded = false;
}
}
alpha.a -= Time.deltaTime / 5;
currentMaterial.SetColor (colorID, alpha);
//once the alpha is 0, remove the gameObject
if (alpha.a > 0) {
allPiecesFaded = false;
}
}
}
if (allPiecesFaded) {
Destroy (gameObject);
@@ -148,7 +156,11 @@ public class crate : MonoBehaviour
transparentShader = Shader.Find (defaultShaderName);
}
}
}
if (fadeBrokenPieces) {
colorID = Shader.PropertyToID (colorPropertyName);
}
}
Component[] components = brokenCrateClone.GetComponentsInChildren (typeof(MeshRenderer));