private void OnEditPoIDescDone(InputField input) { MessageManager.Instance.DebugMessage("End editing PoI description"); AnchorController myAnchorController = GetComponentInParent <AnchorController>(); myAnchorController.OnEditPoIDescDone(input); }
//-------------------------ActivitySettingPanel------------------------- public void OnConfirmActivitySettingClick() { AnchorController anchorController = AnchorManager.Instance.GetCurrentAnchorObj().GetComponent <AnchorController>(); anchorController.SetUIMode(AnchorUIMode.Creator_PostSetting); anchorController.SetBehaviourMode(AnchorBehaviourMode.SettingDoneButNotSaved); //start editing activity name AnchorManager.Instance.StartEditingCurrentAnchor(); }
//--------------- Register current selected anchor object ----------------- /// <summary> /// Light-weight registration of current anchor, in this case only report the index number /// </summary> /// <param name="anchorIndex"></param> public void RegisterCurrentAnchor(int anchorIndex) { //check if the current focus object is another anchor, then 'turn it off'. AnchorController currentAnchorObjController = currAnchorObj.GetComponent <AnchorController>(); if (currentAnchorObjController.index != anchorIndex) { currentAnchorObjController.TurnOffButtons(); } //then switch the focus this.currAnchorObj = anchorObjList[anchorIndex]; }
public GameObject RebornAnchorObj(AnchorInfo info) { GameObject anchorObj = Instantiate(anchorObjPrefab); anchorObj.transform.position = info.pose.position; anchorObj.transform.rotation = info.pose.rotation; anchorObj.transform.localScale = new Vector3(0.001f, 0.001f, 0.001f); anchorObj.SetActive(true); AnchorController anchorController = anchorObj.GetComponentInChildren <AnchorController>(); anchorController.Reborn(info); return(anchorObj); }
//-------------------------------- Spawn & Reborn AnchorObject------------------------- /// <summary> /// This is used only when user is creating anchor /// </summary> /// <param name="anchorPosition"></param> public void SpawnAnchorObj(Vector3 anchorPosition) { //Instantiate new anchor prefab and set transform. GameObject anchorObj = Instantiate(anchorObjPrefab); anchorObj.transform.position = anchorPosition + Const.ANCHOR_Y_OFFSET; anchorObj.transform.localScale = new Vector3(0.001f, 0.001f, 0.001f); AnchorController anchorController = anchorObj.GetComponent <AnchorController>(); if (currAnchorObj != null) { anchorController.TurnOffButtons(); } currAnchorObj = anchorObj; //set some initial information string expId = SBContextManager.Instance.GetSBContent().experienceId; string actGroupId = SBContextManager.Instance.GetSBContent().activityGroupId; string activityId = Utilities.GenerateAnchorUniqueId(expId, actGroupId); Pose anchorPose = new Pose(anchorObj.transform.position, anchorObj.transform.rotation); Dictionary <string, string> actSpecific = new Dictionary <string, string>(); AnchorInfo initialAnchorInfo = new AnchorInfo { //initial values pose = anchorPose, experienceId = expId, activityCollectionId = actGroupId, activityId = activityId, activityName = "", //to be set later by creator type = ActivityType.Undefined, // poiDesc = "", activitySpecific = actSpecific }; anchorController.Born(anchorObjList.Count, initialAnchorInfo); //init! //add to anchor list anchorObjList.Add(currAnchorObj); MessageManager.Instance.DebugMessage(string.Format("New anchor spawned, ID: '{0}'", activityId)); }