Commit 82c3a448 by Eko Simanjuntak

starting level 3

parent 25c38151
...@@ -3372,7 +3372,7 @@ GameObject: ...@@ -3372,7 +3372,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!212 &909257000 --- !u!212 &909257000
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,7 +8,7 @@ public class BackgroundChanger : MonoBehaviour { ...@@ -8,7 +8,7 @@ public class BackgroundChanger : MonoBehaviour {
private List<GameObject> obstacleGroup = new List<GameObject>(); private List<GameObject> obstacleGroup = new List<GameObject>();
private GameObject[] gameObjectGroup; private GameObject[] gameObjectGroup;
private GameObject background; private GameObject background;
private string[] colors = {"Blue", "Green" }; private string[] colors = {"Blue", "Green", "Yellow" };
public void Start() public void Start()
{ {
...@@ -42,6 +42,9 @@ public class BackgroundChanger : MonoBehaviour { ...@@ -42,6 +42,9 @@ public class BackgroundChanger : MonoBehaviour {
} else if (Input.GetKey(KeyCode.Z)) } else if (Input.GetKey(KeyCode.Z))
{ {
UpdateBackgroud("Green"); UpdateBackgroud("Green");
} else if (Input.GetKey(KeyCode.C))
{
UpdateBackgroud("Yellow");
} }
} }
...@@ -53,13 +56,18 @@ public class BackgroundChanger : MonoBehaviour { ...@@ -53,13 +56,18 @@ public class BackgroundChanger : MonoBehaviour {
} else if (tagColor == "Blue") } else if (tagColor == "Blue")
{ {
background.GetComponent<SpriteRenderer>().color = new Color32(65, 131, 215, 255); background.GetComponent<SpriteRenderer>().color = new Color32(65, 131, 215, 255);
} else if (tagColor == "Yellow")
{
background.GetComponent<SpriteRenderer>().color = new Color32(255, 193, 7, 255);
} }
UpdateObstacle(tagColor); UpdateObstacle(tagColor);
} }
private void UpdateObstacle(string tagColor) private void UpdateObstacle(string tagColor)
{ {
Debug.Log(tagColor);
foreach (GameObject obstacle in obstacleGroup) foreach (GameObject obstacle in obstacleGroup)
{ {
if (obstacle.tag == tagColor + "Obstacle") if (obstacle.tag == tagColor + "Obstacle")
......
...@@ -7,6 +7,7 @@ TagManager: ...@@ -7,6 +7,7 @@ TagManager:
- BlueObstacle - BlueObstacle
- GreenObstacle - GreenObstacle
- Background - Background
- YellowObstacle
layers: layers:
- Default - Default
- TransparentFX - TransparentFX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment