ZhangZhouSpecialEquipment/Assets/Scripts/锅炉/GuoLuMoLi.cs

65 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 模拟操作
/// 1材质替换
/// 2粒子控制
/// </summary>
public class GuoLuMoLi : MonoBehaviour
{
[Tooltip("烟雾物体")]
public MeshRenderer YanRender;
public Material[] Materials;
[Tooltip("喷火粒子")]
public ParticleSystem HuoParticle;
private Material m_yanMat;
public Image[] AllImgs;
public Sprite[] AllSprites;
public TextMeshProUGUI TextMPU;
private void Awake()
{
m_yanMat = YanRender.material;
}
// Start is called before the first frame update
void Start()
{
HuoParticle.Stop();
}
// Update is called once per frame
void Update()
{
}
public void StartToChange()
{
YanRender.material = Materials[1];
HuoParticle.Play();
AllImgs[0].sprite = AllSprites[1];
AllImgs[1].sprite = AllSprites[2];
TextMPU.text = "开";
}
public void EndToChange()
{
YanRender.material = Materials[0];
HuoParticle.Stop();
AllImgs[0].sprite = AllSprites[0];
AllImgs[1].sprite = AllSprites[3];
TextMPU.text = "关";
}
}