diff --git a/Color Switch Replica/.vs/Color Switch Replica/DesignTimeBuild/.dtbcache b/Color Switch Replica/.vs/Color Switch Replica/DesignTimeBuild/.dtbcache new file mode 100644 index 0000000..6d2bc8a Binary files /dev/null and b/Color Switch Replica/.vs/Color Switch Replica/DesignTimeBuild/.dtbcache differ diff --git a/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/db.lock b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..0a68faa Binary files /dev/null and b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide differ diff --git a/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-shm b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..2261251 Binary files /dev/null and b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-shm differ diff --git a/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-wal b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..d5476e5 Binary files /dev/null and b/Color Switch Replica/.vs/Color Switch Replica/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Color Switch Replica/Assets/ColorsType.cs b/Color Switch Replica/Assets/ColorsType.cs new file mode 100644 index 0000000..a0287cf --- /dev/null +++ b/Color Switch Replica/Assets/ColorsType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ColorSwitchReplica +{ + public enum ColorsType + { + Cyan = 0, + Yellow = 1, + Magenta = 2, + Pink = 3 + } +} diff --git a/Color Switch Replica/Assets/ColorsType.cs.meta b/Color Switch Replica/Assets/ColorsType.cs.meta new file mode 100644 index 0000000..32f112b --- /dev/null +++ b/Color Switch Replica/Assets/ColorsType.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1d623ffc8e0bf0e4fbe2f12e2910659f +timeCreated: 1530224951 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Color Switch Replica/Assets/Main.unity b/Color Switch Replica/Assets/Main.unity index 55069bb..e15ef7e 100644 Binary files a/Color Switch Replica/Assets/Main.unity and b/Color Switch Replica/Assets/Main.unity differ diff --git a/Color Switch Replica/Assets/Player.cs b/Color Switch Replica/Assets/Player.cs index 0089d31..69822a5 100644 --- a/Color Switch Replica/Assets/Player.cs +++ b/Color Switch Replica/Assets/Player.cs @@ -1,71 +1,70 @@ using UnityEngine; using UnityEngine.SceneManagement; -public class Player : MonoBehaviour { +namespace ColorSwitchReplica { - public float jumpForce = 10f; + public class Player : MonoBehaviour { - public Rigidbody2D rb; - public SpriteRenderer sr; + public float jumpForce = 10f; + public Rigidbody2D rigidBody2D; + public SpriteRenderer spriteRenderer; + public string currentColorInTheCircle; + public Color colorPink, colorAzul; - public string currentColor; - - public Color colorCyan; - public Color colorYellow; - public Color colorMagenta; - public Color colorPink; - - void Start () - { - SetRandomColor(); - } + void Start () + { + SetRandomColor(); + } - // Update is called once per frame - void Update () { - if (Input.GetButtonDown("Jump") || Input.GetMouseButtonDown(0)) - { - rb.velocity = Vector2.up * jumpForce; - } - } + // Update is called once per frame + void Update () { + if (Input.GetButtonDown("Jump") || Input.GetMouseButtonDown(0)) + { + rigidBody2D.velocity = Vector2.up * jumpForce; + } + } - void OnTriggerEnter2D (Collider2D col) - { - if (col.tag == "ColorChanger") - { - SetRandomColor(); - Destroy(col.gameObject); - return; - } + void OnTriggerEnter2D (Collider2D collider2D) + { + if (collider2D.tag == "ColorChanger") + { + SetRandomColor(); + Destroy(collider2D.gameObject); + return; + } - if (col.tag != currentColor) - { - Debug.Log("GAME OVER!"); - SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); - } - } + if (collider2D.tag != currentColorInTheCircle) + { + Debug.Log("GAME OVER!"); + SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); + } + } - void SetRandomColor () - { - int index = Random.Range(0, 4); + void SetRandomColor () + { + int colorsType = Random.Range(0, 4); - switch (index) - { - case 0: - currentColor = "Cyan"; - sr.color = colorCyan; - break; - case 1: - currentColor = "Yellow"; - sr.color = colorYellow; - break; - case 2: - currentColor = "Magenta"; - sr.color = colorMagenta; - break; - case 3: - currentColor = "Pink"; - sr.color = colorPink; - break; - } - } -} + switch (colorsType) + { + case 0: + currentColorInTheCircle = "Cyan"; + spriteRenderer.color = Color.cyan; + break; + case 1: + currentColorInTheCircle = "Yellow"; + spriteRenderer.color = Color.yellow; + break; + case 2: + currentColorInTheCircle = "Magenta"; + spriteRenderer.color = Color.magenta; + break; + case 3: + currentColorInTheCircle = "Pink"; + spriteRenderer.color = colorPink; + break; + default: + throw new System.NotImplementedException(); + } + } + } +} \ No newline at end of file diff --git a/Color Switch Replica/Assets/SetRotation.cs b/Color Switch Replica/Assets/SetRotation.cs new file mode 100644 index 0000000..3d082f4 --- /dev/null +++ b/Color Switch Replica/Assets/SetRotation.cs @@ -0,0 +1,11 @@ +using UnityEngine; + +public class SetRotation : MonoBehaviour { + + public float speedRotation = 100f; + + // Update is called once per frame + void Update () { + transform.Rotate(0f, 0f, speedRotation * Time.deltaTime); + } +} diff --git a/Color Switch Replica/Assets/SetRotation.cs.meta b/Color Switch Replica/Assets/SetRotation.cs.meta new file mode 100644 index 0000000..1ab6e71 --- /dev/null +++ b/Color Switch Replica/Assets/SetRotation.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: efc7a070891697c4ebabd3737a6663fa +timeCreated: 1493817858 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Color Switch Replica/ProjectSettings/ProjectVersion.txt b/Color Switch Replica/ProjectSettings/ProjectVersion.txt index ca09a3d..2576b78 100644 --- a/Color Switch Replica/ProjectSettings/ProjectVersion.txt +++ b/Color Switch Replica/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 5.6.0f3 +m_EditorVersion: 2017.2.1f1 diff --git a/Color Switch Replica/UnityPackageManager/manifest.json b/Color Switch Replica/UnityPackageManager/manifest.json new file mode 100644 index 0000000..526aca6 --- /dev/null +++ b/Color Switch Replica/UnityPackageManager/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +}