// static DepthOfFieldDef() { if (depthOfFieldEffect == null) { depthOfFieldEffect = Util.GetComponentVar <DepthOfFieldScatter, DepthOfFieldDef>(depthOfFieldEffect); } visualizeFocus = false; focalLength = 10f; focalSize = 0.05f; //focalTransform; aperture = 11.5f; blurType = DepthOfFieldScatter.BlurType.DiscBlur; blurSampleCount = DepthOfFieldScatter.BlurSampleCount.High; maxBlurSize = 2f; highResolution = false; nearBlur = false; foregroundOverlap = 1f; dx11BokehScale = 1.2f; dx11BokehIntensity = 2.5f; dx11BokehThreshhold = 0.5f; dx11SpawnHeuristic = 0.0875f; focusedMaid = -1; }
// Use this for initialization void Start() { tempPosition = transform.position; cam = GameObject.Find("Station Camera").GetComponent <StationCamera>(); DOF = cam.gameObject.GetComponent <DepthOfFieldScatter>(); cameraTm = GameObject.Find("Station Camera").transform; OrigScale = gameObject.transform.localScale.y; effect = transform.FindChild("effect").gameObject; if (ANIMATE_3) { animator_3 = gameObject.GetComponent <Greeble_3_Animator>(); Debug.Log(animator_3); } if (ANIMATE_5) { animator_5 = gameObject.GetComponent <Greeble_5_Animator>(); Debug.Log(animator_5); } if (SPINS) { spinner = gameObject.GetComponent <ObjectSpinner>(); Debug.Log("This is spinner: " + spinner); } }
void Start() { dof = gameObject.GetComponent <DepthOfFieldScatter>(); // Get current camera angle alpha = camera.fieldOfView * Mathf.PI / 180 / 2; lens = Mathf.Tan(alpha) * 2 * f; }
// *************************** // add private variable here // *************************** void Start() { _ohCam = GetComponent<RtsCamera>(); if (_ohCam == null) this.enabled = false; _dof3 = GetComponent<DepthOfField34>(); _dof4 = GetComponent<DepthOfFieldScatter>(); // *************************** // get instance of component here // *************************** }
// Use this for initialization void Start() { bloom = GetComponent<Bloom>(); if(bloom != null){ bUpdateBloom = true; targetBloomStrength = bloom.bloomIntensity; } dof = GetComponent<DepthOfFieldScatter>(); if(dof != null){ bUpdateDoF = true; targetDofAperture = dof.aperture; } }
// *************************** // add private variable here // *************************** void Start() { _ohCam = GetComponent <RtsCamera>(); if (_ohCam == null) { this.enabled = false; } _dof3 = GetComponent <DepthOfField34>(); _dof4 = GetComponent <DepthOfFieldScatter>(); // *************************** // get instance of component here // *************************** }
/* ========================================================================================================== * UNITY METHODS * ========================================================================================================== */ void Awake() { // dictColorsToEnglish = new Dictionary <Color, string>(); dictColorsToEnglish.Add(Color.black, "black"); dictColorsToEnglish.Add(Color.blue, "blue"); dictColorsToEnglish.Add(Color.cyan, "cyan"); dictColorsToEnglish.Add(Color.green, "green"); dictColorsToEnglish.Add(Color.yellow, "yellow"); dictColorsToEnglish.Add(Color.red, "red"); dictColorsToEnglish.Add(Color.magenta, "magenta"); dictColorsToEnglish.Add(Color.grey, "grey"); dictColorsToEnglish.Add(Color.white, "white"); // Get the main camera if (trMainCamera == null) { trMainCamera = Camera.main.transform; } if (trObjectivesCard == null) { trObjectivesCard = GameObject.Find("ObjectivesCard").transform; } // Get the DOF script dofScript = trMainCamera.gameObject.GetComponent <DepthOfFieldScatter>(); dofScript.enabled = false; // Find the level manager object and script GameObject goLevelManager = GameObject.Find("Level Manager"); if (goLevelManager) { levelManagerScript = goLevelManager.GetComponent <LevelManager>(); } // Register myself with the level manager. Why? Well, I'm the only player script for now... levelManagerScript.RegisterObjectiveCard(this.transform, this); guiObjectivesCardScript = gameObject.GetComponent <GUIObjectivesCard>(); }
public static void Update(DepthOfFieldPane depthOfFieldPane) { // FIXME: Becomes null after scene transition? if (depthOfFieldEffect == null) { depthOfFieldEffect = Util.GetComponentVar <DepthOfFieldScatter, DepthOfFieldDef>(depthOfFieldEffect); } if (Instances.needEffectWindowReload == true) { depthOfFieldPane.IsEnabled = depthOfFieldEffect.enabled; } else { depthOfFieldEffect.enabled = depthOfFieldPane.IsEnabled; } depthOfFieldEffect.visualizeFocus = depthOfFieldPane.VisualizeFocusValue; depthOfFieldEffect.focalLength = depthOfFieldPane.FocalLengthValue; depthOfFieldEffect.focalSize = depthOfFieldPane.FocalSizeValue; depthOfFieldEffect.aperture = depthOfFieldPane.ApertureValue; depthOfFieldEffect.blurType = depthOfFieldPane.BlurTypeValue; depthOfFieldEffect.blurSampleCount = depthOfFieldPane.BlurSampleCountValue; depthOfFieldEffect.maxBlurSize = depthOfFieldPane.MaxBlurSizeValue; depthOfFieldEffect.highResolution = depthOfFieldPane.HighResolutionValue; depthOfFieldEffect.nearBlur = depthOfFieldPane.NearBlurValue; depthOfFieldEffect.foregroundOverlap = depthOfFieldPane.ForegroundOverlapValue; depthOfFieldEffect.dx11BokehScale = depthOfFieldPane.Dx11BokehScaleValue; depthOfFieldEffect.dx11BokehIntensity = depthOfFieldPane.Dx11BokehIntensityValue; depthOfFieldEffect.dx11BokehThreshhold = depthOfFieldPane.Dx11BokehThreshholdValue; depthOfFieldEffect.dx11SpawnHeuristic = depthOfFieldPane.Dx11SpawnHeuristicValue; focusedMaid = -1; }
public static void InitMemberByInstance(DepthOfFieldScatter depth) { visualizeFocus = depth.visualizeFocus; focalLength = depth.focalLength; focalSize = depth.focalSize; focalTransform = depth.focalTransform; aperture = depth.aperture; blurType = depth.blurType; blurSampleCount = depth.blurSampleCount; maxBlurSize = depth.maxBlurSize; highResolution = depth.highResolution; nearBlur = depth.nearBlur; foregroundOverlap = depth.foregroundOverlap; dx11BokehScale = depth.dx11BokehScale; dx11BokehIntensity = depth.dx11BokehIntensity; dx11BokehThreshhold = depth.dx11BokehThreshhold; dx11SpawnHeuristic = depth.dx11SpawnHeuristic; }
void Start() { depthOfField = GetComponent<DepthOfFieldScatter>(); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(orthoPerspectiveCameraToggleKey)) { if (perspectiveCamera != null) { perspectiveCamera.enabled = !perspectiveCamera.enabled; orthographicCamera.enabled = !orthographicCamera.enabled; if (perspectiveCamera.enabled) { if (touchTracker != null) { touchTracker.displayTouchPointsSwitch = true; // this is trying to fix the issue with the touch track in perspective space... it turns off the touch indicator. } } if (orthographicCamera.enabled) { if (touchTracker != null) { touchTracker.displayTouchPointsSwitch = true; } } } } if (Input.GetKeyDown(dofToggleKey)) { if (perspectiveCamera != null) { DepthOfFieldScatter dof = perspectiveCamera.gameObject.GetComponent <DepthOfFieldScatter>(); dof.enabled = !dof.enabled; } } if (Input.GetKeyDown(blurToggleKey)) { if (orthographicCamera.enabled) { Blur blo = orthographicCamera.gameObject.GetComponent <Blur>(); blo.enabled = !blo.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { Blur blp = perspectiveCamera.gameObject.GetComponent <Blur>(); blp.enabled = !blp.enabled; } } } if (Input.GetKeyDown(antialiasingToggleKey)) { if (orthographicCamera.enabled) { AntialiasingAsPostEffect aao = orthographicCamera.gameObject.GetComponent <AntialiasingAsPostEffect>(); aao.enabled = !aao.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { AntialiasingAsPostEffect aap = perspectiveCamera.gameObject.GetComponent <AntialiasingAsPostEffect>(); aap.enabled = !aap.enabled; } } } if (Input.GetKeyDown(vignetteToggleKey)) { if (orthographicCamera.enabled) { Vignetting vigo = orthographicCamera.gameObject.GetComponent <Vignetting>(); vigo.enabled = !vigo.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { Vignetting vigp = perspectiveCamera.gameObject.GetComponent <Vignetting>(); vigp.enabled = !vigp.enabled; } } } }
private void Start() { m_dof = GetComponent <DepthOfFieldScatter>(); }
void Start() { dof = gameObject.GetComponent <DepthOfFieldScatter>(); }
void Start() { dofScript = GetComponent <DepthOfFieldScatter>(); startFocalSize = GetComponent <DepthOfFieldScatter>().focalSize; }
// Start void Start() { depthOfFieldScatter = this.GetComponent <DepthOfFieldScatter>(); }
public static void InitExtra(DepthOfFieldScatter depth) { depth.dx11BokehTexture = new Texture2D(64, 64, TextureFormat.DXT5, false); depth.dx11BokehTexture.LoadImage(ConstantValues.byteHexShapePng); depth.dx11BokehTexture.Apply(); }