generated from LeonardoTPereira/SSW.GitHub.Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds enraged logic and shader for visuals
Adds a script to "enrage" the mad mantis in the animator and a shader manager to control the values and states, as well as a shader graph to color it gradually red and make it wavy during the enraging animation. Adds the URP package to enable using shadergraph with sprites.
- Loading branch information
1 parent
77c7c95
commit 46681e9
Showing
30 changed files
with
11,112 additions
and
6,852 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,62 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 8 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: MadMantisMaterial | ||
m_Shader: {fileID: -6465566751694194690, guid: ef1a2e5dd02533043affa83176d81b67, type: 3} | ||
m_ValidKeywords: [] | ||
m_InvalidKeywords: [] | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _AlphaTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 2800000, guid: 8620bcf7fa769e94fa548c2fc0325ef4, type: 3} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MaskTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _NormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- unity_Lightmaps: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- unity_LightmapsInd: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- unity_ShadowMasks: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Ints: [] | ||
m_Floats: | ||
- _BUILTIN_QueueControl: -1 | ||
- _BUILTIN_QueueOffset: 0 | ||
- _EnableExternalAlpha: 0 | ||
- _FillRate: 0 | ||
- _IsEnraging: 0 | ||
m_Colors: | ||
- _Color: {r: 1, g: 1, b: 1, a: 1} | ||
- _Flip: {r: 1, g: 1, b: 1, a: 1} | ||
- _RendererColor: {r: 1, g: 1, b: 1, a: 1} | ||
m_BuildTextureStacks: [] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class MadMantisEnrage : StateMachineBehaviour | ||
{ | ||
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) | ||
{ | ||
animator.GetComponent<MadMantisShaderManager>().Enrage(); | ||
} | ||
} |
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,38 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem; | ||
|
||
public class MadMantisShaderManager : MonoBehaviour | ||
{ | ||
private float _fillRate; | ||
private float _step; | ||
private Material _material; | ||
private Animator _animator; | ||
|
||
private void Awake() | ||
{ | ||
_fillRate = 0f; | ||
_step = 0.05f; | ||
_material = GetComponent<Renderer>().material; | ||
_animator = GetComponent<Animator>(); | ||
} | ||
|
||
public void Enrage() | ||
{ | ||
_material.SetFloat("_IsEnraging", 1); | ||
StartCoroutine(FillRage()); | ||
} | ||
|
||
private IEnumerator FillRage() | ||
{ | ||
while (_fillRate < 1.0f) | ||
{ | ||
_material.SetFloat("_FillRate", _fillRate); | ||
_fillRate += _step; | ||
yield return new WaitForSeconds(2 * _step); | ||
} | ||
_animator.SetTrigger("FinishedRage"); | ||
_material.SetFloat("_IsEnraging", 0); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.