Ejemplo n.º 1
0
    public void Move(int step, float t)
    {
        if (IsError || step == 0)
        {
            return;
        }

        if (!IsCreateMotionUnitList)
        {
            IsCreateMotionUnitList = true;

            int fromPanelIndex, toPanelIndex;
            ComputeMotionPanelIndexSection(ref step, out fromPanelIndex, out toPanelIndex);
            for (int i = fromPanelIndex; i <= toPanelIndex; i++)
            {
                MotionUnit motionUnit = CreateMotionUnit(i, step);
                if (motionUnit != null)
                {
                    MotionUnitList.Add(motionUnit);
                }
            }
        }
        else
        {
            foreach (MotionUnit mu in MotionUnitList)
            {
                mu.Motion(t);
            }

            if (t == 1)
            {
                IsCreateMotionUnitList = false;
                MotionUnitList.Clear();
            }
        }
    }
Ejemplo n.º 2
0
 public override void VelocityImpulse(Vector3 impulse)
 {
     MotionUnit.VelocityImpulse(impulse);
 }