I'm tired

This commit is contained in:
falc@null.net 2016-10-29 16:08:57 +02:00
parent bf1f1ac586
commit 01cadc4791
3 changed files with 24 additions and 18 deletions

View file

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4828dbfa7343efb49b36490a44cb05d7 guid: 4828dbfa7343efb49b36490a44cb05d7
timeCreated: 1477746563 timeCreated: 1477749872
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
@ -8,6 +8,7 @@ MonoImporter:
- tmanager: {fileID: 1000011212613648, guid: 0193d92a24b3bc94aad43f1f8c93643b, type: 2} - tmanager: {fileID: 1000011212613648, guid: 0193d92a24b3bc94aad43f1f8c93643b, type: 2}
- mcreator: {fileID: 1000013182272914, guid: bd3068e9944aae447a20ec5f0a4784be, type: 2} - mcreator: {fileID: 1000013182272914, guid: bd3068e9944aae447a20ec5f0a4784be, type: 2}
- ucreator: {fileID: 1000012081215776, guid: afbffbb7b9d986345b62d4e4b7969551, type: 2} - ucreator: {fileID: 1000012081215776, guid: afbffbb7b9d986345b62d4e4b7969551, type: 2}
- imanager: {fileID: 1000013132162768, guid: c25c1548ba0651c429c11b0a9718bda8, type: 2}
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:

View file

@ -17,9 +17,12 @@ public class InputManagerScript : MonoBehaviour {
private bool unitSelected; private bool unitSelected;
private bool showActions; private bool showActions;
private bool actionSelected;
private Image i1; private Image i1;
private Image i2; private Image i2;
private int actionOption;
private TurnManagerScript tmss; private TurnManagerScript tmss;
// Use this for initialization // Use this for initialization
@ -34,7 +37,8 @@ public class InputManagerScript : MonoBehaviour {
unitSelected = false; unitSelected = false;
showActions = false; showActions = false;
actionOption = -1;
actionSelected = false;
} }
// Update is called once per frame // Update is called once per frame
@ -111,9 +115,14 @@ public class InputManagerScript : MonoBehaviour {
Color lol = i1.color; Color lol = i1.color;
i1.color = new Color (1f, 0f, 0f); i1.color = new Color (1f, 0f, 0f);
i2.color = new Color (1f, 1f, 1f); i2.color = new Color (1f, 1f, 1f);
actionOption = 1;
} else if (Input.GetKeyUp (KeyCode.A)) { } else if (Input.GetKeyUp (KeyCode.A)) {
i2.color = new Color (1f, 0f, 0f); i2.color = new Color (1f, 0f, 0f);
i1.color = new Color (1f, 1f, 1f); i1.color = new Color (1f, 1f, 1f);
actionOption = 0;
} else if (Input.GetKeyUp (KeyCode.Space) && actionOption > -1) {
actionSelected = true;
unitSelected = false;
} }
} }

View file

@ -2,34 +2,30 @@
using System.Collections; using System.Collections;
public class MapCreation : MonoBehaviour { public class MapCreation : MonoBehaviour {
public int vs = 20; private int vs = 20;
public int hs = 40; private int hs = 40;
public int[,] matrix; //0 significa zona habitable public int[,] matrix; //0 significa zona habitable
//dif de 0 zona no habitable //dif de 0 zona no habitable
public GameObject basic_floor; public GameObject basic_floor;
public GameObject nhabitable_floor; public GameObject nhabitable_floor;
void Start () { 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 i = 0; i < vs; i++){
for(int j = 0; j < hs; j++){ 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; if(matrix[i,j]!=0) basic_floor_instance = Instantiate(nhabitable_floor, new Vector3(i,1f,j), Quaternion.identity) as GameObject;
else basic_floor_instance = Instantiate(nhabitable_floor, new Vector3(i,0.5f,j), Quaternion.identity) as GameObject;
} }
} }
} }
void Update () {
}
public void setMatrix(int[,] new_floor, int x, int z){ public void setMatrix(int[,] new_floor, int x, int z){
matrix = new_floor; matrix = new_floor;
vs = x; vs = x;
hs = z; hs = z;
} }
} }