/// <summary> /// Import Brush from Content Application /// </summary> /// <param name="_strName"></param> private CubeBrush ImportContentVoxelBrush(string _strName) { var stream = System.IO.File.OpenRead(Path.Combine(Content.RootDirectory, _strName)); //Load From Content Application MagicaVoxelLoader loader = new MagicaVoxelLoader(); BinaryReader br = new BinaryReader(stream); CubeBrush brush = null; if (loader.ReadFile(br) == true) { brush = new CubeBrush(this, loader.Array, loader.Palette); brush.GenerateMesh(); brush.ApplyEditorEffect(); } br.Dispose(); return(brush); }
/// <summary> /// Import Brush from Content Application /// </summary> /// <param name="_strName"></param> private CubeBrush ImportContentVoxelBrush(string _strName) { //Lecture assets sous android var stream = Game.Activity.Assets.Open(Path.Combine(Content.RootDirectory, _strName), Android.Content.Res.Access.Buffer); //Load From Content Application MagicaVoxelLoader loader = new MagicaVoxelLoader(); BinaryReader br = new BinaryReader(stream); CubeBrush brush = null; if (loader.ReadFile(br) == true) { brush = new CubeBrush(this, loader.Array, loader.Palette); brush.GenerateMesh(); brush.ApplyEditorEffect(); } br.Dispose(); return(brush); }