50 lines
886 B
C#
50 lines
886 B
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
/// <summary>
|
||
/// 模拟操作
|
||
/// 1,材质替换
|
||
/// 2,粒子控制
|
||
/// </summary>
|
||
public class GuoLuMoLi : MonoBehaviour
|
||
{
|
||
[Tooltip("烟雾物体")]
|
||
public MeshRenderer YanRender;
|
||
public Material[] Materials;
|
||
[Tooltip("喷火粒子")]
|
||
public ParticleSystem HuoParticle;
|
||
|
||
private Material m_yanMat;
|
||
|
||
|
||
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();
|
||
}
|
||
|
||
public void EndToChange()
|
||
{
|
||
YanRender.material = Materials[0];
|
||
HuoParticle.Stop();
|
||
}
|
||
}
|