André McGrail
5 年前
当前提交
21c60d19
共有 7 个文件被更改,包括 34 次插入 和 86 次删除
-
29Assets/Scripts/GameSystem/DefaultVolume.cs
-
13Packages/com.verasl.water-system/Scripts/Rendering/WaterSystemFeature.cs
-
2Packages/com.verasl.water-system/Scripts/Rendering/WaterSystemFeature.cs.meta
-
10Packages/com.verasl.water-system/Scripts/Water.cs
-
5Packages/manifest.json
-
50Assets/Scripts/GameSystem/VolumeHolder.cs
-
11Assets/Scripts/GameSystem/VolumeHolder.cs.meta
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.AddressableAssets; |
|||
using UnityEngine.Rendering; |
|||
using UnityEngine.Serialization; |
|||
|
|||
[CreateAssetMenu(fileName = "VolumeHolder", menuName = "Volume Holder", order = 0)] |
|||
public class VolumeHolder : ScriptableObject |
|||
{ |
|||
[SerializeField] |
|||
public AssetReference[] _Volumes; |
|||
[FormerlySerializedAs("qualityIndicies")] [SerializeField] |
|||
public List<int> qualityIndices = new List<int>(); |
|||
[FormerlySerializedAs("qualityVolumeIndicies")] [SerializeField] |
|||
public List<int> qualityVolumeIndices = new List<int>(); |
|||
|
|||
public bool ContainsKey(int key) |
|||
{ |
|||
return qualityIndices.Contains(key); |
|||
} |
|||
|
|||
public void Add(int key, int value) |
|||
{ |
|||
qualityIndices.Add(key); |
|||
qualityVolumeIndices.Add(value); |
|||
} |
|||
|
|||
public void SetKey(int key, int value) |
|||
{ |
|||
if (qualityIndices.Contains(key)) |
|||
{ |
|||
qualityVolumeIndices[qualityIndices.IndexOf(key)] = value; |
|||
} |
|||
else |
|||
{ |
|||
Add(key, value); |
|||
} |
|||
} |
|||
|
|||
public int GetValue(int key) |
|||
{ |
|||
if (qualityIndices.Contains(key)) |
|||
{ |
|||
return qualityVolumeIndices[qualityIndices.IndexOf(key)]; |
|||
} |
|||
|
|||
throw new Exception(message: $"{qualityIndices} does not contain key {key}"); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: bea894b80a78a4f9a9d5210e78f59e3b |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue