#if GAIA_PRESENT && UNITY_EDITOR using UnityEngine; using System.Collections; using System; using System.Reflection; using VolumetricFogAndMist; using UnityEditor; namespace Gaia.GX.Kronnect { /// /// Volumetric Fog & Mist extension for Gaia. /// public class VolumetricFogGaiaExtension : MonoBehaviour { #region Generic informational methods /// /// Returns the publisher name if provided. /// This will override the publisher name in the namespace ie Gaia.GX.PublisherName /// /// Publisher name public static string GetPublisherName() { return "Kronnect"; } /// /// Returns the package name if provided /// This will override the package name in the class name ie public class PackageName. /// /// Package name public static string GetPackageName() { return "Volumetric Fog & Mist"; } #endregion #region Methods exposed by Gaia as buttons must be prefixed with GX_ public static void GX_About() { EditorUtility.DisplayDialog("About Volumetric Fog & Mist", "Volumetric Fog & Mist is a full-screen image effect that adds realistic, live, moving fog, mist, dust, clouds and sky haze to your scenes making them less dull and boring.", "OK"); } static VolumetricFog CheckFog() { VolumetricFog fog = VolumetricFog.instance; // Checks Volumetric Fog image effect is attached if (fog==null) { Camera camera = Camera.main; if (camera == null) { camera = FindObjectOfType(); } if (camera == null) { Debug.LogError("Could not find camera to add camera effects to. Please add a camera to your scene."); return null; } fog = camera.gameObject.AddComponent(); } // Finds a suitable Sun light if (fog.sun==null) { Light[] lights = FindObjectsOfType(); for (int k=0;k