vylion the master
This commit is contained in:
parent
e15dbc9182
commit
04a26c89c3
2 changed files with 27 additions and 7 deletions
|
@ -27,6 +27,10 @@ public class TurnManagerScript : MonoBehaviour {
|
||||||
private float timeExpStep;
|
private float timeExpStep;
|
||||||
private float timeExpLimit;
|
private float timeExpLimit;
|
||||||
|
|
||||||
|
|
||||||
|
private bool unitSelected;
|
||||||
|
private bool showActions;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
|
|
||||||
|
@ -37,14 +41,16 @@ public class TurnManagerScript : MonoBehaviour {
|
||||||
// Characters that have finished its actions
|
// Characters that have finished its actions
|
||||||
actualNumFinishedChars = 0;
|
actualNumFinishedChars = 0;
|
||||||
|
|
||||||
timeStep = 0.4f;
|
timeStep = 0.2f;
|
||||||
timeExp = 0.0f;
|
timeExp = 0.0f;
|
||||||
timeExpStep = 0.04f;
|
timeExpStep = 0.05f;
|
||||||
timeExpLimit = 0.3f;
|
timeExpLimit = 0.15f;
|
||||||
|
|
||||||
cursor = Instantiate (cursor, new Vector3 (1.0f, 1.5f, 1.0f), Quaternion.identity) as GameObject;
|
cursor = Instantiate (cursor, new Vector3 (1.0f, 1.5f, 1.0f), Quaternion.identity) as GameObject;
|
||||||
cursor.transform.Rotate (new Vector3(90, 0, 0));
|
cursor.transform.Rotate (new Vector3(90, 0, 0));
|
||||||
|
|
||||||
|
unitSelected = false;
|
||||||
|
showActions = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -84,8 +90,16 @@ public class TurnManagerScript : MonoBehaviour {
|
||||||
timeExp = 0.0f;
|
timeExp = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyUp (KeyCode.Space)) {
|
if (Input.GetKeyUp (KeyCode.Space) && !unitSelected) {
|
||||||
Vector2 tilePosition = cursor.transform.position;
|
Vector3 tilePosition = cursor.transform.position;
|
||||||
|
int cpos = (int)tilePosition.z * (int)mapSize.x + (int)tilePosition.x;
|
||||||
|
GameObject c = charMap [cpos];
|
||||||
|
//UnitBehaviour ub = c.GetComponent<UnitBehaviour> ();
|
||||||
|
if (c != null) {
|
||||||
|
unitSelected = true;
|
||||||
|
showActions = true;
|
||||||
|
}
|
||||||
|
|
||||||
//Obtener GameObject de la matriz luego extraer sus funciones
|
//Obtener GameObject de la matriz luego extraer sus funciones
|
||||||
//Mostrar opciones y elegir una
|
//Mostrar opciones y elegir una
|
||||||
//Ejecutar acción
|
//Ejecutar acción
|
||||||
|
@ -117,5 +131,11 @@ public class TurnManagerScript : MonoBehaviour {
|
||||||
actualNumFinishedChars = 0;
|
actualNumFinishedChars = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnGUI(){
|
||||||
|
if (showActions) {
|
||||||
|
GUI.Box (new Rect(0, 0, 100, 100), "Move");
|
||||||
|
GUI.Box (new Rect(100, 0, 100, 100), "Attack");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class UnitCreator : MonoBehaviour {
|
||||||
unit.transform.localScale = new Vector3 (unit.transform.lossyScale.y/unit.transform.lossyScale.y, 1, unit.transform.lossyScale.z/unit.transform.lossyScale.y);
|
unit.transform.localScale = new Vector3 (unit.transform.lossyScale.y/unit.transform.lossyScale.y, 1, unit.transform.lossyScale.z/unit.transform.lossyScale.y);
|
||||||
unit.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0);
|
unit.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0);
|
||||||
unit.GetComponent<UnitBehaviour> ().SetupBaseAttack (4, 2, 3);
|
unit.GetComponent<UnitBehaviour> ().SetupBaseAttack (4, 2, 3);
|
||||||
units.Insert(posX*(int)mapSize.x+posZ, unit);
|
units.Insert(posZ*(int)mapSize.x+posX, unit);
|
||||||
|
|
||||||
if (team == UnitBehaviour.Team.Player && playerLichScript == null )
|
if (team == UnitBehaviour.Team.Player && playerLichScript == null )
|
||||||
playerLichScript = unit.GetComponent<UnitBehaviour> ();
|
playerLichScript = unit.GetComponent<UnitBehaviour> ();
|
||||||
|
@ -46,7 +46,7 @@ public class UnitCreator : MonoBehaviour {
|
||||||
unit = Instantiate (skeletonObject, new Vector3(posX, 0f, posZ), Quaternion.identity) as GameObject;
|
unit = Instantiate (skeletonObject, new Vector3(posX, 0f, posZ), Quaternion.identity) as GameObject;
|
||||||
unit.transform.localScale = new Vector3 (unit.transform.localScale.x*0.3f, unit.transform.localScale.y*0.3f, unit.transform.localScale.z*0.3f);
|
unit.transform.localScale = new Vector3 (unit.transform.localScale.x*0.3f, unit.transform.localScale.y*0.3f, unit.transform.localScale.z*0.3f);
|
||||||
unit.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ);
|
unit.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ);
|
||||||
units.Insert(posX*(int)mapSize.x+posZ, unit);
|
units.Insert(posZ*(int)mapSize.x+posX, unit);
|
||||||
|
|
||||||
|
|
||||||
if (team == UnitBehaviour.Team.Enemy1) {
|
if (team == UnitBehaviour.Team.Enemy1) {
|
||||||
|
|
Loading…
Reference in a new issue