// Update is called once per frame void Update() { for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (WebCamManager.checkActivePixel(x, y)) { Vector3 pos = new Vector3((x - Width / 2), (y - Height / 2), 0) + transform.position; Particle.Emit(pos); } } } }
void CollisionGenerate() { for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (WebCamManager.checkActivePixel(x, y)) { CollisionObject[y * Width + x].SetActive(true); } else { CollisionObject[y * Width + x].SetActive(false); } } } }
// Update is called once per frame void Update() { for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (WebCamManager.checkActivePixel(x, y)) { BoxObject[y * Width + x].transform.localScale = new Vector3(BoxPrefab.transform.localScale.x, BoxPrefab.transform.localScale.y, Level3D); } else { BoxObject[y * Width + x].transform.localScale = BoxPrefab.transform.localScale; } } } }