-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grimm now changes color as the fight progresses
Moves have also been refined
- Loading branch information
Showing
64 changed files
with
2,421 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}*/ | ||
} |
2 changes: 1 addition & 1 deletion
2
Assets/Scripts/EnemyTester.cs.meta → Assets/GrimmParticles.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.