Finished
This commit is contained in:
parent
16507f4121
commit
436dd245aa
84 changed files with 79361 additions and 75 deletions
24
Assets/Scripts/EnemyStats.cs
Normal file
24
Assets/Scripts/EnemyStats.cs
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue