Exemplo n.º 1
0
        // [RMS] management of Panel children. Currently we do not use Panel
        //   directly, so these are not publicly accessible. I don't entirely like this.
        //   However, C# does not allow us to "hide" a public member in a subclass,
        //   which means that Panel implementations would directly expose these, when
        //   in most cases they should not be exposed...

        protected virtual void AddChild(SceneUIElement ui, bool bKeepWorldPosition = true)
        {
            if (!Children.Contains(ui))
            {
                Children.Add(ui);
                ui.Parent = this;
                ui.SetLayer(this.Layer);
                gameObject.AddChild(ui.RootGameObject, bKeepWorldPosition);
            }
        }
Exemplo n.º 2
0
        public void AddUIElement(SceneUIElement e, bool bIsInLocalFrame = true)
        {
            vUIElements.Add(e);
            e.Parent = this;
            if (e.RootGameObject != null)
            {
                // assume element transform is set to a local transform, so we want to apply current scene transform?
                e.RootGameObject.SetParent(RootGameObject, (bIsInLocalFrame == false));
            }

            e.SetLayer(UIElementLayer);
        }