コード例 #1
0
        public void Write( )
        {
            Help.IOHelp.WriteInt(Scripts.Count);
            foreach (Script.ScriptLink s in Scripts)
            {
                Help.IOHelp.WriteString(s.Name);
                Help.IOHelp.WriteString(s.FilePath);
            }
            Help.IOHelp.WriteMatrix(LocalTurn);
            Help.IOHelp.WriteVec(LocalPos);
            Help.IOHelp.WriteVec(LocalScale);
            Help.IOHelp.WriteString(Name);
            Help.IOHelp.WriteBool(AlwaysAlpha);
            Help.IOHelp.WriteBool(On);
            Help.IOHelp.WriteInt(Sub.Count);

            int mc = Meshes.Count;

            Help.IOHelp.WriteInt(mc);
            foreach (Mesh3D msh in Meshes)
            {
                msh.Write( );
            }
            foreach (Node3D sn in Sub)
            {
                Entity3D e = sn as Entity3D;
                e.Write( );
            }
        }
コード例 #2
0
        public void SaveGraph(string file)
        {
            FileStream   fs = new FileStream(file, FileMode.Create, FileAccess.Write);
            BinaryWriter bw = new BinaryWriter(fs);

            Help.IOHelp.w = bw;

            bw.Write(Cams.Count);
            foreach (Cam3D c in Cams)
            {
                c.Write( );
            }
            bw.Write(Lights.Count);
            foreach (Light3D c in Lights)
            {
                c.Write( );
            }
            Entity3D r = Root as Entity3D;

            if (Root != null)
            {
                r.Write( );
            }

            fs.Flush( );
            fs.Close( );
        }