to new git
This commit is contained in:
@ -15,9 +15,9 @@ public class Player : MonoBehaviour, ICharacter
|
||||
Condition = PlayerCharacter.Condition;
|
||||
}
|
||||
|
||||
public void ResetCharacter()
|
||||
private void OnDestroy()
|
||||
{
|
||||
Condition = new CharacterCondition();
|
||||
Debug.LogWarning("Pooled object was destroyed");
|
||||
}
|
||||
|
||||
public event Action<object> OnKilledEvent;
|
||||
@ -27,12 +27,12 @@ public class Player : MonoBehaviour, ICharacter
|
||||
Condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - Condition.ArmourPoints * 0.5f)));
|
||||
Condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
|
||||
|
||||
if (Condition.HealthPoints < 0)
|
||||
OnKilledEvent?.Invoke(this);
|
||||
if (Condition.HealthPoints < 0)
|
||||
OnKilledEvent?.Invoke(this);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
public void ResetCharacter()
|
||||
{
|
||||
Debug.LogWarning("Pooled object was destroyed");
|
||||
Condition = new CharacterCondition();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user