50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using UnityEngine.UI;
|
|||
|
|
using ZXK.Framework;
|
|||
|
|
/*******************************************************************************
|
|||
|
|
*Create By CG
|
|||
|
|
*Function ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
*******************************************************************************/
|
|||
|
|
namespace ZXK.BYSS
|
|||
|
|
{
|
|||
|
|
public class SettingSystemPanel : UIBase
|
|||
|
|
{
|
|||
|
|
private void Start()
|
|||
|
|
{
|
|||
|
|
AddEventListener("VolumnTog_N", UIEventType.OnToggleValueChanged, (isOn) =>
|
|||
|
|
{
|
|||
|
|
if (isOn)
|
|||
|
|
{//<2F><><EFBFBD><EFBFBD>
|
|||
|
|
Slider slider = GetWedage("VolumnSlider_N").GetComponent<Slider>();
|
|||
|
|
slider.value = 0;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
Slider slider = GetWedage("VolumnSlider_N").GetComponent<Slider>();
|
|||
|
|
slider.value = 1;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
AudioMng.Instance.AdjustVolume(AudioMng.Instance._CurVolume);
|
|||
|
|
GetWedage("VolumnTxt_N").GetComponent<Text>().text = Mathf.RoundToInt(AudioMng.Instance._CurVolume * 100).ToString();
|
|||
|
|
GetWedage("VolumnSlider_N").GetComponent<Slider>().value = AudioMng.Instance._CurVolume;
|
|||
|
|
if (AudioMng.Instance._CurVolume == 0)
|
|||
|
|
{
|
|||
|
|
GetWedage("VolumnTog_N").GetComponent<Toggle>().isOn = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
AddEventListener("VolumnSlider_N", UIEventType.OnSliderValueChanged, (float volue) =>
|
|||
|
|
{
|
|||
|
|
AudioMng.Instance.AdjustVolume(volue);
|
|||
|
|
GetWedage("VolumnTxt_N").GetComponent<Text>().text = volue.ToString("0.00");
|
|||
|
|
});
|
|||
|
|
AddEventListener("CloseBtn_N", UIEventType.OnButtonClick, () =>
|
|||
|
|
{
|
|||
|
|
Destroy(gameObject);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|