Skip to content

Instantly share code, notes, and snippets.

@WestHillApps
Last active April 10, 2019 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WestHillApps/df658b47e1b043e4acfd to your computer and use it in GitHub Desktop.
Save WestHillApps/df658b47e1b043e4acfd to your computer and use it in GitHub Desktop.
AlphaBlendedシェーダを適用したマテリアルの3Dオブジェクトをフェードアウトさせるテスト
using UnityEngine;
using System.Collections;
public class FadeTest : MonoBehaviour
{
void Start ()
{
StartCoroutine (FadeAlpha ());
}
IEnumerator FadeAlpha ()
{
Color col = renderer.material.GetColor ("_TintColor");
while (0f < col.a) {
col.a -= 0.01f;
renderer.material.SetColor ("_TintColor", col);
yield return null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment