Ejemplo n.º 1
0
        public static CellOfSin SignalSin(this IEventReader e, float scale, float speed, float resetVal, Action <IDisposable> connectionSink)
        {
            CellOfSin cell = new CellOfSin {
                scale = scale, speed = speed
            };

            connectionSink(UnityExecutor.instance.AddUpdatable(cell));
            connectionSink(e.Subscribe(() => cell.Reset(resetVal)));
            return(cell);
        }
        public static CellOfSin SignalSin(this IEventStream reset, float scale, float speed, float resetVal,
                                          IConnectionSink connectionSink)
        {
            CellOfSin cell = new CellOfSin {
                scale = scale, speed = speed
            };

            connectionSink.AddConnection(UnityExecutor.Instance.AddUpdatable(cell));
            if (reset != null)
            {
                connectionSink.AddConnection(reset.Subscribe(() => cell.Reset(resetVal)));
            }
            return(cell);
        }