This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.SceneManagement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
namespace Nomnom.Editor { | |
public sealed class FullBrightSceneCamera { | |
private const string KEY = "key_FullBrightSceneCamera"; | |
private static Transform? _rig = null; | |
[InitializeOnLoadMethod] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using TMPro; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.UI; | |
internal static class LoremIpsumExtension { | |
private const string LOREM_IPSUM_SHORT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; | |
private const string LOREM_IPSUM_MEDIUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam gravida orci in efficitur vulputate. Nunc quis nunc hendrerit, egestas libero non, ullamcorper enim."; | |
private const string LOREM_IPSUM_LONG = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam gravida orci in efficitur vulputate. Nunc quis nunc hendrerit, egestas libero non, ullamcorper enim. Praesent accumsan auctor orci, sed pharetra nulla efficitur at. Vivamus lacus arcu, malesuada eget magna vitae, condimentum maximus mauris."; | |
private const string LOREM_IPSUM_EXTRA_LONG = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam gravida orci in efficitur vulputate. Nunc quis nunc hendrerit, egestas libero non, ullamcorper enim. Praesent accumsan auctor orc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// it didn't add the object properly in Awake, so I put it in OnDestroy instead | |
// as the plugin object is destroyed when loading is done | |
private void OnDestroy() { | |
var unlitHandler = new GameObject("UnlitModeHandler").AddComponent<UnlitModeHandler>(); | |
DontDestroyOnLoad(unlitHandler); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HarmonyPatch(typeof(QuickMenuManager), "Debug_SetEnemyDropdownOptions")] | |
[HarmonyPrefix] | |
private static void AddGiantToDebugList(QuickMenuManager __instance) { | |
// ? isn't in the main level list so have to add here | |
// ? adding in Start didn't seem to work | |
var testLevel = __instance.testAllEnemiesLevel; | |
var firstEnemy = testLevel.Enemies.FirstOrDefault(); | |
if (firstEnemy == null) { | |
Plugin.Log.LogError("Failed to get first enemy for debug list!"); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static class EnumCache<T> where T : Enum { | |
public static T[] Values { get; } = (T[])Enum.GetValues(typeof(T)); | |
} | |
// 32-bit max enum simplification | |
private static int SimplifyEnum<T>(T e) where T: Enum { | |
var values = EnumCache<T>.Values; | |
var max = 0; | |
var number = Convert.ToInt32(e); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.UI; | |
[ExecuteAlways] | |
[DisallowMultipleComponent] | |
[RequireComponent(typeof(RectTransform))] | |
public class PercentageFill : LayoutGroup { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace SLController.Attributes { | |
public class SimpleTitleAttribute: PropertyAttribute { | |
public readonly string Text; | |
public readonly string Style; | |
public SimpleTitleAttribute(string text, string style = null) { | |
Text = text; | |
Style = style; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
public class MaxLengthAttribute : PropertyAttribute { | |
public readonly uint Length; | |
public MaxLengthAttribute(uint length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int RandomNumberInRange(int min, int max, int minExclusion, int maxExclusion) { | |
int value = Random.Range(min, max + 1 - maxExclusion + minExclusion); | |
value += value >= minExclusion ? maxExclusion - minExclusion : 0; | |
return value; | |
} |
NewerOlder