diff --git a/Assets/Generator.cs.meta b/Assets/Generator.cs.meta index 484325a..2162bf1 100644 --- a/Assets/Generator.cs.meta +++ b/Assets/Generator.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 4828dbfa7343efb49b36490a44cb05d7 -timeCreated: 1477746563 +timeCreated: 1477749872 licenseType: Free MonoImporter: serializedVersion: 2 @@ -8,6 +8,7 @@ MonoImporter: - tmanager: {fileID: 1000011212613648, guid: 0193d92a24b3bc94aad43f1f8c93643b, type: 2} - mcreator: {fileID: 1000013182272914, guid: bd3068e9944aae447a20ec5f0a4784be, type: 2} - ucreator: {fileID: 1000012081215776, guid: afbffbb7b9d986345b62d4e4b7969551, type: 2} + - imanager: {fileID: 1000013132162768, guid: c25c1548ba0651c429c11b0a9718bda8, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Assets/InputManagerScript.cs b/Assets/InputManagerScript.cs index e8413ef..65e28f3 100644 --- a/Assets/InputManagerScript.cs +++ b/Assets/InputManagerScript.cs @@ -17,9 +17,12 @@ public class InputManagerScript : MonoBehaviour { private bool unitSelected; private bool showActions; + private bool actionSelected; private Image i1; private Image i2; + private int actionOption; + private TurnManagerScript tmss; // Use this for initialization @@ -34,7 +37,8 @@ public class InputManagerScript : MonoBehaviour { unitSelected = false; showActions = false; - + actionOption = -1; + actionSelected = false; } // Update is called once per frame @@ -111,9 +115,14 @@ public class InputManagerScript : MonoBehaviour { Color lol = i1.color; i1.color = new Color (1f, 0f, 0f); i2.color = new Color (1f, 1f, 1f); + actionOption = 1; } else if (Input.GetKeyUp (KeyCode.A)) { i2.color = new Color (1f, 0f, 0f); i1.color = new Color (1f, 1f, 1f); + actionOption = 0; + } else if (Input.GetKeyUp (KeyCode.Space) && actionOption > -1) { + actionSelected = true; + unitSelected = false; } } diff --git a/Assets/MapCreation.cs b/Assets/MapCreation.cs index fc8ee5f..c5066c9 100644 --- a/Assets/MapCreation.cs +++ b/Assets/MapCreation.cs @@ -2,34 +2,30 @@ using System.Collections; public class MapCreation : MonoBehaviour { - - public int vs = 20; - public int hs = 40; - public int[,] matrix; //0 significa zona habitable - //dif de 0 zona no habitable + + private int vs = 20; + private int hs = 40; + public int[,] matrix; //0 significa zona habitable + //dif de 0 zona no habitable public GameObject basic_floor; public GameObject nhabitable_floor; - void Start () { - GameObject basic_floor_instance; + //Creacion de suelo plano + GameObject basic_floor_instance = Instantiate(basic_floor, new Vector3(0,-0.5f,0), Quaternion.identity) as GameObject; + basic_floor_instance.transform.localScale = new Vector3 (vs, 1, hs); + basic_floor_instance.transform.Translate((vs / 2) - 0.5f, 0, (hs / 2) - 0.5f); + //Anadir pilares para zonas inaccesibles for(int i = 0; i < vs; i++){ for(int j = 0; j < hs; j++){ - if(matrix[i,j]==0) basic_floor_instance = Instantiate(basic_floor, new Vector3(i,-0.5f,j), Quaternion.identity) as GameObject; - else basic_floor_instance = Instantiate(nhabitable_floor, new Vector3(i,0.5f,j), Quaternion.identity) as GameObject; + if(matrix[i,j]!=0) basic_floor_instance = Instantiate(nhabitable_floor, new Vector3(i,1f,j), Quaternion.identity) as GameObject; } } } - - void Update () { - - } - - public void setMatrix(int[,] new_floor, int x, int z){ matrix = new_floor; vs = x; hs = z; } -} +} \ No newline at end of file