SceneEventSeepbumpLogic.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityGameFramework.Runtime;
  6. using X2Battle;
  7. /// <summary>
  8. /// 场景组件 减速带 渗水池 进入增加buff 离开移除buff
  9. /// </summary>
  10. public class SceneEventSeepbumpLogic : MonoBehaviour
  11. {
  12. private float speed = 0;
  13. private void Awake()
  14. {
  15. }
  16. // Start is called before the first frame update
  17. void Start()
  18. {
  19. SceneCmptManager.Instance.AddMechanism(this.gameObject);
  20. }
  21. public void OnTriggerEnter(Collider collider)
  22. {
  23. Role role = collider.GetComponent<Role>();
  24. if (!role || role.isDie)
  25. {
  26. return;
  27. }
  28. X2Battle.X2BattleManager.Instance.mBulletModel.OnCastSkill(
  29. 0, "711002",
  30. false, EBulletCastPoint.ECAST_POINT_DEFLUAT, role.mData.UID, false);
  31. SceneCmptManager.Instance.OpenMechanism(this.gameObject);
  32. //speed = role.GetPropertyFinal(YLBattle.EBattleProperty.MOVESPEED);
  33. //role.SetPropertyFinal(null,YLBattle.EBattleProperty.MOVESPEED, 0.3f);
  34. //// buff挂载
  35. //YLBattle.FieldEvent field = new YLBattle.FieldEvent();
  36. //field.PutValue("tid", "801003");
  37. //field.PutValue("skill", "0");
  38. //field.PutValue("level", "1");
  39. //field.PutValue("caster", "0");
  40. //field.PutValue("target", role.ID());
  41. //field.PutValue("skilltype", "7");
  42. //field.PutValue("tipdelay", 0.ToString());
  43. //X2BattleManager.Instance.mBuffModel.OnBuff(field);
  44. }
  45. public void OnTriggerExit(Collider collider)
  46. {
  47. Animator anim = this.GetComponent<Animator>();
  48. //anim.Play("full");
  49. Role role = collider.GetComponent<Role>();
  50. role.SetPropertyFinal(null, YLBattle.EBattleProperty.MOVESPEED, speed);
  51. }
  52. public void EnableCollider()
  53. {
  54. }
  55. public void OnClickInteractive()
  56. {
  57. }
  58. }