当前位置:   article > 正文

UnityEngine.PostProcessing.MinAttribute引用错误_minattribute' is an ambiguous reference between 'u

minattribute' is an ambiguous reference between 'unityengine.postprocessing

报错提示:

'MinAttribute' is an ambiguous reference between 'UnityEngine.PostProcessing.MinAttribute' and 'UnityEngine.MinAttribute'

修改方法:

找到MinDrawer.cs,修改如下三处代码(红色字体):

namespace UnityEditor.PostProcessing
{
    [CustomPropertyDrawer(typeof(UnityEngine.PostProcessing.MinAttribute))]
    sealed class MinDrawer : PropertyDrawer
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            UnityEngine.PostProcessing.MinAttribute attribute = (UnityEngine.PostProcessing.MinAttribute)base.attribute;

……

完整代码如下:

  1. using UnityEngine;
  2. using UnityEngine.PostProcessing;
  3. namespace UnityEditor.PostProcessing
  4. {
  5. [CustomPropertyDrawer(typeof(UnityEngine.PostProcessing.MinAttribute))]
  6. sealed class MinDrawer : PropertyDrawer
  7. {
  8. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  9. {
  10. UnityEngine.PostProcessing.MinAttribute attribute = (UnityEngine.PostProcessing.MinAttribute)base.attribute;
  11. if (property.propertyType == SerializedPropertyType.Integer)
  12. {
  13. int v = EditorGUI.IntField(position, label, property.intValue);
  14. property.intValue = (int)Mathf.Max(v, attribute.min);
  15. }
  16. else if (property.propertyType == SerializedPropertyType.Float)
  17. {
  18. float v = EditorGUI.FloatField(position, label, property.floatValue);
  19. property.floatValue = Mathf.Max(v, attribute.min);
  20. }
  21. else
  22. {
  23. EditorGUI.LabelField(position, label.text, "Use Min with float or int.");
  24. }
  25. }
  26. }
  27. }

参考链接:https://github.com/Brackeys/RPG-Tutorial/issues/9

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/786448
推荐阅读
相关标签
  

闽ICP备14008679号