示例#1
0
        static void CreateSceneSettingsGameObject(MenuCommand menuCommand)
        {
            var parent   = menuCommand.context as GameObject;
            var settings = CoreEditorUtils.CreateGameObject(parent, "Sky and Fog Volume");

            GameObjectUtility.SetParentAndAlign(settings, menuCommand.context as GameObject);
            Undo.RegisterCreatedObjectUndo(settings, "Create " + settings.name);
            Selection.activeObject = settings;

            var profile   = VolumeProfileFactory.CreateVolumeProfile(settings.scene, "Sky and Fog Settings");
            var visualEnv = VolumeProfileFactory.CreateVolumeComponent <VisualEnvironment>(profile, true, false);

            visualEnv.skyType.value = SkySettings.GetUniqueID <PhysicallyBasedSky>();
            visualEnv.skyAmbientMode.overrideState = false;
            VolumeProfileFactory.CreateVolumeComponent <PhysicallyBasedSky>(profile, false, false);
            var fog = VolumeProfileFactory.CreateVolumeComponent <Fog>(profile, false, true);

            fog.enabled.Override(true);
            fog.enableVolumetricFog.Override(true);

            var volume = settings.AddComponent <Volume>();

            volume.isGlobal      = true;
            volume.sharedProfile = profile;
        }
示例#2
0
        static void CreateProbeVolumeGameObject(MenuCommand menuCommand)
        {
            var parent      = menuCommand.context as GameObject;
            var probeVolume = CoreEditorUtils.CreateGameObject("Probe Volume", parent);

            probeVolume.AddComponent <ProbeVolume>();
        }
示例#3
0
        public static void CreateDecal(MenuCommand menuCommand)
        {
            var go = CoreEditorUtils.CreateGameObject("Decal Projector", menuCommand.context);

            go.AddComponent <DecalProjector>();
            go.transform.RotateAround(go.transform.position, go.transform.right, 90);
        }
示例#4
0
        static void CreateGlobalVolume(MenuCommand menuCommand)
        {
            var go     = CoreEditorUtils.CreateGameObject("Custom Pass", menuCommand.context);
            var volume = go.AddComponent <CustomPassVolume>();

            volume.isGlobal = true;
        }
        static void CreateSceneSettingsGameObject(MenuCommand menuCommand)
        {
            var parent        = menuCommand.context as GameObject;
            var sceneSettings = CoreEditorUtils.CreateGameObject(parent, "Scene Settings");

            GameObjectUtility.SetParentAndAlign(sceneSettings, menuCommand.context as GameObject);
            Undo.RegisterCreatedObjectUndo(sceneSettings, "Create " + sceneSettings.name);
            Selection.activeObject = sceneSettings;

            var profile = VolumeProfileFactory.CreateVolumeProfile(sceneSettings.scene, "Scene Settings");

            VolumeProfileFactory.CreateVolumeComponent <HDShadowSettings>(profile, true, false);
            var visualEnv = VolumeProfileFactory.CreateVolumeComponent <VisualEnvironment>(profile, true, false);

            visualEnv.skyType.value = SkySettings.GetUniqueID <ProceduralSky>();
            visualEnv.fogType.value = FogType.Exponential;
            VolumeProfileFactory.CreateVolumeComponent <ProceduralSky>(profile, true, false);
            VolumeProfileFactory.CreateVolumeComponent <ExponentialFog>(profile, true, true);

            var volume = sceneSettings.AddComponent <Volume>();

            volume.isGlobal      = true;
            volume.sharedProfile = profile;

            var bakingSky = sceneSettings.AddComponent <BakingSky>();

            bakingSky.profile           = volume.sharedProfile;
            bakingSky.bakingSkyUniqueID = SkySettings.GetUniqueID <ProceduralSky>();
        }
        static void CreateRaytracingEnvironmentGameObject(MenuCommand menuCommand)
        {
            var parent = menuCommand.context as GameObject;
            var raytracingEnvGameObject = CoreEditorUtils.CreateGameObject(parent, "Raytracing Environment");

            raytracingEnvGameObject.AddComponent <HDRaytracingEnvironment>();
        }
