Reorganizing and renaming
This commit is contained in:
parent
cd62cd6aa2
commit
b043440827
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 22c766fdadc55c449b5311282a681a64
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7e3f0ef7b0919344e82d2052fbe05143
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,63 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities.Enemies.Scripts
|
||||
{
|
||||
public class EnemyHealth : MonoBehaviour
|
||||
{
|
||||
[Header("Assigned on start")]
|
||||
// [SerializeField] EnemyHandler enemyHandler;
|
||||
// [SerializeField] ScoreHandler scoreHandler;
|
||||
|
||||
[Header("Parameters")]
|
||||
[SerializeField] int _maxHealth = 5;
|
||||
[SerializeField] int _difficultyRamp = 1;
|
||||
|
||||
[SerializeField] int _wealthValue = 5;
|
||||
|
||||
[Header("Stats")]
|
||||
[SerializeField] int _currentHealth;
|
||||
|
||||
#region Public
|
||||
public int Health { get=> _currentHealth;}
|
||||
#endregion
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// enemyHandler = FindObjectOfType<EnemyHandler>();
|
||||
// scoreHandler = FindObjectOfType<ScoreHandler>();
|
||||
_currentHealth = _maxHealth;
|
||||
}
|
||||
|
||||
private void OnParticleCollision(GameObject damager)
|
||||
{
|
||||
ProcessHitFrom(damager);
|
||||
}
|
||||
|
||||
private void ProcessHitFrom(GameObject damager)
|
||||
{
|
||||
// SpawnFX(damageVFX);
|
||||
|
||||
// Debug.Log(damager.GetComponentInParent<Tower>().GetDamage());
|
||||
_currentHealth -= damager.GetComponentInParent<Turret>().Damage;
|
||||
|
||||
//UpdateHealthText(health);
|
||||
|
||||
if(_currentHealth <= 0)
|
||||
{
|
||||
ProcessDeathFrom(damager);
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessDeathFrom(GameObject damager)
|
||||
{
|
||||
//damager.GetComponentInParent<Turret>().UpdateScore(1f);
|
||||
|
||||
// SpawnFX(deathFX);
|
||||
// scoreHandler.ModifyWealth(wealthValue);
|
||||
// enemyHandler.RemoveEnemy(gameObject);
|
||||
// Destroy(gameObject);
|
||||
gameObject.SetActive(false);
|
||||
_maxHealth += _difficultyRamp;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ac0f42db9d6c21540a5ef3107e36946a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,61 +0,0 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities.Enemies
|
||||
{
|
||||
public class EnemyMovement : MonoBehaviour
|
||||
{
|
||||
[Header("Parameters")]
|
||||
[SerializeField] [Range(0f, 5f)] float _speed = 1f;
|
||||
[SerializeField] int _damage = 1;
|
||||
|
||||
|
||||
// [SerializeField] EnemyHandler enemyHandler;
|
||||
// [SerializeField] ScoreHandler scoreHandler;
|
||||
|
||||
|
||||
Vector3 _startPosition;
|
||||
Vector3 _endPosition;
|
||||
float _travelPercent = 0f;
|
||||
|
||||
private IEnumerator _followPath;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// enemyHandler = FindObjectOfType<EnemyHandler>();
|
||||
// scoreHandler = FindObjectOfType<ScoreHandler>();
|
||||
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// enemyHandler.AddEnemyToAllEnemies(gameObject);
|
||||
}
|
||||
|
||||
|
||||
void RecalculatePath()
|
||||
{
|
||||
if (_followPath != null)
|
||||
{
|
||||
//Debug.Log("Stopping Coroutine");
|
||||
StopCoroutine(_followPath);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void HandleReachedEndOfPath()
|
||||
{
|
||||
// scoreHandler.ModifyHealth(-damage);
|
||||
// scoreHandler.ModifyWealth(-100);
|
||||
// enemyHandler.RemoveEnemy(gameObject);
|
||||
//Destroy(gameObject);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private Vector3 GetVector3(Vector2Int coord)
|
||||
{
|
||||
return new Vector3((float)coord.x, 0f, (float)coord.y) * 10f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e691044df4c75f4cb07af0551efa2c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEnemyBaseRuntimeSet", menuName = "RuntimeSet/EnemyBase")]
|
||||
public class SoEnemyBaseRuntimeSet : SRuntimeSet<EnemyBase>
|
||||
public class SoEnemyBaseRuntimeSet : SoRuntimeSet<EnemyBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEntityBaseRuntimeSet", menuName = "RuntimeSet/EntityBase")]
|
||||
public class SoEntityBaseRuntimeSet : SRuntimeSet<EntityBase>
|
||||
public class SoEntityBaseRuntimeSet : SoRuntimeSet<EntityBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newPowerBaseRuntimeSet", menuName = "RuntimeSet/PowerBase")]
|
||||
public class SoPowerBaseRuntimeSet : SRuntimeSet<PowerBase>
|
||||
public class SoPowerBaseRuntimeSet : SoRuntimeSet<PowerBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newStructureBaseRuntimeSet", menuName = "RuntimeSet/StructureBase")]
|
||||
public class SoStructureBaseRuntimeSet : SRuntimeSet<StructureBase>
|
||||
public class SoStructureBaseRuntimeSet : SoRuntimeSet<StructureBase>
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue