示例#1
0
    private void LoadIconJob(JobMetaLoader jobMetaLoader, VRMMetaObject meta)
    {
        System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
        stopwatch.Start();
        var t = jobMetaLoader.LoadThumbnail();

        meta.Thumbnail      = t;
        m_thumbnail.texture = t;
        stopwatch.Stop();
        Debug.Log("JobLoadThumbnail: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");
    }
    private void LoadMeta(string file)
    {
        using (var metaLoader = new JobMetaLoader(file))
        {
            var meta = metaLoader.Read();

            var go   = Instantiate(_cardPrefab, transform);
            var card = go.GetComponent <CharacterCard>();
            card.SetMetaText(meta);
            card.SetThumbnail(meta.Thumbnail = metaLoader.LoadThumbnail());
        }
    }
示例#3
0
    void Start()
    {
        System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();

        stopwatch.Start();
        const string path  = "AliciaSolid_1.10.vrm";
        var          bytes = File.ReadAllBytes(path);

        stopwatch.Stop();
        Debug.Log("ReadAllBytes: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");

        stopwatch.Restart();
        using (var metaLoader = new MetaLoader(bytes))
        {
            var meta = metaLoader.Read();
            stopwatch.Stop();
            Debug.Log("QuickMetaLoader: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");

            ViewMeta(meta);
            LoadIcon(metaLoader);
        }

        stopwatch.Restart();
        using (var jobMetaLoader = new JobMetaLoader(path))
        {
            var meta = jobMetaLoader.Read();
            stopwatch.Stop();
            Debug.Log("JobMetaLoader: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");

            ViewMeta(meta);
            LoadIconJob(jobMetaLoader, meta);
        }
        stopwatch.Stop();

        stopwatch.Restart();
        var context = new VRMImporterContext();

        context.ParseGlb(bytes);
        stopwatch.Stop();
        Debug.Log("VRM ParseGlb: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");

        stopwatch.Restart();
        context.ReadMeta(true);
        stopwatch.Stop();
        Debug.Log("VRM ReadMeta: " + (float)stopwatch.Elapsed.TotalSeconds + " sec");
    }