Example #1
0
        /*public bool _refresh = false;
         #if UNITY_EDITOR
         * void Update () {
         *      if (_refresh && !string.IsNullOrEmpty(_vodFile)) {
         *
         *              FileStream sw = new FileStream (_vodFile, FileMode.Open, FileAccess.Read);
         *              System.IO.BinaryReader br = new System.IO.BinaryReader (sw);
         *              if(_model != null){
         *                      _model.data = VoxelReader.FromMagica (br);
         *              }
         *              _refresh = false;
         *      }
         *
         * }
         *
         #endif
         */

        public override void read()
        {
            if (_model == null)
            {
                _model = this.gameObject.GetComponent <VoxelModel>();
            }
            FileStream sw = new FileStream(_vodFile, FileMode.Open, FileAccess.Read);

            System.IO.BinaryReader br = new System.IO.BinaryReader(sw);
            if (_model != null)
            {
                _model.data = VoxelReader.FromMagica(br);
            }
        }