// Use this for initialization void Start() { if (mode == DisplayMode.Colors) { background = new Texture2D(1, 1); background.SetPixel(1, 1, colors.background); background.wrapMode = TextureWrapMode.Repeat; background.Apply(); foreground = new Texture2D(1, 1); foreground.SetPixel(1, 1, colors.foreground); foreground.wrapMode = TextureWrapMode.Repeat; foreground.Apply(); xpShadow = new Texture2D(1, 1); xpShadow.SetPixel(1, 1, colors.xpShadowIncrease); xpShadow.wrapMode = TextureWrapMode.Repeat; xpShadow.Apply(); } else { background = textures.background; foreground = textures.foreground; xpShadow = textures.xpShadowIncrease; } barwidth = Screen.width * screenPer; boxwidth = barwidth / 10; barstrt = Screen.width * ((1.0f - screenPer) / 2); Debug.Log(barstrt + ":" + Screen.width); parser.Load(IniFiles.XP); if (parser.Get("XP").Equals("")) { parser.Set("", "XP", "0"); float curxp = 0; for (int i = 0; i < 200; i++) { if (i != 0) { curxp += 800 + (400 * (i - 1)); } int cp = Mathf.CeilToInt(curxp); parser.Set("Ranks", "level-" + i, curxp.ToString()); } curxp = 9999999; parser.Set("Ranks", "level-200", curxp.ToString()); parser.Save(IniFiles.XP); } localxp = int.Parse(parser.Get("XP")); calc(); }
// Option values void Start() { resolutionsSTR = new string[Screen.resolutions.Length]; windowed = Screen.fullScreen; network = GameObject.FindGameObjectWithTag("Lobby").GetComponent <NetworkManager>(); //GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity,new Vector3(Screen.width / nativeWidth, Screen.height / nativeHeight)); if (parser.DoesExist(IniFiles.CONFIG)) { parser.Load(IniFiles.CONFIG); } else { gs.Create(); parser.Load(IniFiles.CONFIG); } if (!Application.isEditor) { int i = 0; foreach (Resolution res in Screen.resolutions) { if (Screen.width == res.width && Screen.height == res.height) { currentResolution = res.width + "x" + res.height; curResInt = i; } else { currentResolution = "Select res"; } resolutionsSTR[i] = res.width + "x" + res.height; i++; } } else { curResInt = 0; } loadSettings(); }
void Start() { if (!networkView.isMine) { enabled = false; gameObject.GetComponent <XPmanager>().enabled = false; } parser.Load(IniFiles.CONFIG); moveDirection = transform.TransformDirection(Vector3.forward); _animation = GetComponent <Animation>(); }
// Use this for initialization void Start() { if (!networkView.isMine) { gameObject.SetActive(false); enabled = false; } parser.Load(IniFiles.CONFIG); // Initialize camera rotation vRotation = rotationObject.transform.eulerAngles.x; hRotation = rotationObject.transform.eulerAngles.y; // Set the vertical rotation of the camera to the average of the vertical limits. rotationObject.transform.localEulerAngles = new Vector3((vertical.maximumAngle + vertical.maximumAngle) / 2, (horizontal.minimumAngle + horizontal.maximumAngle) / 2, rotationObject.transform.localEulerAngles.z); // Set the initial distance from the camera based on the preferred distance scroller.transform.localPosition = new Vector3(scroller.transform.localPosition.x, scroller.transform.localPosition.y, preferredDistance * -1); }
void Refresh() { parser.Clear(); if (parser.DoesExist(IniFiles.CONFIG)) { parser.Load(IniFiles.CONFIG); } else { gs.Create(); parser.Load(IniFiles.CONFIG); } DepthOfField34 dof = gameObject.GetComponent <DepthOfField34>(); Bloom blf = gameObject.GetComponent <Bloom>(); AmbientObscurance ssao = gameObject.GetComponent <AmbientObscurance>(); SunShafts sunshaft = gameObject.GetComponent <SunShafts>(); NoiseAndGrain nag = gameObject.GetComponent <NoiseAndGrain>(); EdgeDetectEffectNormals edn = gameObject.GetComponent <EdgeDetectEffectNormals>(); Vignetting vig = gameObject.GetComponent <Vignetting>(); if (bool.Parse(parser.Get("fx_enable"))) { if (bool.Parse(parser.Get("fx_dof"))) { dof.enabled = true; dof.resolution = DofResolution.High; dof.quality = bool.Parse(parser.Get("fx_dof_foreground")) ? Dof34QualitySetting.BackgroundAndForeground : Dof34QualitySetting.OnlyBackground; dof.bokeh = bool.Parse(parser.Get("fx_dof_bokeh")) ? true : false; dof.focalPoint = float.Parse(parser.Get("fx_dof_focaldistance")); dof.smoothness = float.Parse(parser.Get("fx_dof_smoothness")); dof.focalSize = float.Parse(parser.Get("fx_dof_focalSize")); dof.visualize = bool.Parse(parser.Get("fx_dof_visualizeFocus")); switch (parser.Get("fx_dof_blurriness")) { case "0": dof.bluriness = DofBlurriness.Low; break; case "1": dof.bluriness = DofBlurriness.High; break; case "2": dof.bluriness = DofBlurriness.VeryHigh; break; default: dof.bluriness = DofBlurriness.High; break; } dof.maxBlurSpread = float.Parse(parser.Get("fx_dof_blurSpread")); dof.foregroundBlurExtrude = float.Parse(parser.Get("fx_dof_foregroundSize")); switch (parser.Get("fx_dof_bokeh_destination")) { case "0": dof.bokehDestination = BokehDestination.Background; break; case "1": dof.bokehDestination = BokehDestination.BackgroundAndForeground; break; case "2": dof.bokehDestination = BokehDestination.Foreground; break; default: dof.bokehDestination = BokehDestination.Background; break; } dof.bokehIntensity = float.Parse(parser.Get("fx_dof_bokeh_intensity")); dof.bokehThreshholdLuminance = float.Parse(parser.Get("fx_dof_bokeh_minLuminance")); dof.bokehThreshholdContrast = float.Parse(parser.Get("fx_dof_bokeh_minContrast")); dof.bokehDownsample = int.Parse(parser.Get("fx_dof_bokeh_DownSample")); dof.bokehScale = float.Parse(parser.Get("fx_dof_bokeh_sizeScale")); } else { dof.enabled = false; } // SSAO if (bool.Parse(parser.Get("fx_SSAO"))) { ssao.enabled = true; ssao.intensity = float.Parse(parser.Get("fx_SSAO_intensity")); ssao.radius = float.Parse(parser.Get("fx_SSAO_radius")); ssao.blurIterations = int.Parse(parser.Get("fx_SSAO_blurIterations")); ssao.blurFilterDistance = float.Parse(parser.Get("fx_SSAO_blurFilterDistance")); ssao.downsample = int.Parse(parser.Get("fx_SSAO_downsample")); } else { ssao.enabled = false; } // NOISE GRAIN nag.enabled = bool.Parse(parser.Get("fx_noisegrain")) ? true : false; nag.intensityMultiplier = float.Parse(parser.Get("fx_noisegrain_intensity")); // BLOOM if (bool.Parse(parser.Get("fx_bloom"))) { blf.enabled = true; switch (parser.Get("fx_bloom_quality")) { case "0": blf.quality = Bloom.BloomQuality.Cheap; break; case "1": blf.quality = Bloom.BloomQuality.High; break; default: blf.quality = Bloom.BloomQuality.High; break; } switch (parser.Get("fx_bloom_mode")) { case "0": blf.tweakMode = Bloom.TweakMode.Basic; break; case "1": blf.tweakMode = Bloom.TweakMode.Complex; break; default: blf.tweakMode = Bloom.TweakMode.Complex; break; } switch (parser.Get("fx_bloom_blendMode")) { case "0": blf.screenBlendMode = Bloom.BloomScreenBlendMode.Screen; break; case "1": blf.screenBlendMode = Bloom.BloomScreenBlendMode.Add; break; default: blf.screenBlendMode = Bloom.BloomScreenBlendMode.Add; break; } blf.hdr = bool.Parse(parser.Get("fx_bloom_hdr")) ? Bloom.HDRBloomMode.On : Bloom.HDRBloomMode.Off; blf.bloomIntensity = float.Parse(parser.Get("fx_bloom_intensity")); blf.bloomThreshhold = float.Parse(parser.Get("fx_bloom_threshhold")); blf.bloomBlurIterations = int.Parse(parser.Get("fx_bloom_blurIterations")); blf.blurWidth = float.Parse(parser.Get("fx_bloom_sampleDistance")); switch (parser.Get("fx_bloom_lensFlareMode")) { case "0": blf.lensflareMode = Bloom.LensFlareStyle.Ghosting; break; case "1": blf.lensflareMode = Bloom.LensFlareStyle.Anamorphic; break; case "2": blf.lensflareMode = Bloom.LensFlareStyle.Combined; break; default: blf.lensflareMode = Bloom.LensFlareStyle.Ghosting; break; } blf.lensflareIntensity = float.Parse(parser.Get("fx_bloom_LFlocalIntensity")); blf.lensflareThreshhold = float.Parse(parser.Get("fx_bloom_LFthreshhold")); } else { blf.enabled = false; } // Sunshafts if (bool.Parse(parser.Get("fx_sunshaft"))) { sunshaft.enabled = true; sunshaft.useDepthTexture = bool.Parse(parser.Get("fx_sunshaft_zBuffer")); switch (parser.Get("fx_sunshaft_resolution")) { case "0": sunshaft.resolution = SunShaftsResolution.Low; break; case "1": sunshaft.resolution = SunShaftsResolution.Normal; break; case "2": sunshaft.resolution = SunShaftsResolution.High; break; default: sunshaft.resolution = SunShaftsResolution.Normal; break; } switch (parser.Get("fx_sunshaft_blendMode")) { case "0": sunshaft.screenBlendMode = ShaftsScreenBlendMode.Add; break; case "1": sunshaft.screenBlendMode = ShaftsScreenBlendMode.Screen; break; default: sunshaft.screenBlendMode = ShaftsScreenBlendMode.Screen; break; } sunshaft.maxRadius = float.Parse(parser.Get("fx_sunshaft_distFalloff")); sunshaft.sunShaftBlurRadius = float.Parse(parser.Get("fx_sunshaft_blurSize")); sunshaft.radialBlurIterations = int.Parse(parser.Get("fx_sunshaft_blurIterations")); sunshaft.sunShaftIntensity = float.Parse(parser.Get("fx_sunshaft_intensity")); sunshaft.useSkyBoxAlpha = float.Parse(parser.Get("fx_sunshaft_alphaMask")); } else { sunshaft.enabled = false; } // Edge detect edn.enabled = bool.Parse(parser.Get("fx_edgeDetect")) ? true : false; // Vignetting if (bool.Parse(parser.Get("fx_vignetting"))) { vig.enabled = true; vig.intensity = float.Parse(parser.Get("fx_vignetting_intensity")); vig.blurSpread = float.Parse(parser.Get("fx_vignetting_blurredCornors")); vig.chromaticAberration = float.Parse(parser.Get("fx_vignetting_aberration")); } else { vig.enabled = false; } } else { dof.enabled = false; ssao.enabled = false; nag.enabled = false; blf.enabled = false; sunshaft.enabled = false; edn.enabled = false; vig.enabled = false; } }
void Refresh() { parser.Load(IniFiles.CONFIG); smoothTime = float.Parse(parser.Get("fx_dof_smoothtime")); addDistance = float.Parse(parser.Get("fx_dof_focaldistance")); }