fix:风机初始化代码提交
This commit is contained in:
31
Assets/Scripts/Sluices/ModifySluiceHeightManually.cs
Normal file
31
Assets/Scripts/Sluices/ModifySluiceHeightManually.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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<Slider>().value = height;
|
||||
//}
|
||||
public void setHeight(string sluiceNameAndHeight)
|
||||
{
|
||||
string[] parts = sluiceNameAndHeight.Split(',');
|
||||
transform.Find("Sliders/" + parts[0]).GetComponent<Slider>().value = float.Parse(parts[1]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user