FBXEventYL.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. 
  2. using Chronos;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. namespace AdonGameKit
  7. {
  8. /// <summary>
  9. /// anim事件接收类
  10. /// </summary>
  11. public class FBXEventYL : MonoBehaviour
  12. {
  13. GameObject m_Owner;
  14. /// <summary>
  15. /// 设置言灵类
  16. /// </summary>
  17. /// <param name="owner"></param>
  18. public void SetOwner(GameObject owner)
  19. {
  20. m_Owner = owner;
  21. }
  22. #region ============================================ Animation Event ============================================
  23. /// <summary>
  24. /// 普通攻击进入
  25. /// </summary>
  26. public void OnAttackStart()
  27. {
  28. if(m_Owner)
  29. {
  30. m_Owner.SendMessage("OnAttackStart");
  31. }
  32. }
  33. /// <summary>
  34. /// 普通攻击进入
  35. /// </summary>
  36. public void OnAttackOn(string attackId)
  37. {
  38. if(m_Owner)
  39. {
  40. m_Owner.SendMessage("OnAttackOn",attackId);
  41. }
  42. }
  43. /// <summary>
  44. /// 普通攻击结束
  45. /// </summary>
  46. public void OnAttackOff()
  47. {
  48. if(m_Owner)
  49. {
  50. m_Owner.SendMessage("OnAttackOff");
  51. }
  52. }
  53. /// <summary>
  54. /// 震屏
  55. /// </summary>
  56. public void OnShake(int lv = 0)
  57. {
  58. if(lv == 0)
  59. {
  60. //m_Owner.SetCameraShake(m_Owner.transform.position, 0.8f, 0.1f, 0.2f);
  61. }
  62. else if (lv == 1)
  63. {
  64. //m_Owner.SetCameraShake(m_Owner.transform.position, 2f, 0.1f, 0.3f);
  65. }
  66. }
  67. #endregion
  68. }
  69. }