mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
UXAssist: buffer tweaks for ejector and silo
This commit is contained in:
1 parent
23aa8c1f13
commit
dc246170ac
6 files changed
+98
-8
No files matched your search
@@ -248,6 +248,22 @@ public class MyWindow : ManualBehaviour
|
||||
public override int Max => max;
|
||||
}
|
||||
|
||||
public class RangeValueWithMultiplierMapper<T>(int min, int max, T multiplier) : ValueMapper<T>
|
||||
{
|
||||
public override int Min => min;
|
||||
public override int Max => max;
|
||||
|
||||
public override T IndexToValue(int index)
|
||||
{
|
||||
return (T)Convert.ChangeType((float)index * (float)Convert.ChangeType(multiplier, typeof(float)), typeof(T));
|
||||
}
|
||||
|
||||
public override int ValueToIndex(T value)
|
||||
{
|
||||
return Mathf.RoundToInt((float)Convert.ChangeType(value, typeof(float)) / (float)Convert.ChangeType(multiplier, typeof(float)));
|
||||
}
|
||||
}
|
||||
|
||||
private class ArrayMapper<T> : ValueMapper<T>
|
||||
{
|
||||
private readonly T[] _values;
|
||||
|
||||
Reference in new issue
Block a user