Compare commits
No commits in common. "77a3b7f3fc9fbddf6b22ad4f31302539f9c71026" and "a20d05cc1c5f7b50f8ddc8236b3636a4229375b4" have entirely different histories.
77a3b7f3fc
...
a20d05cc1c
|
@ -10,7 +10,6 @@ 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;
|
||||||
|
|
|
@ -98,7 +98,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, enemyInfo.damage);
|
WaypointEntityData data = new WaypointEntityData(spawned.transform, enemyInfo.moveSpeed, enemyInfo.feetOffset);
|
||||||
|
|
||||||
if (enemyInfo.FlyPath)
|
if (enemyInfo.FlyPath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,16 +43,6 @@ public class GameManager : MonoBehaviour
|
||||||
health = startHealth;
|
health = startHealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
|
||||||
{
|
|
||||||
foreach (var go in GameObject.FindObjectsByType<GameObject>(FindObjectsSortMode.None))
|
|
||||||
{
|
|
||||||
if (go != null && go != this.gameObject)
|
|
||||||
Destroy(go);
|
|
||||||
}
|
|
||||||
Destroy(this.gameObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
MoneyManager.OnShopSelected += m_OnTowerShopSelected;
|
MoneyManager.OnShopSelected += m_OnTowerShopSelected;
|
||||||
|
|
|
@ -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 -= data.Damage;
|
GameManager.Instance.health--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -69,15 +69,13 @@ 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, int damage)
|
public WaypointEntityData(Transform entity, float moveSpeed, float feet)
|
||||||
{
|
{
|
||||||
Entity = entity;
|
Entity = entity;
|
||||||
MoveSpeed = moveSpeed;
|
MoveSpeed = moveSpeed;
|
||||||
|
|
||||||
// feet :P
|
// feet :P
|
||||||
FeetOffset = feet;
|
FeetOffset = feet;
|
||||||
Damage = damage;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ public class PlayerHealth : MonoBehaviour
|
||||||
{
|
{
|
||||||
gameOver.SetActive(true);
|
gameOver.SetActive(true);
|
||||||
yield return new WaitForSecondsRealtime(5f);
|
yield return new WaitForSecondsRealtime(5f);
|
||||||
GameManager.Instance.Reset();
|
|
||||||
SceneManager.LoadScene(0);
|
SceneManager.LoadScene(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class SwitchScene : MonoBehaviour
|
||||||
{
|
{
|
||||||
public void SwitchToScene(string scene)
|
public void SwitchToScene(string scene)
|
||||||
{
|
{
|
||||||
GameManager.Instance.Reset();
|
|
||||||
SceneManager.LoadScene(scene);
|
SceneManager.LoadScene(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue