diff --git a/Assets/Scripts/康养仿真/ClickKangYangdevice.cs b/Assets/Scripts/康养仿真/ClickKangYangdevice.cs index d2f2c58..7b02f47 100644 --- a/Assets/Scripts/康养仿真/ClickKangYangdevice.cs +++ b/Assets/Scripts/康养仿真/ClickKangYangdevice.cs @@ -71,7 +71,7 @@ public class ClickKangYangdevice : MonoBehaviour /// public void Init() { - XueYaYiSMR.SetBlendShapeWeight(0,0); + XueYaYiSMR.SetBlendShapeWeight(0, 0); ShuaiDaoIamge.gameObject.SetActive(false); OldManAni.speed = 0; playableDirector.Pause(); @@ -90,14 +90,14 @@ public class ClickKangYangdevice : MonoBehaviour if (lightsildervalue > value) { Debug.Log("----"); - SetEmissionIntensity(LightsModel[i].GetComponent(), value); - LightsModel[i].GetChild(0).GetComponent().intensity = value; + SetEmissionIntensity(LightsModel[i].parent.GetComponent(), value); + LightsModel[i].GetComponent().intensity = value; } else if (lightsildervalue < value) { Debug.Log("+++++++++"); - SetEmissionIntensity(LightsModel[i].GetComponent(), value); - LightsModel[i].GetChild(0).GetComponent().intensity = value; + SetEmissionIntensity(LightsModel[i].parent.GetComponent(), value); + LightsModel[i].GetComponent().intensity = value; } } lightsildervalue = Lightbrightness.value; @@ -123,14 +123,14 @@ public class ClickKangYangdevice : MonoBehaviour switch (KangYangMangner.Instance.kangYangregion) { case kangYangRegion.½¡¿µ¹ÜÀíÓë¼ì²â: - + if (hit.collider.gameObject.name == "Ѫѹ¼Æ") { - + StartCoroutine(Sphygmomanometer()); XueYaYiSMR.GetComponent().enabled = false; - - + + } float weigh = XueYaYiSMR.GetBlendShapeWeight(0); if (weigh == 100) @@ -167,10 +167,10 @@ public class ClickKangYangdevice : MonoBehaviour //Open.transform.GetComponentInChildren().text = "¹Ø"; for (int i = 0; i < LightsModel.Count; i++) { - Material material = LightsModel[i].GetComponent().materials[0]; + Material material = LightsModel[i].parent.GetComponent().materials[0]; material.EnableKeyword("_EMISSION"); //material.SetColor("_EmissionColor", Color.HSVToRGB(0, 0, 1)); - LightsModel[i].GetChild(0).gameObject.SetActive(true); + LightsModel[i].gameObject.SetActive(true); } } else @@ -178,10 +178,10 @@ public class ClickKangYangdevice : MonoBehaviour //Open.transform.GetComponentInChildren().text = "¿ª"; for (int i = 0; i < LightsModel.Count; i++) { - Material material = LightsModel[i].GetComponent().materials[0]; + Material material = LightsModel[i].parent.GetComponent().materials[0]; material.DisableKeyword("_EMISSION"); //material.SetColor("_EmissionColor", Color.HSVToRGB(5, 5, 1)); - LightsModel[i].GetChild(0).gameObject.SetActive(false); + LightsModel[i].gameObject.SetActive(false); } } } @@ -205,7 +205,7 @@ public class ClickKangYangdevice : MonoBehaviour IEnumerator Sphygmomanometer() { yield return new WaitForSeconds(0.1f); - for (int i = 0; i <=100; i++) + for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.01f); XueYaYiSMR.SetBlendShapeWeight(0, i); @@ -236,7 +236,7 @@ public class ClickKangYangdevice : MonoBehaviour /// µÈ´ý¼¸Ãë /// °´Å¥ /// - IEnumerator ShowButtonAfterDelay(float delay,Button Btn) + IEnumerator ShowButtonAfterDelay(float delay, Button Btn) { yield return new WaitForSeconds(delay); Btn.gameObject.SetActive(true); @@ -320,7 +320,7 @@ public class ClickKangYangdevice : MonoBehaviour InitColor = new Color(1, 1, 1); for (int i = 0; i < LightsModel.Count; i++) { - LightsModel[i].GetChild(0).GetComponent().color = new Color(1, 1, 1); + LightsModel[i].GetComponent().color = new Color(1, 1, 1); LightsModel[i].GetComponentInParent().material.SetColor("_EmissionColor", new Color(1, 1, 1)); } } @@ -332,7 +332,7 @@ public class ClickKangYangdevice : MonoBehaviour InitColor = new Color(0, 0.6145419f, 0.9433962f); for (int i = 0; i < LightsModel.Count; i++) { - LightsModel[i].GetChild(0).GetComponent().color = new Color(0, 0.6145419f, 0.9433962f); + LightsModel[i].GetComponent().color = new Color(0, 0.6145419f, 0.9433962f); LightsModel[i].GetComponentInParent().material.SetColor("_EmissionColor", new Color(0, 0.6145419f, 0.9433962f)); } } @@ -344,7 +344,7 @@ public class ClickKangYangdevice : MonoBehaviour InitColor = new Color(1, 0.6831585f, 0); for (int i = 0; i < LightsModel.Count; i++) { - LightsModel[i].GetChild(0).GetComponent().color = new Color(1, 0.6831585f, 0); + LightsModel[i].GetComponent().color = new Color(1, 0.6831585f, 0); LightsModel[i].GetComponentInParent().material.SetColor("_EmissionColor", new Color(1, 0.6831585f, 0)); } }