spell refactor part - assets and prefabs
This commit is contained in:
@@ -5,7 +5,7 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
||||
{
|
||||
[Header("Health")]
|
||||
[SerializeField] private int maxHealth = 40;
|
||||
[SerializeField] private float currentHealth = 40f;
|
||||
[SerializeField] private float _currentHealth = 40f;
|
||||
|
||||
[Header("Death")]
|
||||
[SerializeField] private bool destroyOnDeath = true;
|
||||
@@ -23,7 +23,7 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
||||
public OnReceiveDamage onReceiveDamage => _onReceiveDamage;
|
||||
public OnDead onDead => _onDead;
|
||||
|
||||
public float currentHealth => this.currentHealth;
|
||||
public float currentHealth => this._currentHealth;
|
||||
public int MaxHealth => maxHealth;
|
||||
public bool isDead { get; set; }
|
||||
|
||||
@@ -50,13 +50,13 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
||||
public void AddHealth(int value)
|
||||
{
|
||||
if (isDead) return;
|
||||
currentHealth = Mathf.Min(maxHealth, currentHealth + value);
|
||||
_currentHealth = Mathf.Min(maxHealth, currentHealth + value);
|
||||
}
|
||||
|
||||
public void ChangeHealth(int value)
|
||||
{
|
||||
if (isDead) return;
|
||||
currentHealth = Mathf.Clamp(currentHealth + value, 0f, maxHealth);
|
||||
_currentHealth = Mathf.Clamp(currentHealth + value, 0f, maxHealth);
|
||||
|
||||
if (currentHealth <= 0f)
|
||||
Die();
|
||||
@@ -65,20 +65,20 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
||||
public void ChangeMaxHealth(int value)
|
||||
{
|
||||
maxHealth = Mathf.Max(1, maxHealth + value);
|
||||
currentHealth = Mathf.Min(currentHealth, maxHealth);
|
||||
_currentHealth = Mathf.Min(currentHealth, maxHealth);
|
||||
}
|
||||
|
||||
public void ResetHealth(float health)
|
||||
{
|
||||
maxHealth = Mathf.Max(1, maxHealth);
|
||||
currentHealth = Mathf.Clamp(health, 0f, maxHealth);
|
||||
_currentHealth = Mathf.Clamp(health, 0f, maxHealth);
|
||||
isDead = false;
|
||||
}
|
||||
|
||||
public void ResetHealth()
|
||||
{
|
||||
maxHealth = Mathf.Max(1, maxHealth);
|
||||
currentHealth = maxHealth;
|
||||
_currentHealth = maxHealth;
|
||||
isDead = false;
|
||||
}
|
||||
|
||||
|
||||
2
Assets/AI/_Summons/SummonDamageReceiver.cs.meta
Normal file
2
Assets/AI/_Summons/SummonDamageReceiver.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0662ff12c007d4a7189cb7071852ecc9
|
||||
2
Assets/AI/_Summons/SwarmAgent.cs.meta
Normal file
2
Assets/AI/_Summons/SwarmAgent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c709df02a66df41d2bfc2fdab3e74587
|
||||
2
Assets/AI/_Summons/SwarmCoordinator.cs.meta
Normal file
2
Assets/AI/_Summons/SwarmCoordinator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f8e474d734e543518adf0325c9970bc
|
||||
Reference in New Issue
Block a user