修改建议: 1.添加了击中的粒子特效,但是还需要迭代 2.修复马死后灰尘不会消失的bug 完善特效 1.制作了死亡时的阴间特效,已经在全场景实装 2.制作了闪电的辉光特效。 3.调整了所有场景的全局shader以适配死亡阴间特效
40 lines
693 B
C#
40 lines
693 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Underworld : MonoBehaviour
|
|
{
|
|
public Material dead;
|
|
|
|
public float speed;
|
|
|
|
public static bool isDead = false;
|
|
private float step = 0;
|
|
|
|
void Start()
|
|
{
|
|
dead.SetFloat("_Step",0);
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (isDead == true)
|
|
{
|
|
StartCoroutine(startDead());
|
|
isDead = false;
|
|
}
|
|
|
|
}
|
|
|
|
public IEnumerator startDead()
|
|
{
|
|
while (step<1)
|
|
{
|
|
step += 0.02f;
|
|
dead.SetFloat("_Step",step);
|
|
yield return new WaitForSeconds(speed);
|
|
}
|
|
}
|
|
}
|