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

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

            if (FindLayer(identifier, ref layerInfo))
            {
                mBakedDataLayerInfo.Remove(layerInfo);
                UpdateGameObjectStatistics(layerInfo);
            }
        }
示例#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);
        }
示例#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);
        }
示例#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);
            }
        }
示例#6
0
        public int GetSizeForLayer(BakedDataIdentifier identifier)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                return(layerInfo.dataSize);
            }
            else
            {
                return(0);
            }
        }
示例#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;
                }
            }
        }