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 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; | |
| 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
| /* | |
| // 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
| 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
| /// <summary> | |
| /// This is a pubsub system used for coordinating loosely coupled systems. | |
| /// It does some tricks with an internal class to improve the appearance | |
| /// of the public API. | |
| /// </summary> | |
| public static class GameEvent | |
| { | |
| /* Public API */ | |
| public static void Publish<T>(T ev) => _InternalGameEvent<T>.Publish(ev); |
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; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class AssetForgePostProcessor : AssetPostprocessor | |
| { |
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.Generic; | |
| using UnityEngine; | |
| public abstract class MonoBehaviourSystem<T> : MonoBehaviour where T : MonoBehaviourComponent<T> | |
| { | |
| protected abstract void UpdateBatch(Queue<T> components); | |
| void Update() | |
| { | |
| UpdateBatch(ComponentBatch<T>.components); |
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
| float Sin(float x) | |
| { | |
| while (x < -3.14159265f) | |
| x += 6.28318531f; | |
| while (x > 3.14159265f) | |
| x -= 6.28318531f; | |
| float sin; | |
| var xZ = x < 0 ? -1 : 1; | |
| sin = 1.27323954f * x - xZ * .405284735f * x * x; | |
| var sinZ = sin < 0 ? -1 : 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
| [Serializable] | |
| public class MyClass { | |
| public int id; | |
| } | |
| [CustomPropertyDrawer(typeof(MyClass))] | |
| public class MyClassDrawer : PropertyDrawer | |
| { | |
| public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | |
| { |