Ejemplo n.º 1
0
    /// <summary>Clears all content from the UI and all WorldUI's.
    /// Please note that it is safer to set innerHTML to a blank string for a particular UI than calling this.</summary>
    public static void ClearAll()
    {
        content = null;

        if (Renderer != null)
        {
            Renderer.Destroy();
            Renderer = null;
            document = null;
        }

        Fonts.Clear();
        AtlasStacks.Clear();
        Web.Clear();
        Spa.SPA.Clear();
        UIAnimation.Clear();
        ScreenInfo.Clear();
        WorldUI currentWorldUI = FirstWorldUI;

        while (currentWorldUI != null)
        {
            currentWorldUI.Destroy();
            currentWorldUI = currentWorldUI.UIAfter;
        }

        LastWorldUI  = null;
        FirstWorldUI = null;
    }
Ejemplo n.º 2
0
    /// <summary>Clears all content from the UI and all WorldUI's.
    /// Please note that it is safer to set innerHTML to a blank string for a particular UI than calling this.</summary>
    public static void ClearAll()
    {
        content = null;

        if (Renderer != null)
        {
            Renderer.Destroy();
            Renderer = null;
            document = null;
        }

        Fonts.Clear();
        AtlasStacks.Clear();
        Http.Clear();
        SPA.Clear();
        UIAnimation.Clear();
        DynamicTexture.RemoveAll();
        PowerUI.Input.Clear();
        ScreenInfo.Clear();
        WorldUI currentWorldUI = FirstWorldUI;

        while (currentWorldUI != null)
        {
            currentWorldUI.Destroy();
            currentWorldUI = currentWorldUI.UIAfter;
        }

        LastWorldUI  = null;
        FirstWorldUI = null;
    }
Ejemplo n.º 3
0
        /// <summary>Destroys this UI. Note that this also occurs if the gameobject is destroyed;
        /// Just destroying the gameobject or a parent gameObject is all that is required.</summary>
        public virtual void Destroy()
        {
            if (Renderer == null)
            {
                return;
            }

            // Remove from the physics lookup if needed:
            if (PhysicsLookup != null && transform != null)
            {
                PhysicsLookup.Remove(transform);

                if (PhysicsLookup.Count == 0)
                {
                    PhysicsLookup = null;
                }
            }

            Renderer.Destroy();
            Renderer = null;

            if (gameObject != null)
            {
                GameObject.Destroy(gameObject);
                gameObject = null;
                transform  = null;
            }

            // Remove it from the UI update linked list:
            if (UIBefore == null)
            {
                UI.FirstWorldUI = UIAfter;
            }
            else
            {
                UIBefore.UIAfter = UIAfter;
            }

            if (UIAfter == null)
            {
                UI.LastWorldUI = UIBefore;
            }
            else
            {
                UIAfter.UIBefore = UIBefore;
            }
        }
Ejemplo n.º 4
0
        /// <summary>Destroys this UI. Note that this also occurs if the gameobject is destroyed;
        /// Just destroying the gameobject or a parent gameObject is all that is required.</summary>
        public void Destroy()
        {
            if (Renderer == null)
            {
                return;
            }

            Renderer.Destroy();
            Renderer = null;

            if (gameObject != null)
            {
                GameObject.Destroy(gameObject);
                gameObject = null;
                transform  = null;
            }

            // Remove it from the UI update linked list:
            if (UIBefore == null)
            {
                UI.FirstWorldUI = UIAfter;
            }
            else
            {
                UIBefore.UIAfter = UIAfter;
            }

            if (UIAfter == null)
            {
                UI.LastWorldUI = UIBefore;
            }
            else
            {
                UIAfter.UIBefore = UIBefore;
            }
        }