/// <summary>
 /// 破棄
 /// </summary>
 private void OnDestroy()
 {
     Compute.Dispose();
     Wind.Dispose();
     Team.Dispose();
     Mesh.Dispose();
     Bone.Dispose();
     Particle.Dispose();
 }
        /// <summary>
        /// 破棄
        /// </summary>
        protected override void OnDestroy()
        {
            Compute.Dispose();
            Wind.Dispose();
            Team.Dispose();
            Mesh.Dispose();
            Bone.Dispose();
            Particle.Dispose();
            Component.Dispose();

            base.OnDestroy();
        }
Beispiel #3
0
        public SceneImportResult LoadSkelletalMesh(string xFile)
        {
            this.xFile = xFile;
            var allocator = new MeshAllocator();
            AnimationController aController;
            FileStream          file = new FileStream(xFile, FileMode.Open, FileAccess.Read);
            GFrame frameRoot         = (GFrame)Frame.LoadHierarchyFromX(Engine.Graphics, file, MeshFlags.Managed, allocator, null, out aController);

            var vd = VertexDescriptor.Get <SkinVertex>();
            List <Tuple <Bone, GFrame> > bones = new List <Tuple <Bone, GFrame> >();

            Bone root = GetBone(frameRoot, bones);
            QuadTreeSceneNode sceneNode = new QuadTreeSceneNode(Path.GetFileNameWithoutExtension(xFile), 10);

            foreach (var item in bones)
            {
                if (item.Item2.MeshContainer != null)
                {
                    var mesh = GetMesh((GMeshContainer)item.Item2.MeshContainer, root, vd);
                    sceneNode.Add(new SkelletalMeshNode(item.Item2.Name, mesh));
                }
            }

            sceneNode.UpdateLayout(true);

            try
            {
                file.Close();
                if (aController != null)
                {
                    aController.Dispose();
                }
                allocator.DestroyFrame(frameRoot);
                root.Dispose();
            }
            catch (Exception)
            {
            }

            //AnimationCollection animations = new AnimationCollection();
            //animations.Load(xFile, model.RootBone);

            return(new SceneImportResult {
                VisualSceneRoot = sceneNode, BoneRoots = new List <Bone> {
                    root
                }
            });
        }
 void ReleaseDesignerOutlets()
 {
     if (Bcover != null)
     {
         Bcover.Dispose();
         Bcover = null;
     }
     if (Beight != null)
     {
         Beight.Dispose();
         Beight = null;
     }
     if (Bfive != null)
     {
         Bfive.Dispose();
         Bfive = null;
     }
     if (Bfour != null)
     {
         Bfour.Dispose();
         Bfour = null;
     }
     if (Bnine != null)
     {
         Bnine.Dispose();
         Bnine = null;
     }
     if (Bone != null)
     {
         Bone.Dispose();
         Bone = null;
     }
     if (BQuitGame != null)
     {
         BQuitGame.Dispose();
         BQuitGame = null;
     }
     if (Bseven != null)
     {
         Bseven.Dispose();
         Bseven = null;
     }
     if (Bsix != null)
     {
         Bsix.Dispose();
         Bsix = null;
     }
     if (Bthree != null)
     {
         Bthree.Dispose();
         Bthree = null;
     }
     if (Btwo != null)
     {
         Btwo.Dispose();
         Btwo = null;
     }
     if (FirstLabel != null)
     {
         FirstLabel.Dispose();
         FirstLabel = null;
     }
     if (FirstLabel2 != null)
     {
         FirstLabel2.Dispose();
         FirstLabel2 = null;
     }
     if (FirstPiece != null)
     {
         FirstPiece.Dispose();
         FirstPiece = null;
     }
     if (OutputLabel != null)
     {
         OutputLabel.Dispose();
         OutputLabel = null;
     }
     if (PlayView != null)
     {
         PlayView.Dispose();
         PlayView = null;
     }
     if (SecondLabel != null)
     {
         SecondLabel.Dispose();
         SecondLabel = null;
     }
     if (SecondLabel2 != null)
     {
         SecondLabel2.Dispose();
         SecondLabel2 = null;
     }
     if (SecondPiece != null)
     {
         SecondPiece.Dispose();
         SecondPiece = null;
     }
     if (StatusLabel != null)
     {
         StatusLabel.Dispose();
         StatusLabel = null;
     }
 }