add some extra assets FX and SFX
This commit is contained in:
@@ -82,6 +82,8 @@ public class vehicleHUDManager : healthManagement
|
||||
|
||||
public string defaultShaderName = "Legacy Shaders/Transparent/Diffuse";
|
||||
|
||||
public string colorPropertyName = "_Color";
|
||||
|
||||
public advancedSettingsClass advancedSettings = new advancedSettingsClass ();
|
||||
|
||||
public bool damageObjectsOnCollision = true;
|
||||
@@ -270,6 +272,8 @@ public class vehicleHUDManager : healthManagement
|
||||
|
||||
Coroutine damageOverTimeCoroutine;
|
||||
|
||||
Coroutine damageOrHealthTargetWithDelayCoroutine;
|
||||
|
||||
public string mainDecalManagerName = "Decal Manager";
|
||||
|
||||
decalManager impactDecalManager;
|
||||
@@ -334,6 +338,9 @@ public class vehicleHUDManager : healthManagement
|
||||
|
||||
bool originalRegenerateFuelValue;
|
||||
|
||||
int colorID = -1;
|
||||
|
||||
|
||||
private void InitializeAudioElements ()
|
||||
{
|
||||
if (destroyedSound != null) {
|
||||
@@ -472,12 +479,17 @@ public class vehicleHUDManager : healthManagement
|
||||
for (int 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);
|
||||
|
||||
if (alpha.a <= 0) {
|
||||
piecesAmountFade++;
|
||||
alpha.a -= Time.deltaTime / 5;
|
||||
|
||||
currentMaterial.SetColor (colorID, alpha);
|
||||
|
||||
//once the alpha is 0, remove the gameObject
|
||||
if (alpha.a <= 0) {
|
||||
piecesAmountFade++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -974,7 +986,7 @@ public class vehicleHUDManager : healthManagement
|
||||
|
||||
checkEventsToSendPassengerOnStateChange (currentPassenger, passengersOnVehicle);
|
||||
} else {
|
||||
print ("obstacle detected " +currentPassenger.name);
|
||||
print ("obstacle detected " + currentPassenger.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1923,6 +1935,33 @@ public class vehicleHUDManager : healthManagement
|
||||
}
|
||||
}
|
||||
|
||||
public void setDamageOrHealthTargetWithDelay (float waitAmount, float valueAmount, int damageTypeID)
|
||||
{
|
||||
stopDamageOrHealthTargetWithDelay ();
|
||||
|
||||
damageOrHealthTargetWithDelayCoroutine = StartCoroutine (setDamageOrHealthTargetWithDelayCoroutine (waitAmount, valueAmount, damageTypeID));
|
||||
}
|
||||
|
||||
IEnumerator setDamageOrHealthTargetWithDelayCoroutine (float waitAmount, float valueAmount, int damageTypeID)
|
||||
{
|
||||
WaitForSeconds delay = new WaitForSeconds (waitAmount);
|
||||
|
||||
yield return delay;
|
||||
|
||||
if (valueAmount > 0) {
|
||||
getHealth (valueAmount);
|
||||
} else {
|
||||
setDamage (-valueAmount, transform.forward, transform.position + 1.5f * transform.up, gameObject, gameObject, true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopDamageOrHealthTargetWithDelay ()
|
||||
{
|
||||
if (damageOrHealthTargetWithDelayCoroutine != null) {
|
||||
StopCoroutine (damageOrHealthTargetWithDelayCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
public int getClosesWeakSpotIndex (Vector3 collisionPosition)
|
||||
{
|
||||
float distance = Mathf.Infinity;
|
||||
@@ -2064,6 +2103,10 @@ public class vehicleHUDManager : healthManagement
|
||||
if (destroyedMeshShader == null) {
|
||||
destroyedMeshShader = Shader.Find (defaultShaderName);
|
||||
}
|
||||
|
||||
if (colorID == -1) {
|
||||
colorID = Shader.PropertyToID (colorPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
Renderer currentRenderer;
|
||||
@@ -2331,7 +2374,7 @@ public class vehicleHUDManager : healthManagement
|
||||
bool hudElementState = false;
|
||||
|
||||
if (weaponsManager != null && weaponsManager.isWeaponsEnabled ()) {
|
||||
if (!destroyed) {
|
||||
if (!destroyed || weaponsManager.ignoreDisableVehicleWeaponsIfDestroyed) {
|
||||
weaponsManager.changeWeaponState (drivingState);
|
||||
}
|
||||
|
||||
@@ -3330,6 +3373,11 @@ public class vehicleHUDManager : healthManagement
|
||||
stopDamageOverTime ();
|
||||
}
|
||||
|
||||
public override void setDamageOrHealthTargetWithDelayWithHealthManagement (float waitAmount, float valueAmount, int damageTypeID)
|
||||
{
|
||||
setDamageOrHealthTargetWithDelay (waitAmount, valueAmount, damageTypeID);
|
||||
}
|
||||
|
||||
public override void setHealWithHealthManagement (float healAmount)
|
||||
{
|
||||
getHealth (healAmount);
|
||||
|
||||
Reference in New Issue
Block a user