Exemplo n.º 1
0
 public void Read()
 {
     LocalTurn = IOHelp.ReadMatrix();
     LocalPos  = IOHelp.ReadVec3();
     MinZ      = IOHelp.ReadFloat();
     MaxZ      = IOHelp.ReadFloat();
     LR        = IOHelp.ReadVec3();
 }
Exemplo n.º 2
0
    public override void LoadNode()
    {
        _Width         = IOHelp.ReadFloat();
        _Depth         = IOHelp.ReadFloat();
        _YScale        = IOHelp.ReadFloat();
        _HeightMapPath = IOHelp.ReadString();
        Node3D prev_t = SceneGraph3D.CurScene.FindNode("TerrainObjNode");

        if (prev_t != null)
        {
            TerrainNode = prev_t as Terrain3D;
            //    SceneGraph3D.CurScene.Remove(prev_t);
        }
    }
Exemplo n.º 3
0
        public void ReadClass(object cls)
        {
            var cn = IOHelp.ReadString();
            var np = IOHelp.ReadInt();

            foreach (var prop in cls.GetType().GetProperties())
            {
                var pn = IOHelp.ReadString();
                int pt = IOHelp.ReadInt();
                switch (pt)
                {
                case -1:
                    prop.SetValue(cls, null);
                    break;

                case 0:
                    prop.SetValue(cls, IOHelp.ReadString());
                    break;

                case 1:
                    prop.SetValue(cls, IOHelp.ReadInt());
                    break;

                case 2:
                    prop.SetValue(cls, IOHelp.ReadFloat());
                    break;

                case 3:
                    prop.SetValue(cls, IOHelp.ReadDouble());
                    break;

                case 4:
                    prop.SetValue(cls, IOHelp.ReadTexture2D());
                    break;

                case 5:
                    prop.SetValue(cls, IOHelp.ReadBool());
                    break;

                case 6:
                    prop.SetValue(cls, IOHelp.ReadVec3());
                    break;

                case 7:
                    prop.SetValue(cls, IOHelp.ReadVec4());
                    break;

                case 8:
                    prop.SetValue(cls, IOHelp.ReadMatrix());
                    break;

                case 9:

                    dynamic nl = prop.GetValue(cls);

                    nl.Clear();

                    int ec = IOHelp.ReadInt();

                    for (int i = 0; i < ec; i++)
                    {
                    }


                    break;
                }
            }
        }