Last active
April 10, 2019 13:39
-
-
Save westhillapps/df658b47e1b043e4acfd to your computer and use it in GitHub Desktop.
AlphaBlendedシェーダを適用したマテリアルの3Dオブジェクトをフェードアウトさせるテスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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