示例#7
0
        static void CreateDensityVolumeGameObject(MenuCommand menuCommand)
        {
            var parent        = menuCommand.context as GameObject;
            var densityVolume = CoreEditorUtils.CreateGameObject("Density Volume", parent);

            densityVolume.AddComponent <DensityVolume>();
        }
        static void CreateLocalVolumetricFogGameObject(MenuCommand menuCommand)
        {
            var parent             = menuCommand.context as GameObject;
            var localVolumetricFog = CoreEditorUtils.CreateGameObject("Local Volumetric Fog", parent);

            localVolumetricFog.AddComponent <LocalVolumetricFog>();
        }
        static void CreatePlanarReflectionGameObject(MenuCommand menuCommand)
        {
            var parent      = menuCommand.context as GameObject;
            var go          = CoreEditorUtils.CreateGameObject("Planar Reflection", parent);
            var planarProbe = go.AddComponent <PlanarReflectionProbe>();

            planarProbe.influenceVolume.boxSize = new Vector3(1, 0.01f, 1);
        }
示例#10
0
        static void CreateDecal(MenuCommand menuCommand)
        {
            var parent = menuCommand.context as GameObject;
            var go     = CoreEditorUtils.CreateGameObject("Decal Projector", parent);
            var decal  = go.AddComponent <DecalProjector>();

            decal.transform.RotateAround(decal.transform.position, decal.transform.right, 90);
        }
示例#11
0
        static void CreateDensityVolumeGameObject(MenuCommand menuCommand)
        {
            var parent        = menuCommand.context as GameObject;
            var densityVolume = CoreEditorUtils.CreateGameObject(parent, "Density Volume");

            GameObjectUtility.SetParentAndAlign(densityVolume, menuCommand.context as GameObject);
            Undo.RegisterCreatedObjectUndo(densityVolume, "Create " + densityVolume.name);
            Selection.activeObject = densityVolume;

            densityVolume.AddComponent <DensityVolume>();
        }
示例#12
0
        static void CreateDecal(MenuCommand menuCommand)
        {
            var parent = menuCommand.context as GameObject;
            var go     = CoreEditorUtils.CreateGameObject(parent, "Decal Projector");

            go.AddComponent <DecalProjectorComponent>();
            // Ensure it gets re-parented if this was a context click (otherwise does nothing)
            GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
            // Register the creation in the undo system
            Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
            Selection.activeObject = go;
        }
        static void CreatePlanarReflectionGameObject(MenuCommand menuCommand)
        {
            var parent      = menuCommand.context as GameObject;
            var go          = CoreEditorUtils.CreateGameObject(parent, "Planar Reflection");
            var planarProbe = go.AddComponent <PlanarReflectionProbe>();

            planarProbe.influenceVolume.boxBaseSize = new Vector3(1, 0.01f, 1);
            // Ensure it gets re-parented if this was a context click (otherwise does nothing)
            GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
            // Register the creation in the undo system
            Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
            Selection.activeObject = go;
        }
        static void CreateSceneSettingsGameObject(MenuCommand menuCommand)
        {
            var parent   = menuCommand.context as GameObject;
            var settings = CoreEditorUtils.CreateGameObject("Sky and Fog Global Volume", parent);

            var profile   = VolumeProfileFactory.CreateVolumeProfile(settings.scene, "Sky and Fog Settings");
            var visualEnv = VolumeProfileFactory.CreateVolumeComponent <VisualEnvironment>(profile, true, false);

            visualEnv.skyType.value = SkySettings.GetUniqueID <PhysicallyBasedSky>();
            visualEnv.skyAmbientMode.overrideState = false;
            VolumeProfileFactory.CreateVolumeComponent <PhysicallyBasedSky>(profile, false, false);
            var fog = VolumeProfileFactory.CreateVolumeComponent <Fog>(profile, false, true);

            fog.enabled.Override(true);
            fog.enableVolumetricFog.Override(true);

            var volume = settings.AddComponent <Volume>();

            volume.isGlobal      = true;
            volume.sharedProfile = profile;
        }
示例#15
0
        static void CreateCustomGameObject(MenuCommand menuCommand)
        {
            //var sceneSettings = new GameObject("Scene Settings");
            //GameObjectUtility.SetParentAndAlign(sceneSettings, menuCommand.context as GameObject);
            //Undo.RegisterCreatedObjectUndo(sceneSettings, "Create " + sceneSettings.name);
            //Selection.activeObject = sceneSettings;
            //sceneSettings.AddComponent<SceneSettings>();

            var parent        = menuCommand.context as GameObject;
            var scenesettings = CoreEditorUtils.CreateGameObject(parent, "Scene Settings");

            GameObjectUtility.SetParentAndAlign(scenesettings, menuCommand.context as GameObject);
            Selection.activeObject = scenesettings;

            var profile = VolumeProfileFactory.CreateVolumeProfile(scenesettings.scene, "Scene Settings");

            VolumeProfileFactory.CreateVolumeComponent <CommonSettings>(profile, true, false);

            var volume = scenesettings.AddComponent <Volume>();

            volume.isGlobal      = true;
            volume.sharedProfile = profile;
        }