设置页面,调些细节
This commit is contained in:
1 parent
4896fab824
commit
bb4fabc833
23 files changed
+5528
-1756
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PFUISlider : MonoBehaviour
|
||||
{
|
||||
private Text text;
|
||||
private Slider slider;
|
||||
private void Awake()
|
||||
{
|
||||
text = transform.Find("Text").GetComponent<Text>();
|
||||
slider = transform.GetComponent<Slider>();
|
||||
text.text = $"{(slider.value * 100).ToString("#0")}%";
|
||||
slider.onValueChanged.AddListener((f) =>
|
||||
{
|
||||
text.text = $"{(f * 100).ToString("#0")}%";
|
||||
});
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e288f268809db2a4bbc2b31a9fe797e4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user