Commit 52ac555a by Eko Simanjuntak

Merge branch 'level3' into 'development'

Level3 See merge request !4
parents 12ea5d78 906c2426
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,11 +4,12 @@ using UnityEngine;
public class BackgroundChanger : MonoBehaviour {
private List<GameObject> backgroundGroup = new List<GameObject>();
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()
{
......@@ -43,6 +44,9 @@ public class BackgroundChanger : MonoBehaviour {
} else if (Input.GetKey(KeyCode.Z))
{
UpdateBackgroud("Green");
} else if (Input.GetKey(KeyCode.C))
{
UpdateBackgroud("Yellow");
}
}
......@@ -54,11 +58,16 @@ 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)
{
foreach (GameObject obstacle in obstacleGroup)
......
......@@ -3,13 +3,7 @@
--- !u!78 &1
TagManager:
serializedVersion: 2
tags:
- BlueObstacle
- GreenObstacle
- Background
- BlueBackground
- GreenBackground
- WhiteObstacle
tags: []
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