CombatGestureController.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. using Fort23.Mono;
  3. using GameLogic.Combat.Hero;
  4. using UnityEngine;
  5. using Utility;
  6. namespace GameLogic.Combat.CombatTool
  7. {
  8. public class CombatGestureController : Singleton<CombatGestureController>
  9. {
  10. private HeroEntityMono heroEntityMono;
  11. private RaycastHit[] hit = new RaycastHit[10];
  12. public void Dispose()
  13. {
  14. }
  15. public void Update()
  16. {
  17. return;
  18. // if (Input.GetMouseButtonDown(0))
  19. // {
  20. // Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  21. // // LayerMask layerMask = LayerMask.NameToLayer("hero");
  22. // if (Physics.Raycast(ray.origin, ray.direction, out RaycastHit hit))
  23. // {
  24. // HeroEntityMono mono = hit.transform.gameObject.GetComponent<HeroEntityMono>();
  25. // if (mono != null && !mono.combatHeroEntity.IsEnemy)
  26. // {
  27. // heroEntityMono= mono;
  28. // heroEntityMono.combatHeroEntity.CombatAIBasic.ChangeState(CombatHeroStateType.PickUp);
  29. // CombatHeroEntity[] combatHeroEntities = CombatController.currActiveCombat.CombatHeroController.GetHero(false);
  30. // if (CombatController.currActiveCombat.CombatCameraControllder.FollowHeroId== heroEntityMono.combatHeroEntity.CurrCombatHeroInfo.modelID||combatHeroEntities!=null&&combatHeroEntities.Length == 1)
  31. // {
  32. // CombatController.currActiveCombat.CombatCameraControllder.isStop = true;
  33. // }
  34. // }
  35. // }
  36. // }
  37. //
  38. // if (Input.GetMouseButton(0))
  39. // {
  40. // if (heroEntityMono != null && heroEntityMono.combatHeroEntity != null)
  41. // {
  42. // // Vector2 pos = Input.mousePosition;
  43. // Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  44. // int layerMask = LayerMask.NameToLayer("hongpei");
  45. // int count = Physics.RaycastNonAlloc(ray.origin, ray.direction, hit);
  46. // if (count > 0)
  47. // {
  48. // for (int i = 0; i < count; i++)
  49. // {
  50. // if (hit[i].transform.gameObject.layer == layerMask)
  51. // {
  52. // heroEntityMono.gameObject.transform.position =
  53. // hit[i].point;
  54. // }
  55. // }
  56. // }
  57. // }
  58. // }
  59. //
  60. // if (Input.GetMouseButtonUp(0))
  61. // {
  62. // if (heroEntityMono != null)
  63. // {
  64. // heroEntityMono.combatHeroEntity.CombatAIBasic.ChangeState(CombatHeroStateType.idle);
  65. // }
  66. //
  67. // heroEntityMono = null;
  68. // CombatController.currActiveCombat.CombatCameraControllder.isStop = false;
  69. // }
  70. }
  71. }
  72. }