mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
smoke VFX done
This commit is contained in:
parent
246042f125
commit
ea6e45b593
7 changed files with 4662 additions and 2 deletions
4583
Assets/Prefabs/Smoke.prefab
Normal file
4583
Assets/Prefabs/Smoke.prefab
Normal file
File diff suppressed because it is too large
Load diff
7
Assets/Prefabs/Smoke.prefab.meta
Normal file
7
Assets/Prefabs/Smoke.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c5d4e25823f45c946b9dd01264b40a1b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -96,6 +96,8 @@ MonoBehaviour:
|
|||
controlWheelsOnLocalPlayer: 1
|
||||
vehicleSyncRate: 20
|
||||
explosionForceMultiplier: 700
|
||||
explosionChassisForceMultiplier: 11000
|
||||
explosionLeftoverPartsLifetime: 30
|
||||
explosionLeftoverPartsMaxDepenetrationVelocity: 15
|
||||
explosionLeftoverPartsMass: 100
|
||||
smokePrefab: {fileID: 100000, guid: c5d4e25823f45c946b9dd01264b40a1b, type: 3}
|
||||
|
|
|
@ -28,6 +28,9 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
public float explosionLeftoverPartsMaxDepenetrationVelocity = 15f;
|
||||
public float explosionLeftoverPartsMass = 100f;
|
||||
|
||||
public GameObject smokePrefab;
|
||||
|
||||
|
||||
|
||||
void Awake()
|
||||
{
|
||||
|
|
|
@ -21,6 +21,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
|
||||
public float TimeWhenBecameUnderFlame { get; private set; } = float.NegativeInfinity;
|
||||
|
||||
GameObject m_smokeGameObject;
|
||||
|
||||
|
||||
|
||||
void Awake_Damage()
|
||||
|
@ -59,7 +61,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
// smoke status changed
|
||||
this.IsUnderSmoke = shouldBeUnderSmoke;
|
||||
// update vfx
|
||||
|
||||
this.UpdateSmokeVfx();
|
||||
}
|
||||
|
||||
bool shouldBeUnderFlame = this.MaxHealth * 0.1f >= this.Health;
|
||||
|
@ -81,6 +83,27 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
|
||||
}
|
||||
|
||||
void UpdateSmokeVfx()
|
||||
{
|
||||
if (this.IsUnderSmoke)
|
||||
{
|
||||
if (null == m_smokeGameObject)
|
||||
{
|
||||
Transform parent = this.EngineTransform != null ? this.EngineTransform : this.transform;
|
||||
m_smokeGameObject = Object.Instantiate(
|
||||
VehicleManager.Instance.smokePrefab, parent.position, parent.rotation, parent);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (null != m_smokeGameObject)
|
||||
{
|
||||
Object.Destroy(m_smokeGameObject);
|
||||
m_smokeGameObject = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode()
|
||||
{
|
||||
F.RunExceptionSafe(() => this.ExplodeInternal());
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 033f0bb8034673d7548708910b80af76ae3ddb1e
|
||||
Subproject commit 4527e028ba14b7802e8ba4da2dbdc90792adfa63
|
|
@ -29,9 +29,16 @@ QualitySettings:
|
|||
vSyncCount: 0
|
||||
lodBias: 0.3
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 4
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
|
@ -57,9 +64,16 @@ QualitySettings:
|
|||
vSyncCount: 0
|
||||
lodBias: 0.4
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 16
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
|
@ -85,9 +99,16 @@ QualitySettings:
|
|||
vSyncCount: 0
|
||||
lodBias: 0.7
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 64
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
|
@ -113,9 +134,16 @@ QualitySettings:
|
|||
vSyncCount: 1
|
||||
lodBias: 1
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 256
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
|
@ -141,9 +169,16 @@ QualitySettings:
|
|||
vSyncCount: 1
|
||||
lodBias: 1.5
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 1024
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
- serializedVersion: 2
|
||||
|
@ -169,9 +204,16 @@ QualitySettings:
|
|||
vSyncCount: 1
|
||||
lodBias: 2
|
||||
maximumLODLevel: 0
|
||||
streamingMipmapsActive: 0
|
||||
streamingMipmapsAddAllCameras: 1
|
||||
streamingMipmapsMemoryBudget: 512
|
||||
streamingMipmapsRenderersPerFrame: 512
|
||||
streamingMipmapsMaxLevelReduction: 2
|
||||
streamingMipmapsMaxFileIORequests: 1024
|
||||
particleRaycastBudget: 4096
|
||||
asyncUploadTimeSlice: 2
|
||||
asyncUploadBufferSize: 4
|
||||
asyncUploadPersistentBuffer: 1
|
||||
resolutionScalingFixedDPIFactor: 1
|
||||
excludedTargetPlatforms: []
|
||||
m_PerPlatformDefaultQuality: {}
|
||||
|
|
Loading…
Reference in a new issue