Skip to content

Instantly share code, notes, and snippets.

@Buravo46
Last active January 2, 2016 21:59
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 Buravo46/8366967 to your computer and use it in GitHub Desktop.
Save Buravo46/8366967 to your computer and use it in GitHub Desktop.
【Unity】オブジェクトの透明度を減算していくスクリプト。
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;
}
}
#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