2023-08-12 23:26:36 -04:00
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using RuntimeSet;
|
2023-08-04 19:37:13 -04:00
|
|
|
using UnityEngine;
|
2023-08-07 12:34:42 -04:00
|
|
|
using UnityEngine.Assertions;
|
|
|
|
|
|
|
|
[assembly: InternalsVisibleTo("TestsPlaymode")]
|
2023-08-04 19:37:13 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Component that makes a duder a duder.
|
|
|
|
/// Manages class, skills, level, attrs, and AI.
|
|
|
|
/// </summary>
|
|
|
|
public class HeroUnit : MonoBehaviour
|
|
|
|
{
|
|
|
|
[SerializeField] private new string name;
|
|
|
|
[SerializeField] private HeroClassSO class_;
|
|
|
|
[SerializeField] private long level;
|
|
|
|
[SerializeField] private long xp;
|
|
|
|
[SerializeField] private HeroAttributesSO attrs;
|
2023-08-12 23:26:36 -04:00
|
|
|
[SerializeField] private HeroUnitRuntimeSetSO _party;
|
|
|
|
internal HeroUnitRuntimeSetSO party => _party;
|
2023-08-07 12:34:42 -04:00
|
|
|
|
|
|
|
private void OnEnable()
|
|
|
|
{
|
|
|
|
Assert.IsNotNull(_party);
|
|
|
|
_party.Add(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnDisable()
|
|
|
|
{
|
|
|
|
_party.Remove(this);
|
|
|
|
}
|
2023-08-04 19:37:13 -04:00
|
|
|
}
|