- Added the new kill mechanic (slow x cross)

This commit is contained in:
Patrice Vignola 2015-08-16 12:53:04 -04:00
parent 9c3a06dd56
commit 4364c86cae
17 changed files with 641 additions and 38 deletions

View File

@ -17,6 +17,24 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!1 &147480
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 424146}
- 33: {fileID: 3395424}
- 23: {fileID: 2372840}
- 114: {fileID: 11438000}
m_Layer: 0
m_Name: xMarkLeft
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &176828 --- !u!1 &176828
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -27,8 +45,9 @@ GameObject:
- 4: {fileID: 498100} - 4: {fileID: 498100}
- 33: {fileID: 3387390} - 33: {fileID: 3387390}
- 23: {fileID: 2308108} - 23: {fileID: 2308108}
- 114: {fileID: 11422410}
m_Layer: 0 m_Layer: 0
m_Name: xQuad m_Name: xMarkRight
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -62,12 +81,24 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193868} m_GameObject: {fileID: 193868}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -544.163269, y: -235.973114, z: 0} m_LocalPosition: {x: 1.96902442, y: 3.20279193, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 496448} - {fileID: 496448}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
--- !u!4 &424146
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
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: -.00999999978}
m_LocalScale: {x: 1.25, y: 1.25, z: 1}
m_Children: []
m_Father: {fileID: 496448}
m_RootOrder: 0
--- !u!4 &496448 --- !u!4 &496448
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -78,6 +109,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: -.00100000005} m_LocalPosition: {x: 0, y: 0, z: -.00100000005}
m_LocalScale: {x: .800000012, y: .800000012, z: 1} m_LocalScale: {x: .800000012, y: .800000012, z: 1}
m_Children: m_Children:
- {fileID: 424146}
- {fileID: 498100} - {fileID: 498100}
m_Father: {fileID: 410576} m_Father: {fileID: 410576}
m_RootOrder: 0 m_RootOrder: 0
@ -89,21 +121,21 @@ Transform:
m_GameObject: {fileID: 176828} m_GameObject: {fileID: 176828}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -.00999999978} m_LocalPosition: {x: 0, y: 0, z: -.00999999978}
m_LocalScale: {x: 1.5, y: 1.5, z: 1} m_LocalScale: {x: 1.25, y: 1.25, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 496448} m_Father: {fileID: 496448}
m_RootOrder: 0 m_RootOrder: 1
--- !u!23 &2308108 --- !u!23 &2308108
MeshRenderer: MeshRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 176828} m_GameObject: {fileID: 176828}
m_Enabled: 0 m_Enabled: 1
m_CastShadows: 1 m_CastShadows: 1
m_ReceiveShadows: 1 m_ReceiveShadows: 1
m_Materials: m_Materials:
- {fileID: 2100000, guid: 30594d2784eed81489fa210d180bdfce, type: 2} - {fileID: 2100000, guid: 65515d5275108d64f993d24ce2e0e11d, type: 2}
m_SubsetIndices: m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0} m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1 m_UseLightProbes: 1
@ -165,6 +197,30 @@ MeshRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!23 &2372840
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
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!33 &3312470 --- !u!33 &3312470
MeshFilter: MeshFilter:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -186,6 +242,13 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 176828} m_GameObject: {fileID: 176828}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3395424
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &5464416 --- !u!54 &5464416
Rigidbody: Rigidbody:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -241,7 +304,31 @@ MonoBehaviour:
MiddleColor: {r: 1, g: .921568632, b: .0156862754, a: 1} MiddleColor: {r: 1, g: .921568632, b: .0156862754, a: 1}
EndColor: {r: 1, g: 0, b: 0, a: 1} EndColor: {r: 1, g: 0, b: 0, a: 1}
internQuad: {fileID: 2363438} internQuad: {fileID: 2363438}
xQuad: {fileID: 2308108} KillHoldDuration: 2
xMarkLeft: {fileID: 11438000}
xMarkRight: {fileID: 11422410}
--- !u!114 &11422410
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 176828}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 51e725985a0e317458c006132d935c25, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &11438000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 51e725985a0e317458c006132d935c25, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

View File

