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

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