5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unity2Dメモ2 スクリプトからSpriteの透明度を変える

Last updated at Posted at 2014-05-15

スクリプトからSpriteの透明度を変える

TransparencyTest.cs
public class TransparencyTest: MonoBehaviour {
    SpriteRenderer spriteRenderer;

	void Start () 
    {
        this.spriteRenderer = GetComponent<SpriteRenderer>();
        ChangeTransparency(0); // 完全に透明にする
    }

    void ChangeTransparency (float alpha) 
    {
        this.hukidashiRenderer.color = new Color(1, 1, 1, alpha);
    }
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?