religion/Assets/Shader/阴间/Underworld.cs
Roman 65237ef698 Squashed commit of the following:
commit 0d7446d2e7a625f033cda6acc496c6cddfe2d75f
Author: SAIPO <grasste0403@hotmail.com>
Date:   Sat Dec 25 22:53:32 2021 +0800

    修改建议及完善特效

    修改建议:
    1.添加了击中的粒子特效,但是还需要迭代
    2.修复马死后灰尘不会消失的bug

    完善特效
    1.制作了死亡时的阴间特效,已经在全场景实装
    2.制作了闪电的辉光特效。
    3.调整了所有场景的全局shader以适配死亡阴间特效

# Conflicts:
#	UserSettings/EditorUserSettings.asset
2021-12-26 21:25:59 +08:00

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);
}
}
}