Add particles on death
This commit is contained in:
parent
88496c99ae
commit
2b7afef0ae
12 changed files with 14104 additions and 54 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
4642
Assets/Prefabs/despawn.prefab
Normal file
4642
Assets/Prefabs/despawn.prefab
Normal file
File diff suppressed because it is too large
Load diff
8
Assets/Prefabs/despawn.prefab.meta
Normal file
8
Assets/Prefabs/despawn.prefab.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 469f111ee663c824d97f618a355cf82e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 100100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -674,6 +674,52 @@ AudioSource:
|
|||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1001 &809524311
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1887677565572348, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1 &816024604
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -882,52 +928,6 @@ MonoBehaviour:
|
|||
- {fileID: 2012930731}
|
||||
- {fileID: 2060531170}
|
||||
- {fileID: 1908750963}
|
||||
--- !u!1001 &934296221
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4665188581213052, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1887677565572348, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: dd625f75dbf83194392a299951cf04fb, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1 &1028937042
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1153,7 +1153,7 @@ Prefab:
|
|||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||
type: 2}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 65.89836
|
||||
value: 64.16286
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||
type: 2}
|
||||
|
|
19
Assets/Scripts/Destroyer.cs
Normal file
19
Assets/Scripts/Destroyer.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Destroyer : MonoBehaviour {
|
||||
ParticleSystem ps;
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
ps = GetComponent<ParticleSystem>();
|
||||
ps.Play();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
if(ps != null && !ps.isPlaying) {
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Destroyer.cs.meta
Normal file
11
Assets/Scripts/Destroyer.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1a9a1f70c735c4346b1fc5dc2ed6571d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -25,11 +25,13 @@ namespace Assets.Scripts.Entities {
|
|||
}
|
||||
|
||||
protected virtual void Start() {
|
||||
ParticleSystem ps = GetComponentInChildren<ParticleSystem>();
|
||||
if(ps != null && ps.name == "spawn") {
|
||||
ParticleSystem[] pss = GetComponentsInChildren<ParticleSystem>();
|
||||
foreach(ParticleSystem ps in pss) {
|
||||
if ( ps.gameObject.name == "spawn" ) {
|
||||
ps.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Update() {
|
||||
|
||||
|
|
|
@ -43,6 +43,15 @@ public abstract class Mob : Entity {
|
|||
if ( objective != null )
|
||||
objective.RemoveEntity(this);
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.explosion);
|
||||
ParticleSystem[] pss = GetComponentsInChildren<ParticleSystem>(true);
|
||||
foreach ( ParticleSystem ps in pss ) {
|
||||
if ( ps.gameObject.name == "despawn" ) {
|
||||
GameObject tmp = Instantiate(ps.gameObject);
|
||||
tmp.transform.position = transform.position;
|
||||
tmp.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
|
8
Assets/graphics/Materials.meta
Normal file
8
Assets/graphics/Materials.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fa3a8aa1a0d62cd4f934d63b20c041b4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
83
Assets/graphics/Materials/Flames.mat
Normal file
83
Assets/graphics/Materials/Flames.mat
Normal file
|
@ -0,0 +1,83 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Flames
|
||||
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 390eba5510448e245bd1b27b9c0009f1, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _ColorMask: 15
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 10
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 3
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _UseUIAlphaClip: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.5529412}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
8
Assets/graphics/Materials/Flames.mat.meta
Normal file
8
Assets/graphics/Materials/Flames.mat.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6a21764f056428a42b455751935fe9f4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Reference in a new issue