using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ModifySluiceHeightManually : MonoBehaviour { // Start is called before the first frame update void Start() { //setHeight("sluice1", 1.5f); //setHeight("sluice2,1.5"); //setHeight("sluice1,1.5"); //Debug.Log("aaaa"); } // Update is called once per frame void Update() { } //public void setHeight(string sluiceName,float height) //{ // transform.Find("Sliders/" + sluiceName).GetComponent().value = height; //} public void setHeight(string sluiceNameAndHeight) { string[] parts = sluiceNameAndHeight.Split(','); transform.Find("Sliders/" + parts[0]).GetComponent().value = float.Parse(parts[1]); } }