//========================================================================================== //========================================================================================== //========================================================================================== void Awake() { // Cache Reference To R_ThunderStorm rt = THOR_Thunderstorm.instance; // Cache own transform t = transform; // Store Initial Scale initScale = t.localScale; // Clone Materials lightningCloudMR.material = lightningCloudMaterial; lightningCloudMaterial = lightningCloudMR.material; lightningBoltMR.material = lightningBoltMaterial; lightningBoltMaterial = lightningBoltMR.material; // Disable GameObjects lightningBoltT.gameObject.SetActive(false); lightningCloudT.gameObject.SetActive(false); // Set AudioMixerGroup audioSource.outputAudioMixerGroup = rt.audioMixerGroup; // Set Colors lightningCloudMaterial.SetColor("_ColorCore", rt.colorCloudCore); lightningCloudMaterial.SetColor("_ColorGlow", rt.colorCloudGlow); lightningBoltMaterial.SetColor("_ColorCore", rt.colorLightningCore); lightningBoltMaterial.SetColor("_ColorGlow", rt.colorLightningGlow); // Set Depth Blending if (rt.enableDepthBlending) { lightningBoltMaterial.SetFloat("_EnableDepthBlend", 1); } else { lightningBoltMaterial.SetFloat("_EnableDepthBlend", 0); } lightningBoltMaterial.SetFloat("_DepthBlend", rt.depthBlend); } //========================================================================================
void Awake() { if (instance != null && instance != this) { Destroy(instance); } instance = this; } //========================================================================================
} //======================================================================================== void Start() { rt = THOR_Thunderstorm.instance; SetupCameraRig(); Camera.main.depthTextureMode = DepthTextureMode.Depth; QualitySettings.shadowDistance = 500; QualitySettings.shadowResolution = ShadowResolution.VeryHigh; } //========================================================================================
void Awake() { // Cache Reference To R_ThunderStorm rt = THOR_Thunderstorm.instance; // Clone Materials lightningCloudMR.material = lightningCloudMaterial; lightningCloudMaterial = lightningCloudMR.material; // Set Colors lightningCloudMaterial.SetColor("_ColorCore", rt.colorCloudCore); lightningCloudMaterial.SetColor("_ColorGlow", rt.colorCloudGlow); } //========================================================================================
} //======================================================================================== void OnEnable() { string scriptLocation = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)); installPath = scriptLocation.Replace("/Sources/Scripts/Editor/THOR_ThunderstormEditor.cs", ""); inspectorGUIPath = installPath + "/Sources/Scripts/Editor/EditorGUI"; logoTex = AssetDatabase.LoadAssetAtPath(inspectorGUIPath + "/THOR_Logo.png", typeof(Texture2D)) as Texture2D; thor = (THOR_Thunderstorm)target; SetupSerializedProperties(); } //========================================================================================
//========================================================================================== //========================================================================================== //========================================================================================== THOR_Thunderstorm() { instance = this; if (instance.ctrlThunderstorm != null) { instance.StopCoroutine(instance.ctrlThunderstorm); instance.ctrlThunderstorm = null; } if (fadeDown != null) { StopCoroutine(fadeDown); fadeDown = null; } if (fadeUp != null) { StopCoroutine(fadeUp); fadeUp = null; } }
} //======================================================================================== void Start() { rt = THOR_Thunderstorm.instance; SetupCameraRig(); Camera.main.depthTextureMode = DepthTextureMode.Depth; } //========================================================================================
} //======================================================================================== void OnDetroy() { instance = null; } //========================================================================================