diff --git a/Assets/Generator.cs b/Assets/Generator.cs index ade6612..8951814 100644 --- a/Assets/Generator.cs +++ b/Assets/Generator.cs @@ -34,6 +34,7 @@ public class Generator : MonoBehaviour { map [10, 20] = -1; mScript.setMatrix (map,x,y); + turnMan.GetComponent ().charMap = uScript.tutorialUnits (); } // Update is called once per frame diff --git a/Assets/UnitCreator.cs b/Assets/UnitCreator.cs index c715a2e..9046d4a 100644 --- a/Assets/UnitCreator.cs +++ b/Assets/UnitCreator.cs @@ -8,7 +8,7 @@ public class UnitCreator : MonoBehaviour { public GameObject skeletonObject; public List units; - private UnitBehaviour script; + private UnitBehaviour playerLichScript; public enum UnitType { Lich = 0, @@ -19,7 +19,7 @@ public class UnitCreator : MonoBehaviour { // Use this for initialization void Start () { units = new List (); - script = null; + playerLichScript = null; } // Update is called once per frame @@ -28,19 +28,28 @@ public class UnitCreator : MonoBehaviour { } void createUnit(int posX, int posZ, UnitBehaviour.Team team, UnitType type = UnitType.Skeleton) { - GameObject lich; + GameObject unit; if (type == UnitType.Lich) { - lich = Instantiate (lichObject, new Vector3(posX, 0, posZ), Quaternion.identity) as GameObject; - lich.GetComponent ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0); - lich.GetComponent ().SetupBaseAttack (4, 2, 3); + unit = Instantiate (lichObject, new Vector3(posX, lichObject.transform.lossyScale.y/2f, posZ), Quaternion.identity) as GameObject; + unit.transform.localScale = new Vector3 (unit.transform.lossyScale.y/unit.transform.lossyScale.y, 1, unit.transform.lossyScale.z/unit.transform.lossyScale.y); + unit.GetComponent ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0); + unit.GetComponent ().SetupBaseAttack (4, 2, 3); + units.Add (unit); - if (team == UnitBehaviour.Team.Player && script == null ) - script = lich.GetComponent (); + if (team == UnitBehaviour.Team.Player && playerLichScript == null ) + playerLichScript = unit.GetComponent (); + } else if (type == UnitType.Skeleton) { - GameObject skeleton; - skeleton = Instantiate (skeletonObject, new Vector3(posX, 0, posZ), Quaternion.identity) as GameObject; - units.Add (skeleton); + unit = Instantiate (skeletonObject, new Vector3(posX, skeletonObject.transform.lossyScale/2f, posZ), Quaternion.identity) as GameObject; + unit.transform.localScale = new Vector3 (unit.transform.lossyScale.x/unit.transform.lossyScale.y, 1, unit.transform.lossyScale.z/unit.transform.lossyScale.y); + unit.GetComponent ().SetupStats (posX, posZ); + + if (team == UnitBehaviour.Team.Enemy1) { + unit.transform.Rotate (new Vector3 (0, 180, 0)); + } + + units.Add (unit); } } diff --git a/Assets/prefab/SKELETON.prefab b/Assets/prefab/SKELETON.prefab index c4af1e4..56a8b05 100644 --- a/Assets/prefab/SKELETON.prefab +++ b/Assets/prefab/SKELETON.prefab @@ -117,6 +117,7 @@ GameObject: m_Component: - 4: {fileID: 495872} - 111: {fileID: 11195950} + - 114: {fileID: 114000012057328986} m_Layer: 0 m_Name: SKELETON m_TagString: Untagged @@ -1321,3 +1322,31 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 137098} m_IsPrefabParent: 1 +--- !u!114 &114000012057328986 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 137098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f685a25083417604590f9afdb346f66f, type: 3} + m_Name: + m_EditorClassIdentifier: + actionsPerTurn: 2 + remainingActions: 0 + stepLength: 5 + precision: 50 + critChance: 10 + health: 4 + armour: 0 + mana: 0 + element: 0 + teamID: 1 + posX: 0 + posZ: 0 + attackRange: 1 + attackArea: 1 + attackDamage: 1 + attackActions: 2 + attackElem: 0 diff --git a/Assets/unitCreator.prefab b/Assets/unitCreator.prefab index af702d4..a6016a6 100644 --- a/Assets/unitCreator.prefab +++ b/Assets/unitCreator.prefab @@ -52,5 +52,5 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: lichObject: {fileID: 1000013980076266, guid: 055ce9e83be0bd140a3e7aa52d871817, type: 2} - skeletonObject: {fileID: 0} + skeletonObject: {fileID: 137098, guid: c7e8a5bb79537a441836a1e2ea02a005, type: 2} units: []