Compare commits
2 Commits
1e4dbda8e8
...
4baa667b4e
Author | SHA1 | Date |
---|---|---|
Sveske Juice | 4baa667b4e | |
Sveske Juice | ee61049de0 |
|
@ -10,6 +10,7 @@ public class EnemyCollection : ScriptableObject
|
||||||
public struct EnemyInfo
|
public struct EnemyInfo
|
||||||
{
|
{
|
||||||
public string name;
|
public string name;
|
||||||
|
public int damage;
|
||||||
public float moveSpeed;
|
public float moveSpeed;
|
||||||
public bool FlyPath;
|
public bool FlyPath;
|
||||||
public float feetOffset;
|
public float feetOffset;
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class EnemySpawnManager : MonoBehaviour
|
||||||
EnemyInfo enemyInfo = enemyCollection.Enemies[group.enemyIndex];
|
EnemyInfo enemyInfo = enemyCollection.Enemies[group.enemyIndex];
|
||||||
|
|
||||||
GameObject spawned = Instantiate(enemyInfo.prefab);
|
GameObject spawned = Instantiate(enemyInfo.prefab);
|
||||||
WaypointEntityData data = new WaypointEntityData(spawned.transform, enemyInfo.moveSpeed, enemyInfo.feetOffset);
|
WaypointEntityData data = new WaypointEntityData(spawned.transform, enemyInfo.moveSpeed, enemyInfo.feetOffset, enemyInfo.damage);
|
||||||
|
|
||||||
if (enemyInfo.FlyPath)
|
if (enemyInfo.FlyPath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class WaypointPath : MonoBehaviour
|
||||||
if (index + 1 >= Waypoints.Count)
|
if (index + 1 >= Waypoints.Count)
|
||||||
{
|
{
|
||||||
Destroy(data.Entity.gameObject); // Destroy object when finish waypoints
|
Destroy(data.Entity.gameObject); // Destroy object when finish waypoints
|
||||||
GameManager.Instance.health--;
|
GameManager.Instance.health -= data.Damage;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -69,13 +69,15 @@ public class WaypointEntityData
|
||||||
public Transform NextTargetPosition;
|
public Transform NextTargetPosition;
|
||||||
public float MoveSpeed;
|
public float MoveSpeed;
|
||||||
public float FeetOffset;
|
public float FeetOffset;
|
||||||
|
public int Damage;
|
||||||
|
|
||||||
public WaypointEntityData(Transform entity, float moveSpeed, float feet)
|
public WaypointEntityData(Transform entity, float moveSpeed, float feet, int damage)
|
||||||
{
|
{
|
||||||
Entity = entity;
|
Entity = entity;
|
||||||
MoveSpeed = moveSpeed;
|
MoveSpeed = moveSpeed;
|
||||||
|
|
||||||
// feet :P
|
// feet :P
|
||||||
FeetOffset = feet;
|
FeetOffset = feet;
|
||||||
|
Damage = damage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue