Class Static Ctor
↓
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
↓
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
↓
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
↓
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.Linq; | |
| public static class TypeExtensions | |
| { | |
| public static string GetSlimAssemblyQualifiedName(this Type type) | |
| { | |
| if (type.IsGenericType) | |
| { | |
| var names = string.Join("],[", type.GenericTypeArguments.Select(t => t.GetSlimAssemblyQualifiedName())); |
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 static class PlayerLoopExtensions | |
| { | |
| public static void AddSubSystem<TParent, TInner>(Action action) | |
| { | |
| var playerLoop = PlayerLoop.GetCurrentPlayerLoop(); | |
| ref var parentSystemRef = ref FindSystem<TParent>(playerLoop); | |
| Array.Resize(ref parentSystemRef.subSystemList, parentSystemRef.subSystemList.Length + 1); | |
| var subSystem = new PlayerLoopSystem { type = typeof(TInner), updateDelegate = action.Invoke }; | |
| parentSystemRef.subSystemList[parentSystemRef.subSystemList.Length - 1] = subSystem; | |
| PlayerLoop.SetPlayerLoop(playerLoop); |
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.Reflection; | |
| using System.Reflection.Emit; | |
| public static class EmitCompatibilityCheck | |
| { | |
| public static bool Check() | |
| { | |
| try | |
| { | |
| var assemblyName = new AssemblyName(nameof(EmitCompatibilityCheck)); |
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.Threading; | |
| namespace Raptor.Game.Shared | |
| { | |
| public class Clock | |
| { | |
| private int _tick; | |
| private bool _stop; | |
| private readonly Thread _thread; |
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 static float Mod(float a, float b) | |
| { | |
| float c = a % b; | |
| if ((c < 0 && b > 0) || (c > 0 && b < 0)) { | |
| c += b; | |
| } | |
| return c; | |
| } |
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 static class CameraExtensions | |
| { | |
| public static Bounds WorldToScreenBounds(this Camera camera, Bounds bounds) | |
| { | |
| var center = bounds.center; | |
| var extents = bounds.extents; | |
| Span<Vector3> worldSpaceCorners = stackalloc Vector3[8]; | |
| worldSpaceCorners[0] = new Vector3(center.x + extents.x, center.y + extents.y, center.z + extents.z); | |
| worldSpaceCorners[1] = new Vector3(center.x + extents.x, center.y + extents.y, center.z - extents.z); |
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 UnityEngine; | |
| public static class GetBoundsAtScreenSpace | |
| { | |
| private static readonly List<Vector3> _localSpaceVerticesBuffer = new List<Vector3>(); | |
| public static Bounds Get(MeshFilter meshFilter, Camera camera) | |
| { |
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
| internal sealed class InjectedPropertyInfo | |
| { | |
| public readonly Type PropertyType; | |
| public readonly Action<object, object> Setter; | |
| public InjectedPropertyInfo(PropertyInfo propertyInfo) | |
| { | |
| PropertyType = propertyInfo.PropertyType; | |
| Setter = GenerateSetter(propertyInfo); | |
| } |
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
| internal sealed class InjectedMethodInfo | |
| { | |
| public readonly MethodInfo MethodInfo; | |
| public readonly ParameterInfo[] Parameters; | |
| public readonly Action<object, object[]> Call; | |
| public InjectedMethodInfo(MethodInfo methodInfo) | |
| { | |
| MethodInfo = methodInfo; | |
| Parameters = methodInfo.GetParameters(); |
OlderNewer