to new git

This commit is contained in:
2022-05-04 23:50:07 +07:00
parent 290f5515b7
commit c8af0e5284
39 changed files with 720 additions and 359 deletions

View File

@ -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();
}
}