/// <summary> /// Instantiates a dialog and passes a generated result /// </summary> /// <param name="dialogPrefab">Dialog prefab</param> /// <param name="buttons">button configuration type which is defined in DialogButtonType enum</param> /// <param name="title">Title text of the dialog</param> /// <param name="message">Description text of the dialog</param> /// <param name="variable">Object with additional variable</param> public static Dialog Open(GameObject dialogPrefab, DialogButtonType buttons, string title, string message, bool placeForNearInteraction, System.Object variable = null) { GameObject dialogGameObject = GameObject.Instantiate(dialogPrefab) as GameObject; if (placeForNearInteraction == true) { // For HoloLens 2, place the dialog at 45cm from the user for the near hand interactions. // Size is maintained by ConstantViewSize solver RadialView rv = dialogGameObject.GetComponent <RadialView>(); rv.MinDistance = 0.4f; rv.MaxDistance = 0.7f; } else { // For HoloLens 1 and other platforms, place the dialog for far interactions with gaze or pointers. // Size is maintained by ConstantViewSize solver RadialView rv = dialogGameObject.GetComponent <RadialView>(); rv.MinDistance = 1.5f; rv.MaxDistance = 2.0f; } Dialog dialog = dialogGameObject.GetComponent <Dialog>(); DialogResult result = new DialogResult { Buttons = buttons, Title = title, Message = message, Variable = variable }; dialog.Launch(result); return(dialog); }
public void setImageProperties(RadialView radialView) { radialView.MoveLerpTime = 0.5f; radialView.RotateLerpTime = 0.5f; radialView.MinDistance = 0.8f; radialView.MaxDistance = 0.6f; radialView.MaxViewDegrees = 0.0f; }
private void Awake() { radialView = GetComponent <RadialView>(); if (autoFollowTransformTarget == null) { autoFollowTransformTarget = transform; } // Begin the follow coroutine if requested at the beginning. AutoFollowAtDistance = autoFollowAtDistance; }
// Start is called before the first frame update void Start() { interactables = GetComponentsInChildren <Interactable>(); Texts = GetComponentsInChildren <TextMeshPro>(); animator = GetComponent <Animator>(); radView = GetComponent <RadialView>(); billBoard = GetComponent <Billboard>(); animator.SetBool("isAzerty", isAzerty); currentFontState = FontState.Lower; if (StartOpen == false) { Close(false); } }
public IEnumerator TestSolverSwap() { // Reset view to origin MixedRealityPlayspace.PerformTransformation(p => { p.position = Vector3.zero; p.LookAt(Vector3.forward); }); // Instantiate and setup RadialView to place object in the view center. var testObjects = InstantiateTestSolver <RadialView>(); RadialView radialViewSolver = (RadialView)testObjects.solver; radialViewSolver.MinDistance = 2.0f; radialViewSolver.MaxDistance = 2.0f; radialViewSolver.MinViewDegrees = 0.0f; radialViewSolver.MaxViewDegrees = 0.0f; // Let RadialView update the target object yield return(WaitForFrames(2)); // Make sure Radial View is placing object in center of View, so we can later check that a solver swap actually moved the target object. TestUtilities.AssertAboutEqual(testObjects.target.transform.position, Vector3.forward * 2.0f, "RadialView does not place object in center of view"); // Disable the old solver radialViewSolver.enabled = false; // Add a another solver during runtime, give him a specific location to check whether the new solver updates the target object. Orbital orbitalSolver = AddSolverComponent <Orbital>(testObjects.target); orbitalSolver.WorldOffset = Vector3.zero; orbitalSolver.LocalOffset = Vector3.down * 2.0f; // Let Orbital update the target object yield return(WaitForFrames(2)); // Make sure Orbital is now updating the target object TestUtilities.AssertAboutEqual(testObjects.target.transform.position, Vector3.down * 2.0f, "Orbital solver did not place object below origin"); // Swap solvers once again during runtime radialViewSolver.enabled = true; orbitalSolver.enabled = false; // Let RadialView update the target object yield return(WaitForFrames(2)); // Make sure Radial View is now updating the target object once again. TestUtilities.AssertAboutEqual(testObjects.target.transform.position, Vector3.forward * 2.0f, "RadialView solver did not place object in center of view"); }
void Start() { querymenu = transform.gameObject;; transform.gameObject.SetActive(false); queryMenuPosition = GetComponent <SolverHandler>().AdditionalOffset; initRadialView = GetComponent <RadialView>(); queryList = new Dictionary <int, GameObject>(); scrollObeObjectCollectionGameObject = querymenu.transform.GetChild(2).gameObject; scrollingObjectCollection = scrollObeObjectCollectionGameObject.GetComponent <ScrollingObjectCollection>(); searchButton = transform.GetChild(3).gameObject; searchButton.GetComponent <Interactable>().OnClick.AddListener((() => searchClick())); ErrorDialog = transform.GetChild(8).gameObject; ErrorDialog.SetActive(false); ErrorButton = transform.GetChild(8).GetChild(2).GetChild(0).gameObject; ErrorButton.GetComponent <Interactable>().OnClick.AddListener((() => backClick())); }
public void SearchIDProvider(GameObject gameObject, List <PicturePointerData> list) { PicturePointerData result = list.Find(x => x.getGameObject() == gameObject); PictureAttribute attribute = result.getGameObject().GetComponent <PictureAttribute>(); Debug.Log(attribute.latitude + " " + attribute.longitude); Debug.Log(result.getID() + " ID "); var eventArgs = new SelectResultPictureDataArgs(result); OnSelectPicture(this, eventArgs); ShowObject = Instantiate(result.getGameObject()); ShowObject.AddComponent <ObjectManipulator>(); ShowObject.AddComponent <NearInteractionGrabbable>(); ShowObject.GetComponent <PointerHandler>().enabled = false; // Disabling it otherwise other Listener will get Events ShowObject.transform.position = result.getGameObject().transform.position; // This position used for a smooth transition from collection to view ShowPictureObject = (GameObject)Resources.Load("Prefab/ShowResult", typeof(GameObject)); ShowPictureObject = Instantiate(ShowPictureObject); ShowPictureObject.transform.parent = transform.parent; ShowPictureObject.transform.position = ShowObject.transform.position; // Get Original position from colloection for nice smooth transition ShowObject.transform.localScale = new Vector3(attribute.width / local_resize, attribute.height / local_resize, 0.0001f); // Setting size ShowObject.transform.parent = ShowPictureObject.transform; //ShowPictureObject.transform.GetChild(0).transform.position = result.getGameObject().transform.position; //ShowPictureObject.transform.GetChild(0).transform.localScale = new Vector3(0.5f,-0.3f,0.0001f); ShowPictureObject.GetComponent <SolverHandler>().enabled = true; ShowPictureObject.GetComponent <RadialView>().enabled = true; RadialView radialView = ShowPictureObject.GetComponent <RadialView>(); setImageProperties(radialView); setCollectionVisibility(false); initPictureObject(); initHandMenuPictureObject(attribute); HandMenuSuperImoseInit(); PictureMenuSuperImoseInit(); }
// Start is called before the first frame update void Start() { this.radialView = GetComponent <RadialView>(); }
private void Start() { // Get Radial Solver component radialView = GetComponent <RadialView>(); }
void Start() { myRadial = GetComponent <RadialView>(); }