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

12345678910111213141516171819202122232425262728293031323334353637383940
  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.CanMove = false;
  14. }
  15. public override bool IsRigid => true;
  16. public override ShapeType Shape => ShapeType.Square;
  17. public override bool IgnoreCollideExecutor(IGameObj targetObj)
  18. {
  19. if (targetObj.Type != GameObjType.Character)
  20. return true; // 非玩家不碰撞
  21. if (whoIsClimbing != null && targetObj == whoIsClimbing)
  22. {
  23. return true;
  24. }
  25. return false;
  26. }
  27. private Character? whoIsClimbing = null;
  28. public Character? WhoIsClimbing
  29. {
  30. get => whoIsClimbing;
  31. set
  32. {
  33. lock (gameObjLock)
  34. whoIsClimbing = value;
  35. }
  36. }
  37. }
  38. }