- Added the blood splatter when killing someone

This commit is contained in:
Patrice Vignola 2015-08-16 13:47:46 -04:00
parent 53d76e8953
commit 16a88142be
6 changed files with 343 additions and 13 deletions

View File

@ -19,7 +19,7 @@ GameObject:
m_IsActive: 1
--- !u!1 &147480
GameObject:
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
@ -27,14 +27,13 @@ GameObject:
- 4: {fileID: 424146}
- 33: {fileID: 3395424}
- 23: {fileID: 2372840}
- 114: {fileID: 11438000}
m_Layer: 0
m_Name: xMarkLeft
m_Name: BloodSplatter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!1 &176828
GameObject:
m_ObjectHideFlags: 1
@ -53,6 +52,24 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &177472
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 476902}
- 33: {fileID: 3311720}
- 23: {fileID: 2315696}
- 114: {fileID: 11439868}
m_Layer: 0
m_Name: xMarkLeft
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &193868
GameObject:
m_ObjectHideFlags: 0
@ -81,9 +98,10 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193868}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.96902442, y: 3.20279193, z: 0}
m_LocalPosition: {x: -.133731544, y: -.756275117, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 424146}
- {fileID: 496448}
m_Father: {fileID: 0}
m_RootOrder: 0
@ -94,6 +112,18 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -.0109999999}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 410576}
m_RootOrder: 0
--- !u!4 &476902
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 177472}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -.00999999978}
m_LocalScale: {x: 1.25, y: 1.25, z: 1}
m_Children: []
@ -109,10 +139,10 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: -.00100000005}
m_LocalScale: {x: .800000012, y: .800000012, z: 1}
m_Children:
- {fileID: 424146}
- {fileID: 476902}
- {fileID: 498100}
m_Father: {fileID: 410576}
m_RootOrder: 0
m_RootOrder: 1
--- !u!4 &498100
Transform:
m_ObjectHideFlags: 1
@ -149,6 +179,30 @@ MeshRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2315696
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 177472}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 30594d2784eed81489fa210d180bdfce, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_ImportantGI: 0
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2341426
MeshRenderer:
m_ObjectHideFlags: 1
@ -204,10 +258,10 @@ MeshRenderer:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_Enabled: 1
m_CastShadows: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 30594d2784eed81489fa210d180bdfce, type: 2}
- {fileID: 2100000, guid: 8c192887af84c6d489323981a0248291, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
@ -221,6 +275,13 @@ MeshRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3311720
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 177472}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3312470
MeshFilter:
m_ObjectHideFlags: 1
@ -305,8 +366,9 @@ MonoBehaviour:
EndColor: {r: 1, g: 0, b: 0, a: 1}
internQuad: {fileID: 2363438}
KillHoldDuration: 2
xMarkLeft: {fileID: 11438000}
xMarkLeft: {fileID: 11439868}
xMarkRight: {fileID: 11422410}
bloodSplatter: {fileID: 2372840}
--- !u!114 &11422410
MonoBehaviour:
m_ObjectHideFlags: 1
@ -318,12 +380,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 51e725985a0e317458c006132d935c25, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &11438000
--- !u!114 &11439868
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_GameObject: {fileID: 177472}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 51e725985a0e317458c006132d935c25, type: 3}

View File

@ -0,0 +1,165 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 5
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BloodSplatter
m_Shader: {fileID: 32, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 53b43f40f83eccf429bfd482f09effb1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Cutoff
second: .5
data:
first:
name: _Shininess
second: .257999986
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Parallax
second: .0199999996
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: .5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _EmissionScaleUI
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
data:
first:
name: _Ratio
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: .5, g: .5, b: .5, a: 0}
data:
first:
name: _EmissionColorUI
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _CompletedColor
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _RemainingColor
second: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c192887af84c6d489323981a0248291
timeCreated: 1439745852
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: 53b43f40f83eccf429bfd482f09effb1
timeCreated: 1439745776
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 0
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -23,6 +23,7 @@ public class PersonNode : MonoBehaviour, IObserver
public float KillHoldDuration = 2f;
public RatioProgression xMarkLeft;
public RatioProgression xMarkRight;
public Renderer bloodSplatter;
private List<Link> _links;
private bool _highlighted = false;
@ -103,9 +104,48 @@ public class PersonNode : MonoBehaviour, IObserver
public void Kill()
{
_model.Kill();
if (_model.Kill())
{
StartCoroutine(SplashBlood());
}
}
private IEnumerator SplashBlood()
{
bloodSplatter.gameObject.SetActive(true);
float ratio = 0f;
Vector3 finalScale = Vector3.one * 1.7f;
while (ratio < 1f)
{
ratio += Time.deltaTime / 0.5f;
bloodSplatter.transform.localScale = Vector3.Lerp(Vector3.zero, finalScale, ratio);
yield return null;
}
ratio = 0f;
Color initialColor = bloodSplatter.material.color;
Color finalColor = initialColor;
finalColor.a = 0f;
// Fade out
while (ratio < 1f)
{
ratio += Time.deltaTime / 1f;
bloodSplatter.material.color = Color.Lerp(initialColor, finalColor, ratio);
yield return null;
}
bloodSplatter.gameObject.SetActive(false);
}
public void Notify()
{
//Debug.Log("Received notification! " + Model.AwarenessLevel);