OperationData_TriggerMode.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace ChivaXR.Op
  2. {
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. /// <summary>
  7. /// 操作点触发监听模式
  8. /// </summary>
  9. public abstract class OperationData_TriggerMode : OperationDataBase
  10. {
  11. public override OperationDataType OperationType { get { return OperationDataType.Trigger; } }
  12. /// <summary>
  13. /// 激活监听状态下的触发条件
  14. /// </summary>
  15. /// <returns></returns>
  16. public abstract bool TriggerCondition();
  17. protected override void PlayUpdata()
  18. {
  19. base.PlayUpdata();
  20. if(TriggerCondition())
  21. {
  22. Debug.Log("触发成功");
  23. OpValue = 1;
  24. }
  25. }
  26. protected override void CheckOperationDataDisActive()
  27. {
  28. switch (operationDisActioveMode)
  29. {
  30. case OperationDisActiveMode.once:
  31. OperationStatus = OperationDataStatus.InActive;
  32. break;
  33. case OperationDisActiveMode.loop:
  34. OpValue = 0;
  35. break;
  36. }
  37. }
  38. }
  39. }