예제 #1
0
        private void _Read(TableStreamReader reader)
        {
            reader.Blob("SceneChunkData", () =>
            {
                this.Name = reader.ReadKeyString("Name");

                this.Objects = new List <SceneObjectData>();
                var count    = reader.ReadKeyNumber("Objects");
                for (var i = 0; i < count; ++i)
                {
                    var type = (SceneObjectType)reader.ReadKeyByte("Type");
                    SceneObjectData objectData = null;
                    switch (type)
                    {
                    case SceneObjectType.PREFAB:
                        objectData = new ScenePrefabData();
                        break;

                    case SceneObjectType.LIGHTMODIFIER:
                        objectData = new SceneLightModifierData();
                        break;

                    default:
                        objectData = new SceneObjectData();
                        break;
                    }
                    objectData._Read(reader);
                    this.Objects.Add(objectData);
                }
            });
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        protected virtual void Read(TableStreamReader reader)
        {
            this.Type = (SceneObjectType)reader.ReadKeyByte("Type");

            this.Name = reader.ReadKeyString("Name");

            this.PositionX = (float)reader.ReadKeyFloat("PositionX");
            this.PositionY = (float)reader.ReadKeyFloat("PositionY");
            this.PositionZ = (float)reader.ReadKeyFloat("PositionZ");

            this.OrientationX = (float)reader.ReadKeyFloat("OrientationX");
            this.OrientationY = (float)reader.ReadKeyFloat("OrientationY");
            this.OrientationZ = (float)reader.ReadKeyFloat("OrientationZ");
            this.OrientationW = (float)reader.ReadKeyFloat("OrientationW");

            this.ScaleX = (float)reader.ReadKeyFloat("ScaleX");
            this.ScaleY = (float)reader.ReadKeyFloat("ScaleY");
            this.ScaleZ = (float)reader.ReadKeyFloat("ScaleZ");
        }