Ejemplo n.º 1
0
        public static void NodeSubscribe(this Behaviour behaviour, JNode node, JNodeEvent eventFilter, Action <JNode> action, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            node.Subscribe(linkHandler, (n, e) =>
            {
                if (e == eventFilter)
                {
                    action(n);
                }
            });
        }
Ejemplo n.º 2
0
        public FrameTimer(int frames, Action onCompleted, Behaviour behaviour, bool alwaysActive = false) : this(frames, onCompleted)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            this.updateCondition = () => linkHandler.IsActive;
        }
Ejemplo n.º 3
0
        public static IFrameTimer NewFrameTimer <T>(this Behaviour behaviour, int frames, Action onCompleted, bool alwaysActive = false) where T : ITimeEvent
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            return(new FrameTimer <T>(frames, onCompleted, () => linkHandler.IsActive));
        }
Ejemplo n.º 4
0
        public static ITimer NewTimer <T>(this Behaviour behaviour, float seconds, Action onCompleted, bool alwaysActive = false) where T : ITimeDeltaEvent
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            return(new Timer <T>(seconds, onCompleted, () => linkHandler.IsActive));
        }
Ejemplo n.º 5
0
        public static IClock NewClock <T>(this Behaviour behaviour, float elapsedSeconds, bool alwaysActive = false) where T : ITimeDeltaEvent
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            return(new Clock <T>(elapsedSeconds, () => linkHandler.IsActive));
        }
Ejemplo n.º 6
0
 public Clock(float elapsedSeconds, Behaviour behaviour, bool alwaysActive = false) : this(elapsedSeconds)
 {
     var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);
     this.updateCondition = () => linkHandler.IsActive;
 }
Ejemplo n.º 7
0
        public Clock(Behaviour behaviour, bool alwaysActive = false) : this()
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            this.updateCondition = () => linkHandler.IsActive;
        }
Ejemplo n.º 8
0
        public static Action <TRemote> DataBind <T, TRemote>(this Behaviour behaviour, JData <T> node, Action <JData <T> > action, Func <TRemote, T> converter, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            return(node.Bind(linkHandler, action, converter));
        }
Ejemplo n.º 9
0
        public static Action <T> DataBind <T>(this Behaviour behaviour, JData <T> node, Action <JData <T> > action, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            return(node.Bind(linkHandler, action));
        }
Ejemplo n.º 10
0
        public static void DataSubscribe <T>(this Behaviour behaviour, JData <T> node, Action <JData <T> > action, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            node.Subscribe(linkHandler, action);
        }
Ejemplo n.º 11
0
        public static void NodeSubscribe(this Behaviour behaviour, JNode node, Action <JNode, JNodeEvent> action, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            node.Subscribe(linkHandler, action);
        }
Ejemplo n.º 12
0
        public Timer(float seconds, Action onCompleted, Behaviour behaviour, bool alwaysActive = false) : this(seconds, onCompleted)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            this.updateCondition = () => linkHandler.IsActive;
        }