ClearPixels() public method

public ClearPixels ( Color color ) : void
color Color
return void
Exemplo n.º 1
0
    void Update()
    {
        fupixel.ClearPixels(Color.black);

        for (int i = 0; i < stars.Length; i++)
        {
            int  x = (int)(stars[i].x / stars[i].z) + fupixel.width / 2;
            int  y = (int)(stars[i].y / stars[i].z) + fupixel.height / 2;
            byte c = (byte)(255f / stars[i].z);

            if (x < fupixel.width)
            {
                stars[i] += new Vector3(Time.deltaTime * speed, 0f, 0f);
            }
            else
            {
                stars[i] = new Vector3(-xSize, stars[i].y, stars[i].z);
            }

            if (x >= 0 && x < fupixel.width && y >= 0 && y < fupixel.height)
            {
                fupixel.SetPixel(x, y, c, c, c, 255);
            }
        }
    }
Exemplo n.º 2
0
    void Awake()
    {
        fupixel = gameObject.GetComponent<Fupixel>();
        fupixel.ClearPixels(Color.black);
        stars = new Vector3[count];

        for(int i=0; i<stars.Length; i++)
            stars[i] = new Vector3(Random.Range(-xSize, xSize), Random.Range(-ySize, ySize), (float)(stars.Length - i) * maxZ / stars.Length + minZ);
    }
Exemplo n.º 3
0
    void Awake()
    {
        fupixel = gameObject.GetComponent <Fupixel>();
        fupixel.ClearPixels(Color.black);
        stars = new Vector3[count];

        for (int i = 0; i < stars.Length; i++)
        {
            stars[i] = new Vector3(Random.Range(-xSize, xSize), Random.Range(-ySize, ySize), (float)(stars.Length - i) * maxZ / stars.Length + minZ);
        }
    }
Exemplo n.º 4
0
 void Awake()
 {
     fupixel = gameObject.GetComponent <Fupixel>();
     fupixel.ClearPixels(Color.black);
     snakeParts = new Queue <int>();
     snakeX     = fupixel.width / 2;
     snakeY     = fupixel.height / 4;
     foodIndex  = fupixel.GetIndex(snakeX, fupixel.height / 2);
     snakeParts.Enqueue(fupixel.GetIndex(snakeX, snakeY));
     DrawWalls();
 }
Exemplo n.º 5
0
 void Awake()
 {
     fupixel = gameObject.GetComponent<Fupixel>();
     fupixel.ClearPixels(Color.black);
     snakeParts = new Queue<int>();
     snakeX = fupixel.width / 2;
     snakeY = fupixel.height / 4;
     foodIndex = fupixel.GetIndex(snakeX, fupixel.height / 2);
     snakeParts.Enqueue(fupixel.GetIndex(snakeX, snakeY));
     DrawWalls();
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     fupixel = gameObject.GetComponent<Fupixel>();
     fupixel.ClearPixels(Color.black);
     fupixel.SetPixel(10, 10, Color.red);
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     fupixel = gameObject.GetComponent <Fupixel>();
     fupixel.ClearPixels(Color.black);
     fupixel.SetPixel(10, 10, Color.red);
 }