This file contains hidden or 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.Collections.Generic; | |
using Sirenix.OdinInspector; | |
using UnityEngine; | |
using UnityEngine.U2D; | |
namespace Son.Modules | |
{ | |
public class Hair : MonoBehaviour | |
{ |
This file contains hidden or 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 IEnumerator UpdateInspector() | |
{ | |
var inspectorWindowType = typeof(Editor).Assembly.GetType("UnityEditor.InspectorWindow"); | |
var targetInspector = EditorWindow.GetWindow(inspectorWindowType, false, null, false); | |
while (targetInspector) | |
{ | |
targetInspector.Repaint(); | |
yield return YieldCache.WaitForSeconds(.2f); | |
} | |
} |
This file contains hidden or 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 void CreateDLL(string name) | |
{ | |
var assemblyName = new AssemblyName(AssemblyName); | |
var fileName = $"{AssemblyName}.{name}.dll"; | |
AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave, "Assets/Plugins/"); | |
ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name, fileName); | |
EnumBuilder enumData = moduleBuilder.DefineEnum($"{AssemblyName}.{name}", TypeAttributes.Public, typeof(int)); | |
for (int i = 0; i < Container.TypeNames.Count; i++) | |
enumData.DefineLiteral(Container.TypeNames[i].Replace(" ", ""), i); |
This file contains hidden or 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; | |
namespace Pulsar.Utils | |
{ | |
public static class Xoroshiro128Plus | |
{ | |
private const int A = 24, B = 16, C = 37; | |
// float has a maximum of '24' bits of precision. This means that not all integers larger than 16777216 can be represented exactly. | |
private const long FloatMask = (1L << 24) - 1; | |
private const float Normalize24 = 1.0f / (1L << 24); |