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 TouchRecognizer : MonoBehaviour | |
| { | |
| const float LOWPASS_FILTER = 0.1f; | |
| const float ANGLE_DELTA_THRESHOLD = 0.001f; | |
| const float PINCH_DELTA_THRESHOLD = 0.1f; | |
| const float TIME_REQUIRED_FOR_SINGLE_TOUCH = 0.05f; | |
| float _angleDelta, _pinchDelta, angleDelta, pinchDelta; | |
| Vector3 delta; |
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
| /* | |
| // Example Usage: | |
| public class SomeEv : Event<SomeEv> { } | |
| public class SomeOtherEv : Event<SomeOtherEv> { } | |
| public class EVTest : MonoBehaviour | |
| { | |
| void Start() |
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; | |
| namespace Simulator | |
| { | |
| public class HeapQueue<T> where T : IComparable<T> | |
| { | |
| List<T> items; | |
| public int Count { get { return items.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 static class ServiceLocator<TA> where TA : class | |
| { | |
| static System.Func<TA> constructor = null; | |
| static System.Type type; | |
| public static void Bind<TB> () where TB:TA,new() | |
| { | |
| type = typeof(TB); |
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.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class StopAction : YieldInstruction | |
| { | |
| } | |
| public class GoroutinePool |
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 InstancedRenderer : System.IDisposable | |
| { | |
| const int BATCH_MAX = 1023; | |
| public NativeArray<Matrix4x4> matrices; | |
| public readonly int count, allocated; | |
| public readonly Mesh mesh; | |
| public readonly Material material; | |
| Matrix4x4[] batchedMatrices = new Matrix4x4[BATCH_MAX]; |
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 AddThingToSomeScriptableObject : ScriptableWizard | |
| { | |
| internal SomeScriptableObject someScriptableObject; | |
| public SomeThing someThing; | |
| void OnCreateButton() | |
| { | |
| //add someThing to someScriptableObject. | |
| } | |
| } |
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 InstanceTracker<T> : MonoBehaviour where T : MonoBehaviour | |
| { | |
| public static List<T> Instances { get; private set; } = new List<T>(); | |
| int instanceIndex = 0; | |
| void OnEnable() | |
| { | |
| instanceIndex = Instances.Count; | |
| Instances.Add(this as 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
| using System; | |
| using UnityEngine; | |
| using UnityEngine.Rendering.PostProcessing; | |
| [Serializable] | |
| [PostProcess(typeof(ColorBlindCorrectionRenderer), PostProcessEvent.AfterStack, "Custom/ColorBlindCorrection")] | |
| public sealed class ColorBlindCorrection : PostProcessEffectSettings | |
| { | |
| [Header("1:Protanopia 2:Deuteranopia 3:Tritanopia")] | |
| [Range(0, 2)] |
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 AI | |
| { | |
| Domain CreateDomain() | |
| { | |
| using (domain = Domain.New()) | |
| { | |
| worldState = DefineWorldState(health, fuel, speed, angularSpeed); | |
| DefinePrimitiveTask(SetRandomDestination); | |
| DefinePrimitiveTask(MoveToDestination) |