Exemplo n.º 1
0
 public JFiniteTimeActionState(JFiniteTimeAction action, GameObject target)
     : base(action, target)
 {
     Duration  = action.Duration;
     Elapsed   = 0.0f;
     firstTick = true;
 }
Exemplo n.º 2
0
 public static JActionState RepeatForever(this GameObject target, JFiniteTimeAction action)
 {
     return(target.RunAction(new JRepeatForever(action)
     {
         Tag = action.Tag
     }));
 }
Exemplo n.º 3
0
        public JSpawn(params JFiniteTimeAction[] actions)
        {
            JFiniteTimeAction prev = actions [0];
            JFiniteTimeAction next = null;

            if (actions.Length == 1)
            {
                next = new JExtraAction();
            }
            else
            {
                // We create a nested set of JSpawnActions out of all of the actions
                for (int i = 1; i < actions.Length - 1; i++)
                {
                    prev = new JSpawn(prev, actions [i]);
                }

                next = actions [actions.Length - 1];
            }

            // Can't call base(duration) because we need to determine max duration
            // Instead call base's init method here
            if (prev != null && next != null)
            {
                Duration = Math.Max(prev.Duration, next.Duration);
                InitJSpawn(prev, next);
            }
        }
Exemplo n.º 4
0
        void InitJSequence(JFiniteTimeAction actionOne, JFiniteTimeAction actionTwo)
        {
            Debug.Assert(actionOne != null);
            Debug.Assert(actionTwo != null);

            Actions [0] = actionOne;
            Actions [1] = actionTwo;
        }
Exemplo n.º 5
0
        public override JFiniteTimeAction Reverse()
        {
            JFiniteTimeAction[] rev = new JFiniteTimeAction[Actions.Length];
            for (int i = 0; i < Actions.Length; i++)
            {
                rev [i] = Actions [i].Reverse();
            }

            return(new JParallel(rev));
        }
Exemplo n.º 6
0
        public JRepeat(JFiniteTimeAction action, uint times) : base(action.Duration * times)
        {
            Times       = times;
            InnerAction = action;

            ActionInstant = action is JActionInstant;
            //an instant action needs to be executed one time less in the update method since it uses startWithTarget to execute the action
            if (ActionInstant)
            {
                Times -= 1;
            }
            Total = 0;
        }
Exemplo n.º 7
0
        private void InitJSpawn(JFiniteTimeAction action1, JFiniteTimeAction action2)
        {
            Debug.Assert(action1 != null);
            Debug.Assert(action2 != null);

            float d1 = action1.Duration;
            float d2 = action2.Duration;

            ActionOne = action1;
            ActionTwo = action2;

            if (d1 > d2)
            {
                ActionTwo = new JSequence(action2, new JDelayTime(d1 - d2));
            }
            else if (d1 < d2)
            {
                ActionOne = new JSequence(action1, new JDelayTime(d2 - d1));
            }
        }
Exemplo n.º 8
0
 public JReverseTime(JFiniteTimeAction action) : base(action.Duration)
 {
     Other = action;
 }
Exemplo n.º 9
0
 public JEaseElastic(JFiniteTimeAction action, float period) : base(action)
 {
     Period = period;
 }
Exemplo n.º 10
0
 public JEaseQuintInOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 11
0
 public JEaseElasticInOut(JFiniteTimeAction action, float period) : base(action, period)
 {
 }
Exemplo n.º 12
0
 public JEaseExponentialOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 13
0
 protected JSpawn(JFiniteTimeAction action1, JFiniteTimeAction action2)
     : base(Math.Max(action1.Duration, action2.Duration))
 {
     InitJSpawn(action1, action2);
 }
Exemplo n.º 14
0
 public JEaseBackInOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 15
0
 public JEaseElasticOut(JFiniteTimeAction action) : base(action, 0.3f)
 {
 }
Exemplo n.º 16
0
 public JEaseRateAction(JFiniteTimeAction action, float rate) : base(action)
 {
     Rate = rate;
 }
Exemplo n.º 17
0
 public static JActionState Repeat(this GameObject target, uint times, JFiniteTimeAction action)
 {
     return(target.RunAction(new JRepeat(action, times)));
 }
Exemplo n.º 18
0
 public JEaseBounceInOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 19
0
 public JEaseCircInOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 20
0
 public JSpeed(JFiniteTimeAction action, float speed)
 {
     InnerAction = action;
     Speed       = speed;
 }
Exemplo n.º 21
0
 public JEaseInOut(JFiniteTimeAction action, float rate) : base(action, rate)
 {
 }
Exemplo n.º 22
0
 public JEaseCubicOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 23
0
 public JEaseCustom(JFiniteTimeAction action, Func <float, float> easeFunc) : base(action)
 {
     EaseFunc = easeFunc;
 }
Exemplo n.º 24
0
 public JActionEase(JFiniteTimeAction action) : base(action.Duration)
 {
     InnerAction = action;
 }
Exemplo n.º 25
0
 public JEaseQuartOut(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 26
0
 public JTargetedAction(GameObject target, JFiniteTimeAction action) : base(action.Duration)
 {
     ForcedTarget   = target;
     TargetedAction = action;
 }
Exemplo n.º 27
0
 public JEaseElasticInOut(JFiniteTimeAction action) : this(action, 0.3f)
 {
 }
Exemplo n.º 28
0
 public JEaseSineIn(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 29
0
 public JEaseQuadIn(JFiniteTimeAction action) : base(action)
 {
 }
Exemplo n.º 30
0
 public JSequence(JFiniteTimeAction action1, JFiniteTimeAction action2) : base(action1.Duration + action2.Duration)
 {
     Actions = new JFiniteTimeAction[2];
     InitJSequence(action1, action2);
 }