using System.Collections; using System.Collections.Generic; using UnityEngine; using NodeCanvas.Framework; using ParadoxNotion.Design; namespace KairoEngine.CharacterSystem { public class ChangeHitpointsTaskAction : ActionTask { [BlackboardOnly] public BBParameter character; public int hitpoints; public GameObject fxPrefab; protected override string info { get { return $"Change Hitpoints ({hitpoints})"; } } protected override void OnExecute() { DamageController damageController = CharacterManager.GetCharacter("Player_Character")?.GetComponent(); if(damageController == null) return; if(hitpoints > 0) { damageController.Heal(hitpoints); GameObject.Instantiate(fxPrefab, damageController.transform.position, damageController.transform.rotation); } else if(hitpoints < 0) { } } } }