private void OnDragEnded() { foreach (GameObject obj in instructionObjects) { InstructionSet set = obj.GetComponent <InstructionSet>(); if (set != null) { instructionSets[instructionSetIndex++] = set; HUDLogController.QuickMessage("Instruction set found"); } } if (instructionSetIndex > 0 && instructionSets[0] != null) { selectedSet = instructionSets[0]; bool failState = false; int count = 0; StepController[] list = instructionSets[0].GetControllers(out count, out failState); if (failState) { HUDLogController.QuickMessage("failed"); } else { HUDLogController.QuickMessage("Populate manager "); InstructionManager.instance.StepControllers = new List <StepController>(list); } } else { HUDLogController.QuickMessage("Presenter Nope!!"); } InstructionManager.instance.SetInstructionState(InstructionManager.InstructionStates.Starting); }
public void SetInstructionState(InstructionStates state) { switch (state) { case InstructionStates.Unseen: NextButton.SetActive(false); BackButton.SetActive(false); CloseButton.SetActive(false); StartButton.SetActive(false); HUDLogController.QuickMessage("Set to Placing"); break; case InstructionStates.Starting: NextButton.SetActive(false); BackButton.SetActive(false); CloseButton.SetActive(false); StartButton.SetActive(true); HUDLogController.QuickMessage("Set to Starting"); break; case InstructionStates.Using: NextButton.SetActive(true); BackButton.SetActive(true); CloseButton.SetActive(true); StartButton.SetActive(false); HUDLogController.QuickMessage("Set to Using"); break; default: break; } }
private void InteractionManager_SourceLost(InteractionSourceState state) { // Ensure only the driver cancel detection if (controllingID == state.source.id) { HandDetected = false; HUDLogController.QuickMessage("Hand Lost"); } }
//// Update is called once per frame //void Update() //{ //} private void PopulateInstructionManager() { if (selectedSet != null) { //InstructionManager.instance.StepControllers = selectedSet.StepControllers; } else { HUDLogController.QuickMessage("selectedSet is null "); } }
private void CursorUpdate() { oldFocusedObject = FocusedObject; switch (priority) { case CursorFocusPriority.Hand: if (HandManager.instance.HandDetected) { HandUpdate(); } else { GazeUpdate(); } break; case CursorFocusPriority.Gaze: GazeUpdate(); break; default: break; } // Message sending should be suppressed while dragging if (!Dragging) { // Send Messages if (FocusedObject != oldFocusedObject) { if (FocusedObject != null) { FocusedObject.SendMessage("OnFocusEnter", this, SendMessageOptions.DontRequireReceiver); HUDLogController.QuickMessage("Focus Enter " + FocusedObject.name); } if (oldFocusedObject != null) { oldFocusedObject.SendMessage("OnFocusExit", this, SendMessageOptions.DontRequireReceiver); HUDLogController.QuickMessage("Focus Exit " + oldFocusedObject.name); } } else { if (FocusedObject != null) { FocusedObject.SendMessage("OnFocusOver", this, SendMessageOptions.DontRequireReceiver); } } } else { DraggedObject.transform.position = mesh.transform.position; } }
public void OnNextPressed() { if (StepIndex < StepControllers.Count) { HUDLogController.QuickMessage("Next Pressed"); GameObject obj = Instantiate(StepControllers[StepIndex].gameObject, PresentationSpace.transform) as GameObject; StepArray[StepIndex] = obj.gameObject; CurrentStep = obj.gameObject; obj.transform.position += PresentationSpace.transform.position; StepIndex++; } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } HUDLogController.QuickMessage("Gaze Manager Checking In"); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } logText = GetComponent <Text>(); logText.color = messageColor; }
public void OnStartPressed() { HUDLogController.QuickMessage("StepControllers Count " + StepControllers.Count.ToString()); if (StepControllers.Count > 0) { StepIndex = 0; GameObject obj = Instantiate(StepControllers[StepIndex].gameObject, PresentationSpace.transform) as GameObject; StepArray[StepIndex] = obj.gameObject; CurrentStep = obj.gameObject; obj.transform.position += PresentationSpace.transform.position; StepIndex++; SetInstructionState(InstructionStates.Using); } }
private void InteractionManager_SourceDetected(InteractionSourceState state) { // Ensure only one hand is driving if (!HandDetected) { HUDLogController.QuickMessage("Hand Detected"); HandDetected = true; controllingID = state.source.id; Vector3 handPosition; if (state.properties.location.TryGetPosition(out handPosition)) { HandPosition = handPosition; } } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } HUDLogController.QuickMessage("Hand Manager Checking In"); HandDetected = false; HandPosition = new Vector3(0, 0, 0); }
public void UpdateBounds() { HUDLogController.QuickMessage("UpdateBounds Called"); Bounds b = new Bounds(); Vector3 newExtents = minExtents; //Create a bounds structure with extents that include all insta try { foreach (GameObject obj in StepArray) { MeshFilter filter = obj.GetComponent <MeshFilter>(); if (filter != null) { Vector3 max = filter.mesh.bounds.max; if (Mathf.Abs(max.x) > Mathf.Abs(newExtents.x)) { newExtents.x = Mathf.Abs(max.x); } if (Mathf.Abs(max.y) > Mathf.Abs(newExtents.y)) { newExtents.y = Mathf.Abs(max.y); } if (Mathf.Abs(max.z) > Mathf.Abs(newExtents.z)) { newExtents.z = Mathf.Abs(max.z); } } } b.extents = newExtents; b.center = new Vector3(0, 0, 0); HUDLogController.instance.AddToLog("x: " + newExtents.x + " y: " + newExtents.y + " z: " + newExtents.z, HUDLogController.LogMessageTypes.Message, false); CanvasManager.ResizeCanvas(b); } catch (UnityException e) { HUDLogController.QuickMessage("ProblemWithUpdateBOunds"); HUDLogController.QuickError(e.ToString()); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } HUDLogController.QuickMessage("Smart Cursor Checking In"); mesh = GetComponent <MeshRenderer>(); GameObject eye = GameObject.Find("EyeIcon"); eyeRenderer = eye.GetComponent <SpriteRenderer>(); GameObject hand = GameObject.Find("HandIcon"); handRenderer = hand.GetComponent <SpriteRenderer>(); }
void OnGazeExit() { HUDLogController.QuickError(name + " exited"); MaterialPropertyBlock mpb = new MaterialPropertyBlock(); _Renderer.GetPropertyBlock(mpb); mpb.SetFloat("_Outline", 0); _Renderer.SetPropertyBlock(mpb); ARButtonEventArgs args = new ARButtonEventArgs() { GazeFocused = false, HandFocused = false, PriorityFocused = true }; OnExitedHandler handler = OnExited; if (handler != null) { handler(this, args); } }
// Use this for initialization void Start() { HUDLogController.QuickMessage("Presenter Starting!!"); }
public void OnLaunchClick() { HUDLogController.QuickMessage("Launch Pressed"); }
private void OnDragStarted() { HUDLogController.QuickError("Drag started"); InstructionManager.instance.SetInstructionState(InstructionManager.InstructionStates.Unseen); }
public void OnClosePressed() { HUDLogController.QuickMessage("Close Pressed"); }
// Use this for initialization void Start() { HUDLogController.QuickMessage("Something"); }