idle-survivors/Assets/Scripts/HeroUnit.cs

34 lines
850 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Assertions;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("TestsPlaymode")]
/// <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;
[SerializeField] private HeroPartySO _party;
internal HeroPartySO party => _party;
private void OnEnable()
{
Assert.IsNotNull(_party);
_party.Add(this);
}
private void OnDisable()
{
_party.Remove(this);
}
}