我想使用这个包:https://github.com/sandrofigo/VoxReader 我是 C sharp 的初学者,我看了一些教程,但我无法运行我的代码,总是出现一些错误。
main.cs:
using System;
class Program {
public static void Main (string[] args) {
Test myTest = new Test();
myTest.Run();
}
}
测试.cs:
using System;
using VoxReader;
class Test
{
public void Run()
{
// Read .vox file
IVoxFile voxFile = VoxReader.Read("my_awesome_model.vox");
// Access models of .vox file
IModel[] models = voxFile.Models;
// Access voxels of first model in the file
Voxel[] voxels = models[0].Voxels;
// Access properties of a voxel
Vector3 position = voxels[0].Position;
Color color = voxels[0].Color;
// Access palette of .vox file
IPalette palette = voxFile.Palette;
// Access raw data of a chunk
byte[] rawData = voxFile.Chunks[0].Content;
}
}
packages.lock.json:
{
"version": 1,
"dependencies": {
"net6.0": {
"VoxReader": {
"type": "Direct",
"requested": "[4.0.0, )",
"resolved": "4.0.0",
"contentHash": "P1LlbtuHEG5kbkxsOHZdark40TCp5CkurqyN3BxZ4xUiodKTQzjjlapRBQL4FWotw6DP1UFue1FsC7TiabVNVg=="
}
}
}
}