using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RudeLevelScripts.Essentials")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9434d305d6d7e2d913c69afe409f247076c1fe94")] [assembly: AssemblyProduct("RudeLevelScripts.Essentials")] [assembly: AssemblyTitle("RudeLevelScripts.Essentials")] [assembly: AssemblyVersion("1.0.0.0")] namespace RudeLevelScript { public class FinalRoomTarget : MonoBehaviour { [Tooltip("If a valid Unique ID of a Rude Level Data is written, the level will be loaded. This ID can be in other bundles. If the id is invalid or the level is not available, returns to the main menu")] public string targetLevelUniqueId = ""; } [CreateAssetMenu] public class RudeLevelData : ScriptableObject { [SerializeField] [Tooltip("Scene which belongs to the data")] public Object targetScene; [SerializeField] [HideInInspector] public string[] requiredDllNames; [HideInInspector] public string scenePath = ""; [Header("Level Locator")] [Tooltip("This ID is used to reference the level externally, such as final pit targets or activasion scripts. This field must not match any other data's id even accross bundles. Strong naming suggested, such as including author name in the id")] public string uniqueIdentifier = ""; [Space(10f)] [Header("Level Info")] [Tooltip("Name which will be displayed on angry")] public string levelName = ""; [Tooltip("If the level is secret and uses FirstRoomSecret variant, set to true. Enabling this field will disable rank and challenge panel on angry side")] public bool isSecretLevel; [Tooltip("Order of the level in angry. Lower valued levels are at the top")] public int prefferedLevelOrder; [Tooltip("Sprite containing the level thumbnail. Label the sprite as well")] public Sprite levelPreviewImage; [Space(10f)] [Tooltip("Enablind this field will hide the level from angry until accessed by a final pit. Implemented for secret levels")] public bool hideIfNotPlayed; [Tooltip("The level IDs required to be completed before the level can be played. If one of the level ID's are not completed, level will be locked")] public string[] requiredCompletedLevelIdsForUnlock; [Space(10f)] public bool levelChallengeEnabled; public string levelChallengeText = ""; [Tooltip("Set exactly to the number of secret bonuses in the level")] public int secretCount; public bool doNotHideLevelPreviewWhenNotCompleted; public bool doNotExport; public bool doesNotSupportNoMo; } } namespace RudeLevelScripts { public class RudeMapVarHandler : MonoBehaviour { [Header("This is the id of the file to register the list of MapVars below with. Keep in mind, fileID's are not bundle or level specific.", order = 0)] [Header("With this in mind, please use an id that is unique to you.", order = 1)] public string fileID; [Space(10f)] [Header("Every MapVar key you list here will be registered to be set/read from the provided fileID. ", order = 2)] [Header("For any MapVarSetter components that use keys in this list,", order = 3)] [Header("their persistence setting will be ignored and it will only read/write to the provided fileID.", order = 4)] public List varList; private const int MAX_FILE_NAME_LENGTH = 48; public bool IsValid() { if (string.IsNullOrEmpty(fileID) || string.IsNullOrWhiteSpace(fileID)) { Debug.LogError((object)("(" + ((Object)this).name + ") RudeMapVarHandler.fileID is empty, null, or whitespace.")); return false; } if (fileID.IndexOfAny(Path.GetInvalidFileNameChars()) != -1) { Debug.LogError((object)("(" + ((Object)this).name + ") RudeMapVarHandler.fileID contains invalid characters.")); return false; } if (fileID.Length > 48) { Debug.LogError((object)string.Format("({0}) {1}.{2} is too long. Max length is {3} characters.", ((Object)this).name, "RudeMapVarHandler", "fileID", 48)); return false; } return true; } private void OnValidate() { if (fileID == null) { fileID = Guid.NewGuid().ToString(); } char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); if (fileID.IndexOfAny(invalidFileNameChars) != -1) { Debug.LogError((object)"RudeMapVarHandler: fileID of RudeMapVarHandler contains invalid characters."); for (int i = 0; i < invalidFileNameChars.Length; i++) { fileID = fileID.Replace(invalidFileNameChars[i], '_'); } } if (fileID.Length > 48) { fileID = fileID.Substring(0, Mathf.Min(fileID.Length, 48)); } } } } namespace RudeLevelScripts.Essentials { public class ExecuteOnSceneLoad : MonoBehaviour { [Tooltip("Lower value ExecuteOnSceneLoad are executed first")] public int relativeExecutionOrder; public UnityEvent onSceneLoad; public void Execute() { if (onSceneLoad != null) { onSceneLoad.Invoke(); } } } public class IgnoreSecret : MonoBehaviour { } [CreateAssetMenu] public class RudeBundleData : ScriptableObject { [Tooltip("Will be shown on the angry bundle list")] public string bundleName; [Tooltip("Will be shown below the bundle name")] public string author; [Tooltip("Icon shown right next to the level name. Must be in png format. If not square, gets cropped")] public Sprite levelIcon; [Tooltip("Flag this field if the bundle contains levels that contains seizure inducing elements")] public bool epilepsyWarning; } }