Predective algo

This commit is contained in:
2024-09-08 18:16:38 +05:30
parent cd837472b9
commit 7822aec907
26 changed files with 9189 additions and 592 deletions

View File

@@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(TMP_Text))]
public class SliderValueText : MonoBehaviour
{
public Slider slider;
void OnValidate(){
if(slider==null){
slider = GetComponentInParent<Slider>();
}
}
void Start()
{
slider.onValueChanged.AddListener(RefreshText);
txt= GetComponent<TMP_Text>();
RefreshText(slider.value);
}
TMP_Text txt;
void RefreshText(float value){
txt.text = slider.value.ToString("n3");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ffd6249c0d241384ab3caa05bc93e9cf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: