Skip to content

Commit

Permalink
color changer reworked
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueIceshard committed Jun 30, 2018
1 parent 2607a1c commit b285f57
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Neonmania/Assets/Materials/EnemyMaterial.mat
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Material:
m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_30FACB43: 1.5
- Vector1_80FF0A22: 0.1
- Vector1_80FF0A22: 1
- Vector1_A132DC88: 0.05
- Vector1_CF9D8B96: 20
- _AlphaClip: 0
Expand Down
6 changes: 6 additions & 0 deletions Neonmania/Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ Prefab:
propertyPath: player
value:
objectReference: {fileID: 1079610143}
- target: {fileID: 114429256390817914, guid: da9c70ea3ed54464b955c8fdd666b19d,
type: 2}
propertyPath: properties
value:
objectReference: {fileID: 11400000, guid: f0e71a788898eb04985a95ec5e4a9d6e,
type: 2}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: da9c70ea3ed54464b955c8fdd666b19d, type: 2}
m_IsPrefabParent: 0
Expand Down
4 changes: 2 additions & 2 deletions Neonmania/Assets/Scripts/EnemyColorChanger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class EnemyColorChanger : MonoBehaviour {
private void Start () {
enemy = GetComponent<EnemyPropertyController>().properties;
killHandler = GetComponent<EnemyPathfinding>();
currentColor = enemy.color;
// currentColor = GetComponent<EnemyPropertyController>().color;

ApplyColor(currentColor);
}
Expand All @@ -34,6 +34,6 @@ private void OnCollisionEnter(Collision collision) {
}

private void ApplyColor(CMYColor color) {
// TODO
GetComponent<Renderer>().material.SetColor(Shader.PropertyToID("Color_53254DB6"), color.AsColor());
}
}
4 changes: 1 addition & 3 deletions Neonmania/Assets/Scripts/EnemyProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ public class EnemyProperties : ScriptableObject
public float speed = 2f;
public EnemyPathfinding movementLogic;

[Header("Init Values")]
public CMYColor color;

[Header("Strength")]
[Range(0f, 1f)]
// higher is weaker
public float weakness = 1f;
public int level = 1;
[Range(0.3f, 5f)]
// higher is greater
public float scale = 0.8f;
Expand Down
2 changes: 2 additions & 0 deletions Neonmania/Assets/Scripts/EnemyPropertyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class EnemyPropertyController : MonoBehaviour {

void Start() {
lifetime = 0f;


}

void Update() {
Expand Down
18 changes: 18 additions & 0 deletions Neonmania/Assets/Shaders/DissolveShader.ShaderGraph
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"fullName": "UnityEditor.ShaderGraph.Vector1ShaderProperty"
},
"JSONnodeData": "{\n \"m_Value\": 1.0,\n \"m_Name\": \"Animation Speed\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"466dfdc1-c1fd-4fc6-b817-9ec3c1210d82\"\n },\n \"m_FloatType\": 0,\n \"m_RangeValues\": {\n \"x\": 0.0,\n \"y\": 1.0\n }\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.ColorShaderProperty"
},
"JSONnodeData": "{\n \"m_Value\": {\n \"r\": 0.0,\n \"g\": 0.0,\n \"b\": 0.0,\n \"a\": 0.0\n },\n \"m_Name\": \"Color\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"e795eb0b-5bf4-48ad-b0b8-fe8c0581b1fe\"\n },\n \"m_ColorMode\": 1\n}"
}
],
"m_GUID": {
Expand Down Expand Up @@ -106,6 +112,12 @@
"fullName": "UnityEditor.ShaderGraph.RemapNode"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"b49a4309-db32-4fe1-b917-2879e3aec4e9\",\n \"m_Name\": \"Remap\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 903.2683715820313,\n \"y\": 730.511474609375,\n \"width\": 208.0,\n \"height\": 326.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": -1.0,\\n \\\"y\\\": -1.0,\\n \\\"z\\\": -1.0,\\n \\\"w\\\": -1.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"In Min Max\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"InMinMax\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 1.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out Min Max\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"OutMinMax\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 1.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"fea1cf33-0492-4aeb-9ebd-0060b8a19c26\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 1370.7139892578125,\n \"y\": 362.0873718261719,\n \"width\": 221.0,\n \"height\": 132.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"e795eb0b-5bf4-48ad-b0b8-fe8c0581b1fe\"\n}"
}
],
"m_SerializableEdges": [
Expand Down Expand Up @@ -186,6 +198,12 @@
"fullName": "UnityEditor.Graphing.Edge"
},
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 3,\n \"m_NodeGUIDSerialized\": \"b49a4309-db32-4fe1-b917-2879e3aec4e9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 8,\n \"m_NodeGUIDSerialized\": \"6916f657-1d28-471b-a9ef-30c8adaa12cb\"\n }\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.Graphing.Edge"
},
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"fea1cf33-0492-4aeb-9ebd-0060b8a19c26\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"6916f657-1d28-471b-a9ef-30c8adaa12cb\"\n }\n}"
}
],
"m_PreviewData": {
Expand Down

0 comments on commit b285f57

Please sign in to comment.