Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/hsuanhauliu/RuGo
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishore Venkateshan committed Nov 25, 2018
2 parents aba8bd7 + d18f757 commit 0f87edc
Show file tree
Hide file tree
Showing 13 changed files with 320 additions and 6 deletions.
80 changes: 80 additions & 0 deletions RuGoTheGame/Assets/Materials/BluePlastic.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_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GreenPlastic
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.839
- _GlossyReflections: 1
- _Metallic: 0.095
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.31300002, g: 0.87541467, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8 changes: 8 additions & 0 deletions RuGoTheGame/Assets/Materials/BluePlastic.mat.meta

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

80 changes: 80 additions & 0 deletions RuGoTheGame/Assets/Materials/GreenPlastic.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_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: YellowPlastic
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.839
- _GlossyReflections: 1
- _Metallic: 0.095
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.03844783, g: 0.9056604, b: 0.19303618, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8 changes: 8 additions & 0 deletions RuGoTheGame/Assets/Materials/GreenPlastic.mat.meta

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

80 changes: 80 additions & 0 deletions RuGoTheGame/Assets/Materials/OrangePlastic.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_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BluePlastic
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.839
- _GlossyReflections: 1
- _Metallic: 0.095
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.65660703, b: 0.11792451, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8 changes: 8 additions & 0 deletions RuGoTheGame/Assets/Materials/OrangePlastic.mat.meta

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

8 changes: 8 additions & 0 deletions RuGoTheGame/Assets/Resources/Domino.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,12 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MakeGadgetSolid: 0
HapticsEnabled: 1
CurrentGadgetState: 0
KinematicRigidbodies: []
DominoColors:
- {fileID: 2100000, guid: 3daf27a1b44c941b08393806b7d1f071, type: 2}
- {fileID: 2100000, guid: 222a3d15fdd19492e891e8776898c91d, type: 2}
- {fileID: 2100000, guid: eb4f4132fa184414d890927bb21797af, type: 2}
- {fileID: 2100000, guid: d005256fc83304ae2aca4cc4c538968d, type: 2}
DominoColorIndex: 3
31 changes: 30 additions & 1 deletion RuGoTheGame/Assets/Scripts/Gadgets/DominoGadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,48 @@ public class DominoGadget : Gadget
{
protected AudioSource mAudioData;

public Material[] DominoColors;

public static int DEFAULT_COLOR_INDEX = 0;

public int DominoColorIndex = DEFAULT_COLOR_INDEX;

new void Awake()
{
base.Awake();
mAudioData = this.GetComponent<AudioSource>();
}

protected override int GetColorInfo()
{
return DominoColorIndex;
}

public void SetDominoColor(int index)
{
DominoColorIndex = index;
Renderer r = this.GetComponent<Renderer>();
r.material = DominoColors[index];
}

public static int GetRandomColorIndex()
{
return Random.Range(0, 4);
}

public override GadgetInventory GetGadgetType()
{
return GadgetInventory.Domino;
}

public void SetDominoInWorld()
protected override void RestoreColorInfo(int colorInfo)
{
SetDominoColor(colorInfo);
}

public void SetDominoInWorld(int colorIndex)
{
this.SetDominoColor(colorIndex);
ChangeState(GadgetState.InWorld);
transform.SetParent(World.Instance.transform);
MakeSolid();
Expand Down
14 changes: 14 additions & 0 deletions RuGoTheGame/Assets/Scripts/Gadgets/Gadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class GadgetLayers
public struct GadgetSaveData
{
public string name;
public int colorInfo;
public float px;
public float py;
public float pz;
Expand All @@ -29,6 +30,7 @@ public struct GadgetSaveData

public GadgetSaveData(GadgetInventory name, Vector3 position, Quaternion orientation) {
this.name = name.ToString();
colorInfo = 0;
px = position.x;
py = position.y;
pz = position.z;
Expand Down Expand Up @@ -107,6 +109,7 @@ protected void UpdateGadgetSaveData()
}
#endif
mGadgetSaveData.name = this.GetGadgetType().ToString();
mGadgetSaveData.colorInfo = this.GetColorInfo();
mGadgetSaveData.px = this.transform.position.x;
mGadgetSaveData.py = this.transform.position.y;
mGadgetSaveData.pz = this.transform.position.z;
Expand All @@ -116,6 +119,11 @@ protected void UpdateGadgetSaveData()
mGadgetSaveData.ow = this.transform.rotation.w;
}

protected virtual int GetColorInfo()
{
return 0;
}

private void CheckLoadSync()
{
if (!Mathf.Approximately(mGadgetSaveData.px, this.transform.position.x))
Expand Down Expand Up @@ -148,6 +156,11 @@ private void CheckLoadSync()
}
}

protected virtual void RestoreColorInfo(int colorInfo)
{

}

public GadgetSaveData GetSaveData()
{
return mGadgetSaveData;
Expand All @@ -156,6 +169,7 @@ public GadgetSaveData GetSaveData()
public void RestoreStateFromSaveData(GadgetSaveData data) {
this.transform.position = data.GetPosition();
this.transform.rotation = data.GetQuaternion();
this.RestoreColorInfo(data.colorInfo);
ChangeState(GadgetState.Loaded);
mGadgetSaveData = data;
}
Expand Down
2 changes: 0 additions & 2 deletions RuGoTheGame/Assets/Scripts/Gadgets/GoalGadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ void OnTriggerEnter(Collider other)

World.Instance.NotifyGoalComplete();



LineRenderer[] lasers = this.GetComponentsInChildren<LineRenderer>();
foreach (LineRenderer laser in lasers)
{
Expand Down
Loading

0 comments on commit 0f87edc

Please sign in to comment.