Example #1
0
    public virtual void ClearShadows()
    {
        VFXAppearanceController shadow = null;
        GameObject shadowObject        = null;

        if (pausedShadows != null)
        {
            for (int i = 0; i < pausedShadows.Length; i++)
            {
                shadow = pausedShadows[i];
                if (shadow != null)
                {
                    shadow.Clear();
                    pausedShadows[i] = null;
                }
                shadowObject = pausedShadowObjects[i];
                if (shadowObject != null)
                {
                    Destroy(shadowObject);
                    pausedShadowObjects[i] = null;
                }
            }
            pausedShadows       = null;
            pausedShadowObjects = null;
        }
        if (shadows != null)
        {
            for (int i = 0; i < shadows.Length; i++)
            {
                shadow = shadows[i];
                if (shadow != null)
                {
                    shadow.Clear();
                    shadows[i] = null;
                }
                shadowObject = shadowObjects[i];
                if (shadowObject != null)
                {
                    Destroy(shadowObject);
                    shadowObjects[i] = null;
                }
            }
            shadows       = null;
            shadowObjects = null;
        }
    }
Example #2
0
    protected void RemoveShadow(int shadowIndex, bool fromPausedShadows)
    {
        VFXAppearanceController shadow = null;
        GameObject shadowObject        = null;

        VFXAppearanceController[] properShadows = null;
        GameObject[] properShadowObjects        = null;

        if (fromPausedShadows)
        {
            properShadowObjects = pausedShadowObjects;
            properShadows       = pausedShadows;
        }
        else
        {
            properShadowObjects = shadowObjects;
            properShadows       = shadows;
        }
        if (properShadows != null)
        {
            if ((shadowIndex > -1) && (shadowIndex < properShadows.Length))
            {
                shadow = properShadows[shadowIndex];
                if (shadow != null)
                {
                    shadow.Clear();
                    properShadows[shadowIndex] = null;
                }
                shadowObject = properShadowObjects[shadowIndex];
                if (shadowObject != null)
                {
                    Destroy(shadowObject);
                    properShadowObjects[shadowIndex] = null;
                }
                if (fromPausedShadows)
                {
                    UsefulFunctions.DecreaseArray <VFXAppearanceController>(ref pausedShadows, shadowIndex);
                    UsefulFunctions.DecreaseArray <GameObject>(ref pausedShadowObjects, shadowIndex);
                }
                else
                {
                    UsefulFunctions.DecreaseArray <VFXAppearanceController>(ref shadows, shadowIndex);
                    UsefulFunctions.DecreaseArray <GameObject>(ref shadowObjects, shadowIndex);
                }
            }
        }
    }