Ejemplo n.º 1
0
    void Benchmark()
    {
        Chunks.Chunk chunk = new Chunks.Chunk();
        chunk.Position = new Vector3Int(0, 0, 0);
        chunk.LOD      = 0;
        SE.MC.Algorithm.BenchmarkResult totals = new SE.MC.Algorithm.BenchmarkResult();

        for (int i = 0; i < BenchmarkTrials; i++)
        {
            chunk.Position.x += Resolution;
            chunk.LODCode     = 0;         //(chunk.LODCode + 1) % 64;
            SE.MC.Algorithm.BenchmarkResult result = SE.MC.Algorithm.PolygonizeAreaBenchmarked(BenchmarkResolution, UtilFuncs.Sample, chunk, testData);
            totals.createVerticesMs += result.createVerticesMs;
            totals.fillDataMs       += result.fillDataMs;
            totals.transitionCellMs += result.transitionCellMs;
            totals.triangulateMs    += result.triangulateMs;
        }

        totals.createVerticesMs /= (float)BenchmarkTrials;
        totals.fillDataMs       /= (float)BenchmarkTrials;
        totals.transitionCellMs /= (float)BenchmarkTrials;
        totals.triangulateMs    /= (float)BenchmarkTrials;

        string result2 = "Done benchmark. Res: " + BenchmarkResolution + ", Trials: " + BenchmarkTrials + ", Average FillData ms: " + totals.fillDataMs + ", CreateVertices ms: " + totals.createVerticesMs + ", Triangulate ms: " + totals.triangulateMs + ", TransitionCell ms: " + totals.transitionCellMs + " (Total: " + (totals.transitionCellMs + totals.triangulateMs + totals.createVerticesMs + totals.fillDataMs) + "ms. )";

        Debug.Log(result2);
        UConsole.Print(result2);
    }
Ejemplo n.º 2
0
 void InitializeUConsoleIfNeeded()
 {
     if (!GameObject.Find(nameof(UConsole)))
     {
         return;
     }
     _c = GameObject.Find(nameof(UConsole)).GetComponent <UConsole>();
 }
Ejemplo n.º 3
0
 void InitializeUConsoleIfNeeded()
 {
     if (!GameObject.Find(nameof(UConsole)))
     {
         return;
     }
     _c = GameObject.Find(nameof(UConsole)).GetComponent <UConsole>();
     _c.AddFilter(_appname, transform.Find("Control/Panel/Icon").GetComponent <Image>().sprite, string.Empty);
 }
Ejemplo n.º 4
0
 public void AddCommands()
 {
     UConsole.AddCommand("mesh", (string[] tokens) => {
         MeshChunks();
     });
     UConsole.AddCommand("upload", (string[] tokens) => {
         UploadChunks();
     });
     UConsole.AddCommand("mu", (string[] tokens) => {
         MeshChunks();
         UploadChunks();
     });
 }
Ejemplo n.º 5
0
    void Start()
    {
        buffer            = new StringBuffer();
        UConsole.Executor = executor;
        UConsole.Buffer   = buffer;
        Thread main = new Thread(() =>
        {
            try
            {
                Program.Main();
            }
            catch (System.Exception e)
            {
                UConsole.WriteLine("Exception:\n" + e.Message);
            }
        });

        main.Start();
    }
Ejemplo n.º 6
0
 public static void Main()
 {
     UConsole.WriteLine("Hello, world!");
 }
Ejemplo n.º 7
0
 public void Enter()
 {
     String = input.text;
     UConsole.WriteLine(input.text);
     input.text = "";
 }