use separate prefab for rocket explosion

This commit is contained in:
in0finite 2020-12-21 22:56:41 +01:00
parent d32688155c
commit 26ed669de8
4 changed files with 42086 additions and 1 deletions

View file

@ -77,9 +77,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ec78359df717b4b468d7394c6be40dcc, type: 3} m_Script: {fileID: 11500000, guid: ec78359df717b4b468d7394c6be40dcc, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
explosionPrefab: {fileID: 100010, guid: 2894e2899fe860745afbc810459e2cc2, type: 3} explosionPrefab: {fileID: 100010, guid: 4f8c6e508a3f69243ab7b8813398b7ed, type: 3}
explosionDamageAmount: 1000 explosionDamageAmount: 1000
explosionDamageRadius: 5 explosionDamageRadius: 5
particleSystemMultiplier: 1
collisionLayerMask: collisionLayerMask:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4f8c6e508a3f69243ab7b8813398b7ed
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -3,6 +3,7 @@ using SanAndreasUnity.Importing.Conversion;
using SanAndreasUnity.Net; using SanAndreasUnity.Net;
using SanAndreasUnity.Utilities; using SanAndreasUnity.Utilities;
using UnityEngine; using UnityEngine;
using UnityStandardAssets.Effects;
using Object = UnityEngine.Object; using Object = UnityEngine.Object;
namespace SanAndreasUnity.Behaviours namespace SanAndreasUnity.Behaviours
@ -12,6 +13,7 @@ namespace SanAndreasUnity.Behaviours
public GameObject explosionPrefab; public GameObject explosionPrefab;
public float explosionDamageAmount = 1000; public float explosionDamageAmount = 1000;
public float explosionDamageRadius = 5; public float explosionDamageRadius = 5;
public float particleSystemMultiplier = 1;
public LayerMask collisionLayerMask; public LayerMask collisionLayerMask;
public float speed = 10; public float speed = 10;
public float lifeTime = 30; public float lifeTime = 30;
@ -94,6 +96,9 @@ namespace SanAndreasUnity.Behaviours
contactPoint, contactPoint,
this.transform.rotation); this.transform.rotation);
var psm = explosionGo.GetComponentOrThrow<ParticleSystemMultiplier>();
psm.multiplier = this.particleSystemMultiplier;
if (NetStatus.IsServer) if (NetStatus.IsServer)
NetManager.Spawn(explosionGo); NetManager.Spawn(explosionGo);