您好这是我的第一个堆栈溢出问题,请原谅我,如果我做任何愚蠢的事情.好吧,我的问题是我正在使用一个关卡编辑器,我想使用一个PropertyGrid控件来编辑磁贴/实体的属性等.所以到目前为止一切正常,值显示正确,更改时通过代码更改但问题我是expierencing是我不能改变值,除非它是一个布尔值,我googled很多但我只是找不到解决方案.
这是我定义属性的代码:
[Description("Defines the Position on the screen")]
public Vector2 screenpos { get; set; }
Vector2 WorldPos;
[Description("Defines the texture of the selected tile")]
public string texture { get; set; }
[Description("Defines if the player can collide with this tile")]
public bool IsCollidable { get; set; }
[Description("Defines on what layer this tile is drawn (1-3)")]
public int Layer { get; set; }
[Description("Shows if the tile is currently visible on the screen")]
public bool OnScreen { get; private set; …Run Code Online (Sandbox Code Playgroud)