idle-survivors/Assets/Scripts/HeroUnit.cs

37 lines
893 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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;
private void OnEnable()
{
// NOTE(zeph): Party is mandatory. If none is set, we want an exception.
party.Add(this);
}
private void OnDisable()
{
party.Remove(this);
}
internal HeroPartySO getParty()
{
return party;
}
}