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; | |
| namespace RamjetAnvil.GameObjectFactories | |
| { | |
| public struct ObjectFactory { | |
| private readonly bool _isObjectActive; | |
| private readonly Func<GameObject> _instantiator; | |
| public ObjectFactory(bool isObjectActive, Func<GameObject> instantiator) { |
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
| var cloneWithProps = React.addons.cloneWithProps; | |
| var SmartSortable = React.createClass({ | |
| getDefaultProps: function() { | |
| return {component: "ul", childComponent: "li"}; | |
| }, | |
| render: function() { | |
| var props = jQuery.extend({}, this.props); |
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 Func<float, float> SingleAxisDeadzone(float deadzone) | |
| { | |
| var scalingFactor = 1 - deadzone; | |
| return axisState => | |
| { | |
| if (Mathf.Abs(axisState) < deadzone) | |
| { | |
| return 0f; | |
| } |
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
| void Start () | |
| { | |
| var onNext = UnityObservable.EveryUpdate<float>(observer => | |
| { | |
| Debug.Log("on next call: " + Time.time); | |
| observer.OnNext(Time.time); | |
| }); | |
| var select = UnityObservable.EveryUpdate<Unit>(observer => observer.OnNext(Unit.Default)) | |
| .Select(_ => | |
| { |
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 UnityEngine; | |
| public class Example : MonoBehaviour | |
| { | |
| public static Example Singleton; | |
| void OnEnable() | |
| { | |
| if (Singleton == null) | |
| Singleton = this; |
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 AnonymousMonoBehaviours | |
| { | |
| private static readonly Action EmptyAction = () => { }; | |
| /// <summary> | |
| /// Creates an anonymous MonoBehaviour instance from a given update Action. | |
| /// The instance can be destroyed by calling Dispose on the returned IDisposable. | |
| /// </summary> | |
| /// <param name="updateFn">Called whenever AnonymousMonobehaviour.Update() is called.</param> | |
| /// <param name="startFn">Called whenever AnonymousMonobehaviour.Start() is called.</param> |
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 enum MoveType { LightPunch, MediumPunch, HeavyPunch, SuperPunch, Fireball } | |
| public class InputSequence | |
| { | |
| public IList<IList> sequence; | |
| } | |
| public class Move | |
| { | |
| public MoveType type; |
NewerOlder