Unity & Script problems, errors and solutions


Unity & Script problems, errors and solutions

'UnityEngine.PostProcessing.MinAttribute' and 'UnityEngine.MinAttribute'



Error
PostProcessing\Editor\PropertyDrawers\MinDrawer.cs(6,34): error CS0104: 'MinAttribute' is an ambiguous reference between 'UnityEngine.PostProcessing.MinAttribute' and 'UnityEngine.MinAttribute'

Actually the simpler fix is to add one line at the top : using MinAttribute = UnityEngine.PostProcessing.MinAttribute;


Error
Standard Assets\Effects\ImageEffects\Scripts\Bloom.cs(109,97): error CS1061: 'Camera' does not contain a definition for 'hdr' and no accessible extension method 'hdr' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)

Problem :

if (hdr == HDRBloomMode.Auto)
                doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().hdr;

Solution :
if (hdr == HDRBloomMode.Auto)
                doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().allowHDR;



Error
Standard Assets\Effects\AmbientOcclusion\AmbientOcclusion.cs(23,39): error CS1061: 'Camera' does not contain a definition for 'hdr' and no accessible extension method 'hdr' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)

Problem :

public bool isAmbientOnlySupported
        {
            get { return targetCamera.hdr && occlusionSource == OcclusionSource.GBuffer; }
        }

Solution :
public bool isAmbientOnlySupported
        {
            get { return targetCamera.allowHDR && occlusionSource == OcclusionSource.GBuffer; }
        }



 Error
Standard Assets\Effects\ImageEffects\Scripts\BloomAndFlares.cs(112,97): error CS1061: 'Camera' does not contain a definition for 'hdr' and no accessible extension method 'hdr' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)

Problem :

if (hdr == HDRBloomMode.Auto)
                doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().hdr;

Solution :
if (hdr == HDRBloomMode.Auto)
                doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().allowHDR;



 Error
Standard Assets\Effects\ImageEffects\Scripts\SunShafts.cs(93,52): error CS1061: 'Camera' does not contain a definition for 'hdr' and no accessible extension method 'hdr' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)

Problem :

if (!useDepthTexture) {
                var format= GetComponent<Camera>().hdr ? RenderTextureFormat.DefaultHDR: RenderTextureFormat.Default;

Solution :
if (!useDepthTexture) {
                var format= GetComponent<Camera>().allowHDR ? RenderTextureFormat.DefaultHDR: RenderTextureFormat.Default;


Error
error CS0246: The type or namespace name 'Text' could not be found (are you missing a using directive or an assembly reference?)

Solution :
using UnityEngine.UI;
  

Error

Assets\AQUAS\Scripts\AQUAS_CameraSwitcher.cs(28,125): error CS0103: The name 'AssetDatabase' does not exist in the current context

Problem :

camerappv2.GetComponentInChildren<AQUAS_LensEffects>().underWaterParameters.underwaterProfile = (PostProcessProfile)AssetDatabase.LoadAssetAtPath("Assets/AQUAS/Post Processing/AQUAS_Underwater_v2.asset"typeof(PostProcessProfile));

camerappv2.GetComponentInChildren<AQUAS_LensEffects>().underWaterParameters.defaultProfile = (PostProcessProfile)AssetDatabase.LoadAssetAtPath("Assets/AQUAS/Post Processing/DemoPostProcessing_v2.asset"typeof(PostProcessProfile));

Solution :
using UnityEditor;

Tidak ada komentar:

Posting Komentar