//To Create 360 shot public void CreateNew360Shot() { if (!Check360InputFeildIsNull()) { if (IsNameOfShot(loadListOfShotDetails, CaptureTemplateUI.Instance.nameOf360Shot.text)) { int loadBetweenShots = int.Parse(CaptureTemplateUI.Instance.betweenShotsDropDown.options[CaptureTemplateUI.Instance.betweenShotsDropDown.value].text); if (CaptureTemplateUI.Instance.clockwise.activeInHierarchy) { direction = Direction.RotationDirection.clockwise; } else { direction = Direction.RotationDirection.counterClockwise; } ShotDetails newShot = new ShotDetails(ProductHandlerManager.Instance.product.name, CaptureTemplateUI.Instance.nameOf360Shot.text, int.Parse(CaptureTemplateUI.Instance.width360.text), int.Parse(CaptureTemplateUI.Instance.height360.text), loadBetweenShots, GetBetweenShots(loadBetweenShots), direction); if (CheckFolderIsCreated.JsonFolderCreation(ProductHandlerManager.Instance.product.name)) { CreateJsonFile(newShot); GameObject newShotButton = GameObject.Instantiate(CaptureTemplateUI.Instance.ShotButtonPrefab); newShotButton.GetComponent <RefrenceShotDetails>().shotDetails = newShot; newShotButton.transform.SetParent(CaptureTemplateUI.Instance.shotsContainer.transform); newShotButton.GetComponent <RefrenceShotDetails>().frameCount.text = "# of shots : " + newShot.frameCount; CreateShotUIManager.Instance.New360CancelButton(); //To open shots panel after shot creation CreateShotUIManager.Instance.ShotButton(); } } } }
//Json file for saving shots list public void CreateJsonFile(ShotDetails _shotDetails) { loadListOfShotDetails.Items.Add(_shotDetails); string jsonToSave = JsonHelper.ToJson(loadListOfShotDetails.Items.ToArray()); string fileName = GetFileNames.Instance.ProductJsonFileName(ProductHandlerManager.Instance.product.name); File.WriteAllText(fileName, jsonToSave); }
//To create silo shot public void CreateSilo() { if (!CheckSiloInputFeildIsNull()) { if (IsNameOfShot(loadListOfShotDetails, CaptureTemplateUI.Instance.nameOfSiloShot.text)) { ShotDetails newShot = new ShotDetails(ProductHandlerManager.Instance.product.name, CaptureTemplateUI.Instance.nameOfSiloShot.text, int.Parse(CaptureTemplateUI.Instance.widthSilo.text), int.Parse(CaptureTemplateUI.Instance.heightSilo.text)); if (CheckFolderIsCreated.JsonFolderCreation(ProductHandlerManager.Instance.product.name)) { CreateJsonFile(newShot); GameObject newShotButton = GameObject.Instantiate(CaptureTemplateUI.Instance.ShotButtonPrefab); newShotButton.GetComponent <RefrenceShotDetails>().shotDetails = newShot; newShotButton.transform.SetParent(CaptureTemplateUI.Instance.shotsContainer.transform); CreateShotUIManager.Instance.SiloCancelButton(); //To open shots panel after shot creation CreateShotUIManager.Instance.ShotButton(); } } } }
public void UpdateIsCapture(ShotDetails _shotDetail) { _shotDetail.isCaptured = true; RewriteJsonFile(); }
public void UpdateCameraEulerAngle(ShotDetails _shotDetail) { _shotDetail.cameraRotationX = ProductHandlerManager.Instance.cameraObject.transform.eulerAngles.x; _shotDetail.cameraRotationY = ProductHandlerManager.Instance.cameraObject.transform.eulerAngles.y; RewriteJsonFile(); }
public void UpdateCameraPosition(ShotDetails _shotDetail) { _shotDetail.cameraPosition = ProductHandlerManager.Instance.cameraObject.transform.position; RewriteJsonFile(); }
public void PushShotDetails(ShotDetails shotDetails) { _statuses.Add(_index++, shotDetails); }