private void PlaceChristmasTree(Vector2 screenTouchPos) { Pose placementPose = arRayHits[0].pose; christmasTree = Instantiate(christmasTreePrefab, placementPose.position, placementPose.rotation).GetComponent <ChristmasTree>(); // execute loading if user pressed "Load" button. if (ChristmasTree.isLoadingON) { var loadObj = SaveLoadManager <TreeSaveData> .GetLoadData(Application.persistentDataPath + "/save.txt"); christmasTree.DecorateWithLoadData(loadObj); } christmasTree.SetTreeLight(false); Snow.SetActive(true); FindObjectOfType <UIController>().tabBar.SetActive(true); SwitchToOcclusionPlane(); }
/// <summary> /// set saving data when creating save object /// </summary> public TreeSaveData(ChristmasTree christmasTree) { this.decorationItemLocalPos = christmasTree.decorationItemLocalPos; this.decorationItemColors = christmasTree.decorationItemColors; }