This commit is contained in:
parent
54fd8a2094
commit
e3789081ab
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -17,16 +17,19 @@ public class Control_Curtain : MonoBehaviour
|
|||
/// 点击的窗帘
|
||||
/// </summary>
|
||||
public Transform curtain;
|
||||
|
||||
public Toggle Open;
|
||||
public Toggle Close;
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
opencurtain.onClick.AddListener(() =>
|
||||
{
|
||||
Opencurtains();
|
||||
});
|
||||
//opencurtain.onClick.AddListener(() =>
|
||||
//{
|
||||
// Opencurtains();
|
||||
//});
|
||||
}
|
||||
public void Opencurtains()
|
||||
{
|
||||
|
@ -39,15 +42,14 @@ public class Control_Curtain : MonoBehaviour
|
|||
/// <returns></returns>
|
||||
void Opencurtain()
|
||||
{
|
||||
|
||||
if (curtain.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 0)
|
||||
{
|
||||
opencurtain.GetComponentInChildren<TextMeshProUGUI>().text = "À¿ª´°Á±";
|
||||
Open.isOn = false;
|
||||
curtain.GetComponent<Animation>().Play("窗帘开");
|
||||
}
|
||||
else if (curtain.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 100)
|
||||
{
|
||||
opencurtain.GetComponentInChildren<TextMeshProUGUI>().text = "ÀÆð´°Á±";
|
||||
Open.isOn = true;
|
||||
curtain.GetComponent<Animation>().Play("窗帘关");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,9 +33,13 @@ public class Control_Light : MonoBehaviour
|
|||
/// <summary>
|
||||
/// ³õʼ·¢É¢ÑÕÉ«
|
||||
/// </summary>
|
||||
private Color InitColor = new Color(1, 1,1);
|
||||
private Color InitColor = new Color(1, 1, 1);
|
||||
public TMP_InputField listenFeild;
|
||||
public Button enter;
|
||||
|
||||
public Toggle cool;
|
||||
public Toggle warm;
|
||||
public Toggle Incandescent;
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
|
@ -129,7 +133,7 @@ public class Control_Light : MonoBehaviour
|
|||
{
|
||||
if (IsOpen)
|
||||
{
|
||||
Open.transform.GetComponentInChildren<TextMeshProUGUI>().text = "šŘ";
|
||||
//Open.transform.GetComponentInChildren<TextMeshProUGUI>().text = "¹Ø";
|
||||
for (int i = 0; i < LightsModel.Count; i++)
|
||||
{
|
||||
Material material = LightsModel[i].GetComponent<MeshRenderer>().materials[0];
|
||||
|
@ -140,7 +144,7 @@ public class Control_Light : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
Open.transform.GetComponentInChildren<TextMeshProUGUI>().text = "żŞ";
|
||||
//Open.transform.GetComponentInChildren<TextMeshProUGUI>().text = "¿ª";
|
||||
for (int i = 0; i < LightsModel.Count; i++)
|
||||
{
|
||||
Material material = LightsModel[i].GetComponent<MeshRenderer>().materials[0];
|
||||
|
@ -155,7 +159,8 @@ public class Control_Light : MonoBehaviour
|
|||
/// </summary>
|
||||
public void Coollight()
|
||||
{
|
||||
|
||||
warm.isOn = false;
|
||||
Incandescent.isOn = false;
|
||||
InitColor = new Color(0, 0.6145419f, 0.9433962f);
|
||||
for (int i = 0; i < LightsModel.Count; i++)
|
||||
{
|
||||
|
@ -168,6 +173,8 @@ public class Control_Light : MonoBehaviour
|
|||
/// </summary>
|
||||
public void Warmlight()
|
||||
{
|
||||
cool.isOn = false;
|
||||
Incandescent.isOn = false;
|
||||
InitColor = new Color(1, 0.6831585f, 0);
|
||||
for (int i = 0; i < LightsModel.Count; i++)
|
||||
{
|
||||
|
@ -180,6 +187,8 @@ public class Control_Light : MonoBehaviour
|
|||
/// </summary>
|
||||
public void Incandescentlight()
|
||||
{
|
||||
cool.isOn = false;
|
||||
warm.isOn = false;
|
||||
InitColor = new Color(1, 1, 1);
|
||||
for (int i = 0; i < LightsModel.Count; i++)
|
||||
{
|
||||
|
|
|
@ -12,18 +12,21 @@ public class Control_Windows : MonoBehaviour
|
|||
/// <summary>
|
||||
/// ¿ª/¹Ø´°»§
|
||||
/// </summary>
|
||||
public Button openwindows;
|
||||
//public Button openwindows;
|
||||
/// <summary>
|
||||
/// µã»÷µÄ´°»§
|
||||
/// </summary>
|
||||
public Transform window;
|
||||
|
||||
public Toggle open;
|
||||
public Toggle close;
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
openwindows.onClick.AddListener(() => { Openwindows(); });
|
||||
//openwindows.onClick.AddListener(() => { Openwindows(); });
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
|
@ -42,7 +45,8 @@ public class Control_Windows : MonoBehaviour
|
|||
{
|
||||
if (window.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 0)
|
||||
{
|
||||
openwindows.GetComponentInChildren<TextMeshProUGUI>().text = "关窗";
|
||||
close.isOn = false;
|
||||
//openwindows.GetComponentInChildren<TextMeshProUGUI>().text = "¹Ø´°";
|
||||
for (int i = 1; i < 101; i++)
|
||||
{
|
||||
window.GetComponent<SkinnedMeshRenderer>().SetBlendShapeWeight(0, i);
|
||||
|
@ -51,7 +55,8 @@ public class Control_Windows : MonoBehaviour
|
|||
}
|
||||
else if (window.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 100)
|
||||
{
|
||||
openwindows.GetComponentInChildren<TextMeshProUGUI>().text = "开窗";
|
||||
open.isOn = false;
|
||||
//openwindows.GetComponentInChildren<TextMeshProUGUI>().text = "¿ª´°";
|
||||
for (int i = 100; i >= 0; i--)
|
||||
{
|
||||
window.GetComponent<SkinnedMeshRenderer>().SetBlendShapeWeight(0, i);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -5,19 +6,43 @@ using UnityEngine.UI;
|
|||
|
||||
public class PlayImage : MonoBehaviour
|
||||
{
|
||||
public static PlayImage Instance;
|
||||
public Sprite[] sprites; // 存储序列帧动画的所有帧
|
||||
public float framesPerSecond = 10.0f; // 每秒播放的帧数
|
||||
private float index = 0;
|
||||
private int imageindex = 0;
|
||||
public Image image;
|
||||
|
||||
bool isPlay = false;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
private void Update()
|
||||
{
|
||||
StartCoroutine(PlaySprites());
|
||||
if (isPlay)
|
||||
{
|
||||
index += 0.3f;
|
||||
if (index >= framesPerSecond)
|
||||
{
|
||||
imageindex++;
|
||||
index = 0;
|
||||
if (imageindex >= sprites.Length)
|
||||
{
|
||||
imageindex = 0;
|
||||
}
|
||||
image.sprite = sprites[imageindex];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image.sprite = sprites[0];
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator PlaySprites()
|
||||
public void PlayImager()
|
||||
{
|
||||
while (true)
|
||||
isPlay = !isPlay;
|
||||
}
|
||||
IEnumerator PlaySprites(bool isPlay)
|
||||
{
|
||||
|
||||
while (isPlay)
|
||||
{
|
||||
for (int i = 0; i < sprites.Length; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue