Decompiled source of CreativeContentConverter v1.0.2
LethalSDK.dll
Decompiled 8 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using DunGen; using DunGen.Adapters; using GameNetcodeStuff; using HarmonyLib; using LethalLevelLoader; using LethalSDK.Component; using LethalSDK.Conversions; using LethalSDK.Converter; using LethalSDK.ScriptableObjects; using LethalSDK.Utils; using Microsoft.CodeAnalysis; using Unity.AI.Navigation; using Unity.Netcode; using UnityEditor; using UnityEditor.Animations; using UnityEditor.Events; using UnityEditor.SceneManagement; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("LethalSDK")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A Unity Plugin to assist with custom content creation in Lethal Company.")] [assembly: AssemblyFileVersion("0.0.0.0")] [assembly: AssemblyInformationalVersion("0.0.0+fe2a3c892a1e484c7acd98a53677698bd133e93d")] [assembly: AssemblyProduct("LethalSDK")] [assembly: AssemblyTitle("LethalSDK")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class PlayerShip : MonoBehaviour { public readonly Vector3 shipPosition = new Vector3(-17.5f, 5.75f, -16.55f); private void Start() { Object.Destroy((Object)(object)this); } } public class TestClass { public static string TransferPersistentCalls(Object item, in string fromName, in string toName, in bool removeOldCalls = false, in bool dryRun = true) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) SerializedObject val = new SerializedObject(item); string name2 = fromName.Trim(); SerializedProperty val2 = val.FindProperty($"{GetValidFieldName(in name2)}.m_PersistentCalls.m_Calls"); name2 = toName.Trim(); SerializedProperty val3 = val.FindProperty($"{GetValidFieldName(in name2)}.m_PersistentCalls.m_Calls"); int arraySize = val3.arraySize; string text = string.Empty; for (int i = 0; i < val2.arraySize; i++) { SerializedProperty callProperty2 = val2.GetArrayElementAtIndex(i); SerializedProperty val4 = GetCallTarget(in callProperty2); SerializedProperty val5 = GetCallMethodName(in callProperty2); SerializedProperty val6 = GetCallMode(in callProperty2); SerializedProperty val7 = GetCallState(in callProperty2); SerializedProperty argsProperty2 = GetCallArgs(in callProperty2); SerializedProperty val8 = GetCallObjectArg(in argsProperty2); SerializedProperty val9 = GetCallObjectArgType(in argsProperty2); SerializedProperty val10 = GetCallIntArg(in argsProperty2); SerializedProperty val11 = GetCallFloatArg(in argsProperty2); SerializedProperty val12 = GetCallStringArg(in argsProperty2); SerializedProperty val13 = GetCallBoolArg(in argsProperty2); text += $"At index {i}:\n"; text += $"\t{val4.displayName}: {val4.propertyType} = {val4.objectReferenceValue}\n"; text += $"\t{val5.displayName}: {val5.propertyType} = {val5.stringValue}\n"; text += $"\t{val6.displayName}: {val6.propertyType} = {val6.enumValueIndex}\n"; text += $"\t{val7.displayName}: {val7.propertyType} = {val7.enumValueIndex}\n"; text += $"\t{argsProperty2.displayName}: {argsProperty2.propertyType} =\n"; text += $"\t\t{val8.displayName}: {val8.propertyType} = {val8.objectReferenceValue}\n"; text += $"\t\t{val9.displayName}: {val9.propertyType} = {val9.stringValue}\n"; text += $"\t\t{val10.displayName}: {val10.propertyType} = {val10.intValue}\n"; text += $"\t\t{val11.displayName}: {val11.propertyType} = {val11.floatValue}\n"; text += $"\t\t{val12.displayName}: {val12.propertyType} = {val12.stringValue}\n"; text += $"\t\t{val13.displayName}: {val13.propertyType} = {val13.boolValue}\n\n"; if (dryRun) { continue; } SerializedProperty arrayElementAtIndex; if (arraySize > 0) { arrayElementAtIndex = val3.GetArrayElementAtIndex(i); if (SerializedProperty.DataEquals(callProperty2, arrayElementAtIndex)) { text = text + "(Already present in " + toName + ".)\n\n"; continue; } } val3.InsertArrayElementAtIndex(arraySize + i); arrayElementAtIndex = val3.GetArrayElementAtIndex(arraySize + i); SerializedProperty val14 = GetCallTarget(in arrayElementAtIndex); SerializedProperty val15 = GetCallMethodName(in arrayElementAtIndex); SerializedProperty val16 = GetCallMode(in arrayElementAtIndex); SerializedProperty val17 = GetCallState(in arrayElementAtIndex); SerializedProperty argsProperty3 = GetCallArgs(in arrayElementAtIndex); SerializedProperty val18 = GetCallObjectArg(in argsProperty3); SerializedProperty val19 = GetCallObjectArgType(in argsProperty3); SerializedProperty val20 = GetCallIntArg(in argsProperty3); SerializedProperty val21 = GetCallFloatArg(in argsProperty3); SerializedProperty val22 = GetCallStringArg(in argsProperty3); SerializedProperty val23 = GetCallBoolArg(in argsProperty3); val14.objectReferenceValue = val4.objectReferenceValue; val15.stringValue = val5.stringValue; val16.enumValueIndex = val6.enumValueIndex; val17.enumValueIndex = val7.enumValueIndex; val18.objectReferenceValue = val8.objectReferenceValue; val19.stringValue = val9.stringValue; val20.intValue = val10.intValue; val21.floatValue = val11.floatValue; val22.stringValue = val12.stringValue; val23.boolValue = val13.boolValue; } if (!dryRun & removeOldCalls) { val2.ClearArray(); } val.ApplyModifiedProperties(); return text; static SerializedProperty GetCallArgs(in SerializedProperty callProperty) { SerializedProperty obj7 = callProperty; return (obj7 != null) ? obj7.FindPropertyRelative("m_Arguments") : null; } static SerializedProperty GetCallBoolArg(in SerializedProperty argsProperty) { SerializedProperty obj = argsProperty; return (obj != null) ? obj.FindPropertyRelative("m_BoolArgument") : null; } static SerializedProperty GetCallFloatArg(in SerializedProperty argsProperty) { SerializedProperty obj3 = argsProperty; return (obj3 != null) ? obj3.FindPropertyRelative("m_FloatArgument") : null; } static SerializedProperty GetCallIntArg(in SerializedProperty argsProperty) { SerializedProperty obj4 = argsProperty; return (obj4 != null) ? obj4.FindPropertyRelative("m_IntArgument") : null; } static SerializedProperty GetCallMethodName(in SerializedProperty callProperty) { SerializedProperty obj10 = callProperty; return (obj10 != null) ? obj10.FindPropertyRelative("m_MethodName") : null; } static SerializedProperty GetCallMode(in SerializedProperty callProperty) { SerializedProperty obj9 = callProperty; return (obj9 != null) ? obj9.FindPropertyRelative("m_Mode") : null; } static SerializedProperty GetCallObjectArg(in SerializedProperty argsProperty) { SerializedProperty obj6 = argsProperty; return (obj6 != null) ? obj6.FindPropertyRelative("m_ObjectArgument") : null; } static SerializedProperty GetCallObjectArgType(in SerializedProperty argsProperty) { SerializedProperty obj5 = argsProperty; return (obj5 != null) ? obj5.FindPropertyRelative("m_ObjectArgumentAssemblyTypeName") : null; } static SerializedProperty GetCallState(in SerializedProperty callProperty) { SerializedProperty obj8 = callProperty; return (obj8 != null) ? obj8.FindPropertyRelative("m_CallState") : null; } static SerializedProperty GetCallStringArg(in SerializedProperty argsProperty) { SerializedProperty obj2 = argsProperty; return (obj2 != null) ? obj2.FindPropertyRelative("m_StringArgument") : null; } static SerializedProperty GetCallTarget(in SerializedProperty callProperty) { SerializedProperty obj11 = callProperty; return (obj11 != null) ? obj11.FindPropertyRelative("m_Target") : null; } string GetValidFieldName(in string name) { object obj12 = ((object)item).GetType().GetField(name, BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(item); if (!(obj12 is UnityEventBase)) { throw new FieldAccessException("Incorrect event name."); } return name; } } } public class CubemapTextureBuilder : EditorWindow { private Texture2D[] textures = (Texture2D[])(object)new Texture2D[6]; private string[] labels = new string[6] { "Right", "Left", "Top", "Bottom", "Front", "Back" }; private TextureFormat[] HDRFormats; private Vector2Int[] placementRects; [MenuItem("LethalSDK/Cubemap Builder", false, 100)] public static void OpenWindow() { EditorWindow.GetWindow<CubemapTextureBuilder>(); } private Texture2D UpscaleTexture(Texture2D original, int targetWidth, int targetHeight) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) RenderTexture val = (RenderTexture.active = RenderTexture.GetTemporary(targetWidth, targetHeight)); Graphics.Blit((Texture)(object)original, val); Texture2D val2 = new Texture2D(targetWidth, targetHeight); val2.ReadPixels(new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), 0, 0); val2.Apply(); RenderTexture.ReleaseTemporary(val); return val2; } private void OnGUI() { //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Expected O, but got Unknown for (int i = 0; i < 6; i++) { ref Texture2D reference = ref textures[i]; Object obj = EditorGUILayout.ObjectField(labels[i], (Object)(object)textures[i], typeof(Texture2D), false, Array.Empty<GUILayoutOption>()); reference = (Texture2D)(object)((obj is Texture2D) ? obj : null); } if (!GUILayout.Button("Build Cubemap", Array.Empty<GUILayoutOption>())) { return; } if (textures.Any((Texture2D t) => (Object)(object)t == (Object)null)) { EditorUtility.DisplayDialog("Cubemap Builder Error", "One or more texture is missing.", "Ok"); return; } int size = ((Texture)textures[0]).width; if (textures.Any((Texture2D t) => ((Texture)t).width != size || ((Texture)t).height != size)) { EditorUtility.DisplayDialog("Cubemap Builder Error", "All the textures need to be the same size and square.", "Ok"); return; } bool flag = HDRFormats.Any((TextureFormat f) => f == textures[0].format); string[] array = textures.Select((Texture2D t) => AssetDatabase.GetAssetPath((Object)(object)t)).ToArray(); string text = EditorUtility.SaveFilePanel("Save Cubemap", Path.GetDirectoryName(array[0]), "Cubemap", flag ? "exr" : "png"); if (!string.IsNullOrEmpty(text)) { bool[] array2 = textures.Select((Texture2D t) => ((Texture)t).isReadable).ToArray(); TextureImporter[] array3 = array.Select(delegate(string p) { AssetImporter atPath2 = AssetImporter.GetAtPath(p); return (TextureImporter)(object)((atPath2 is TextureImporter) ? atPath2 : null); }).ToArray(); TextureImporter[] array4 = array3; foreach (TextureImporter val in array4) { val.isReadable = true; } AssetDatabase.Refresh(); string[] array5 = array; foreach (string text2 in array5) { AssetDatabase.ImportAsset(text2); } Texture2D val2 = new Texture2D(size * 4, size * 3, (TextureFormat)(flag ? 20 : 4), false); for (int l = 0; l < 6; l++) { val2.SetPixels(((Vector2Int)(ref placementRects[l])).x * size, ((Vector2Int)(ref placementRects[l])).y * size, size, size, textures[l].GetPixels(0)); } val2.Apply(false); byte[] bytes = (flag ? ImageConversion.EncodeToEXR(val2) : ImageConversion.EncodeToPNG(val2)); File.WriteAllBytes(text, bytes); Object.Destroy((Object)(object)val2); for (int m = 0; m < 6; m++) { array3[m].isReadable = array2[m]; } text = text.Remove(0, Application.dataPath.Length - 6); AssetDatabase.ImportAsset(text); AssetImporter atPath = AssetImporter.GetAtPath(text); TextureImporter val3 = (TextureImporter)(object)((atPath is TextureImporter) ? atPath : null); val3.textureShape = (TextureImporterShape)2; val3.sRGBTexture = false; val3.generateCubemap = (TextureImporterGenerateCubemap)5; string[] array6 = array; foreach (string text3 in array6) { AssetDatabase.ImportAsset(text3); } AssetDatabase.ImportAsset(text); AssetDatabase.Refresh(); } } public CubemapTextureBuilder() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) TextureFormat[] array = new TextureFormat[9]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); HDRFormats = (TextureFormat[])(object)array; placementRects = (Vector2Int[])(object)new Vector2Int[6] { new Vector2Int(2, 1), new Vector2Int(0, 1), new Vector2Int(1, 2), new Vector2Int(1, 0), new Vector2Int(1, 1), new Vector2Int(3, 1) }; ((EditorWindow)this)..ctor(); } } [CustomEditor(typeof(PlayerShip))] public class PlayerShipEditor : Editor { public override void OnInspectorGUI() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((Editor)this).OnInspectorGUI(); PlayerShip playerShip = (PlayerShip)(object)((Editor)this).target; if (((Component)playerShip).transform.position != playerShip.shipPosition) { ((Component)playerShip).transform.position = playerShip.shipPosition; } } } namespace LethalSDK { public class SubWindow : EditorWindow { public static LEConverterWindow MainWindow; public static LEConverterWindowSettings _settings; public static LEConverterWindowSettings MainWindowSettings { get { if ((Object)(object)_settings == (Object)null) { string[] array = AssetDatabase.FindAssets("t:LEConverterWindowSettings"); string text = AssetDatabase.GUIDToAssetPath(array[0]); _settings = AssetDatabase.LoadAssetAtPath<LEConverterWindowSettings>(text); } return _settings; } } public virtual void LoadSubWindow(LEConverterWindow leConverterWindow) { MainWindow = leConverterWindow; } } public static class StringExtension { public static string Bold(this string str) { return "<b>" + str + "</b>"; } public static string Color(this string str, string clr) { return $"<color={clr}>{str}</color>"; } public static string Italic(this string str) { return "<i>" + str + "</i>"; } public static string Size(this string str, int size) { return $"<size={size}>{str}</size>"; } public static string RemoveWhitespace(this string input) { return new string((from c in input.ToCharArray() where !char.IsWhiteSpace(c) select c).ToArray()); } public static string SkipToLetters(this string input) { return new string(input.SkipWhile((char c) => !char.IsLetter(c)).ToArray()); } public static string StripSpecialCharacters(this string input) { string text = string.Empty; for (int i = 0; i < input.Length; i++) { char c = input[i]; if ((!".,?!@#$%^&*()_+-=';:'\"".ToCharArray().Contains(c) && char.IsLetterOrDigit(c)) || c.ToString() == " ") { text += c; } } return text; } public static string FirstToUpper(this string input) { if (string.IsNullOrEmpty(input)) { return string.Empty; } char[] array = input.ToCharArray(); if (char.IsLetter(array[0])) { array[0] = char.ToUpper(array[0]); } return new string(array); } public static string UpperFirstLetters(this string input) { if (string.IsNullOrEmpty(input)) { return string.Empty; } bool flag = false; char[] array = input.ToCharArray(); for (int i = 0; i < array.Length; i++) { if (!char.IsLetter(array[i])) { flag = true; } if (char.IsLetter(array[i]) && flag) { array[i] = char.ToUpper(array[i]); flag = false; } } return new string(array); } public static string ToBold(this string input) { return new string("<b>" + input + "</b>"); } public static string Colorize(this string input) { string text = "#FFFFFF"; return new string("<color=" + text + ">" + input + "</color>"); } public static string Colorize(this string input, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) string text = "#" + ColorUtility.ToHtmlStringRGB(color); return new string("<color=" + text + ">" + input + "</color>"); } } } namespace LethalSDK.Utils { public static class AssetGatherDialog { public static Dictionary<string, AudioClip> audioClips = new Dictionary<string, AudioClip>(); public static Dictionary<string, (AudioMixer, AudioMixerGroup[])> audioMixers = new Dictionary<string, (AudioMixer, AudioMixerGroup[])>(); public static Dictionary<string, Sprite> sprites = new Dictionary<string, Sprite>(); } [Serializable] public class SerializableVersion { public int Major = 1; public int Minor = 0; public int Build = 0; public int Revision = 0; public SerializableVersion(int major, int minor, int build, int revision) { Major = major; Minor = minor; Build = build; Revision = revision; } public Version ToVersion() { return new Version(Major, Minor, Build, Revision); } public override string ToString() { return $"{Major}.{Minor}.{Build}.{Revision}"; } } [Serializable] public class CurveContainer { public AnimationCurve curve; public static string SerializeCurve(AnimationCurve curve) { CurveContainer curveContainer = new CurveContainer { curve = curve }; return JsonUtility.ToJson((object)curveContainer); } public static AnimationCurve DeserializeCurve(string json) { CurveContainer curveContainer = JsonUtility.FromJson<CurveContainer>(json); return curveContainer.curve; } } public static class NetworkDataManager { public static Dictionary<ulong, SI_NetworkData> NetworkData = new Dictionary<ulong, SI_NetworkData>(); } public class SI_NetworkData : NetworkBehaviour { public StringStringPair[] data = new StringStringPair[0]; [HideInInspector] public string serializedData = string.Empty; public string datacache = string.Empty; public UnityEvent dataChangeEvent = new UnityEvent(); public void Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (dataChangeEvent != null) { dataChangeEvent.AddListener(new UnityAction(OnDataChanged)); } } public void Update() { if (datacache != serializedData && dataChangeEvent != null) { dataChangeEvent.Invoke(); } } public override void OnNetworkSpawn() { NetworkDataManager.NetworkData.Add(((NetworkBehaviour)this).NetworkObjectId, this); } public override void OnNetworkDespawn() { NetworkDataManager.NetworkData.Remove(((NetworkBehaviour)this).NetworkObjectId); } public virtual void OnDataChanged() { datacache = serializedData; } public override void OnDestroy() { if (dataChangeEvent != null) { ((UnityEventBase)dataChangeEvent).RemoveAllListeners(); } } public virtual StringStringPair[] getData() { return (from s in serializedData.Split(';') select s.Split(',') into split where split.Length == 2 select new StringStringPair(split[0], split[1])).ToArray(); } public virtual void setData(string datastring) { if (!datastring.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); } else { serializedData = datastring; } } public virtual void setData(StringStringPair[] dataarray) { string text = string.Join(";", dataarray.Select((StringStringPair p) => p._string1 + "," + p._string2)); if (!text.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); } else { serializedData = text; } } public virtual void addData(string datastring) { if (!datastring.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); return; } serializedData += datastring; serializedData = serializedData.Replace(";;", string.Empty); if (serializedData.StartsWith(";")) { serializedData = serializedData.Substring(1); } if (serializedData.EndsWith(";")) { serializedData = serializedData.Substring(0, serializedData.Length - 1); } } public virtual void addData(StringStringPair[] dataarray) { string text = string.Join(";", dataarray.Select((StringStringPair p) => p._string1 + "," + p._string2)).Insert(0, ";"); if (!text.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); return; } serializedData += text; serializedData = serializedData.Replace(";;", string.Empty); if (serializedData.StartsWith(";")) { serializedData = serializedData.Substring(1); } if (serializedData.EndsWith(";")) { serializedData = serializedData.Substring(0, serializedData.Length - 1); } } public virtual void delData(string datastring) { if (!datastring.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); return; } if (!serializedData.Contains(datastring)) { Debug.Log((object)"Datastring doesn't exist in serializedData."); return; } serializedData = serializedData.Replace(datastring, string.Empty); serializedData = serializedData.Replace(";;", string.Empty); if (serializedData.StartsWith(";")) { serializedData = serializedData.Substring(1); } if (serializedData.EndsWith(";")) { serializedData = serializedData.Substring(0, serializedData.Length - 1); } } public virtual void delData(StringStringPair[] dataarray) { string text = string.Join(";", dataarray.Select((StringStringPair p) => p._string1 + "," + p._string2)).Insert(0, ";"); if (!text.Contains(',')) { Debug.LogWarning((object)"Invalid datastring format."); return; } if (!serializedData.Contains(text)) { Debug.Log((object)"Datastring doesn't exist in serializedData."); return; } serializedData = serializedData.Replace(text, string.Empty); serializedData = serializedData.Replace(";;", string.Empty); if (serializedData.StartsWith(";")) { serializedData = serializedData.Substring(1); } if (serializedData.EndsWith(";")) { serializedData = serializedData.Substring(0, serializedData.Length - 1); } } } [Serializable] public struct StringIntPair { public string _string; public int _int; public StringIntPair(string _string, int _int) { this._string = _string.RemoveNonAlphanumeric(1); this._int = Mathf.Clamp(_int, 0, 100); } } [Serializable] public struct StringStringPair { public string _string1; public string _string2; public StringStringPair(string _string1, string _string2) { this._string1 = _string1.RemoveNonAlphanumeric(1); this._string2 = _string2.RemoveNonAlphanumeric(1); } } [Serializable] public struct IntIntPair { public int _int1; public int _int2; public IntIntPair(int _int1, int _int2) { this._int1 = _int1; this._int2 = _int2; } } [Serializable] public struct DungeonFlowPair { public int ID; [Range(0f, 300f)] public int Rarity; public DungeonFlowPair(int id, int rarity) { ID = id; Rarity = Mathf.Clamp(rarity, 0, 300); } } [Serializable] public struct SpawnableScrapPair { public string ObjectName; [Range(0f, 100f)] public int SpawnWeight; public SpawnableScrapPair(string objectName, int spawnWeight) { ObjectName = objectName.RemoveNonAlphanumeric(1); SpawnWeight = Mathf.Clamp(spawnWeight, 0, 100); } } [Serializable] public struct SpawnableMapObjectPair { public string ObjectName; public bool SpawnFacingAwayFromWall; public AnimationCurve SpawnRate; public SpawnableMapObjectPair(string objectName, bool spawnFacingAwayFromWall, AnimationCurve spawnRate) { ObjectName = objectName.RemoveNonAlphanumeric(1); SpawnFacingAwayFromWall = spawnFacingAwayFromWall; SpawnRate = spawnRate; } } [Serializable] public struct SpawnableOutsideObjectPair { public string ObjectName; public AnimationCurve SpawnRate; public SpawnableOutsideObjectPair(string objectName, AnimationCurve spawnRate) { ObjectName = objectName.RemoveNonAlphanumeric(1); SpawnRate = spawnRate; } } [Serializable] public struct SpawnableEnemiesPair { public string EnemyName; [Range(0f, 100f)] public int SpawnWeight; public SpawnableEnemiesPair(string enemyName, int spawnWeight) { EnemyName = enemyName.RemoveNonAlphanumeric(1); SpawnWeight = Mathf.Clamp(spawnWeight, 0, 100); } } [Serializable] public struct ScrapSpawnChancePerScene { public string SceneName; [Range(0f, 100f)] public int SpawnWeight; public ScrapSpawnChancePerScene(string sceneName, int spawnWeight) { SceneName = sceneName.RemoveNonAlphanumeric(1); SpawnWeight = Mathf.Clamp(spawnWeight, 0, 100); } } [Serializable] public struct ScrapInfoPair { public string ScrapPath; public Scrap Scrap; public ScrapInfoPair(string scrapPath, Scrap scrap) { ScrapPath = scrapPath.RemoveNonAlphanumeric(4); Scrap = scrap; } } [Serializable] public struct AudioClipInfoPair { public string AudioClipName; [HideInInspector] public string AudioClipPath; [SerializeField] public AudioClip AudioClip; public AudioClipInfoPair(string audioClipName, string audioClipPath) { AudioClipName = audioClipName.RemoveNonAlphanumeric(1); AudioClipPath = audioClipPath.RemoveNonAlphanumeric(4); AudioClip = null; } } [Serializable] public struct PlanetPrefabInfoPair { public string PlanetPrefabName; [HideInInspector] public string PlanetPrefabPath; [SerializeField] public GameObject PlanetPrefab; public PlanetPrefabInfoPair(string planetPrefabName, string planetPrefabPath) { PlanetPrefabName = planetPrefabName.RemoveNonAlphanumeric(1); PlanetPrefabPath = planetPrefabPath.RemoveNonAlphanumeric(4); PlanetPrefab = null; } } [Serializable] public struct PrefabInfoPair { public string PrefabName; [HideInInspector] public string PrefabPath; [SerializeField] public GameObject Prefab; public PrefabInfoPair(string prefabName, string prefabPath) { PrefabName = prefabName.RemoveNonAlphanumeric(1); PrefabPath = prefabPath.RemoveNonAlphanumeric(4); Prefab = null; } } [Serializable] public struct RandomWeatherPair { public LevelWeatherType Weather; [Tooltip("Thunder Frequency, Flooding speed or minimum initial enemies in eclipses")] public int WeatherVariable1; [Tooltip("Flooding offset when Weather is Flooded")] public int WeatherVariable2; public RandomWeatherPair(LevelWeatherType weather, int weatherVariable1, int weatherVariable2) { Weather = weather; WeatherVariable1 = weatherVariable1; WeatherVariable2 = weatherVariable2; } } public enum LevelWeatherType { None = -1, DustClouds, Rainy, Stormy, Foggy, Flooded, Eclipsed } public class SpawnPrefab { private static SpawnPrefab _instance; public GameObject waterSurface; public static SpawnPrefab Instance { get { if (_instance == null) { _instance = new SpawnPrefab(); } return _instance; } } } public static class TypeExtensions { public enum removeType { Normal, Serializable, Keyword, Path, SerializablePath } public static readonly Dictionary<removeType, string> regexes = new Dictionary<removeType, string> { { removeType.Normal, "[^a-zA-Z0-9 ,.!?_-]" }, { removeType.Serializable, "[^a-zA-Z0-9 .!_-]" }, { removeType.Keyword, "[^a-zA-Z0-9._-]" }, { removeType.Path, "[^a-zA-Z0-9 ,.!_/-]" }, { removeType.SerializablePath, "[^a-zA-Z0-9 .!_/-]" } }; public static string RemoveNonAlphanumeric(this string input) { if (input != null) { return Regex.Replace(input, regexes[removeType.Normal], string.Empty); } return string.Empty; } public static string[] RemoveNonAlphanumeric(this string[] input) { if (input != null) { for (int i = 0; i < input.Length; i++) { input[i] = Regex.Replace(input[i], regexes[removeType.Normal], string.Empty); } return input; } return new string[0]; } public static string RemoveNonAlphanumeric(this string input, removeType removeType = removeType.Normal) { if (input != null) { return Regex.Replace(input, regexes[removeType], string.Empty); } return string.Empty; } public static string[] RemoveNonAlphanumeric(this string[] input, removeType removeType = removeType.Normal) { if (input != null) { for (int i = 0; i < input.Length; i++) { input[i] = Regex.Replace(input[i], regexes[removeType], string.Empty); } return input; } return new string[0]; } public static string RemoveNonAlphanumeric(this string input, int removeType = 0) { if (input != null) { return Regex.Replace(input, regexes[(removeType)removeType], string.Empty); } return string.Empty; } public static string[] RemoveNonAlphanumeric(this string[] input, int removeType = 0) { if (input != null) { for (int i = 0; i < input.Length; i++) { input[i] = Regex.Replace(input[i], regexes[(removeType)removeType], string.Empty); } return input; } return new string[0]; } } } namespace LethalSDK.ScriptableObjects { [CreateAssetMenu(fileName = "AssetBank", menuName = "LethalSDK/Asset Bank")] public class AssetBank : ScriptableObject { [Header("Audio Clips")] [SerializeField] private AudioClipInfoPair[] _audioClips = new AudioClipInfoPair[0]; [SerializeField] public PlanetPrefabInfoPair[] _planetPrefabs = new PlanetPrefabInfoPair[0]; [SerializeField] private PrefabInfoPair[] _networkPrefabs = new PrefabInfoPair[0]; [HideInInspector] public string serializedAudioClips; [HideInInspector] public string serializedPlanetPrefabs; [HideInInspector] public string serializedNetworkPrefabs; private void OnValidate() { for (int i = 0; i < _audioClips.Length; i++) { _audioClips[i].AudioClipName = _audioClips[i].AudioClipName.RemoveNonAlphanumeric(1); _audioClips[i].AudioClipPath = _audioClips[i].AudioClipPath.RemoveNonAlphanumeric(4); } for (int j = 0; j < _planetPrefabs.Length; j++) { _planetPrefabs[j].PlanetPrefabName = _planetPrefabs[j].PlanetPrefabName.RemoveNonAlphanumeric(1); _planetPrefabs[j].PlanetPrefabPath = _planetPrefabs[j].PlanetPrefabPath.RemoveNonAlphanumeric(4); } for (int k = 0; k < _networkPrefabs.Length; k++) { _networkPrefabs[k].PrefabName = _networkPrefabs[k].PrefabName.RemoveNonAlphanumeric(1); _networkPrefabs[k].PrefabPath = _networkPrefabs[k].PrefabPath.RemoveNonAlphanumeric(4); } serializedAudioClips = string.Join(";", _audioClips.Select((AudioClipInfoPair p) => ((p.AudioClipName.Length != 0) ? p.AudioClipName : (((Object)(object)p.AudioClip != (Object)null) ? ((Object)p.AudioClip).name : "")) + "," + AssetDatabase.GetAssetPath((Object)(object)p.AudioClip))); serializedPlanetPrefabs = string.Join(";", _planetPrefabs.Select((PlanetPrefabInfoPair p) => ((p.PlanetPrefabName.Length != 0) ? p.PlanetPrefabName : (((Object)(object)p.PlanetPrefab != (Object)null) ? ((Object)p.PlanetPrefab).name : "")) + "," + AssetDatabase.GetAssetPath((Object)(object)p.PlanetPrefab))); serializedNetworkPrefabs = string.Join(";", _networkPrefabs.Select((PrefabInfoPair p) => ((p.PrefabName.Length != 0) ? p.PrefabName : (((Object)(object)p.Prefab != (Object)null) ? ((Object)p.Prefab).name : "")) + "," + AssetDatabase.GetAssetPath((Object)(object)p.Prefab))); } public AudioClipInfoPair[] AudioClips() { if (serializedAudioClips != null) { return (from s in serializedAudioClips.Split(';') select s.Split(',') into split where split.Length == 2 select new AudioClipInfoPair(split[0], split[1])).ToArray(); } return new AudioClipInfoPair[0]; } public bool HaveAudioClip(string audioClipName) { if (serializedAudioClips != null) { return AudioClips().Any((AudioClipInfoPair a) => a.AudioClipName == audioClipName); } return false; } public string AudioClipPath(string audioClipName) { if (serializedAudioClips != null) { return AudioClips().First((AudioClipInfoPair c) => c.AudioClipName == audioClipName).AudioClipPath; } return string.Empty; } public Dictionary<string, string> AudioClipsDictionary() { if (serializedAudioClips != null) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); AudioClipInfoPair[] audioClips = _audioClips; for (int i = 0; i < audioClips.Length; i++) { AudioClipInfoPair audioClipInfoPair = audioClips[i]; dictionary.Add(audioClipInfoPair.AudioClipName, audioClipInfoPair.AudioClipPath); } return dictionary; } return new Dictionary<string, string>(); } public PlanetPrefabInfoPair[] PlanetPrefabs() { if (serializedPlanetPrefabs != null) { return (from s in serializedPlanetPrefabs.Split(';') select s.Split(',') into split where split.Length == 2 select new PlanetPrefabInfoPair(split[0], split[1])).ToArray(); } return new PlanetPrefabInfoPair[0]; } public bool HavePlanetPrefabs(string planetPrefabName) { if (serializedPlanetPrefabs != null) { return PlanetPrefabs().Any((PlanetPrefabInfoPair a) => a.PlanetPrefabName == planetPrefabName); } return false; } public string PlanetPrefabsPath(string planetPrefabName) { if (serializedPlanetPrefabs != null) { return PlanetPrefabs().First((PlanetPrefabInfoPair c) => c.PlanetPrefabName == planetPrefabName).PlanetPrefabPath; } return string.Empty; } public Dictionary<string, string> PlanetPrefabsDictionary() { if (serializedPlanetPrefabs != null) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); PlanetPrefabInfoPair[] planetPrefabs = _planetPrefabs; for (int i = 0; i < planetPrefabs.Length; i++) { PlanetPrefabInfoPair planetPrefabInfoPair = planetPrefabs[i]; dictionary.Add(planetPrefabInfoPair.PlanetPrefabName, planetPrefabInfoPair.PlanetPrefabPath); } return dictionary; } return new Dictionary<string, string>(); } public PrefabInfoPair[] NetworkPrefabs() { if (serializedNetworkPrefabs != null) { return (from s in serializedNetworkPrefabs.Split(';') select s.Split(',') into split where split.Length == 2 select new PrefabInfoPair(split[0], split[1])).ToArray(); } return new PrefabInfoPair[0]; } public bool HaveNetworkPrefabs(string networkPrefabName) { if (serializedNetworkPrefabs != null) { return NetworkPrefabs().Any((PrefabInfoPair a) => a.PrefabName == networkPrefabName); } return false; } public string NetworkPrefabsPath(string networkPrefabName) { if (serializedNetworkPrefabs != null) { return NetworkPrefabs().First((PrefabInfoPair c) => c.PrefabName == networkPrefabName).PrefabPath; } return string.Empty; } public Dictionary<string, string> NetworkPrefabsDictionary() { if (serializedNetworkPrefabs != null) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); PrefabInfoPair[] networkPrefabs = _networkPrefabs; for (int i = 0; i < networkPrefabs.Length; i++) { PrefabInfoPair prefabInfoPair = networkPrefabs[i]; dictionary.Add(prefabInfoPair.PrefabName, prefabInfoPair.PrefabPath); } return dictionary; } return new Dictionary<string, string>(); } } [CreateAssetMenu(fileName = "ModManifest", menuName = "LethalSDK/Mod Manifest")] public class ModManifest : ScriptableObject { public string modName = "NewMod"; [Space] [SerializeField] private SerializableVersion version = new SerializableVersion(0, 0, 0, 0); [HideInInspector] public string serializedVersion; [Space] public string author = "Author"; [Space] [TextArea(5, 15)] public string description = "Mod Description"; [Space] [Header("Content")] public Scrap[] scraps = new Scrap[0]; public Moon[] moons = new Moon[0]; [Space] public AssetBank assetBank; private void OnValidate() { serializedVersion = version.ToString(); } public SerializableVersion GetVersion() { int[] array = ((serializedVersion != null) ? serializedVersion.Split('.').Select(int.Parse).ToArray() : new int[4]); return new SerializableVersion(array[0], array[1], array[2], array[3]); } } [CreateAssetMenu(fileName = "New Moon", menuName = "LethalSDK/Moon")] public class Moon : ScriptableObject { public string MoonName = "NewMoon"; public string[] RequiredBundles; public string[] IncompatibleBundles; public bool IsEnabled = true; public bool IsHidden = false; public bool IsLocked = false; [Header("Info")] public string OrbitPrefabName = "Moon1"; public bool SpawnEnemiesAndScrap = true; public string PlanetName = "New Moon"; public GameObject MainPrefab; [TextArea(5, 15)] public string PlanetDescription; [TextArea(5, 15)] public string PlanetLore; public VideoClip PlanetVideo; public string RiskLevel = "X"; [Range(0f, 16f)] public float TimeToArrive = 1f; [Header("Time")] [Range(0.1f, 5f)] public float DaySpeedMultiplier = 1f; public bool PlanetHasTime = true; [SerializeField] private RandomWeatherPair[] _RandomWeatherTypes = new RandomWeatherPair[6] { new RandomWeatherPair(LevelWeatherType.None, 0, 0), new RandomWeatherPair(LevelWeatherType.Rainy, 0, 0), new RandomWeatherPair(LevelWeatherType.Stormy, 1, 0), new RandomWeatherPair(LevelWeatherType.Foggy, 1, 0), new RandomWeatherPair(LevelWeatherType.Flooded, -4, 5), new RandomWeatherPair(LevelWeatherType.Eclipsed, 1, 0) }; public bool OverwriteWeather = false; public LevelWeatherType OverwriteWeatherType = LevelWeatherType.None; [Header("Route")] public string RouteWord = "newmoon"; public int RoutePrice; public string BoughtComment = "Please enjoy your flight."; [Header("Dungeon")] [Range(1f, 5f)] public float FactorySizeMultiplier = 1f; public int FireExitsAmountOverwrite = 1; [SerializeField] private DungeonFlowPair[] _DungeonFlowTypes = new DungeonFlowPair[2] { new DungeonFlowPair(0, 300), new DungeonFlowPair(1, 1) }; [SerializeField] private SpawnableScrapPair[] _SpawnableScrap = new SpawnableScrapPair[19] { new SpawnableScrapPair("Cog1", 80), new SpawnableScrapPair("EnginePart1", 90), new SpawnableScrapPair("FishTestProp", 12), new SpawnableScrapPair("MetalSheet", 88), new SpawnableScrapPair("FlashLaserPointer", 4), new SpawnableScrapPair("BigBolt", 80), new SpawnableScrapPair("BottleBin", 19), new SpawnableScrapPair("Ring", 3), new SpawnableScrapPair("SteeringWheel", 32), new SpawnableScrapPair("MoldPan", 5), new SpawnableScrapPair("EggBeater", 10), new SpawnableScrapPair("PickleJar", 10), new SpawnableScrapPair("DustPan", 32), new SpawnableScrapPair("Airhorn", 3), new SpawnableScrapPair("ClownHorn", 3), new SpawnableScrapPair("CashRegister", 3), new SpawnableScrapPair("Candy", 2), new SpawnableScrapPair("GoldBar", 1), new SpawnableScrapPair("YieldSign", 6) }; public string[] spawnableScrapBlacklist = new string[0]; [Range(0f, 100f)] public int MinScrap = 8; [Range(0f, 100f)] public int MaxScrap = 12; public string LevelAmbienceClips = "Level1TypeAmbience"; [Range(0f, 30f)] public int MaxEnemyPowerCount = 4; [SerializeField] private SpawnableEnemiesPair[] _Enemies = new SpawnableEnemiesPair[8] { new SpawnableEnemiesPair("Centipede", 51), new SpawnableEnemiesPair("SandSpider", 58), new SpawnableEnemiesPair("HoarderBug", 28), new SpawnableEnemiesPair("Flowerman", 13), new SpawnableEnemiesPair("Crawler", 16), new SpawnableEnemiesPair("Blob", 31), new SpawnableEnemiesPair("DressGirl", 1), new SpawnableEnemiesPair("Puffer", 28) }; public AnimationCurve EnemySpawnChanceThroughoutDay = CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0015411376953125,\"value\":-3.0,\"inSlope\":19.556997299194337,\"outSlope\":19.556997299194337,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.0,\"outWeight\":0.12297855317592621},{\"serializedVersion\":\"3\",\"time\":0.4575331211090088,\"value\":4.796203136444092,\"inSlope\":24.479534149169923,\"outSlope\":24.479534149169923,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.396077424287796,\"outWeight\":0.35472238063812258},{\"serializedVersion\":\"3\",\"time\":0.7593884468078613,\"value\":4.973001480102539,\"inSlope\":2.6163148880004885,\"outSlope\":2.6163148880004885,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.2901076376438141,\"outWeight\":0.5360636115074158},{\"serializedVersion\":\"3\",\"time\":1.0,\"value\":15.0,\"inSlope\":35.604026794433597,\"outSlope\":35.604026794433597,\"tangentMode\":0,\"weightedMode\":1,\"inWeight\":0.04912583902478218,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}"); [Range(0f, 30f)] public float SpawnProbabilityRange = 4f; [Header("Outside")] [SerializeField] private SpawnableMapObjectPair[] _SpawnableMapObjects = new SpawnableMapObjectPair[2] { new SpawnableMapObjectPair("Landmine", spawnFacingAwayFromWall: false, CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":-0.003082275390625,\"value\":0.0,\"inSlope\":0.23179344832897187,\"outSlope\":0.23179344832897187,\"tangentMode\":0,\"weightedMode\":2,\"inWeight\":0.0,\"outWeight\":0.27936428785324099},{\"serializedVersion\":\"3\",\"time\":0.8171924352645874,\"value\":1.7483322620391846,\"inSlope\":7.064207077026367,\"outSlope\":7.064207077026367,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.2631833553314209,\"outWeight\":0.6898177862167358},{\"serializedVersion\":\"3\",\"time\":1.0002186298370362,\"value\":11.760997772216797,\"inSlope\":968.80810546875,\"outSlope\":968.80810546875,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.029036391526460649,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableMapObjectPair("TurretContainer", spawnFacingAwayFromWall: true, CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":0.354617178440094,\"outSlope\":0.354617178440094,\"tangentMode\":0,\"weightedMode\":2,\"inWeight\":0.0,\"outWeight\":0.0},{\"serializedVersion\":\"3\",\"time\":0.9190289974212647,\"value\":1.0005745887756348,\"inSlope\":Infinity,\"outSlope\":1.7338485717773438,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.0,\"outWeight\":0.6534967422485352},{\"serializedVersion\":\"3\",\"time\":1.0038425922393799,\"value\":7.198680877685547,\"inSlope\":529.4945068359375,\"outSlope\":529.4945068359375,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.14589552581310273,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")) }; [SerializeField] private SpawnableOutsideObjectPair[] _SpawnableOutsideObjects = new SpawnableOutsideObjectPair[7] { new SpawnableOutsideObjectPair("LargeRock1", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":0.0,\"outSlope\":0.0,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.0,\"outWeight\":0.0},{\"serializedVersion\":\"3\",\"time\":0.7571572661399841,\"value\":0.6448163986206055,\"inSlope\":2.974250078201294,\"outSlope\":2.974250078201294,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.3333333432674408,\"outWeight\":0.3333333432674408},{\"serializedVersion\":\"3\",\"time\":0.9995536804199219,\"value\":5.883961200714111,\"inSlope\":65.30631256103516,\"outSlope\":65.30631256103516,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.12097536772489548,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("LargeRock2", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":0.0,\"outSlope\":0.0,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.0,\"outWeight\":0.0},{\"serializedVersion\":\"3\",\"time\":0.7562879920005798,\"value\":1.2308543920516968,\"inSlope\":5.111926555633545,\"outSlope\":5.111926555633545,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.3333333432674408,\"outWeight\":0.21955738961696626},{\"serializedVersion\":\"3\",\"time\":1.0010795593261719,\"value\":7.59307336807251,\"inSlope\":92.0470199584961,\"outSlope\":92.0470199584961,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.05033162236213684,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("LargeRock3", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":0.0,\"outSlope\":0.0,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.0,\"outWeight\":0.0},{\"serializedVersion\":\"3\",\"time\":0.9964686632156372,\"value\":2.0009398460388185,\"inSlope\":6.82940673828125,\"outSlope\":6.82940673828125,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.06891261041164398,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("LargeRock4", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":0.0,\"outSlope\":0.0,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.0,\"outWeight\":0.0},{\"serializedVersion\":\"3\",\"time\":0.9635604619979858,\"value\":2.153383493423462,\"inSlope\":6.251225471496582,\"outSlope\":6.251225471496582,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.07428120821714401,\"outWeight\":0.3333333432674408},{\"serializedVersion\":\"3\",\"time\":0.9995394349098206,\"value\":5.0,\"inSlope\":15.746581077575684,\"outSlope\":15.746581077575684,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.06317413598299027,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("TreeLeafless1", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":1.6912956237792969,\"outSlope\":1.6912956237792969,\"tangentMode\":0,\"weightedMode\":2,\"inWeight\":0.0,\"outWeight\":0.27726083993911745},{\"serializedVersion\":\"3\",\"time\":0.776531994342804,\"value\":6.162014007568359,\"inSlope\":30.075166702270509,\"outSlope\":30.075166702270509,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.15920747816562653,\"outWeight\":0.5323987007141113},{\"serializedVersion\":\"3\",\"time\":1.0002281665802003,\"value\":38.093849182128909,\"inSlope\":1448.839111328125,\"outSlope\":1448.839111328125,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.0620061457157135,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("SmallGreyRocks1", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":1.6912956237792969,\"outSlope\":1.6912956237792969,\"tangentMode\":0,\"weightedMode\":2,\"inWeight\":0.0,\"outWeight\":0.27726083993911745},{\"serializedVersion\":\"3\",\"time\":0.802714467048645,\"value\":1.5478605031967164,\"inSlope\":9.096116065979004,\"outSlope\":9.096116065979004,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.15920747816562653,\"outWeight\":0.58766108751297},{\"serializedVersion\":\"3\",\"time\":1.0002281665802003,\"value\":14.584033966064454,\"inSlope\":1244.9173583984375,\"outSlope\":1244.9173583984375,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.054620321840047839,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")), new SpawnableOutsideObjectPair("GiantPumpkin", CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":0.0,\"inSlope\":1.6912956237792969,\"outSlope\":1.6912956237792969,\"tangentMode\":0,\"weightedMode\":2,\"inWeight\":0.0,\"outWeight\":0.27726083993911745},{\"serializedVersion\":\"3\",\"time\":0.8832725882530212,\"value\":0.5284063816070557,\"inSlope\":3.2962090969085695,\"outSlope\":29.38977813720703,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.19772815704345704,\"outWeight\":0.8989489078521729},{\"serializedVersion\":\"3\",\"time\":0.972209095954895,\"value\":6.7684478759765629,\"inSlope\":140.27394104003907,\"outSlope\":140.27394104003907,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.39466607570648196,\"outWeight\":0.47049039602279665},{\"serializedVersion\":\"3\",\"time\":1.0002281665802003,\"value\":23.0,\"inSlope\":579.3037109375,\"outSlope\":14.8782377243042,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.648808479309082,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}")) }; [Range(0f, 30f)] public int MaxOutsideEnemyPowerCount = 8; [Range(0f, 30f)] public int MaxDaytimeEnemyPowerCount = 5; [SerializeField] private SpawnableEnemiesPair[] _OutsideEnemies = new SpawnableEnemiesPair[3] { new SpawnableEnemiesPair("MouthDog", 75), new SpawnableEnemiesPair("ForestGiant", 0), new SpawnableEnemiesPair("SandWorm", 56) }; [SerializeField] private SpawnableEnemiesPair[] _DaytimeEnemies = new SpawnableEnemiesPair[3] { new SpawnableEnemiesPair("RedLocustBees", 22), new SpawnableEnemiesPair("Doublewing", 74), new SpawnableEnemiesPair("DocileLocustBees", 52) }; public AnimationCurve OutsideEnemySpawnChanceThroughDay = CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":-7.736962288618088e-7,\"value\":-2.996999979019165,\"inSlope\":Infinity,\"outSlope\":0.5040292143821716,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.0,\"outWeight\":0.08937685936689377},{\"serializedVersion\":\"3\",\"time\":0.7105481624603272,\"value\":-0.6555822491645813,\"inSlope\":9.172262191772461,\"outSlope\":9.172262191772461,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.3333333432674408,\"outWeight\":0.7196550369262695},{\"serializedVersion\":\"3\",\"time\":1.0052626132965088,\"value\":5.359400749206543,\"inSlope\":216.42247009277345,\"outSlope\":11.374387741088868,\"tangentMode\":0,\"weightedMode\":3,\"inWeight\":0.044637180864810947,\"outWeight\":0.48315444588661196}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}"); public AnimationCurve DaytimeEnemySpawnChanceThroughDay = CurveContainer.DeserializeCurve("{\"curve\":{\"serializedVersion\":\"2\",\"m_Curve\":[{\"serializedVersion\":\"3\",\"time\":0.0,\"value\":2.2706568241119386,\"inSlope\":-7.500085353851318,\"outSlope\":-7.500085353851318,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.3333333432674408,\"outWeight\":0.20650266110897065},{\"serializedVersion\":\"3\",\"time\":0.38507816195487978,\"value\":-0.0064108967781066898,\"inSlope\":-2.7670974731445314,\"outSlope\":-2.7670974731445314,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.28388944268226626,\"outWeight\":0.30659767985343935},{\"serializedVersion\":\"3\",\"time\":0.6767024993896484,\"value\":-7.021658420562744,\"inSlope\":-27.286888122558595,\"outSlope\":-27.286888122558595,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.10391546785831452,\"outWeight\":0.12503522634506226},{\"serializedVersion\":\"3\",\"time\":0.9998173117637634,\"value\":-14.818100929260254,\"inSlope\":0.0,\"outSlope\":0.0,\"tangentMode\":0,\"weightedMode\":0,\"inWeight\":0.0,\"outWeight\":0.0}],\"m_PreInfinity\":2,\"m_PostInfinity\":2,\"m_RotationOrder\":4}}"); [Range(0f, 30f)] public float DaytimeEnemiesProbabilityRange = 5f; public bool LevelIncludesSnowFootprints = false; [HideInInspector] public string serializedRandomWeatherTypes; [HideInInspector] public string serializedDungeonFlowTypes; [HideInInspector] public string serializedSpawnableScrap; [HideInInspector] public string serializedEnemies; [HideInInspector] public string serializedOutsideEnemies; [HideInInspector] public string serializedDaytimeEnemies; [HideInInspector] public string serializedSpawnableMapObjects; [HideInInspector] public string serializedSpawnableOutsideObjects; private void OnValidate() { RequiredBundles = RequiredBundles.RemoveNonAlphanumeric(1); IncompatibleBundles = IncompatibleBundles.RemoveNonAlphanumeric(1); MoonName = MoonName.RemoveNonAlphanumeric(1); OrbitPrefabName = OrbitPrefabName.RemoveNonAlphanumeric(1); RiskLevel = RiskLevel.RemoveNonAlphanumeric(); RouteWord = RouteWord.RemoveNonAlphanumeric(2); BoughtComment = BoughtComment.RemoveNonAlphanumeric(); LevelAmbienceClips = LevelAmbienceClips.RemoveNonAlphanumeric(1); TimeToArrive = Mathf.Clamp(TimeToArrive, 0f, 16f); DaySpeedMultiplier = Mathf.Clamp(DaySpeedMultiplier, 0.1f, 5f); RoutePrice = Mathf.Clamp(RoutePrice, 0, int.MaxValue); FactorySizeMultiplier = Mathf.Clamp(FactorySizeMultiplier, 1f, 5f); FireExitsAmountOverwrite = Mathf.Clamp(FireExitsAmountOverwrite, 0, 20); MinScrap = Mathf.Clamp(MinScrap, 0, MaxScrap); MaxScrap = Mathf.Clamp(MaxScrap, MinScrap, 100); MaxEnemyPowerCount = Mathf.Clamp(MaxEnemyPowerCount, 0, 30); MaxOutsideEnemyPowerCount = Mathf.Clamp(MaxOutsideEnemyPowerCount, 0, 30); MaxDaytimeEnemyPowerCount = Mathf.Clamp(MaxDaytimeEnemyPowerCount, 0, 30); SpawnProbabilityRange = Mathf.Clamp(SpawnProbabilityRange, 0f, 30f); DaytimeEnemiesProbabilityRange = Mathf.Clamp(DaytimeEnemiesProbabilityRange, 0f, 30f); for (int i = 0; i < _SpawnableScrap.Length; i++) { _SpawnableScrap[i].ObjectName = _SpawnableScrap[i].ObjectName.RemoveNonAlphanumeric(1); } for (int j = 0; j < _Enemies.Length; j++) { _Enemies[j].EnemyName = _Enemies[j].EnemyName.RemoveNonAlphanumeric(1); } for (int k = 0; k < _SpawnableMapObjects.Length; k++) { _SpawnableMapObjects[k].ObjectName = _SpawnableMapObjects[k].ObjectName.RemoveNonAlphanumeric(1); } for (int l = 0; l < _SpawnableOutsideObjects.Length; l++) { _SpawnableOutsideObjects[l].ObjectName = _SpawnableOutsideObjects[l].ObjectName.RemoveNonAlphanumeric(1); } for (int m = 0; m < _OutsideEnemies.Length; m++) { _OutsideEnemies[m].EnemyName = _OutsideEnemies[m].EnemyName.RemoveNonAlphanumeric(1); } for (int n = 0; n < _DaytimeEnemies.Length; n++) { _DaytimeEnemies[n].EnemyName = _DaytimeEnemies[n].EnemyName.RemoveNonAlphanumeric(1); } serializedRandomWeatherTypes = string.Join(";", _RandomWeatherTypes.Select((RandomWeatherPair p) => $"{(int)p.Weather},{p.WeatherVariable1},{p.WeatherVariable2}")); serializedDungeonFlowTypes = string.Join(";", _DungeonFlowTypes.Select((DungeonFlowPair p) => $"{p.ID},{p.Rarity}")); serializedSpawnableScrap = string.Join(";", _SpawnableScrap.Select((SpawnableScrapPair p) => $"{p.ObjectName},{p.SpawnWeight}")); serializedEnemies = string.Join(";", _Enemies.Select((SpawnableEnemiesPair p) => $"{p.EnemyName},{p.SpawnWeight}")); serializedOutsideEnemies = string.Join(";", _OutsideEnemies.Select((SpawnableEnemiesPair p) => $"{p.EnemyName},{p.SpawnWeight}")); serializedDaytimeEnemies = string.Join(";", _DaytimeEnemies.Select((SpawnableEnemiesPair p) => $"{p.EnemyName},{p.SpawnWeight}")); serializedSpawnableMapObjects = string.Join(";", _SpawnableMapObjects.Select((SpawnableMapObjectPair p) => $"{p.ObjectName}|{p.SpawnFacingAwayFromWall}|{CurveContainer.SerializeCurve(p.SpawnRate)}")); serializedSpawnableOutsideObjects = string.Join(";", _SpawnableOutsideObjects.Select((SpawnableOutsideObjectPair p) => p.ObjectName + "|" + CurveContainer.SerializeCurve(p.SpawnRate))); } public RandomWeatherPair[] RandomWeatherTypes() { return (from s in serializedRandomWeatherTypes.Split(';') select s.Split(',') into split where split.Length == 3 select new RandomWeatherPair((LevelWeatherType)int.Parse(split[0]), int.Parse(split[1]), int.Parse(split[2]))).ToArray(); } public DungeonFlowPair[] DungeonFlowTypes() { return (from s in serializedDungeonFlowTypes.Split(';') select s.Split(',') into split where split.Length == 2 select new DungeonFlowPair(int.Parse(split[0]), int.Parse(split[1]))).ToArray(); } public SpawnableScrapPair[] SpawnableScrap() { return (from s in serializedSpawnableScrap.Split(';') select s.Split(',') into split where split.Length == 2 select new SpawnableScrapPair(split[0], int.Parse(split[1]))).ToArray(); } public SpawnableEnemiesPair[] Enemies() { return (from s in serializedEnemies.Split(';') select s.Split(',') into split where split.Length == 2 select new SpawnableEnemiesPair(split[0], int.Parse(split[1]))).ToArray(); } public SpawnableEnemiesPair[] OutsideEnemies() { return (from s in serializedOutsideEnemies.Split(';') select s.Split(',') into split where split.Length == 2 select new SpawnableEnemiesPair(split[0], int.Parse(split[1]))).ToArray(); } public SpawnableEnemiesPair[] DaytimeEnemies() { return (from s in serializedDaytimeEnemies.Split(';') select s.Split(',') into split where split.Length == 2 select new SpawnableEnemiesPair(split[0], int.Parse(split[1]))).ToArray(); } public SpawnableMapObjectPair[] SpawnableMapObjects() { return (from s in serializedSpawnableMapObjects.Split(';') select s.Split('|') into split where split.Length == 3 select new SpawnableMapObjectPair(split[0], bool.Parse(split[1]), CurveContainer.DeserializeCurve(split[2]))).ToArray(); } public SpawnableOutsideObjectPair[] SpawnableOutsideObjects() { return (from s in serializedSpawnableOutsideObjects.Split(';') select s.Split('|') into split where split.Length == 2 select new SpawnableOutsideObjectPair(split[0], CurveContainer.DeserializeCurve(split[1]))).ToArray(); } } [CreateAssetMenu(fileName = "New Scrap", menuName = "LethalSDK/Scrap")] public class Scrap : ScriptableObject { public string[] RequiredBundles; public string[] IncompatibleBundles; [Header("Base")] public ScrapType scrapType = ScrapType.Normal; public string itemName = "NewScrap"; public int minValue = 0; public int maxValue = 0; public bool twoHanded = false; public GrabAnim HandedAnimation = GrabAnim.OneHanded; public bool requiresBattery = false; public bool isConductiveMetal = false; public int weight = 0; public GameObject prefab; public float useCooldown = 0f; [Header("Sounds")] public string grabSFX = string.Empty; public string dropSFX = string.Empty; [Header("Offsets")] public float verticalOffset = 0f; public Vector3 restingRotation = Vector3.zero; public Vector3 positionOffset = Vector3.zero; public Vector3 rotationOffset = Vector3.zero; [Header("Variants")] public Mesh[] meshVariants = (Mesh[])(object)new Mesh[0]; public Material[] materialVariants = (Material[])(object)new Material[0]; [Header("Spawn rate")] public bool useGlobalSpawnWeight = true; [Range(0f, 100f)] public int globalSpawnWeight = 10; [SerializeField] private ScrapSpawnChancePerScene[] _perPlanetSpawnWeight = new ScrapSpawnChancePerScene[9] { new ScrapSpawnChancePerScene("41 Experimentation", 10), new ScrapSpawnChancePerScene("220 Assurance", 10), new ScrapSpawnChancePerScene("56 Vow", 10), new ScrapSpawnChancePerScene("21 Offense", 10), new ScrapSpawnChancePerScene("61 March", 10), new ScrapSpawnChancePerScene("85 Rend", 10), new ScrapSpawnChancePerScene("7 Dine", 10), new ScrapSpawnChancePerScene("8 Titan", 10), new ScrapSpawnChancePerScene("Others", 10) }; public string[] planetSpawnBlacklist = new string[0]; [Header("Shovel")] public int shovelHitForce = 1; public AudioSource shovelAudio; public string reelUp = "ShovelReelUp"; public string swing = "ShovelSwing"; public string[] hitSFX = new string[2] { "ShovelHitDefault", "ShovelHitDefault2" }; [Header("Flashlight")] public bool usingPlayerHelmetLight = false; public int flashlightInterferenceLevel = 0; public Light flashlightBulb; public Light flashlightBulbGlow; public AudioSource flashlightAudio; public string[] flashlightClips = new string[1] { "FlashlightClick" }; public string outOfBatteriesClip = "FlashlightOutOfBatteries"; public string flashlightFlicker = "FlashlightFlicker"; public Material bulbLight; public Material bulbDark; public MeshRenderer flashlightMesh; public int flashlightTypeID = 0; public bool changeMaterial = true; [Header("Noisemaker")] public AudioSource noiseAudio; public AudioSource noiseAudioFar; public string[] noiseSFX = new string[1] { "ClownHorn1" }; public string[] noiseSFXFar = new string[1] { "ClownHornFar" }; public float noiseRange = 60f; public float maxLoudness = 1f; public float minLoudness = 0.6f; public float minPitch = 0.93f; public float maxPitch = 1f; public Animator triggerAnimator; [Header("WhoopieCushion")] public AudioSource whoopieCushionAudio; public string[] fartAudios = new string[4] { "Fart1", "Fart2", "Fart3", "Fart5" }; [HideInInspector] public string serializedData; private void OnValidate() { RequiredBundles = RequiredBundles.RemoveNonAlphanumeric(1); IncompatibleBundles = IncompatibleBundles.RemoveNonAlphanumeric(1); itemName = itemName.RemoveNonAlphanumeric(1); grabSFX = grabSFX.RemoveNonAlphanumeric(1); dropSFX = dropSFX.RemoveNonAlphanumeric(1); for (int i = 0; i < _perPlanetSpawnWeight.Length; i++) { _perPlanetSpawnWeight[i].SceneName = _perPlanetSpawnWeight[i].SceneName.RemoveNonAlphanumeric(1); } serializedData = string.Join(";", _perPlanetSpawnWeight.Select((ScrapSpawnChancePerScene p) => $"{p.SceneName},{p.SpawnWeight}")); } public ScrapSpawnChancePerScene[] perPlanetSpawnWeight() { return (from s in serializedData.Split(';') select s.Split(',') into split where split.Length == 2 select new ScrapSpawnChancePerScene(split[0], int.Parse(split[1]))).ToArray(); } } public enum ScrapType { Normal, Shovel, Flashlight, Noisemaker, WhoopieCushion } public enum GrabAnim { OneHanded, TwoHanded, Shotgun, Jetpack, Clipboard } } namespace LethalSDK.Editor { internal class CopyrightsWindow : EditorWindow { private Vector2 scrollPosition; private readonly Dictionary<string, string> assetAuthorList = new Dictionary<string, string> { { "Drop Ship assets, Sun cycle animations, ScrapItem sprite, ScavengerSuit Textures/Arms Mesh and MonitorWall mesh", "Zeekerss" }, { "SDK Scripts, Sun Texture, CrossButton Sprite (Inspired of vanilla), OldSeaPort planet prefab texture", "HolographicWings" }, { "Old Sea Port asset package", "VIVID Arts" }, { "Survival Game Tools asset package", "cookiepopworks.com" } }; [MenuItem("LethalSDK/Copyrights", false, 999)] public static void ShowWindow() { EditorWindow.GetWindow<CopyrightsWindow>("Copyrights"); } private void OnGUI() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label("List of Copyrights", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); scrollPosition = GUILayout.BeginScrollView(scrollPosition, Array.Empty<GUILayoutOption>()); EditorGUILayout.Space(5f); foreach (KeyValuePair<string, string> assetAuthor in assetAuthorList) { GUILayout.Label("Asset: " + assetAuthor.Key + " - By: " + assetAuthor.Value, EditorStyles.wordWrappedLabel, Array.Empty<GUILayoutOption>()); EditorGUILayout.Space(2f); } EditorGUILayout.Space(5f); GUILayout.Label("This SDK do not embed any Vanilla script.", Array.Empty<GUILayoutOption>()); GUILayout.EndScrollView(); } } internal class LethalSDKCategory : EditorWindow { [MenuItem("LethalSDK/Lethal SDK v1.3.0", false, 0)] public static void ShowWindow() { } } public class Lethal_AssetBundleBuilderWindow : EditorWindow { private enum compressionOption { NormalCompression, FastCompression, Uncompressed } private static string assetBundleDirectoryKey = "LethalSDK_AssetBundleBuilderWindow_assetBundleDirectory"; private static string compressionModeKey = "LethalSDK_AssetBundleBuilderWindow_compressionMode"; private static string _64BitsModeKey = "LethalSDK_AssetBundleBuilderWindow_64BitsMode"; private string assetBundleDirectory = string.Empty; private compressionOption compressionMode = compressionOption.NormalCompression; private bool _64BitsMode; [MenuItem("LethalSDK/AssetBundle Builder", false, 100)] public static void ShowWindow() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) Lethal_AssetBundleBuilderWindow window = EditorWindow.GetWindow<Lethal_AssetBundleBuilderWindow>("AssetBundle Builder"); ((EditorWindow)window).minSize = new Vector2(295f, 133f); ((EditorWindow)window).maxSize = new Vector2(295f, 133f); window.LoadPreferences(); } private void OnGUI() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown GUILayout.Label("Base Settings", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField(new GUIContent("Output Path", "The directory where the asset bundles will be saved."), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(84f) }); assetBundleDirectory = EditorGUILayout.TextField(assetBundleDirectory, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) }); GUILayout.EndHorizontal(); EditorGUILayout.Space(5f); GUILayout.Label("Options", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField(new GUIContent("Compression Mode", "Select the compression option for the asset bundle. Faster the compression is, faster the assets will load and less CPU it will use, but the Bundle will be bigger."), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(145f) }); compressionMode = (compressionOption)(object)EditorGUILayout.EnumPopup((Enum)compressionMode, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField(new GUIContent("64 Bits Asset Bundle (Not recommended)", "Better performances but incompatible with 32 bits computers."), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(270f) }); _64BitsMode = EditorGUILayout.Toggle(_64BitsMode, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); EditorGUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Build AssetBundles", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f) })) { BuildAssetBundles(); } if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(45f) })) { ClearPreferences(); } GUILayout.EndHorizontal(); } private void ClearPreferences() { EditorPrefs.DeleteKey(assetBundleDirectoryKey); EditorPrefs.DeleteKey(compressionModeKey); EditorPrefs.DeleteKey(_64BitsModeKey); LoadPreferences(); } private void BuildAssetBundles() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (!Directory.Exists(assetBundleDirectory)) { Directory.CreateDirectory(assetBundleDirectory); } BuildAssetBundleOptions val = (BuildAssetBundleOptions)0; val = (BuildAssetBundleOptions)(compressionMode switch { compressionOption.NormalCompression => 0, compressionOption.FastCompression => 256, compressionOption.Uncompressed => 1, _ => 0, }); BuildTarget val2 = (BuildTarget)(_64BitsMode ? 19 : 5); if (assetBundleDirectory != null || assetBundleDirectory.Length != 0 || assetBundleDirectory != string.Empty) { AssetBundleManifest val3 = null; try { val3 = BuildPipeline.BuildAssetBundles(assetBundleDirectory, val, val2); } catch (Exception ex) { Debug.LogError((object)ex.Message); } if ((Object)(object)val3 != (Object)null) { Debug.Log((object)"AssetBundles built successfully."); } else { Debug.LogError((object)"Cannot build AssetBundles."); } } else { Debug.LogError((object)"AssetBundles path cannot be blank."); } } private void OnLostFocus() { SavePreferences(); } private void OnDisable() { SavePreferences(); } private void LoadPreferences() { assetBundleDirectory = EditorPrefs.GetString(assetBundleDirectoryKey, "Assets/AssetBundles"); compressionMode = (compressionOption)EditorPrefs.GetInt(compressionModeKey, 0); _64BitsMode = EditorPrefs.GetBool(_64BitsModeKey, false); } private void SavePreferences() { EditorPrefs.SetString(assetBundleDirectoryKey, assetBundleDirectory); EditorPrefs.SetInt(compressionModeKey, (int)compressionMode); EditorPrefs.SetBool(_64BitsModeKey, _64BitsMode); } } internal class OldAssetsRemover { } [RequireComponent(typeof(Terrain))] public class TerrainChecker : MonoBehaviour { [HideInInspector] public Terrain terrain; private void OnDrawGizmosSelected() { terrain = ((Component)this).GetComponent<Terrain>(); } private void Awake() { Object.Destroy((Object)(object)this); } } public class VersionChecker : Editor { [InitializeOnLoadMethod] public static void CheckVersion() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown UnityWebRequest www = UnityWebRequest.Get("https://raw.githubusercontent.com/HolographicWings/LethalSDK-Unity-Project/main/last.txt"); UnityWebRequestAsyncOperation operation = www.SendWebRequest(); CallbackFunction callback = null; callback = (CallbackFunction)delegate { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (((AsyncOperation)operation).isDone) { EditorApplication.update = (CallbackFunction)Delegate.Remove((Delegate?)(object)EditorApplication.update, (Delegate?)(object)callback); OnRequestComplete(www); } }; EditorApplication.update = (CallbackFunction)Delegate.Combine((Delegate?)(object)EditorApplication.update, (Delegate?)(object)callback); } private static void OnRequestComplete(UnityWebRequest www) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 if ((int)www.result == 2 || (int)www.result == 3) { Debug.LogError((object)("Error when getting last version number: " + www.error)); } else { CompareVersions(www.downloadHandler.text); } } private static void CompareVersions(string onlineVersion) { } } } namespace LethalSDK.Converter { public enum AssetType { Textures, Materials, Meshes, Audio, Animation, Prefabs, Scenes, Terrain, Other } [Serializable] public struct AssetTypePair { public AssetType assetInfoType; public string fileExtension; } public static class ConvertComponents { public static void ConvertInteractTriggers() { InteractTriggerConverter interactTriggerConverter = new InteractTriggerConverter(); interactTriggerConverter.InitializeConverter(); } public static void ConvertMatchLocalPlayerPosition() { MatchLocalPlayerPositionConverter matchLocalPlayerPositionConverter = new MatchLocalPlayerPositionConverter(); matchLocalPlayerPositionConverter.InitializeConverter(); } public static void ConvertAnimatedSun() { AnimatedSunConverter animatedSunConverter = new AnimatedSunConverter(); animatedSunConverter.InitializeConverter(); } public static void ConvertScanNodes() { ScanNodeConverter scanNodeConverter = new ScanNodeConverter(); scanNodeConverter.InitializeConverter(); } public static void ConvertAudioReverbPresets() { AudioReverbPresetsConverter audioReverbPresetsConverter = new AudioReverbPresetsConverter(); audioReverbPresetsConverter.InitializeConverter(); } public static void ConvertAudioReverbTriggers() { AudioReverbTriggerConverter audioReverbTriggerConverter = new AudioReverbTriggerConverter(); audioReverbTriggerConverter.InitializeConverter(); } public static void ConvertItemDropship() { ItemDropshipConverter itemDropshipConverter = new ItemDropshipConverter(); itemDropshipConverter.InitializeConverter(); } public static void ConvertDungeonGenerator() { DungeonGeneratorConverter dungeonGeneratorConverter = new DungeonGeneratorConverter(); dungeonGeneratorConverter.InitializeConverter(); } public static void ConvertEntranceTeleports() { EntranceTeleportConverter entranceTeleportConverter = new EntranceTeleportConverter(); entranceTeleportConverter.InitializeConverter(); } public static void ConvertWaterSurfaces() { WaterSurfaceConverter waterSurfaceConverter = new WaterSurfaceConverter(); waterSurfaceConverter.InitializeConverter(); } public static void ConvertLadders() { LadderConverter ladderConverter = new LadderConverter(); ladderConverter.InitializeConverter(); } public static List<GameObject> GetSceneRootGameObjects() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).GetRootGameObjects().ToList(); } } public static class ConvertEventData { public static string ConvertInteractEventData(MonoBehaviour sourceComponent, MonoBehaviour targetComponent) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected I4, but got Unknown //IL_04ab: Unknown result type (might be due to invalid IL or missing references) string text = "<b>Converting InteractEvent Data From: " + ((Object)((Component)sourceComponent).gameObject).name + "</b>\n"; try { GameObject gameObject = ((Component)targetComponent).gameObject; SerializedObject val = new SerializedObject((Object)(object)sourceComponent); try { SerializedObject val2 = new SerializedObject((Object)(object)targetComponent); try { val.Update(); val2.Update(); SerializedProperty iterator = val.GetIterator(); try { while (iterator.NextVisible(true)) { if (iterator.name == "m_Script") { continue; } SerializedProperty val3 = val2.FindProperty(iterator.name); try { if (val3 == null) { continue; } Type propertyType = iterator.GetPropertyType(); Type propertyType2 = val3.GetPropertyType(); if (propertyType == typeof(UnityEvent<object>) && propertyType2 == typeof(InteractEvent)) { UnityEvent<object> propertyValue = iterator.GetPropertyValue<UnityEvent<object>>(); int persistentEventCount = ((UnityEventBase)propertyValue).GetPersistentEventCount(); SerializedProperty val4 = iterator.FindPropertyRelative("m_PersistentCalls.m_Calls"); InteractEvent propertyValue2 = val3.GetPropertyValue<InteractEvent>(); int persistentEventCount2 = ((UnityEventBase)propertyValue2).GetPersistentEventCount(); for (int i = 0; i < persistentEventCount2; i++) { UnityEventTools.UnregisterPersistentListener((UnityEventBase)(object)propertyValue2, i); } for (int j = 0; j < persistentEventCount; j++) { Object persistentTarget = ((UnityEventBase)propertyValue).GetPersistentTarget(j); if (persistentTarget == (Object)null) { continue; } string persistentMethodName = ((UnityEventBase)propertyValue).GetPersistentMethodName(j); if (persistentMethodName == null) { continue; } Type type = ((object)persistentTarget).GetType(); if (type == null) { continue; } text = text + "\nConverting Event Parameter #" + j + ": Target Name: " + persistentTarget.name + ", MethodName: " + persistentMethodName + ", Listener Type: " + type; MethodInfo method = type.GetMethod(persistentMethodName, new Type[1] { typeof(object) }); if ((object)method == null) { PersistentListenerMode val5 = (PersistentListenerMode)val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Mode").enumValueIndex; PersistentListenerMode val6 = val5; PersistentListenerMode val7 = val6; switch ((int)val7) { case 1: { MethodInfo validMethodInfo6 = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, Type.EmptyTypes); Delegate @delegate = Delegate.CreateDelegate(typeof(UnityAction), persistentTarget, validMethodInfo6); UnityAction val13 = (UnityAction)(object)((@delegate is UnityAction) ? @delegate : null); UnityEventTools.AddVoidPersistentListener((UnityEventBase)(object)propertyValue2, val13); break; } case 2: { Object objectReferenceValue = val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Arguments.m_ObjectArgument").objectReferenceValue; MethodInfo validMethodInfo5 = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, new Type[1] { typeof(Object) }); UnityAction<Object> val12 = Delegate.CreateDelegate(typeof(UnityAction<Object>), persistentTarget, validMethodInfo5) as UnityAction<Object>; UnityEventTools.AddObjectPersistentListener<Object>((UnityEventBase)(object)propertyValue2, val12, objectReferenceValue); break; } case 3: { int intValue = val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Arguments.m_IntArgument").intValue; MethodInfo validMethodInfo4 = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, new Type[1] { typeof(int) }); UnityAction<int> val11 = Delegate.CreateDelegate(typeof(UnityAction<int>), persistentTarget, validMethodInfo4) as UnityAction<int>; UnityEventTools.AddIntPersistentListener((UnityEventBase)(object)propertyValue2, val11, intValue); break; } case 4: { float floatValue = val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Arguments.m_FloatArgument").floatValue; MethodInfo validMethodInfo3 = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, new Type[1] { typeof(float) }); UnityAction<float> val10 = Delegate.CreateDelegate(typeof(UnityAction<float>), persistentTarget, validMethodInfo3) as UnityAction<float>; UnityEventTools.AddFloatPersistentListener((UnityEventBase)(object)propertyValue2, val10, floatValue); break; } case 5: { string stringValue = val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Arguments.m_StringArgument").stringValue; MethodInfo validMethodInfo2 = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, new Type[1] { typeof(string) }); UnityAction<string> val9 = Delegate.CreateDelegate(typeof(UnityAction<string>), persistentTarget, validMethodInfo2) as UnityAction<string>; UnityEventTools.AddStringPersistentListener((UnityEventBase)(object)propertyValue2, val9, stringValue); break; } case 6: { bool boolValue = val4.GetArrayElementAtIndex(j).FindPropertyRelative("m_Arguments.m_BoolArgument").boolValue; MethodInfo validMethodInfo = UnityEventBase.GetValidMethodInfo((object)persistentTarget, persistentMethodName, new Type[1] { typeof(bool) }); UnityAction<bool> val8 = Delegate.CreateDelegate(typeof(UnityAction<bool>), persistentTarget, validMethodInfo) as UnityAction<bool>; UnityEventTools.AddBoolPersistentListener((UnityEventBase)(object)propertyValue2, val8, boolValue); break; } default: throw new ArgumentOutOfRangeException(); case 0: break; } } else { UnityAction<PlayerControllerB> val14 = Delegate.CreateDelegate(typeof(UnityAction<PlayerControllerB>), persistentTarget, method) as UnityAction<PlayerControllerB>; UnityEventTools.AddPersistentListener<PlayerControllerB>((UnityEvent<PlayerControllerB>)(object)propertyValue2, val14); } EditorSceneManager.MarkSceneDirty(gameObject.scene); } } else { val2.CopyFromSerializedPropertyIfDifferent(iterator); } } finally { ((IDisposable)val3)?.Dispose(); } } text = text + "Converted Event Data Between: " + ((Object)((Component)sourceComponent).gameObject).name + " And " + ((Object)((Component)targetComponent).gameObject).name; return text; } finally { ((IDisposable)iterator)?.Dispose(); } } finally { ((IDisposable)val2)?.Dispose(); } } finally { ((IDisposable)val)?.Dispose(); } } catch (Exception ex) { return text + "\n\nError! Failed To Convert Event Data Between: " + ((Object)((Component)sourceComponent).gameObject).name + " And " + ((Object)((Component)targetComponent).gameObject).name + ". Stacktrace Below:\n\n" + ex; } } private static TComponent GetOrAddComponent<TComponent>(this GameObject target) where TComponent : Component { TComponent component = target.GetComponent<TComponent>(); return Object.op_Implicit((Object)(object)component) ? component : target.AddComponent<TComponent>(); } private static Type GetPropertyType(this SerializedProperty property) { Type type = ((object)property.serializedObject.targetObject).GetType(); FieldInfo field = type.GetField(property.propertyPath); return field.FieldType; } private static TValue GetPropertyValue<TValue>(this SerializedProperty property) { Object targetObject = property.serializedObject.targetObject; Type type = ((object)targetObject).GetType(); FieldInfo field = type.GetField(property.propertyPath); object value = field.GetValue(targetObject); return (TValue)value; } public static void AddTeleportPlayerEvent(InteractTrigger interactTrigger, EntranceTeleport entranceTeleport) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown MethodInfo validMethodInfo = UnityEventBase.GetValidMethodInfo((object)entranceTeleport, "TeleportPlayer", Type.EmptyTypes); Delegate @delegate = Delegate.CreateDelegate(typeof(UnityAction), entranceTeleport, validMethodInfo); UnityAction val = (UnityAction)(object)((@delegate is UnityAction) ? @delegate : null); interactTrigger.onInteract = new InteractEvent(); UnityEventTools.AddVoidPersistentListener((UnityEventBase)(object)interactTrigger.onInteract, val); } } public class LEConverterWindow : EditorWindow { public enum WindowMode { Moons, Scraps, AssetBundles } [CompilerGenerated] private static class <>O { public static CallbackFunction <0>__RerefreshProgress; } public static LEConverterWindow window; public static LEConverterWindowSettings _settings; public static Moon moon; public static string currentModDirectory = string.Empty; public static string currentModContentDirectory = string.Empty; public static string currentModContentDataDirectory = string.Empty; public static string currentModContentItemsDirectory = string.Empty; public static ExtendedLevel currentExtendedLevel = null; public static ExtendedItem currentExtendedItem = null; public static bool collapseMoonAssets; public static bool collapseScrapAssets; public static Vector2 moonScrollPos; public static Vector2 scrapScrollPos; public static float progressFloat; public static List<AssetImporter> assetImporterList = new List<AssetImporter>(); public static List<Object> dirtiedAssetsList = new List<Object>(); public static WindowMode windowMode; public static bool moonModeToggle; public static bool scrapModeToggle; public static bool assetBundlesToggle; public static Dictionary<ExtendedContent, string> debugLogs = new Dictionary<ExtendedContent, string>(); public static ProgressInfo progressInfo; public static LEConverterWindowSettings WindowSettings { get { if ((Object)(object)_settings == (Object)null) { string[] array = AssetDatabase.FindAssets("t:LEConverterWindowSettings"); if (array.Length != 0) { string text = AssetDatabase.GUIDToAssetPath(array[0]); _settings = AssetDatabase.LoadAssetAtPath<LEConverterWindowSettings>(text); } } return _settings; } } public GUIStyle ButtonStyleUnselected { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.GetStyle("Button")); Texture2D val2 = new Texture2D(1, 1); val2.SetPixel(0, 0, WindowSettings.defaultButtonColor); val2.Apply(); val.normal.background = val2; val.alignment = (TextAnchor)4; val.richText = true; return val; } } public GUIStyle ButtonStyleSelected { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.GetStyle("Button")); Texture2D val2 = new Texture2D(1, 1); val2.SetPixel(0, 0, WindowSettings.selectedButtonColor); val2.Apply(); val.normal.background = val2; val.alignment = (TextAnchor)4; val.richText = true; return val; } } public GUIStyle ButtonStyleDisabled { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.GetStyle("Button")); Texture2D val2 = new Texture2D(1, 1); val2.SetPixel(0, 0, WindowSettings.disabledButtonColor); val2.Apply(); val.normal.background = val2; val.alignment = (TextAnchor)4; val.richText = true; return val; } } [MenuItem("Creative Content Converter/LethalExpansion Conversion Tool", true)] public static bool ValidateOpenWindow() { return (Object)(object)WindowSettings != (Object)null; } [MenuItem("Creative Content Converter/Create New Conversion Settings", true)] public static bool ValidateCreateConversionSettings() { return (Object)(object)WindowSettings == (Object)null; } [MenuItem("Creative Content Converter/LethalExpansion Conversion Tool")] public static void OpenWindow() { if ((Object)(object)WindowSettings != (Object)null) { window = EditorWindow.GetWindow<LEConverterWindow>("LethalSDK: LethalExpansion Conversion Tool"); } } [MenuItem("Creative Content Converter/Create New Conversion Settings")] public static void CreateConversionSettings() { LEConverterWindowSettings.CreateNewSettings(); } public void OnGUI() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Expected O, but got Unknown //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_095e: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0a23: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a40: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)WindowSettings == (Object)null) { ((EditorWindow)this).Close(); OpenWindow(); } GUILayout.ExpandWidth(true); GUILayout.ExpandHeight(true); if ((Object)(object)WindowSettings.scrapItemIcon == (Object)null || (Object)(object)WindowSettings.handIcon == (Object)null || (Object)(object)WindowSettings.itemDropshipPrefab == (Object)null || (Object)(object)WindowSettings.waterSurfacePrefab == (Object)null || (Object)(object)WindowSettings.diageticMasterMixer == (Object)null) { EditorGUILayout.TextField("Required Assets In ConversionSettings Missing, Cannot Load Conversion Tool!", Array.Empty<GUILayoutOption>()); EditorGUILayout.ObjectField((Object)(object)WindowSettings, typeof(LEConverterWindowSettings), true, Array.Empty<GUILayoutOption>()); return; } EditorGUILayout.Space(5f); EditorGUILayout.LabelField("General Settings", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); EditorGUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField("AssetRip Game Root Directory", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Select", (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { string text = EditorUtility.OpenFolderPanel("Select The Game AssetRip Root Folder", WindowSettings.assetRipGameRootDirectory, ""); if (!string.IsNullOrEmpty(text)) { text = text.Substring(text.IndexOf("Assets/")); if (AssetDatabase.IsValidFolder(text)) { WindowSettings.assetRipGameRootDirectory = text; } } } EditorGUILayout.TextField(WindowSettings.assetRipGameRootDirectory, Array.Empty<GUILayoutOption>()); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField("Mods Root Directory", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Select", (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { string text2 = EditorUtility.OpenFolderPanel("Select New Root Mod Folder", WindowSettings.modsRootDirectory, ""); if (!string.IsNullOrEmpty(text2)) { text2 = text2.Substring(text2.IndexOf("Assets/")); if (AssetDatabase.IsValidFolder(text2)) { WindowSettings.modsRootDirectory = text2; } } } EditorGUILayout.TextField(WindowSettings.modsRootDirectory, Array.Empty<GUILayoutOption>()); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(5f); EditorGUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField("AssetBundle Assignment Source", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); WindowSettings.assetBundleAssignmentSetting = (LEConverterWindowSettings.AssetBundleAssignmentSetting)(object)EditorGUILayout.EnumPopup((Enum)WindowSettings.assetBundleAssignmentSetting, Array.Empty<GUILayoutOption>()); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); EditorGUILayout.LabelField("AssetBundle Variant Setting", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); WindowSettings.bundleVariantToggle = (LEConverterWindowSettings.BundleVariantToggle)(object)EditorGUILayout.EnumPopup((Enum)WindowSettings.bundleVariantToggle, Array.Empty<GUILayoutOption>()); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(10f); EditorGUILayout.LabelField("Selected Conversion Tool", EditorStyles.boldLabel, Array.Empty<GUILayoutOption>()); GUIStyle val = new GUIStyle(); val.alignment = (TextAnchor)4; EditorGUILayout.BeginHorizontal(val, Array.Empty<GUILayoutOption>()); if (windowMode == WindowMode.Moons) { if (GUILayout.Button("Moons".Colorize(Color.white).Bold(), ButtonStyleSelected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { windowMode = WindowMode.Moons; } if (GUILayout.Button("Scrap".Colorize(Color.white), ButtonStyleUnselected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { windowMode = WindowMode.Scraps; } if (GUILayout.Button("Asset Bundles".Colorize(Color.white), ButtonStyleUnselected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { windowMode = WindowMode.AssetBundles; } } else if (windowMode == WindowMode.Scraps) { if (GUILayout.Button("Moons".Colorize(Color.white), ButtonStyleUnselected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { windowMode = WindowMode.Moons; } if (GUILayout.Button("Scrap".Colorize(Color.white).Bold(), ButtonStyleSelected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHeight(false), GUILayout.Width(120f) })) { windowMode = WindowMode.Scraps; } if (GUILayout.Button("Asset Bundles".Colorize(Color.white), ButtonStyleUnselected, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandHe