12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using NodeCanvas.Framework;
- using ParadoxNotion.Design;
- using KairoEngine.Core;
- using KairoEngine.Inventory;
- namespace KairoEngine.CharacterSystem
- {
- [Category("KairoEngine")]
- public class CharacteCheckDamageTaskAction : ActionTask
- {
- [BlackboardOnly] public BBParameter<Transform> target;
- [BlackboardOnly] public BBParameter<Vector3> targetPosition;
- private float waitTime = 0f;
- private float counter = 0f;
- private ItemBaseFirearm firearm;
- private int burstCount = 0;
- protected override string info
- {
- get { return "Check for damage"; }
- }
- protected override void OnExecute()
- {
- DamageEvents.OnDamage += OnDamage;
- }
- private void OnDamage(DamageData damageData)
- {
- DamageEvents.OnDamage -= OnDamage;
- if(target != null) EndAction(true);
- targetPosition = damageData.sourcePosition;
- EndAction(true);
- }
- }
- }
|