diff options
| author | yum <yum.food.vr@gmail.com> | 2024-05-13 10:54:57 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-05-13 10:54:57 -0700 |
| commit | 69a2a65710a11cbd7bfa88e35fba89c5eb412b11 (patch) | |
| tree | 6d2fa8e5069783936759d85b3a58bf45ca104af2 /Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs | |
| parent | 1a4298d33de4420b22c723144a1afbe9a3c61b59 (diff) | |
Remove everything except headers, LICENSE and README from LTCGIv0.0.0
Diffstat (limited to 'Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs')
| -rw-r--r-- | Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs b/Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs deleted file mode 100644 index 9dec710..0000000 --- a/Third_Party/at.pimaker.ltcgi/Editor/LTCGI_Emitter.cs +++ /dev/null @@ -1,98 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -#endif - -namespace pi.LTCGI -{ - #if UNITY_EDITOR - [ExecuteInEditMode] - public class LTCGI_Emitter : LTCGI_Screen - { - public Renderer[] EmissiveRenderers; - - [HideInInspector] public bool Initialized = false; - - public LTCGI_Emitter() - { - // static values for emitters - this.Cylinder = false; - this.Diffuse = true; - this.DiffuseFromLm = true; - this.DoubleSided = true; - this.Dynamic = false; - this.FlipUV = false; - this.Specular = false; - } - } - - [CustomEditor(typeof(LTCGI_Emitter))] - [CanEditMultipleObjects] - public class LTCGI_EmitterEditor : LTCGI_ScreenEditor - { - public override void OnInspectorGUI() - { - GUIStyle style = new GUIStyle(EditorStyles.label); - style.alignment = TextAnchor.MiddleCenter; - style.fixedHeight = 150; - GUI.Box(GUILayoutUtility.GetRect(300, 150, style), Logo, style); - - var emitter = (LTCGI_Emitter)target; - - if (!emitter.enabled || !emitter.gameObject.activeInHierarchy) - { - EditorGUILayout.Space(); - EditorGUILayout.HelpBox("This component is disabled, or the GameObject not active! This will cause it to not bake a lightmap, and can cause issues at runtime. If you want this renderer to start disabled, set it's color to Black (0,0,0) or visit https://ltcgi.dev/ to see how you can toggle LTCGI globally.", MessageType.Error, true); - LTCGIDocsHelper.DrawHelpButton("https://ltcgi.dev/Getting%20Started/Setup/Basic_Toggle", "LTCGI Toggle"); - EditorGUILayout.Space(); - } - - LTCGIDocsHelper.DrawHelpButton("https://ltcgi.dev/Advanced/LTCGI_Emitter"); - - serializedObject.Update(); - - var emissiveRenderers = serializedObject.FindProperty("EmissiveRenderers"); - - if (!emitter.Initialized) - { - serializedObject.FindProperty("Initialized").boolValue = true; - lmProp.intValue = 1; - emissiveRenderers.InsertArrayElementAtIndex(0); - emissiveRenderers.GetArrayElementAtIndex(0).objectReferenceValue = emitter.GetComponent<Renderer>(); - } - - EditorGUILayout.HelpBox("This is an emitter component. It can only produce diffuse, untextured light. It can however apply to multiple objects and is a lot cheaper to use.", MessageType.Info); - EditorGUILayout.Space(); - - DrawColorSelector(emitter); - EditorGUILayout.Space(); - DrawColorModeSelector(false); - EditorGUILayout.Space(); - DrawRendererModeSelector(); - EditorGUILayout.Space(); - DrawLmChannelSelector(); - - if (lmProp.intValue == 0) - { - EditorGUILayout.HelpBox("This emitter is not using a lightmap channel. It will not look correct.", MessageType.Warning); - } - - EditorGUILayout.Space(); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("List all emissive renderers below:", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(emissiveRenderers, true); - - if (serializedObject.hasModifiedProperties) - { - serializedObject.ApplyModifiedProperties(); - LTCGI_Controller.Singleton?.UpdateMaterials(); - } - } - } - #endif -}
\ No newline at end of file |
