Last active
January 2, 2016 21:59
-
-
Save Buravo46/8366967 to your computer and use it in GitHub Desktop.
【Unity】オブジェクトの透明度を減算していくスクリプト。
This file contains 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 FadeOutScript : MonoBehaviour { | |
Color alpha = new Color(0, 0, 0, 0.01f); | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
if(renderer.material.color.a >= 0) | |
renderer.material.color -= alpha; | |
} | |
} |
This file contains 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
#pragma strict | |
// 色 | |
var alpha : Color = Color(0.0, 0.0, 0.0, 0.01); | |
function Start () { | |
} | |
function Update () { | |
if(renderer.material.color.a >= 0) | |
renderer.material.color -= alpha; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment