You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Window.cs 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. namespace GameClass.GameObj
  4. {
  5. /// <summary>
  6. /// 窗
  7. /// </summary>
  8. public class Window : GameObj
  9. {
  10. public Window(XY initPos) :
  11. base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Window)
  12. {
  13. this.place = PlaceType.Window;
  14. this.CanMove = false;
  15. }
  16. public override bool IsRigid => true;
  17. public override ShapeType Shape => ShapeType.Square;
  18. public override bool IgnoreCollideExecutor(IGameObj targetObj)
  19. {
  20. if (targetObj.Type != GameObjType.Character)
  21. return true; // 非玩家不碰撞
  22. if (whoIsClimbing != null && targetObj == whoIsClimbing)
  23. {
  24. return true;
  25. }
  26. return false;
  27. }
  28. private Character? whoIsClimbing = null;
  29. public Character? WhoIsClimbing
  30. {
  31. get => whoIsClimbing;
  32. set
  33. {
  34. lock (gameObjLock)
  35. whoIsClimbing = value;
  36. }
  37. }
  38. }
  39. }