123456789101112131415161718192021222324252627282930313233343536373839 |
- 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<CharacterController> 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<DamageController>();
- if(damageController == null) return;
- if(hitpoints > 0)
- {
- damageController.Heal(hitpoints);
- GameObject.Instantiate(fxPrefab, damageController.transform.position, damageController.transform.rotation);
- }
- else if(hitpoints < 0)
- {
-
- }
- }
- }
- }
|