public Texture2D Photo(int width, int height) { gameObject.SetActive(true); var tex = CameraCapture.Capture(MyCamera, width, height); DebugLog.log("キャプチャ"); gameObject.SetActive(false); return(tex); }
// Update is called once per frame void Update() { time += Time.deltaTime; if (time >= 3.0f && (isEnd == false)) { var tex = CameraCapture.Capture(Camera.main); meshRen.material.mainTexture = tex; //isEnd = true; time = 0.0f; } }
IEnumerator CaptureAll() { int i = 0; Camera cam = Camera.main; while (i < snapshotAmount) { Transform tr = PointCloudCoordinator.NextPoint(); cam.transform.position = tr.position; cam.transform.rotation = tr.rotation; CameraCapture.Capture(); i++; yield return(null); } }
void Update() { if (spraying) { bool sprayed = cameraCapture.Capture(); if (sprayed) { Blank = false; if (Spraying != null) { Spraying(); } } } }
void TextureSave(string texName) { var tex = CameraCapture.Capture(Camera.main); tex.name = texName; // ファイルダイアログの表示. string filePath = EditorUtility.SaveFilePanel("Save Texture", "Log/", tex.name + ".png", "png"); byte[] pngData = tex.EncodeToPNG(); // pngのバイト情報を取得. if (filePath.Length > 0) { // pngファイル保存. File.WriteAllBytes(filePath, pngData); } Object.DestroyImmediate(tex); }