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
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
#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
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
class ShotView : MonoBehaviour { | |
public Transform HoleRoot; | |
public Renderer SubtractRenderer; | |
public AnimationCurve ScaleXY; | |
public AnimationCurve ScaleZ; | |
public float TimeLen = 0.3f; | |
public void Render(CompShotData data) { | |
var linear = data.Progress; | |
var xy = ScaleXY.Evaluate(linear); |
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 PoseUtils { | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public static Pose GetPose(this Transform transform) { | |
return new Pose() {position = transform.position, rotation = transform.rotation}; | |
} | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public static void SetPose(this Transform transform, Pose pose) { | |
transform.position = pose.position; | |
transform.rotation = pose.rotation; |
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 class Pool<T> : IDisposable where T : class { | |
static Action<T> Empty { get; } = _ => { }; | |
Func<T> _ctor; | |
readonly Stack<T> _stack; | |
// todo place asserts on app quit | |
Action<T> _reset; | |
Action<T> _destroy; | |
public Pool(Func<T> ctor, Action<T> reset, Action<T> destroy = null) { |
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 class SpeedOMeter { | |
public AverageVector3 AngularVelocity; | |
public AverageVector3 Velocity; | |
Quaternion _lastRotation; | |
Vector3 _lastPos; | |
Transform _t; | |
public SpeedOMeter(Transform t) { | |
_t = t; |
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
#if UNITY_EDITOR | |
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
using System; | |
using System.IO; | |
using System.Text; | |
public class LayerGenerator : EditorWindow { | |
[MenuItem("Edit/Rebuild LAYERS.cs %&L")] |
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 Transform FindInChildren(this Transform self, string name) | |
{ | |
int count = self.childCount; | |
for (int i = 0; i < count; i++) | |
{ | |
Transform child = self.GetChild(i); | |
if (child.name == name) return child; | |
Transform subChild = child.FindInChildren(name); | |
if (subChild != null) return subChild; | |
} |