protected override void ProgressItemAnimator(float timeStep)
 {
     if (areaLockAnimator != null)
     {
         areaLockAnimator.Progress(timeStep);
     }
 }
    public void Progress(float timeStep)
    {
        SimpleAnimator debrisAnimator = null;

        if (!over)
        {
            if (debrisAnimators != null)
            {
                for (int i = 0; i < debrisAnimators.Length; i++)
                {
                    debrisAnimator = debrisAnimators[i];
                    debrisAnimator.Progress(timeStep);
                    if (debrisAnimator.IsOver())
                    {
                        RemoveDebris(i);
                        if (debrisAnimators == null)
                        {
                            break;
                        }
                        else
                        {
                            i--;
                        }
                    }
                }
            }
            if (destroyed)
            {
                if (debrisExtraDelay > 0f)
                {
                    debrisExtraElapsed += timeStep;
                    if (debrisExtraElapsed > debrisExtraDelay)
                    {
                        CreateAllDebris(debrisSlotDestruction);
                        debrisExtraDelay = 0f;
                    }
                }
            }
            if (obstacleAnimator != null)
            {
                obstacleAnimator.Progress(timeStep);
                if (obstacleAnimator.IsDead())
                {
                    /*halmeida - If the animations of the animator are not propperly configured, the animator
                     * may die before we ask it to, which means it will die visually, but it will still be working
                     * normally in terms of purpose.*/
                    if (!destroyed)
                    {
                        DestroyObstacle();
                    }
                    /*halmeida - only after making sure it's propperly disabled we end it.*/
                    over = true;
                }
            }
        }
    }
Exemple #3
0
    public virtual void Progress(float timeStep)
    {
        if (!over)
        {
            if (active)
            {
                if (activeDuration > 0f)
                {
                    activeElapsed += timeStep;
                    if (activeElapsed > activeDuration)
                    {
                        Deactivate();
                    }
                }
                if (active)
                {
                    Accelerate(timeStep);
                    Move(timeStep);
                }
            }
            if (triggered && continuousEffect)
            {
                if (triggeringComponents != null)
                {
                    for (int i = 0; i < triggeringComponents.Length; i++)
                    {
                        ApplyContinuousEffect(triggeringComponents[i], timeStep);
                    }
                }
            }
            if (projectileAnimator != null)
            {
                projectileAnimator.Progress(timeStep);
                if (projectileAnimator.IsDead())
                {
                    /*halmeida - the projectile animation may start dying before we actually ask it to die.
                     * This may be due to the projectile not having a properly configured set of animations.
                     * In this case, we have to deactivate it now, since it does no longer exist visually.*/
                    if (active)
                    {
                        Deactivate();
                    }

                    /*halmeida - wether we asked it to die or it died by itself, at this point the projectile
                     * does no longer exist.*/
                    over = true;
                }
            }
        }
    }