PlayerAnimControlTools.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. namespace SceneStory
  3. {
  4. public class PlayerAnimControlTools : BaseBehaviour
  5. {
  6. private PlayerAction pac
  7. {
  8. get
  9. {
  10. return R.Player.Action;
  11. }
  12. }
  13. public void ControlPlayerStartMove()
  14. {
  15. this.move = true;
  16. }
  17. public void ControlPlayerStopMove()
  18. {
  19. this.move = false;
  20. if (this.pac != null)
  21. {
  22. this.pac.pab.move.Move(0);
  23. }
  24. }
  25. public void ControlPlayerIsShow(PlayerAnimControlTools.BoolEnum show)
  26. {
  27. if (this.pac != null)
  28. {
  29. Log.Warning("没找到玩家");
  30. }
  31. this.pac.gameObject.SetActive(show == PlayerAnimControlTools.BoolEnum.True);
  32. }
  33. public void ControlPlayerTurnRound(PlayerAnimControlTools.Dir dir)
  34. {
  35. if (this.pac != null)
  36. {
  37. this.pac.TurnRound((int)dir);
  38. }
  39. }
  40. public void InputPause()
  41. {
  42. InputSetting.Stop(false);
  43. }
  44. public void InputResume()
  45. {
  46. InputSetting.Resume(false);
  47. }
  48. private void Update()
  49. {
  50. if (this.move)
  51. {
  52. this.pac.pab.move.Move(3);
  53. }
  54. }
  55. private bool move;
  56. public enum BoolEnum
  57. {
  58. True = 1,
  59. False = 0
  60. }
  61. public enum Dir
  62. {
  63. Left = -1,
  64. Right = 1
  65. }
  66. }
  67. }