Hardcoded the tutorial units creation
This commit is contained in:
parent
d1bbc1cfd8
commit
8718b8ca24
1 changed files with 26 additions and 4 deletions
|
@ -19,6 +19,7 @@ public class UnitCreator : MonoBehaviour {
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
units = new List<GameObject> ();
|
units = new List<GameObject> ();
|
||||||
|
script = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -26,20 +27,41 @@ public class UnitCreator : MonoBehaviour {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createUnit(int posX, int posZ, Vector3 posVec3, UnitBehaviour.Team team, UnitType type = UnitType.Skeleton) {
|
void createUnit(int posX, int posZ, UnitBehaviour.Team team, UnitType type = UnitType.Skeleton) {
|
||||||
GameObject lich;
|
GameObject lich;
|
||||||
|
|
||||||
if (type == UnitType.Lich) {
|
if (type == UnitType.Lich) {
|
||||||
lich = Instantiate (lichObject, posVec3, Quaternion.identity) as GameObject;
|
lich = Instantiate (lichObject, new Vector3(posX, 0, posZ), Quaternion.identity) as GameObject;
|
||||||
lich.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0);
|
lich.GetComponent<UnitBehaviour> ().SetupStats (posX, posZ, 3, 3, 100, 0, 0, 0);
|
||||||
lich.GetComponent<UnitBehaviour> ().SetupBaseAttack (4, 2, 3);
|
lich.GetComponent<UnitBehaviour> ().SetupBaseAttack (4, 2, 3);
|
||||||
|
|
||||||
if (team == UnitBehaviour.Team.Player)
|
if (team == UnitBehaviour.Team.Player && script == null )
|
||||||
script = lich.GetComponent<UnitBehaviour> ();
|
script = lich.GetComponent<UnitBehaviour> ();
|
||||||
} else if (type == UnitType.Skeleton) {
|
} else if (type == UnitType.Skeleton) {
|
||||||
GameObject skeleton;
|
GameObject skeleton;
|
||||||
skeleton = Instantiate (skeletonObject, posVec3, Quaternion.identity) as GameObject;
|
skeleton = Instantiate (skeletonObject, new Vector3(posX, 0, posZ), Quaternion.identity) as GameObject;
|
||||||
units.Add (skeleton);
|
units.Add (skeleton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<GameObject> tutorialUnits() {
|
||||||
|
createUnit (9, 5, UnitBehaviour.Team.Player, UnitType.Lich);
|
||||||
|
|
||||||
|
createUnit (8, 7, UnitBehaviour.Team.Player);
|
||||||
|
createUnit (10, 7, UnitBehaviour.Team.Player);
|
||||||
|
|
||||||
|
createUnit (8, 12, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (10, 12, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (8, 12, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (5, 17, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (4, 18, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (5, 19, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (2, 22, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (15, 23, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (13, 24, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (16, 24, UnitBehaviour.Team.Enemy1);
|
||||||
|
createUnit (17, 26, UnitBehaviour.Team.Enemy1);
|
||||||
|
|
||||||
|
return units;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue