1234567891011121314151617181920212223242526 |
- using UnityEngine;
- using System.Collections;
- public static class EmptySprite {
- static Sprite instance;
-
-
-
- public static Sprite Get(){
- if (instance == null) {
- instance = OnePixelWhiteSprite();
- }
- return instance;
- }
-
-
-
-
- static Sprite OnePixelWhiteSprite(){
- Texture2D tex = new Texture2D (1,1);
- tex.SetPixel (0,0,Color.white);
- tex.Apply ();
- return Sprite.Create(tex,new Rect(0,0,1,1),Vector2.zero);
- }
- }
|