This commit is contained in:
Gerard Gascón 2023-08-23 18:27:33 +02:00
parent 16507f4121
commit 436dd245aa
84 changed files with 79361 additions and 75 deletions

View file

@ -0,0 +1,24 @@
using System;
using UnityEngine;
public abstract class EnemyStats : MonoBehaviour{
[HideInInspector] public float throwForce = 5f;
protected Rigidbody2D Rb { get; private set; }
protected Collider2D Collider { get; private set; }
protected virtual void Start() {
Rb = GetComponent<Rigidbody2D>();
Collider = GetComponent<Collider2D>();
BalanceCanvas.instance.sliderChangedCallback += RefreshStats;
RefreshStats();
}
void OnDestroy() {
BalanceCanvas.instance.sliderChangedCallback -= RefreshStats;
}
void RefreshStats() {
throwForce = PlayerPrefs.GetFloat(nameof(throwForce), throwForce);
}
}