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
class OpCodeCounter | |
{ | |
short _cur; | |
public OpCodeCounter(short seed) | |
{ | |
_cur = seed; | |
} | |
public short Next() |
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
#line hidden | |
[Conditional("UNITY_EDITOR")] | |
void Assert(bool value) | |
{ | |
if (value) return; | |
var msg = CallerSrcLine(1); | |
UnityEngine.Debug.LogError(msg); | |
throw new Exception(msg); | |
} | |
#line default |
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 BypassRaycastApi | |
{ | |
static EventTriggerType[] All { get; } = | |
{ | |
EventTriggerType.PointerEnter, | |
EventTriggerType.PointerExit, | |
EventTriggerType.PointerDown, | |
EventTriggerType.PointerUp, | |
EventTriggerType.PointerClick, | |
EventTriggerType.Drag, |
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
/[Ll]ibrary/ | |
/[Tt]emp/ | |
/[Oo]bj/ | |
/[Bb]uild/ | |
/[Bb]uilds/ | |
/.idea/ | |
/.gradle/ | |
/Logs/ | |
/.vs/ |
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
{ | |
"name": "if_false", | |
"references": [], | |
"includePlatforms": [], | |
"excludePlatforms": [], | |
"allowUnsafeCode": false, | |
"overrideReferences": false, | |
"precompiledReferences": [], | |
"autoReferenced": true, | |
"defineConstraints": [ |
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
Shader "Hidden/BoneHandles" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1,1,1,1) | |
} | |
SubShader | |
{ | |
Tags { "Queue" = "Transparent" "RenderType"="Transparent" "ForceSupported" = "True" } |
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
[InitializeOnLoad] | |
public static class BoneRendererUtil { | |
class BatchRenderer { | |
const int KMaxDrawMeshInstanceCount = 1023; | |
public enum SubMeshType { | |
BoneFaces, | |
BoneWire, | |
Count | |
} |
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 BezierSegment TryGetNextSegment() { | |
if (IsInValidChain == false) | |
return null; | |
var thisIndex = transform.GetSiblingIndex(); | |
var isLast = thisIndex == transform.parent.childCount - 1; | |
BezierSegment GetSiblingSegment(int i) => transform.parent.GetChild(i).GetComponent<BezierSegment>(); | |
if (isLast && BezierChain.loop) | |
return GetSiblingSegment(0); // First segment | |
return isLast ? null : GetSiblingSegment(thisIndex + 1); | |
} |
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
IEnumerable<AnimatorState> Traverse(AnimatorController controller) { | |
foreach (var controllerLayer in controller.layers) | |
foreach (var st in Inner(controllerLayer.stateMachine)) | |
yield return st; | |
IEnumerable<AnimatorState> Inner(AnimatorStateMachine f) { | |
foreach (var state in f.states) | |
yield return state.state; | |
foreach (var child in f.stateMachines) |
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
static class DirtyUtils { | |
static bool Same<T1, T2>(ref int hash, in T1 v1, in T2 v2) { | |
var prev = hash; | |
hash = v1.GetHashCode(); | |
hash = (hash * 397) ^ v2.GetHashCode(); | |
return hash == prev; | |
} | |
public static int HashCode<T1, T2>(in T1 v1, in T2 v2) { | |
var hash = v1.GetHashCode(); |