mirror of
https://github.com/muskit/H3VR-TNH-Quality-of-Life-Improvements.git
synced 2026-06-03 04:34:26 -07:00
Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bfb3f51474066d41bd9bd4b08f148ea
|
||||
folderAsset: yes
|
||||
timeCreated: 1457269144
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
+57
@@ -0,0 +1,57 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34a11416a6b53ee4795f603273b9a46d
|
||||
timeCreated: 1457269160
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,57 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 152cd48aa35f97f45b3522bf745d7712
|
||||
timeCreated: 1457269160
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SimpleLightProbePlacer.Editor
|
||||
{
|
||||
[CustomEditor(typeof(LightProbeGroupControl))]
|
||||
public class LightProbeGroupControlEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var control = (LightProbeGroupControl)target;
|
||||
|
||||
if (GUILayout.Button("Delete All Light Probes"))
|
||||
{
|
||||
Undo.RecordObject(control.LightProbeGroup, "Light Probe Group - delete all");
|
||||
control.DeleteAll();
|
||||
}
|
||||
|
||||
if (control.LightProbeGroup != null)
|
||||
{
|
||||
string message = "Light Probes count: {0}\nMerged Probes: {1}";
|
||||
message = string.Format(message, control.LightProbeGroup.probePositions.Length, control.MergedProbes);
|
||||
|
||||
EditorGUILayout.HelpBox(message, MessageType.Info);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Create Light Probes"))
|
||||
{
|
||||
Undo.RecordObject(control.LightProbeGroup, "Light Probe Group - create");
|
||||
control.Create();
|
||||
}
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
if (GUILayout.Button("Merge Closest Light Probes"))
|
||||
{
|
||||
Undo.RecordObject(control.LightProbeGroup, "Light Probe Group - merge");
|
||||
control.Merge();
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
var mergeDist = EditorGUILayout.Slider("Merge distance", control.MergeDistance, 0, 10);
|
||||
|
||||
GUILayout.Space(20);
|
||||
EditorGUILayout.LabelField("Point Light Settings", EditorStyles.boldLabel);
|
||||
|
||||
var useLights = EditorGUILayout.Toggle("Use Point Lights", control.UsePointLights);
|
||||
|
||||
GUI.enabled = control.UsePointLights;
|
||||
var lightRange = EditorGUILayout.FloatField("Range", control.PointLightRange);
|
||||
GUI.enabled = true;
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(control, "Light Probe Group Control changes");
|
||||
|
||||
control.MergeDistance = mergeDist;
|
||||
control.UsePointLights = useLights;
|
||||
control.PointLightRange = lightRange;
|
||||
|
||||
EditorUtility.SetDirty(target);
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Light/Light Probe Group Control")]
|
||||
private static void CreateLightProbeGroupControl(MenuCommand menuCommand)
|
||||
{
|
||||
var go = new GameObject("Light Probe Group Control");
|
||||
|
||||
go.AddComponent<LightProbeGroupControl>();
|
||||
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create Light Probe Group Control");
|
||||
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
|
||||
[DrawGizmo(GizmoType.Selected | GizmoType.InSelectionHierarchy | GizmoType.Active)]
|
||||
private static void DrawGizmoPointLight(Light light, GizmoType gizmoType)
|
||||
{
|
||||
var control = FindObjectOfType<LightProbeGroupControl>();
|
||||
|
||||
if (control == null || !control.UsePointLights || light.type != LightType.Point) return;
|
||||
|
||||
List<Vector3> probes = LightProbeGroupControl.CreatePositionsAround(light.transform, control.PointLightRange);
|
||||
|
||||
for (int i = 0; i < probes.Count; i++)
|
||||
{
|
||||
Gizmos.DrawIcon(probes[i], "NONE", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66045cdc4e8e7c844a763795dc422257
|
||||
timeCreated: 1457268398
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,92 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SimpleLightProbePlacer.Editor
|
||||
{
|
||||
[CanEditMultipleObjects, CustomEditor(typeof(LightProbeVolume))]
|
||||
public class LightProbeVolumeEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var volume = (LightProbeVolume)target;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
GUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("Volume", EditorStyles.boldLabel);
|
||||
var origin = EditorGUILayout.Vector3Field("Origin", volume.Origin);
|
||||
var size = EditorGUILayout.Vector3Field("Size", volume.Size);
|
||||
|
||||
GUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("Density", EditorStyles.boldLabel);
|
||||
var type = (LightProbeVolumeType)EditorGUILayout.EnumPopup("Density Type", volume.Type);
|
||||
|
||||
float densityMin = volume.Type == LightProbeVolumeType.Fixed ? 1 : 0.1f;
|
||||
float densityMax = volume.Type == LightProbeVolumeType.Fixed ? 100 : 50;
|
||||
|
||||
var density = volume.Density;
|
||||
density.x = EditorGUILayout.Slider("DensityX", volume.Density.x, densityMin, densityMax);
|
||||
density.y = EditorGUILayout.Slider("DensityY", volume.Density.y, densityMin, densityMax);
|
||||
density.z = EditorGUILayout.Slider("DensityZ", volume.Density.z, densityMin, densityMax);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(target, "Light Probe Volume changes");
|
||||
|
||||
volume.Density = density;
|
||||
volume.Type = type;
|
||||
volume.Volume = new Volume(origin, size);
|
||||
|
||||
EditorUtility.SetDirty(target);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSceneGUI()
|
||||
{
|
||||
var lightProbeVolume = (LightProbeVolume)target;
|
||||
|
||||
var volume = TransformVolume.EditorVolumeControl(lightProbeVolume, 0.1f, LightProbeVolume.EditorColor);
|
||||
|
||||
if (volume != lightProbeVolume.Volume)
|
||||
{
|
||||
Undo.RecordObject(target, "Light Probe Volume changes");
|
||||
lightProbeVolume.Volume = volume;
|
||||
EditorUtility.SetDirty(target);
|
||||
}
|
||||
}
|
||||
|
||||
[DrawGizmo(GizmoType.Selected | GizmoType.InSelectionHierarchy | GizmoType.Active)]
|
||||
private static void DrawGizmoVolume(LightProbeVolume volume, GizmoType gizmoType)
|
||||
{
|
||||
var color = LightProbeVolume.EditorColor;
|
||||
Gizmos.color = color;
|
||||
Gizmos.matrix = Matrix4x4.TRS(volume.transform.position, volume.transform.rotation, Vector3.one);
|
||||
Gizmos.DrawWireCube(volume.Origin, volume.Size);
|
||||
|
||||
if (gizmoType != (GizmoType.Selected | GizmoType.InSelectionHierarchy | GizmoType.Active)) return;
|
||||
|
||||
color.a = 0.25f;
|
||||
Gizmos.color = color;
|
||||
Gizmos.DrawCube(volume.Origin, volume.Size);
|
||||
|
||||
var probes = volume.CreatePositions();
|
||||
|
||||
for (int i = 0; i < probes.Count; i++)
|
||||
{
|
||||
Gizmos.DrawIcon(probes[i], "NONE", false);
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Light/Light Probe Volume")]
|
||||
private static void CreateLightProbeVolume(MenuCommand menuCommand)
|
||||
{
|
||||
var go = new GameObject("Light Probe Volume");
|
||||
|
||||
go.AddComponent<LightProbeVolume>();
|
||||
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
||||
Undo.RegisterCreatedObjectUndo(go, "Create Light Probe Volume");
|
||||
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed7bb5f68f00e944da65fd411da6fd53
|
||||
timeCreated: 1457260999
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user