示例#1
0
        public static IINode BabylonContainerHelper(this IIContainerObject containerObject)
        {
            IINode babylonHelper = null;

            foreach (IINode directChild in containerObject.ContainerNode.DirectChildren())
            {
                if (directChild.IsBabylonContainerHelper())
                {
                    babylonHelper = directChild;
                }
            }

            if (babylonHelper == null)
            {
                IDummyObject dummy = Loader.Global.DummyObject.Create();
                babylonHelper = Loader.Core.CreateObjectNode(dummy, $"BabylonContainerHelper_{Random.Next(0, 99999)}");
                babylonHelper.SetUserPropBool("babylonjs_ContainerHelper", true);

                Loader.Core.SetQuietMode(true);
                containerObject.ContainerNode.AttachChild(babylonHelper, false);
                Loader.Core.SetQuietMode(false);
                containerObject.AddNodeToContent(babylonHelper);
            }
            return(babylonHelper);
        }
示例#2
0
        public static IINode BabylonContainerHelper(this IIContainerObject containerObject)
        {
            IINode babylonHelper = containerObject.ContainerNode.FindChildNode("BabylonAnimationHelper");

            if (babylonHelper == null)
            {
                IDummyObject dummy = Loader.Global.DummyObject.Create();
                babylonHelper = Loader.Core.CreateObjectNode(dummy, "BabylonAnimationHelper");

                Loader.Core.SetQuietMode(true);
                containerObject.ContainerNode.AttachChild(babylonHelper, false);
                Loader.Core.SetQuietMode(false);
                containerObject.AddNodeToContent(babylonHelper);
            }
            return(babylonHelper);
        }
示例#3
0
        public static IINode BabylonContainerHelper(this IIContainerObject containerObject)
        {
            IINode babylonHelper = containerObject.ContainerNode.FindChildNode("BabylonAnimationHelper");

            if (babylonHelper == null)
            {
                MessageBox.Show($"Container {containerObject.ContainerNode.Name} has no Babylon Animation Helper, " +
                                $"a default one has been created, this process should be done on the container source");
                IDummyObject dummy = Loader.Global.DummyObject.Create();
                babylonHelper = Loader.Core.CreateObjectNode(dummy, "BabylonAnimationHelper");

                Loader.Core.SetQuietMode(true);
                containerObject.ContainerNode.AttachChild(babylonHelper, false);
                Loader.Core.SetQuietMode(false);
                containerObject.AddNodeToContent(babylonHelper);
            }
            return(babylonHelper);
        }