Example #1
0
        public ActionSteps GetActionStep(ref int index)
        {
            if (steps == null || steps.Count == 0)
            {
                if (defaultStep == null)
                {
                    defaultStep          = new ActionSteps();
                    defaultStep.branches = new List <ActionAnim>();
                    ActionAnim aa = new ActionAnim();
                    aa.input      = input;
                    aa.targetAnim = targetAnimation;
                    defaultStep.branches.Add(aa);
                }
                return(defaultStep);
            }

            if (index > steps.Count - 1)
            {
                index = 0;
            }
            ActionSteps retVal = steps[index];

            if (index > steps.Count - 1)
            {
                index = 0;
            }
            else
            {
                index++;
            }

            return(retVal);
        }
Example #2
0
        public static void DeepCopyStep(ActionSteps from, ActionSteps to)
        {
            to.branches = new List <ActionAnim>();

            for (int i = 0; i < from.branches.Count; i++)
            {
                ActionAnim a = new ActionAnim();
                a.input      = from.branches[i].input;
                a.targetAnim = from.branches[i].targetAnim;
                to.branches.Add(a);
            }
        }