48 lines
789 B
C#
48 lines
789 B
C#
![]() |
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class BellShader : MonoBehaviour
|
||
|
{
|
||
|
public Material _Material;
|
||
|
|
||
|
public float Value;
|
||
|
|
||
|
public float speed = 0.1f;
|
||
|
|
||
|
public Color color;
|
||
|
public bool Remake=false;
|
||
|
public bool isBell;
|
||
|
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
_Material.SetFloat("_Float0",-1);
|
||
|
}
|
||
|
|
||
|
void Update()
|
||
|
{
|
||
|
if (Remake)
|
||
|
{
|
||
|
Value = -1;
|
||
|
_Material.SetFloat("_Float0",Value);
|
||
|
Remake = false;
|
||
|
}
|
||
|
|
||
|
if (Value >= 25)
|
||
|
{
|
||
|
Value = -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void FixedUpdate()
|
||
|
{
|
||
|
if (isBell)
|
||
|
{
|
||
|
Value += speed;
|
||
|
_Material.SetFloat("_Float0",Value);
|
||
|
}
|
||
|
}
|
||
|
}
|