Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Error compiler unity

Discussion in 'Editor & General Support' started by BoundBay-Studio, Jul 31, 2018.

  1. BoundBay-Studio

    BoundBay-Studio

    Joined:
    Apr 25, 2018
    Posts:
    1
    Errorr compiler unity:

    Assets/Editor/Image Effects/CameraMotionBlurEditor.js(92,36): BCE0004: Ambiguous Reference 'Preview':CameraMotionBlurEditor.Preview, UnityEditor.Editor.Preview.

    Assets/Editor/Image Effects/CameraMotionBlurEditor.js(93,9): BCE0004: Ambiguous Reference 'Preview':CameraMotionBlurEditor.Preview, UnityEditor.Editor.Preview.

    This is archive:

    #pragma strict

    @CustomEditor (CameraMotionBlur)
    class CameraMotionBlurEditor extends Editor
    {
    var serObj : SerializedObject;

    var filterType : SerializedProperty;
    var preview : SerializedProperty;
    var previewScale : SerializedProperty;
    var movementScale : SerializedProperty;
    var jitter : SerializedProperty;
    var rotationScale : SerializedProperty;
    var maxVelocity : SerializedProperty;
    var minVelocity : SerializedProperty;
    var maxNumSamples : SerializedProperty;
    var velocityScale : SerializedProperty;
    var velocityDownsample : SerializedProperty;
    var noiseTexture : SerializedProperty;
    var showVelocity : SerializedProperty;
    var showVelocityScale : SerializedProperty;
    var excludeLayers : SerializedProperty;
    //var dynamicLayers : SerializedProperty;

    function OnEnable () {
    serObj = new SerializedObject (target);

    filterType = serObj.FindProperty ("filterType");

    preview = serObj.FindProperty ("preview");
    previewScale = serObj.FindProperty ("previewScale");

    movementScale = serObj.FindProperty ("movementScale");
    rotationScale = serObj.FindProperty ("rotationScale");

    maxVelocity = serObj.FindProperty ("maxVelocity");
    minVelocity = serObj.FindProperty ("minVelocity");

    maxNumSamples = serObj.FindProperty ("maxNumSamples");
    jitter = serObj.FindProperty ("jitter");

    excludeLayers = serObj.FindProperty ("excludeLayers");
    //dynamicLayers = serObj.FindProperty ("dynamicLayers");

    velocityScale = serObj.FindProperty ("velocityScale");
    velocityDownsample = serObj.FindProperty ("velocityDownsample");

    noiseTexture = serObj.FindProperty ("noiseTexture");
    }

    function OnInspectorGUI () {
    serObj.Update ();

    EditorGUILayout.LabelField("Simulates camera based motion blur", EditorStyles.miniLabel);

    EditorGUILayout.PropertyField (filterType, new GUIContent("Technique"));
    if (filterType.enumValueIndex == 3 && !(target as CameraMotionBlur).Dx11Support()) {
    EditorGUILayout.HelpBox("DX11 mode not supported (need shader model 5)", MessageType.Info);
    }
    EditorGUILayout.PropertyField (velocityScale, new GUIContent(" Velocity Scale"));
    if(filterType.enumValueIndex >= 2) {
    EditorGUILayout.LabelField(" Tile size used during reconstruction filter:", EditorStyles.miniLabel);
    EditorGUILayout.PropertyField (maxVelocity, new GUIContent(" Velocity Max"));
    }
    else
    EditorGUILayout.PropertyField (maxVelocity, new GUIContent(" Velocity Max"));
    EditorGUILayout.PropertyField (minVelocity, new GUIContent(" Velocity Min"));

    EditorGUILayout.Separator ();

    EditorGUILayout.LabelField("Technique Specific");

    if(filterType.enumValueIndex == 0) {
    // portal style motion blur
    EditorGUILayout.PropertyField (rotationScale, new GUIContent(" Camera Rotation"));
    EditorGUILayout.PropertyField (movementScale, new GUIContent(" Camera Movement"));
    }
    else {
    // "plausible" blur or cheap, local blur
    EditorGUILayout.PropertyField (excludeLayers, new GUIContent(" Exclude Layers"));
    EditorGUILayout.PropertyField (velocityDownsample, new GUIContent(" Velocity Downsample"));
    velocityDownsample.intValue = velocityDownsample.intValue < 1 ? 1 : velocityDownsample.intValue;
    if(filterType.enumValueIndex >= 2) { // only display jitter for reconstruction
    EditorGUILayout.PropertyField (noiseTexture, new GUIContent(" Sample Jitter"));
    EditorGUILayout.PropertyField (jitter, new GUIContent(" Jitter Strength"));
    }
    }

    EditorGUILayout.Separator ();

    EditorGUILayout.PropertyField (preview, new GUIContent("Preview"));
    if (preview.boolValue)
    EditorGUILayout.PropertyField (previewScale, new GUIContent(""));

    serObj.ApplyModifiedProperties();
    }
    }
     
  2. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    When you're doing "new GUIContent("Preview")", Unity doesn't know if you want a CameraMotionBlurEditor.Preview or a UnityEditor.Editor.Preview. That's what Ambiguous Reference error means - a reference can refer to more than one class. Either rename your class, or qualify your reference (e.g. try "new GUIContent("UnityEditor.Editor.Preview")")