Beispiel #1
0
        public void UpdateLayer(BakedDataIdentifier identifier, int dataSize)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                layerInfo.dataSize = dataSize;
            }
        }
Beispiel #2
0
        public void RemoveLayer(BakedDataIdentifier identifier)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                mBakedDataLayerInfo.Remove(layerInfo);
                UpdateGameObjectStatistics(layerInfo);
            }
        }
Beispiel #3
0
        public void AddLayer(GameObject gameObject, BakedDataIdentifier identifier, int dataSize)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            layerInfo.gameObject = gameObject;
            layerInfo.identifier = identifier;
            layerInfo.dataSize   = dataSize;

            mBakedDataLayerInfo.Add(layerInfo);
        }
Beispiel #4
0
        bool FindLayer(BakedDataIdentifier identifier, ref BakedDataLayerInfo result)
        {
            foreach (var layerInfo in mBakedDataLayerInfo)
            {
                if (layerInfo.identifier.Equals(identifier))
                {
                    result = layerInfo;
                    return(true);
                }
            }

            return(false);
        }
Beispiel #5
0
        public void AddOrUpdateLayer(GameObject gameObject, BakedDataIdentifier identifier, int dataSize)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                UpdateLayer(identifier, dataSize);
            }
            else
            {
                AddLayer(gameObject, identifier, dataSize);
            }
        }
Beispiel #6
0
        public int GetSizeForLayer(BakedDataIdentifier identifier)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                return(layerInfo.dataSize);
            }
            else
            {
                return(0);
            }
        }
Beispiel #7
0
        void UpdateGameObjectStatistics(BakedDataLayerInfo layerInfo)
        {
            if (layerInfo.identifier.type == BakedDataType.Reflections)
            {
                switch (layerInfo.identifier.variation)
                {
                case BakedDataVariation.Reverb:
                    layerInfo.gameObject.GetComponent <SteamAudioListener>().UpdateBakedDataStatistics();
                    break;

                case BakedDataVariation.StaticSource:
                    layerInfo.gameObject.GetComponent <SteamAudioBakedSource>().UpdateBakedDataStatistics();
                    break;

                case BakedDataVariation.StaticListener:
                    layerInfo.gameObject.GetComponent <SteamAudioBakedListener>().UpdateBakedDataStatistics();
                    break;
                }
            }
        }