Commit 82c3a448 by Eko Simanjuntak

starting level 3

parent 25c38151
......@@ -3372,7 +3372,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!212 &909257000
SpriteRenderer:
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 {
private List<GameObject> obstacleGroup = new List<GameObject>();
private GameObject[] gameObjectGroup;
private GameObject background;
private string[] colors = {"Blue", "Green" };
private string[] colors = {"Blue", "Green", "Yellow" };
public void Start()
{
......@@ -42,6 +42,9 @@ public class BackgroundChanger : MonoBehaviour {
} else if (Input.GetKey(KeyCode.Z))
{
UpdateBackgroud("Green");
} else if (Input.GetKey(KeyCode.C))
{
UpdateBackgroud("Yellow");
}
}
......@@ -53,13 +56,18 @@ public class BackgroundChanger : MonoBehaviour {
} else if (tagColor == "Blue")
{
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);
}
private void UpdateObstacle(string tagColor)
{
{
Debug.Log(tagColor);
foreach (GameObject obstacle in obstacleGroup)
{
if (obstacle.tag == tagColor + "Obstacle")
......
......@@ -7,6 +7,7 @@ TagManager:
- BlueObstacle
- GreenObstacle
- Background
- YellowObstacle
layers:
- Default
- 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