Compare commits

..

2 Commits

Author SHA1 Message Date
Sveske Juice 4baa667b4e Merge remote-tracking branch 'refs/remotes/origin/main' 2024-04-21 14:04:50 +02:00
Sveske Juice ee61049de0 variable enemy damage 2024-04-21 14:04:42 +02:00
3 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@ public class EnemyCollection : ScriptableObject
public struct EnemyInfo
{
public string name;
public int damage;
public float moveSpeed;
public bool FlyPath;
public float feetOffset;

View File

@ -99,7 +99,7 @@ public class EnemySpawnManager : MonoBehaviour
EnemyInfo enemyInfo = enemyCollection.Enemies[group.enemyIndex];
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)
{

View File

@ -37,7 +37,7 @@ public class WaypointPath : MonoBehaviour
if (index + 1 >= Waypoints.Count)
{
Destroy(data.Entity.gameObject); // Destroy object when finish waypoints
GameManager.Instance.health--;
GameManager.Instance.health -= data.Damage;
}
else
{
@ -69,13 +69,15 @@ public class WaypointEntityData
public Transform NextTargetPosition;
public float MoveSpeed;
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;
MoveSpeed = moveSpeed;
// feet :P
FeetOffset = feet;
Damage = damage;
}
}