void Start() { SettingsFrom = GameObject.Find("Cloud Mod").GetComponent<CloudMod>(); //Pre-Setting FireColor = SettingsFrom.FlameLightColor; FireLightIntensity = SettingsFrom.FireLightIntensity; FireLightRange = SettingsFrom.FireLightRange; FUcount = 0; if (!this.gameObject.GetComponent<Light>()) { ThisLight = this.gameObject.AddComponent<Light>(); ThisLight.transform.localPosition -= Vector3.up * 0.5f ; ThisLight.type = LightType.Point; ThisLight.color = FireColor; ThisLight.intensity = FireLightIntensity; ThisLight.renderMode = LightRenderMode.ForcePixel; ThisLight.shadowBias = 15; ThisLight.shadowStrength = 0.5f; ThisLight.range = FireLightRange; ThisLight.enabled = false; //DontDestroyOnLoad(ThisLight); lastFUTime = this.GetComponent<ParticleSystem>().time; } else { DestroyImmediate(this.GetComponent<ShakeLightingWholalalalalalallalala>()); } }
void Start() { SettingsFrom = GameObject.Find("Cloud Mod").GetComponent<CloudMod>(); //Pre-Setting FireColor = SettingsFrom.FlameLightColor; ShakeMax = SettingsFrom.ShakeMax; ShakeMin = SettingsFrom.ShakeMin; FireLightIntensity = SettingsFrom.FireLightIntensity; Shakefrequency = SettingsFrom.Shakefrequency; FireLightRange = SettingsFrom.FireLightRange; float ScaleMag = Vector3.Magnitude(this.transform.localScale); FUcount = 0; if (!this.gameObject.GetComponent<Light>()) { ThisLight = this.gameObject.AddComponent<Light>(); ThisLight.type = LightType.Point; ThisLight.color = FireColor; ThisLight.intensity = FireLightIntensity * ScaleMag; ThisLight.renderMode = LightRenderMode.ForcePixel; ThisLight.shadowBias = 15; ThisLight.shadowStrength = 0.5f; ThisLight.range = FireLightRange * ScaleMag; ThisLight.enabled = false; lastFUTime = this.GetComponent<ParticleSystem>().time; } else { DestroyImmediate(this.GetComponent<ShakeLightingWholalalalalalallalala>()); } }