0
,因为它是有道理的,我想用脚本的工作,这样的事情时要使用的接口一样多:设置属性
但使用这种方法时,实现接口的类不显示在检查这些属性和我结束了这样的事情:
public class TestConsumable : MonoBehaviour, IConsumable
{
public Sprite Icon { get { return IconSprite; } set { IconSprite = value; } }
// Hack just to show up in Editor
public Sprite IconSprite;
}
这并没有真正意义的我,我希望有一个更好的解决方案。
侧面说明,我没有使用专门用于接口也为一些验证等
由于getter/setter方法!
刚试过。仍然不起作用。该物业仍然不显示与getters/setters。 –
试试我上面编辑的代码... –
我刚刚做过。你是否?它不会在编辑器中显示出来... –