BossBullet2001001.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Adon.Game.BO;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace AdonGameKit
  6. {
  7. /// <summary>
  8. /// boss子弹(boss2麻痹弹)
  9. /// </summary>
  10. public class BossBullet2001001 : MonoBehaviour
  11. {
  12. /// <summary>
  13. /// 子弹步进速度
  14. /// </summary>
  15. public float velocity = 300f;
  16. /// <summary>
  17. /// 生命周期
  18. /// </summary>
  19. public float lifeTime = 5f;
  20. float timer = 0f; // 子弹生命周期计时
  21. public BaseMonsterAdon m_BaseMonsterAdon;
  22. public void SetMonster(BaseMonsterAdon monster)
  23. {
  24. m_BaseMonsterAdon = monster;
  25. }
  26. void Awake()
  27. {
  28. }
  29. // Start is called before the first frame update
  30. void Start()
  31. {
  32. }
  33. void FixedUpdate()
  34. {
  35. //Vector3 step = transform.forward * Time.deltaTime * velocity;//子弹步进
  36. //// 生命周期到了则销毁
  37. //if (timer >= lifeTime)
  38. // OnProjectileDestroy();
  39. //transform.position += step;//向前步进
  40. //timer += Time.deltaTime;
  41. }
  42. /// <summary>
  43. /// 武器技能触发事件
  44. /// </summary>
  45. /// <param name="collision"></param>
  46. void OnTriggerEnter(Collider collision)
  47. {
  48. if (collision.gameObject.layer == LayerMask.NameToLayer("Player"))//玩家层
  49. {
  50. Debug.Log("碰撞敌人");
  51. // //Debug.Log("OnTriggerEnter:" + collision.gameObject.name);
  52. BaseHero component = collision.gameObject.GetComponent<BaseHero>();
  53. //发送战斗信息,等待后台处理逻辑返回数据
  54. //X2Battle.X2BattleManager.Instance.mBulletModel.OnCastSkill(
  55. // m_BaseMonsterAdon.mData.UID, m_BaseMonsterAdon.mData.GetSKillNormal(m_BaseMonsterAdon.m_SkillId, m_BaseMonsterAdon.m_CurAttackIdx),
  56. // false, X2Battle.EBulletCastPoint.ECAST_POINT_DEFLUAT, component.mData.UID, false);
  57. BulletMessage.catSkillFun(m_BaseMonsterAdon.mData.UID, m_BaseMonsterAdon.mData.GetSKillNormal(7, 1),
  58. false, (int)X2Battle.EBulletCastPoint.ECAST_POINT_DEFLUAT, component.mData.UID, false);
  59. }
  60. }
  61. }
  62. }