我目前正在为UWP开发MR应用程序。我正在使用Unity3D(在5.5.2和2017.1.2中测试),当我在Unity中按下播放时一切正常,没有任何编译错误......但是,当我去构建应用程序时,我会遇到错误
据我所知,DescriptionAttribute是System.ComponentModel的一部分。
来自我的C#脚本的代码片段。
希望有人能帮我找出我缺少的指令或参考资料。
/T
Assets\Script\DMEWebRequest.cs(35,10): error CS0246: The type or namespace name 'DescriptionAttribute' could not be found (are you missing a using directive or an assembly reference?)
和Assets\Script\DMEWebRequest.cs(35,10): error CS0246: The type or namespace name 'Description' could not be found (are you missing a using directive or an assembly reference?)
。据我所知,DescriptionAttribute是System.ComponentModel的一部分。
来自我的C#脚本的代码片段。
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
//Makes a dropdown menu in the inspector
public enum EGU {
[Description("")] None,
[Description("ºC")] DegreesCelcius,
[Description("kW")] KiloWatts,
[Description("kW/h")] KiloWattsPerHour,
[Description("MW")] MegaWatts,
[Description("MW/h")] MegaWattsPerHour,
[Description("M³")] CubicMeters,
[Description("M³/h")] CubicMetersPerHour,
[Description("%")] Procentage,
[Description("º")] Degrees,
[Description("l/s")] LiterPerSecond,
[Description("cm")] CentiMeters,
[Description("m")] Meters,
[Description("mg/l")] MiliGramPerLiter,
[Description("g/l")] GramPerLiter
}
希望有人能帮我找出我缺少的指令或参考资料。
/T
System.ComponentModel
命名空间 中,您已经添加了它。 - mmushtaqComponentModel
的引用的? - mmushtaq