add additional tab; fix config panel occlusion bug
This commit is contained in:
@@ -20,10 +20,10 @@ public class ButtonSettingManager : MonoBehaviour
|
||||
|
||||
public enum ButtonType
|
||||
{
|
||||
Test = 0,
|
||||
Service = 1,
|
||||
Coin = 2,
|
||||
Custom = 3,
|
||||
TestKeyBind = 0,
|
||||
ServiceKeyBind = 1,
|
||||
CoinKeyBind = 2,
|
||||
CustomKeyBind = 3,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class Config
|
||||
public int CoinKeyBind = 31;
|
||||
public int CustomKeyBind = 170;
|
||||
public bool FlatShadedRing = false;
|
||||
public bool DynamicProbe = true;
|
||||
public bool PostProcess = true;
|
||||
public int AntiAliasing = 0;
|
||||
public string batFileLocation = "";
|
||||
|
||||
@@ -24,11 +24,11 @@ public class ConfigManager : MonoBehaviour
|
||||
{
|
||||
onConfigChanged += EnsureInitialization;
|
||||
onConfigChanged += SaveFile;
|
||||
ConfigPanelComponents = GetConfigPanelComponents();
|
||||
EnsureInitialization();
|
||||
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
EnsureInitialization();
|
||||
AddListenerToWidget(ConfigPanelComponents);
|
||||
onConfigChanged?.Invoke();
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class ConfigManager : MonoBehaviour
|
||||
if (hasInitialized)
|
||||
return;
|
||||
LoadFile();
|
||||
ConfigPanelComponents = GetConfigPanelComponentsStatic();
|
||||
UpdateConfigPanelFromConfig(ref ConfigPanelComponents);
|
||||
hasInitialized = true;
|
||||
}
|
||||
@@ -88,6 +89,7 @@ public class ConfigManager : MonoBehaviour
|
||||
|
||||
public static GameObject GetConfigPanelWidget(string configKeyName)
|
||||
{
|
||||
EnsureInitialization();
|
||||
foreach (var item in ConfigPanelComponents)
|
||||
{
|
||||
if (item.ConfigKeyName == configKeyName)
|
||||
@@ -109,6 +111,13 @@ public class ConfigManager : MonoBehaviour
|
||||
return _configPanelComponents;
|
||||
}
|
||||
|
||||
private static List<ConfigPanelComponent> GetConfigPanelComponentsStatic()
|
||||
{
|
||||
var _configPanelComponents = new List<ConfigPanelComponent>();
|
||||
_configPanelComponents = GameObject.FindObjectOfType<ConfigManager>().GetConfigPanelComponents();
|
||||
return _configPanelComponents;
|
||||
}
|
||||
|
||||
private void AddListenerToWidget(List<ConfigPanelComponent> _configPanelComponents)
|
||||
{
|
||||
foreach (var configPanelComponent in _configPanelComponents)
|
||||
@@ -151,7 +160,7 @@ public class ConfigManager : MonoBehaviour
|
||||
valueManager.onValueChanged.AddListener(delegate
|
||||
{
|
||||
var field = config.GetType().GetField(configPanelComponent.ConfigKeyName);
|
||||
field.SetValue(config, valueManager.Value);
|
||||
field.SetValue(config, valueManager.value);
|
||||
onConfigChanged?.Invoke();
|
||||
});
|
||||
}
|
||||
@@ -160,38 +169,32 @@ public class ConfigManager : MonoBehaviour
|
||||
|
||||
private static void UpdateConfigPanelFromConfig(ref List<ConfigPanelComponent> _configPanelComponents)
|
||||
{
|
||||
|
||||
foreach (var configPanelComponent in _configPanelComponents)
|
||||
{
|
||||
Debug.Log(configPanelComponent.ConfigKeyName);
|
||||
var componentObject = configPanelComponent.Widget;
|
||||
if (componentObject.GetComponent<TMP_Dropdown>() != null)
|
||||
{
|
||||
var dropdown = componentObject.GetComponent<TMP_Dropdown>();
|
||||
var field = config.GetType().GetField(configPanelComponent.ConfigKeyName);
|
||||
dropdown.value = (int)field.GetValue(config);
|
||||
dropdown.onValueChanged?.Invoke(dropdown.value);
|
||||
}
|
||||
else if (componentObject.GetComponent<Toggle>() != null)
|
||||
{
|
||||
var toggle = componentObject.GetComponent<Toggle>();
|
||||
var field = config.GetType().GetField(configPanelComponent.ConfigKeyName);
|
||||
toggle.isOn = (bool)field.GetValue(config);
|
||||
toggle.onValueChanged?.Invoke(toggle.isOn);
|
||||
}
|
||||
else if (componentObject.GetComponent<Slider>() != null)
|
||||
{
|
||||
var slider = componentObject.GetComponent<Slider>();
|
||||
var field = config.GetType().GetField(configPanelComponent.ConfigKeyName);
|
||||
slider.value = (float)field.GetValue(config);
|
||||
slider.onValueChanged?.Invoke(slider.value);
|
||||
}
|
||||
else if (componentObject.GetComponent<ValueManager>() != null)
|
||||
{
|
||||
var valueManager = componentObject.GetComponent<ValueManager>();
|
||||
var field = config.GetType().GetField(configPanelComponent.ConfigKeyName);
|
||||
valueManager.Value = (float)field.GetValue(config);
|
||||
valueManager.onValueChanged?.Invoke();
|
||||
valueManager.value = (float)field.GetValue(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PlayerSettingManager : MonoBehaviour
|
||||
RHandTransform.localPosition = new Vector3(RHandTransform.localPosition.x, RHandTransform.localPosition.y, value);
|
||||
});
|
||||
heightManager.onValueChanged.AddListener(delegate {
|
||||
height = heightManager.Value;
|
||||
height = heightManager.value;
|
||||
});
|
||||
sizeSlider.onValueChanged.Invoke(sizeSlider.value);
|
||||
xSlider.onValueChanged.Invoke(xSlider.value);
|
||||
|
||||
@@ -17,11 +17,13 @@ public class SpectatorManager : MonoBehaviour
|
||||
var modeWidget = ConfigManager.GetConfigPanelWidget("SpectatorMode");
|
||||
var fovWidget = ConfigManager.GetConfigPanelWidget("SpectatorFOV");
|
||||
var fpsWidget = ConfigManager.GetConfigPanelWidget("SpectatorFPS");
|
||||
var smoothWidget = ConfigManager.GetConfigPanelWidget("SpectatorSmooth");
|
||||
|
||||
|
||||
var modeDropdown = modeWidget.GetComponent<TMP_Dropdown>();
|
||||
var fovSlider = fovWidget.GetComponent<Slider>();
|
||||
var fpsDropdown = fpsWidget.GetComponent<TMP_Dropdown>();
|
||||
var smoothSlider = smoothWidget.GetComponent<Slider>();
|
||||
|
||||
modeDropdown.onValueChanged.AddListener((int value) => {
|
||||
if (SpectatorCam == null || cameraSmooth == null || SpectatorFPTarget == null || SpectatorTPTarget == null)
|
||||
@@ -60,9 +62,14 @@ public class SpectatorManager : MonoBehaviour
|
||||
Application.targetFrameRate = int.Parse(fpsString.Remove(0, 3));
|
||||
});
|
||||
|
||||
smoothSlider.onValueChanged.AddListener((float value) => {
|
||||
cameraSmooth.smoothSpeed = value;
|
||||
});
|
||||
|
||||
modeDropdown.onValueChanged?.Invoke(modeDropdown.value);
|
||||
fovSlider.onValueChanged?.Invoke(fovSlider.value);
|
||||
fpsDropdown.onValueChanged?.Invoke(fpsDropdown.value);
|
||||
smoothSlider.onValueChanged?.Invoke(smoothSlider.value);
|
||||
|
||||
ApplyTPCamTransform();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using TMPro;
|
||||
public class ValueManager : MonoBehaviour
|
||||
{
|
||||
TMP_Text tmp;
|
||||
public float Value
|
||||
public float value
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -40,7 +40,7 @@ public class ValueManager : MonoBehaviour
|
||||
public void ChangeValueContinue(float __value)
|
||||
{
|
||||
tempValue = __value;
|
||||
Value += Time.deltaTime * __value;
|
||||
value += Time.deltaTime * __value;
|
||||
isPointerDown = true;
|
||||
}
|
||||
public void PointerState(bool state)
|
||||
@@ -49,7 +49,7 @@ public class ValueManager : MonoBehaviour
|
||||
}
|
||||
public void ResetValue()
|
||||
{
|
||||
Value = 0;
|
||||
value = 0;
|
||||
}
|
||||
public void UpdateText()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user