@ -2,7 +2,7 @@
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000 --- !u!21 &2100000
Material: Material:
serializedVersion: 6 serializedVersion: 5
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
@ -11,7 +11,6 @@ Material:
m_ShaderKeywords: m_ShaderKeywords:
m_LightmapFlags: 5 m_LightmapFlags: 5
m_CustomRenderQueue: -1 m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties: m_SavedProperties:
serializedVersion: 2 serializedVersion: 2
m_TexEnvs: m_TexEnvs:
@ -79,6 +78,10 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Floats: m_Floats:
data:
first:
name: _Cutoff
second: .5
data: data:
first: first:
name: _SrcBlend name: _SrcBlend
@ -87,10 +90,6 @@ Material:
first: first:
name: _DstBlend name: _DstBlend
second: 0 second: 0
data:
first:
name: _Cutoff
second: .5
data: data:
first: first:
name: _Parallax name: _Parallax
@ -119,6 +118,10 @@ Material:
first: first:
name: _UVSec name: _UVSec
second: 0 second: 0
data:
first:
name: _EmissionScaleUI
second: 0
data: data:
first: first:
name: _Mode name: _Mode
@ -127,6 +130,10 @@ Material:
first: first:
name: _Metallic name: _Metallic
second: 0 second: 0
data:
first:
name: _Ratio
second: .5
m_Colors: m_Colors:
data: data:
first: first:
@ -136,3 +143,15 @@ Material:
first: first:
name: _Color name: _Color
second: {r: 1, g: 1, b: 1, a: 1} second: {r: 1, g: 1, b: 1, a: 1}
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

@ -2,16 +2,15 @@
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000 --- !u!21 &2100000
Material: Material:
serializedVersion: 6 serializedVersion: 5
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_Name: xMark m_Name: xMarkLeft
m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 4800000, guid: bb0f298d1fd9ff24c8aed06d334c0b1f, type: 3}
m_ShaderKeywords: m_ShaderKeywords:
m_LightmapFlags: 5 m_LightmapFlags: 5
m_CustomRenderQueue: -1 m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties: m_SavedProperties:
serializedVersion: 2 serializedVersion: 2
m_TexEnvs: m_TexEnvs:
@ -19,7 +18,7 @@ Material:
first: first:
name: _MainTex name: _MainTex
second: second:
m_Texture: {fileID: 2800000, guid: 84643d1735e87de44889f90b3540c999, type: 3} m_Texture: {fileID: 2800000, guid: efd71283395b4f7468fd7cd652d22155, type: 3}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
data: data:
@ -79,6 +78,10 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Floats: m_Floats:
data:
first:
name: _Cutoff
second: .5
data: data:
first: first:
name: _SrcBlend name: _SrcBlend
@ -87,10 +90,6 @@ Material:
first: first:
name: _DstBlend name: _DstBlend
second: 0 second: 0
data:
first:
name: _Cutoff
second: .5
data: data:
first: first:
name: _Parallax name: _Parallax
@ -127,6 +126,10 @@ Material:
first: first:
name: _Metallic name: _Metallic
second: 0 second: 0
data:
first:
name: _Ratio
second: 0
m_Colors: m_Colors:
data: data:
first: first:
@ -136,3 +139,11 @@ Material:
first: first:
name: _Color name: _Color
second: {r: 1, g: 1, b: 1, a: 1} second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _CompletedColor
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _RemainingColor
second: {r: 1, g: 1, b: 1, a: 0}

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: efd71283395b4f7468fd7cd652d22155
timeCreated: 1439738572
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: -1
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

