Esempio n. 1
0
        public void BeginBake()
        {
            var tasks = new BakedDataTask[1];

            tasks[0].gameObject       = gameObject;
            tasks[0].component        = this;
            tasks[0].name             = gameObject.name;
            tasks[0].identifier       = GetBakedDataIdentifier();
            tasks[0].probeBatches     = new SteamAudioProbeBatch[1];
            tasks[0].probeBatchNames  = new string[1];
            tasks[0].probeBatchAssets = new SerializedData[1];

            tasks[0].probeBatches[0]     = this;
            tasks[0].probeBatchNames[0]  = gameObject.name;
            tasks[0].probeBatchAssets[0] = GetAsset();

            Baker.BeginBake(tasks);
        }
        public void BeginBake()
        {
            CacheIdentifier();
            CacheProbeBatchesUsed();

            var tasks = new BakedDataTask[1];

            tasks[0].gameObject       = gameObject;
            tasks[0].component        = this;
            tasks[0].name             = gameObject.name;
            tasks[0].identifier       = mIdentifier;
            tasks[0].probeBatches     = (useAllProbeBatches) ? FindObjectsOfType <SteamAudioProbeBatch>() : probeBatches;
            tasks[0].probeBatchNames  = new string[tasks[0].probeBatches.Length];
            tasks[0].probeBatchAssets = new SerializedData[tasks[0].probeBatches.Length];
            for (var i = 0; i < tasks[0].probeBatchNames.Length; ++i)
            {
                tasks[0].probeBatchNames[i]  = tasks[0].probeBatches[i].gameObject.name;
                tasks[0].probeBatchAssets[i] = tasks[0].probeBatches[i].GetAsset();
            }

            Baker.BeginBake(tasks);
        }