public void UpdateLayer(BakedDataIdentifier identifier, int dataSize) { var layerInfo = new BakedDataLayerInfo { }; if (FindLayer(identifier, ref layerInfo)) { layerInfo.dataSize = dataSize; } }
public void RemoveLayer(BakedDataIdentifier identifier) { var layerInfo = new BakedDataLayerInfo { }; if (FindLayer(identifier, ref layerInfo)) { mBakedDataLayerInfo.Remove(layerInfo); UpdateGameObjectStatistics(layerInfo); } }
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); }
bool FindLayer(BakedDataIdentifier identifier, ref BakedDataLayerInfo result) { foreach (var layerInfo in mBakedDataLayerInfo) { if (layerInfo.identifier.Equals(identifier)) { result = layerInfo; return(true); } } return(false); }
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); } }
public int GetSizeForLayer(BakedDataIdentifier identifier) { var layerInfo = new BakedDataLayerInfo { }; if (FindLayer(identifier, ref layerInfo)) { return(layerInfo.dataSize); } else { return(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; } } }