Skip to content

Commit

Permalink
Grimm now changes color as the fight progresses
Browse files Browse the repository at this point in the history
Moves have also been refined
  • Loading branch information
nickc01 committed Jun 22, 2020
1 parent 0741ffa commit 8adbf6d
Show file tree
Hide file tree
Showing 64 changed files with 2,421 additions and 634 deletions.
2 changes: 1 addition & 1 deletion Assets/Animation/Grimm/Cast Return.anim
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
Expand Down
157 changes: 157 additions & 0 deletions Assets/GrimmHue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WeaverCore;

[ExecuteInEditMode]
public class GrimmHue : MonoBehaviour
{
static HashSet<GrimmHue> allGrimmHues = new HashSet<GrimmHue>();

public static IEnumerable<GrimmHue> AllGrimmHues
{
get
{
return allGrimmHues;
}
}

public float HueShiftRed
{
get
{
return hueShiftRed;
}

set
{
if (hueShiftRed != value)
{
hueShiftRed = value;
UpdateHue();
}
}
}

public float HueShiftGreen
{
get
{
return hueShiftGreen;
}

set
{
if (HueShiftGreen != value)
{
hueShiftGreen = value;
UpdateHue();
}
}
}

public float HueShiftBlue
{
get
{
return hueShiftBlue;
}

set
{
if (hueShiftBlue != value)
{
hueShiftBlue = value;
UpdateHue();
}
}
}

[Range(0f,1f)]
[SerializeField]
float hueShiftRed;
[Range(0f, 1f)]
[SerializeField]
float hueShiftGreen;
[Range(0f, 1f)]
[SerializeField]
float hueShiftBlue;

static float globalRedHue = 0f;
static float globalGreenHue = 0f;
static float globalBlueHue = 0f;

MaterialPropertyBlock block;
// Use this for initialization

Renderer rend;

void Awake()
{
hueShiftRed = globalRedHue;
hueShiftGreen = globalGreenHue;
hueShiftBlue = globalBlueHue;
UpdateHue();
}

void Start()
{
allGrimmHues.Add(this);
}

void OnEnable()
{
allGrimmHues.Add(this);
}

void OnDisable()
{
allGrimmHues.Remove(this);
}

void OnDestroy()
{
allGrimmHues.Remove(this);
}

void OnValidate()
{
UpdateHue();
}

void UpdateHue()
{
if (block == null)
{
block = new MaterialPropertyBlock();
}
if (rend == null)
{
rend = GetComponent<Renderer>();
}
if (rend != null)
{
rend.GetPropertyBlock(block);

block.SetColor("_HueShift", new Color(hueShiftRed,hueShiftGreen,hueShiftBlue));

rend.SetPropertyBlock(block);
}
}

public static void SetAllGrimmHues(float redHueShift,float greenHueShift,float blueHueShift)
{
foreach (var hue in allGrimmHues)
{
hue.hueShiftRed = Mathf.Clamp01(redHueShift);
hue.hueShiftGreen = Mathf.Clamp01(greenHueShift);
hue.hueShiftBlue = Mathf.Clamp01(blueHueShift);

globalRedHue = Mathf.Clamp01(redHueShift);
globalGreenHue = Mathf.Clamp01(greenHueShift);
globalBlueHue = Mathf.Clamp01(blueHueShift);

hue.UpdateHue();
}
}
}
2 changes: 1 addition & 1 deletion Assets/Scripts/Tester.cs.meta → Assets/GrimmHue.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Assets/GrimmParticles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GrimmParticles : MonoBehaviour
{
/*ParticleSystem ps;
ParticleSystem.MainModule main;
Color initialHueMin = default(Color);
Color initialHueMax = default(Color);
// Use this for initialization
void Start () {
ps = GetComponent<ParticleSystem>();
main = ps.main;
}
// Update is called once per frame
void Update ()
{
main.startco
}*/
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions Assets/Material/GrimmMaterial.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
%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: GrimmMaterial
m_Shader: {fileID: 4800000, guid: aaf6ec53b5875864ca61c6b784fd9c51, type: 3}
m_ShaderKeywords: ETC1_EXTERNAL_ALPHA
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: 0}
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:
- PixelSnap: 0
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _FlashAmount: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FlashColor: {r: 1, g: 1, b: 1, a: 1}
- _HueShift: {r: 0, g: 0, b: 0, a: 0}
8 changes: 8 additions & 0 deletions Assets/Material/GrimmMaterial.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Assets/Material/Particle_Grimm_Smoke.mat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Material:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Particle_Grimm_Smoke
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: aaf6ec53b5875864ca61c6b784fd9c51, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
Expand All @@ -34,6 +34,7 @@ Material:
- _DstBlend: 0
- _EmissionScaleUI: 0
- _EnableExternalAlpha: 0
- _FlashAmount: 0
- _Glossiness: 0.5
- _InvFade: 0.15
- _Metallic: 0
Expand All @@ -48,7 +49,9 @@ Material:
- _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _FlashColor: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _HueShift: {r: 0, g: 0, b: 0, a: 0}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.7058823, g: 0.7058823, b: 0.7058823, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
10 changes: 8 additions & 2 deletions Assets/Material/Particle_Lift_Dust.mat
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Particle_Lift_Dust
m_Shader: {fileID: 4800000, guid: 1a0dd0de724964e428d9708eec99c4ad, type: 3}
m_ShaderKeywords:
m_Shader: {fileID: 4800000, guid: aaf6ec53b5875864ca61c6b784fd9c51, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
Expand All @@ -31,6 +34,7 @@ Material:
- _DstBlend: 0
- _EmissionScaleUI: 0
- _EnableExternalAlpha: 0
- _FlashAmount: 0
- _Glossiness: 0.5
- _InvFade: 0.15
- _Metallic: 0
Expand All @@ -45,7 +49,9 @@ Material:
- _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _FlashColor: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _HueShift: {r: 0, g: 0, b: 0, a: 0}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.7058823, g: 0.7058823, b: 0.7058823, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
10 changes: 8 additions & 2 deletions Assets/Material/Particle_WhiteHit.mat
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Particle_WhiteHit
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_Shader: {fileID: 4800000, guid: aaf6ec53b5875864ca61c6b784fd9c51, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
Expand All @@ -31,6 +34,7 @@ Material:
- _DstBlend: 0
- _EmissionScaleUI: 0
- _EnableExternalAlpha: 0
- _FlashAmount: 0
- _Glossiness: 0.5
- _InvFade: 0.15
- _Metallic: 0
Expand All @@ -45,7 +49,9 @@ Material:
- _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _FlashColor: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _HueShift: {r: 0, g: 0, b: 0, a: 0}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.7058823, g: 0.7058823, b: 0.7058823, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
Loading

0 comments on commit 8adbf6d

Please sign in to comment.