public void LoadGraph(string file) { FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); Help.IOHelp.r = r; int cc = r.ReadInt32(); for (int i = 0; i < cc; i++) { Cam3D nc = new Cam3D(); nc.Read( ); Cams.Add(nc); } int lc = r.ReadInt32(); for (int i = 0; i < lc; i++) { Light3D nl = new FusionEngine.Lighting.Light3D(); nl.Read( ); Lights.Add(nl); } Entity3D re = new Entity3D(); Root = re; re.Read( ); fs.Close( ); }
public void Read( ) { int ns1 = Help.IOHelp.ReadInt(); for (int i = 0; i < ns1; i++) { Script.ScriptLink sb = new Script.ScriptLink { Name = Help.IOHelp.ReadString( ), FilePath = Help.IOHelp.ReadString( ) }; Scripts.Add(sb); } LocalTurn = Help.IOHelp.ReadMatrix( ); LocalPos = Help.IOHelp.ReadVec3( ); LocalScale = Help.IOHelp.ReadVec3( ); Name = Help.IOHelp.ReadString( ); AlwaysAlpha = Help.IOHelp.ReadBool( ); On = Help.IOHelp.ReadBool( ); int ns = Help.IOHelp.ReadInt(); int mc = Help.IOHelp.ReadInt(); for (int m = 0; m < mc; m++) { Mesh3D msh = new Mesh3D(); msh.Read( ); Meshes.Add(msh); } for (int i = 0; i < ns; i++) { Entity3D gn = new Entity3D(); Sub.Add(gn); gn.Top = this; gn.Read( ); } SetMultiPass( ); }