@ -0,0 +1,149 @@
%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: xMarkRight
m_Shader: {fileID: 4800000, guid: b0aba77b532f48a48b23f8b41fbe3bcd, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 0fd4daec51f3afd48a2410f5fe9a02af, 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: _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: _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: 1}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _CompletedColor
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _RemainingColor
second: {r: 1, g: 1, b: 1, a: 0}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 65515d5275108d64f993d24ce2e0e11d
timeCreated: 1439740902
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: 0fd4daec51f3afd48a2410f5fe9a02af
timeCreated: 1439738554
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: 1
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: 0
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -149,15 +149,18 @@ public class NetworkingSphere : MonoBehaviour
private void OnNodeClicked(PersonNode node) private void OnNodeClicked(PersonNode node)
{ {
rb.angularVelocity = Vector3.zero;
if (_selectedNode != null) if (_selectedNode != null)
{ {
_selectedNode.Select(false); _selectedNode.Select(false);
} }
if (_selectedNode != node) if (!_isRotatingTowardsNode || node != _selectedNode)
{ {
FocusOnNode(node); FocusOnNode(node);
} }
/* /*
if (_timeSinceLastClick < 0.5f && node == _selectedNode) if (_timeSinceLastClick < 0.5f && node == _selectedNode)

View File

@ -20,7 +20,9 @@ public class PersonNode : MonoBehaviour, IObserver
public Color EndColor = Color.red; public Color EndColor = Color.red;
public Renderer internQuad; public Renderer internQuad;
public Renderer xQuad; public float KillHoldDuration = 2f;
public RatioProgression xMarkLeft;
public RatioProgression xMarkRight;
private List<Link> _links; private List<Link> _links;
private bool _highlighted = false; private bool _highlighted = false;
@ -30,6 +32,8 @@ public class PersonNode : MonoBehaviour, IObserver
private Renderer _renderer; private Renderer _renderer;
private Transform _transform; private Transform _transform;
private float _holdDuration;
public Person Model public Person Model
{ {
get { return _model; } get { return _model; }
@ -113,12 +117,10 @@ public class PersonNode : MonoBehaviour, IObserver
//If dead -> set offline until all friends are aware, then add a big red X to profile pic //If dead -> set offline until all friends are aware, then add a big red X to profile pic
if (_model.Alive) if (_model.Alive)
{ {
xQuad.enabled = false;
SetColors(); SetColors();
} }
else else
{ {
xQuad.enabled = true;
gameObject.GetComponent<Renderer>().material.color = new Color32(50, 50, 50, 1); gameObject.GetComponent<Renderer>().material.color = new Color32(50, 50, 50, 1);
UpdateLinks(false); UpdateLinks(false);
} }
@ -168,10 +170,38 @@ public class PersonNode : MonoBehaviour, IObserver
void OnMouseDown() void OnMouseDown()
{ {
_holdDuration = 0f;
// The sphere should be subscribed to this event and update the data accordingly // The sphere should be subscribed to this event and update the data accordingly
if (OnClicked != null) if (OnClicked != null)
{ {
OnClicked(this); OnClicked(this);
} }
} }
void OnMouseDrag()
{
if (!_model.Alive) return;
Debug.Log(_model.Alive);
_holdDuration += Time.deltaTime;
xMarkLeft.SetCompletedRatio(Mathf.Clamp(_holdDuration - 0.025f, 0f, 1f));
xMarkRight.SetCompletedRatio(Mathf.Clamp(_holdDuration - 1.025f, 0f, 1f));
if (_holdDuration >= KillHoldDuration)
{
Kill();
}
}
void OnMouseUp()
{
if (_model.Alive)
{
xMarkLeft.SetCompletedRatio(0f);
xMarkRight.SetCompletedRatio(0f);
}
}
} }

View File

@ -0,0 +1,86 @@
// http://wiki.unity3d.com/index.php?title=Shader_Code
Shader "Pat Shaders/RatioProgressionDiagonalLeft"
{
Properties
{
_CompletedColor ("Completed Tint", Color) = (0,0,0,0)
_RemainingColor ("Remaining Tint", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
_Ratio ("Ratio", Range(0,1)) = 0.5
}
SubShader
{
// http://docs.unity3d.com/460/Documentation/Manual/SL-SubshaderTags.html
Tags
{
"Queue"="Transparent-1"
}
// http://docs.unity3d.com/Manual/SL-Blend.html
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
fixed4 _CompletedColor;
fixed4 _RemainingColor;
float _Ratio;
sampler2D _MainTex;
// Data transferred from application to vertex program
struct vertexInput
{
float4 vertex : POSITION;
float2 texcoord0 : TEXCOORD0; // Normalized, from 0 to 1
};
// Data transferred from vertex program to fragment program
struct fragmentInput
{
float4 position : SV_POSITION;
float2 texcoord0 : TEXCOORD0; // Normalized, from 0 to 1
};
// Vertex program
fragmentInput vert(vertexInput i)
{
fragmentInput o;
o.position = mul(UNITY_MATRIX_MVP, i.vertex); // Model*View*Projection matrix
o.texcoord0 = i.texcoord0;
return o;
}
// Fragment program
fixed4 frag(fragmentInput i) : COLOR
{
float4 color;
if (i.texcoord0.x <= _Ratio && i.texcoord0.y >= 1 - _Ratio)
{
color = tex2D(_MainTex, i.texcoord0) * _CompletedColor;
}
else
{
color = tex2D(_MainTex, i.texcoord0) * _RemainingColor;
}
color.rgb = color.rgb * color.a;
return color;
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bb0f298d1fd9ff24c8aed06d334c0b1f
timeCreated: 1439740748
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,86 @@
// http://wiki.unity3d.com/index.php?title=Shader_Code
Shader "Pat Shaders/RatioProgressionDiagonalRight"
{
Properties
{
_CompletedColor ("Completed Tint", Color) = (0,0,0,0)
_RemainingColor ("Remaining Tint", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
_Ratio ("Ratio", Range(0,1)) = 0.5
}
SubShader
{
// http://docs.unity3d.com/460/Documentation/Manual/SL-SubshaderTags.html
Tags
{
"Queue"="Transparent-1"
}
// http://docs.unity3d.com/Manual/SL-Blend.html
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
fixed4 _CompletedColor;
fixed4 _RemainingColor;
float _Ratio;
sampler2D _MainTex;
// Data transferred from application to vertex program
struct vertexInput
{
float4 vertex : POSITION;
float2 texcoord0 : TEXCOORD0; // Normalized, from 0 to 1
};
// Data transferred from vertex program to fragment program
struct fragmentInput
{
float4 position : SV_POSITION;
float2 texcoord0 : TEXCOORD0; // Normalized, from 0 to 1
};
// Vertex program
fragmentInput vert(vertexInput i)
{
fragmentInput o;
o.position = mul(UNITY_MATRIX_MVP, i.vertex); // Model*View*Projection matrix
o.texcoord0 = i.texcoord0;
return o;
}
// Fragment program
fixed4 frag(fragmentInput i) : COLOR
{
float4 color;
if (i.texcoord0.x >= 1 - _Ratio && i.texcoord0.y >= 1 - _Ratio)
{
color = tex2D(_MainTex, i.texcoord0) * _CompletedColor;
}
else
{
color = tex2D(_MainTex, i.texcoord0) * _RemainingColor;
}
color.rgb = color.rgb * color.a;
return color;
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b0aba77b532f48a48b23f8b41fbe3bcd
timeCreated: 1439740921
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3,14 +3,17 @@
--- !u!129 &1 --- !u!129 &1
PlayerSettings: PlayerSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 7 serializedVersion: 6
AndroidProfiler: 0 AndroidProfiler: 0
defaultScreenOrientation: 4 defaultScreenOrientation: 4
targetDevice: 2 targetDevice: 2
targetGlesGraphics: -1
targetIOSGraphics: -1
targetResolution: 0 targetResolution: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: DefaultCompany
productName: DeathBook productName: DeathBook
cloudProjectId:
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_ShowUnitySplashScreen: 1 m_ShowUnitySplashScreen: 1
@ -23,6 +26,7 @@ PlayerSettings:
m_ActiveColorSpace: 0 m_ActiveColorSpace: 0
m_MTRendering: 1 m_MTRendering: 1
m_MobileMTRendering: 0 m_MobileMTRendering: 0
m_UseDX11: 1
m_Stereoscopic3D: 0 m_Stereoscopic3D: 0
iosShowActivityIndicatorOnLoading: -1 iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1
@ -77,7 +81,6 @@ PlayerSettings:
metroEnableIndependentInputSource: 0 metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0 metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0 xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 0
productGUID: 402278fad2098ce4eab29439139ae9ad productGUID: 402278fad2098ce4eab29439139ae9ad
AndroidBundleVersionCode: 1 AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9 AndroidMinSdkVersion: 9
@ -120,7 +123,6 @@ PlayerSettings:
iOSLaunchScreenCustomXibPath: iOSLaunchScreenCustomXibPath:
AndroidTargetDevice: 0 AndroidTargetDevice: 0
AndroidSplashScreenScale: 0 AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName: AndroidKeystoreName:
AndroidKeyaliasName: AndroidKeyaliasName:
AndroidTVCompatibility: 1 AndroidTVCompatibility: 1
@ -134,7 +136,6 @@ PlayerSettings:
resolutionDialogBanner: {fileID: 0} resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: [] m_BuildTargetIcons: []
m_BuildTargetBatching: [] m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs: []
webPlayerTemplate: APPLICATION:Default webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {} m_TemplateCustomTags: {}
actionOnDotNetUnhandledException: 1 actionOnDotNetUnhandledException: 1
@ -196,7 +197,6 @@ PlayerSettings:
ps4ApplicationParam2: 0 ps4ApplicationParam2: 0
ps4ApplicationParam3: 0 ps4ApplicationParam3: 0
ps4ApplicationParam4: 0 ps4ApplicationParam4: 0
ps4GarlicHeapSize: 2048
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
ps4pnSessions: 1 ps4pnSessions: 1
ps4pnPresence: 1 ps4pnPresence: 1
@ -339,7 +339,8 @@ PlayerSettings:
blackberrySquareSplashScreen: {fileID: 0} blackberrySquareSplashScreen: {fileID: 0}
tizenProductDescription: tizenProductDescription:
tizenProductURL: tizenProductURL:
tizenSigningProfileName: tizenCertificatePath:
tizenCertificatePassword:
tizenGPSPermissions: 0 tizenGPSPermissions: 0
tizenMicrophonePermissions: 0 tizenMicrophonePermissions: 0
stvDeviceAddress: stvDeviceAddress:
@ -397,9 +398,4 @@ PlayerSettings:
- WebGL::template - WebGL::template
WebGL::emscriptenArgs: WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default WebGL::template: APPLICATION:Default
firstStreamedSceneWithResources: 0 firstStreamedLevelWithResources: 0
cloudProjectId:
projectId:
projectName:
organizationId:
cloudEnabled: 0