void Start()
{
invicinbleEffect=Instantiate(Resources.Load("Prefabs/InvicinbleEffect")) as GameObject;
particle = invicinbleEffect.transform.GetComponent<ParticleSystem>();
}
// Update is called once per frame
void Update()
{
switch (playerState)
{
case PLAYER_STATE.normal:
skillText.enabled = false;
GameManager.SkillIconActive(false);
particle.Stop();
speed = moveSpeed;
break;
case PLAYER_STATE.isvincible:
particle.Play();
speed = invicinbleSpeed;
StartCoroutine(Isvincible());
break;
default:
break;
}
同学你好,可以参考一下:
https://zhidao.baidu.com/question/1860952484084707147.html
https://blog.csdn.net/KiTok/article/details/78126425?utm_source=blogxgwz1