diff --git a/Assets/DONT TOUCH/Enums/BlockType.cs b/Assets/DONT TOUCH/Enums/BlockType.cs index 0f7f8ad..fdcb9bf 100644 --- a/Assets/DONT TOUCH/Enums/BlockType.cs +++ b/Assets/DONT TOUCH/Enums/BlockType.cs @@ -8,4 +8,5 @@ Schematic = 5, Teleport = 6, Locker = 7, + AudioSource = 8, } diff --git a/Assets/DONT TOUCH/Scripts/Schematic.cs b/Assets/DONT TOUCH/Scripts/Schematic.cs index 3784791..04ccb36 100644 --- a/Assets/DONT TOUCH/Scripts/Schematic.cs +++ b/Assets/DONT TOUCH/Scripts/Schematic.cs @@ -80,6 +80,22 @@ public void CompileSchematic() { "Intensity", lightComponent.intensity }, { "Range", lightComponent.range }, { "Shadows", lightComponent.shadows != LightShadows.None }, + { "Static", lightComponent.gameObject.isStatic } + }; + } + // Audio Source + else if (obj.TryGetComponent(out AudioSource source)) + { + block.BlockType = BlockType.AudioSource; + block.Properties = new Dictionary + { + { "PlayOnAwake", source.playOnAwake }, + { "AudioPath", source.clip.name }, + { "Loop", source.loop }, + { "Volume", source.volume }, + { "IsSpatial", source.spatialBlend is 1f }, + { "MinDistance", source.minDistance }, + { "MaxDistance", source.maxDistance }, }; } else // Empty transform diff --git a/Assets/DONT TOUCH/Scripts/SchematicHelper/SchematicHelper.cs b/Assets/DONT TOUCH/Scripts/SchematicHelper/SchematicHelper.cs new file mode 100644 index 0000000..07de243 --- /dev/null +++ b/Assets/DONT TOUCH/Scripts/SchematicHelper/SchematicHelper.cs @@ -0,0 +1,78 @@ +using UnityEditor; + +[InitializeOnLoad] +public class SchematicHelper : EditorWindow +{ + static SchematicHelper() + { + + } + + #region Selection + [MenuItem("MapEditorReborn Tools/Selection/Set Static")] + private static void SetStaticSelected() + { + foreach (var go in Selection.gameObjects) + { + go.isStatic = true; + } + } + + [MenuItem("MapEditorReborn Tools/Selection/Set Dynamic")] + private static void SetDynamicSelected() + { + foreach (var go in Selection.gameObjects) + { + go.isStatic = false; + } + } + + [MenuItem("MapEditorReborn Tools/Selection/Set Collidable")] + private static void SetCollidableSelected() + { + foreach (var go in Selection.gameObjects) + { + if (go.TryGetComponent(out PrimitiveComponent collider)) + { + collider.Collidable = true; + } + } + } + + [MenuItem("MapEditorReborn Tools/Selection/Set Non-Collidable")] + private static void SetNonCollidableSelected() + { + foreach (var go in Selection.gameObjects) + { + if (go.TryGetComponent(out PrimitiveComponent collider)) + { + collider.Collidable = false; + } + } + } + + [MenuItem("MapEditorReborn Tools/Selection/Set Visible")] + private static void SetVisibleSelected() + { + foreach (var go in Selection.gameObjects) + { + if (go.TryGetComponent(out PrimitiveComponent collider)) + { + collider.Visible = true; + } + } + } + + [MenuItem("MapEditorReborn Tools/Selection/Set Invisible")] + private static void SetInvisibleSelected() + { + foreach (var go in Selection.gameObjects) + { + if (go.TryGetComponent(out PrimitiveComponent collider)) + { + collider.Visible = false; + } + } + } + #endregion +} \ No newline at end of file diff --git a/Assets/Resources/Blocks/Audio Source.prefab b/Assets/Resources/Blocks/Audio Source.prefab new file mode 100644 index 0000000..392e16b --- /dev/null +++ b/Assets/Resources/Blocks/Audio Source.prefab @@ -0,0 +1,130 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7279034928316163286 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7136889950038605761} + - component: {fileID: 451896642418324752} + m_Layer: 0 + m_Name: Audio Source + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7136889950038605761 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7279034928316163286} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &451896642418324752 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7279034928316163286} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 9 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4