Skip to content

Commit

Permalink
Switch material color on Smile
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPEZ committed Jan 8, 2021
1 parent c2d8608 commit 1d065ee
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 176 deletions.
13 changes: 7 additions & 6 deletions Prototype/Assets/Prefabs/goodSmile2.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Transform:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1111747923641672}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 2.13, y: 1.213, z: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.519425, y: 1.4104863, z: 0}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.20000002}
m_Children:
- {fileID: 4575707645286520}
Expand Down Expand Up @@ -89,7 +89,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: f3b3738fb3608024ba94712d4daf62c3, type: 2}
- {fileID: 2100000, guid: 4f30c1adb9ec5c849b36746e980649a6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
Expand Down Expand Up @@ -163,6 +163,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
gameController: {fileID: 0}
objectGoodSmile: {fileID: 1977251435392318}
goodSmile: {fileID: 21300000, guid: a2bd550470c31e845b6c26f543e9e582, type: 3}
badSmile: {fileID: 21300000, guid: caf166d1667cea7438d3a73945735d13, type: 3}
goldSmile: {fileID: 21300000, guid: 9f9e496e96effc64486d79e3e6066ffa, type: 3}
Expand All @@ -182,7 +183,7 @@ SpriteRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: c57af84aa93d7d34780f73276605b2a4, type: 2}
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
Expand All @@ -202,14 +203,14 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: a2bd550470c31e845b6c26f543e9e582, type: 3}
m_Sprite: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.12, y: 5.12}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_WasSpriteAssigned: 0
m_MaskInteraction: 0
m_SpriteSortPoint: 0
12 changes: 6 additions & 6 deletions Prototype/Assets/Scenes/Play.unity
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ LightmapSettings:
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
Expand Down Expand Up @@ -580,7 +580,7 @@ Light:
m_Strength: 1
m_Bias: 0.2
m_NormalBias: 0.4
m_NearPlane: 0.2
m_NearPlane: 0.1
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
Expand All @@ -602,13 +602,13 @@ Transform:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 736968034}
m_LocalRotation: {x: 0.4216722, y: -0.50462663, z: -0.028261488, w: 0.75282514}
m_LocalPosition: {x: 3, y: 0.19, z: -0.02}
m_LocalRotation: {x: 0.1464465, y: -0.3535538, z: 0.3535533, w: 0.8535533}
m_LocalPosition: {x: 3.53, y: 5.53, z: -0.76}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 37.327003, y: -80.219, z: -36.065002}
m_LocalEulerAnglesHint: {x: 30.000002, y: -35.264, z: 35.264}
--- !u!1 &809035882
GameObject:
m_ObjectHideFlags: 0
Expand Down
15 changes: 8 additions & 7 deletions Prototype/Assets/Scripts/CntrlSmile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
public class CntrlSmile : MonoBehaviour
{
public GameController gameController;
public Sprite goodSmile;
public Sprite badSmile;
public Sprite goldSmile;
public GameObject objectGoodSmile;
public bool isGold = false;

private float speed, tilt;
Expand All @@ -27,22 +25,25 @@ private void Start()
void Update()
{
transform.position = Vector3.MoveTowards(transform.position, target, Time.deltaTime * speed);
transform.Rotate(Vector3.back * tilt);
objectGoodSmile.transform.Rotate(Vector3.back * tilt);
if (localScore % randomAngerActivator == 0 && localScore != 0)
{
isAnger = true;
tilt = Random.Range(-10, 10);
GetComponent<SpriteRenderer>().sprite = badSmile;
objectGoodSmile.GetComponent<MeshRenderer>().material.SetColor("_Color", Color.red + Color.black);
//GetComponent<SpriteRenderer>().sprite = badSmile;
}
else if (isAnger == false)
{
if (isGold)
{
GetComponent<SpriteRenderer>().sprite = goldSmile;
objectGoodSmile.GetComponent<MeshRenderer>().material.SetColor("_Color", Color.yellow );
//GetComponent<SpriteRenderer>().sprite = goldSmile;
}
else
{
GetComponent<SpriteRenderer>().sprite = goodSmile;
objectGoodSmile.GetComponent<MeshRenderer>().material.SetColor("_Color", Color.gray + Color.black);
//GetComponent<SpriteRenderer>().sprite = goodSmile;
}

}
Expand Down
62 changes: 4 additions & 58 deletions Prototype/Assets/ToonShader/Demo/Materials/ShadowReceiver.mat
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,12 @@ Material:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2001
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_TexEnvs: []
m_Floats:
- _Alpha: 0.5
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 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}
- _Alpha: 1
m_Colors: []
7 changes: 3 additions & 4 deletions Prototype/Assets/ToonShader/Demo/Materials/ToonCornflower.mat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ToonCornflower
m_Shader: {fileID: 4800000, guid: 99bb36e9d2c76874e8e8e2baed6debca, type: 3}
m_ShaderKeywords:
Expand Down Expand Up @@ -67,7 +66,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _RimAmount: 0.716
- _RimAmount: 0.5
- _RimThreshold: 0.1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
Expand All @@ -76,7 +75,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _AmbientColor: {r: 0.4, g: 0.4, b: 0.4, a: 1}
- _Color: {r: 0.49803925, g: 0.6489124, b: 1, a: 1}
- _Color: {r: 0.6, g: 0.3, b: 0.2, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _RimColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecularColor: {r: 0.9, g: 0.9, b: 0.9, a: 1}
4 changes: 2 additions & 2 deletions Prototype/Assets/ToonShader/Demo/Materials/ToonGlossy.mat
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _RimAmount: 0.569
- _RimAmount: 0.5
- _RimThreshold: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
Expand All @@ -75,7 +75,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _AmbientColor: {r: 0.4, g: 0.4, b: 0.4, a: 1}
- _Color: {r: 0.6509434, g: 0.532077, b: 0.08904416, a: 1}
- _Color: {r: 0.627451, g: 0.3529412, b: 0.15686275, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _RimColor: {r: 2, g: 2, b: 2, a: 1}
- _SpecularColor: {r: 4.2870936, g: 4.2870936, b: 4.2870936, a: 1}
Loading

0 comments on commit 1d065ee

Please sign in to comment.