问题描述
我在https://gist.github.com/deebrol/02f61b7611fd4eca923776077b92dfc2中使用带有条件属性的代码
并稍微更改代码以适合可序列化的类
public override void OnGUI(Rect position,SerializedProperty property,GUIContent label)
{
ShowWhenAttribute attribtue = attribute as ShowWhenAttribute ;
string conditionFieldpath = property.propertyPath.Replace(property.name,attribtue.conditionFieldName);
SerializedProperty conditionField = property.serializedobject.FindProperty(conditionFieldpath);
if(conditionField == null).....
}
[Serializable]
public class Url
{
[ShowWhen("isTitle")]
public string title;
public bool isTitle;
}
很适合单身。
但在数组中有错误。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)