Quantcast
Channel: Questions in topic: "namespace"
Viewing all articles
Browse latest Browse all 398

Can't access another script, think it may be due to namespace/public class ?

$
0
0
I'm having trouble accessing another script in my project. This is the script I want to access - using System; using UnityEngine; namespace UnityStandardAssets.ImageEffects { [ExecuteInEditMode] [RequireComponent (typeof(Camera))] [AddComponentMenu ("Image Effects/Camera/Vignette and Chromatic Aberration")] public class VignetteAndChromaticAberration : PostEffectsBase { public enum AberrationMode { Simple = 0, Advanced = 1, } public AberrationMode mode = AberrationMode.Simple; public static float intensity = 0.0f; //I CHANGED THIS TO A STATIC VARIABLE ! and I'm using this script to access/change the other script - using UnityEngine; using System.Collections; public class FadeOut : MonoBehaviour { private bool levelCompleted = false; public float fadeAmount; void OnTriggerEnter(Collider collider) { if(collider.gameObject.name == "Player") { levelCompleted = true; } } void Update() { if(levelCompleted = true) { VignetteAndChromaticAberration.intensity += fadeAmount; } } } I'm getting this error - Assets/Scripts/FadeOut.cs(22,25): error CS0103: The name `VignetteAndChromaticAberration' does not exist in the current context I think (please correct me if I'm wrong) its something to do with namespace / public class. I've not come across a script yet that uses the namespace thing so that I tink is why I having issues with finding the 'other' script. ???

Viewing all articles
Browse latest Browse all 398

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>