using System.Collections; using System.Collections.Generic; using UnityEngine; using Sirenix.OdinInspector; namespace KairoEngine.Stats { [HideMonoScript, AddComponentMenu("KairoEngine/Stats Controller")] public class StatsComponent : MonoBehaviour { [InlineProperty, HideLabel, PropertySpace(2, 2), OnInspectorInit("Initialize")] public StatsController statsController = new StatsController(); //[InlineButton("CreateNewStatusEffect", "Create")] [LabelText("Add new StatusEffect"), ShowIf("@showEdit")] public StatusEffectTemplate template; [ShowIf("@target == null")] public Transform target; private bool showEdit = false; void Awake() { statsController.Initialize(); } void OnDisable() { statsController.statusEffects.Stop(); } private void Initialize() { statsController.statusEffects.target = target; statsController.statusEffects.Start(); } private void CreateNewStatusEffect() { statsController.statusEffects.Add(template, null); } } }