public override void SetupMode() { saveMapPanel.SetActive(true); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element(inputFieldElementName, OnSelectInputField)); elements.Add(new MM.Element("Cancel", OnSelectCancel)); MM.instance.elements = elements; MM.instance.index = 0; MM.instance.currentPanel = saveMapPanel; HighlightElement(saveMapPanel); // Set up event handlers TapSwipeDetector.OnSwipe += OnSwipeDefault; TapSwipeDetector.OnSwipe += OnSwipeInputField; TapSwipeDetector.OnTap += OutputCurrentElement; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; // Activate input field inputField.interactable = true; inputField.Select(); inputField.ActivateInputField(); // Output intro MM.OutputText("Enter the name of your map."); }
/** * For iterating between elements on the audio cue list. */ public void OnVerticalSwipe(SwipeData swipeData) { // Only trigger on up/down swipes if (swipeData.Direction != SwipeDirection.Down && swipeData.Direction != SwipeDirection.Up) { return; } // Update index storedAudioInfoElement.Pause(); audioLibraryIndex += swipeData.Direction == SwipeDirection.Up ? -1 : 1; int librarySize = AudioLibrary.instance.library.Length; audioLibraryIndex = (audioLibraryIndex + librarySize) % librarySize; // Update list and candidate audio cue playingAudio = false; Audio audio = AudioLibrary.instance.library[audioLibraryIndex]; storedAudioInfoElement = storedAudioInfoElements[audioLibraryIndex]; AM.instance.PauseCandidateAudioCueSound(); AM.instance.ChangeCandidateAudioCueClip(audio); HighlightAudioElement(audioCuePanel, audioLibraryIndex, contentPanel); // Output current audio cue name MM.OutputText(audio.id); }
private void SpecialOutputElement() { if (MM.instance.elements[MM.instance.index].name.Equals(MAP_LIST_NAME)) { MM.OutputText(MAP_LIST_NAME + ", " + PM.instance.selectedMapInfo.metadata.name); } else { OutputCurrentElement(); } }
public void OnMapListTap() { if (!MM.instance.elements[MM.instance.index].name.Equals(MAP_LIST_NAME)) { OutputCurrentElement(); } else { MM.OutputText(PM.instance.selectedMapInfo.metadata.name + ", " + mapInfoElement.mLocationText.text); } }
/** * Outputs the element name, with special casing to output the audio cue * name when the audio cue list is selected. */ private void SpecialOutputElement() { if (MM.instance.elements[MM.instance.index].name.Equals(AUDIO_CUE_LIST_NAME)) { Audio audio = AudioLibrary.instance.library[audioLibraryIndex]; MM.OutputText(AUDIO_CUE_LIST_NAME + ", " + audio.id); } else { OutputCurrentElement(); } }
public void OnSelectScanning() { bool success = PM.instance.CreateNewSession(); if (success) { //Debug.Log("Scanning. Moving to New Map Mode."); MM.instance.SwitchModes(scanningMode); } else { MM.OutputText("ARVI is still loading, please stand by."); } }
public void OnSelectInputField() { //Debug.Log("Submitting input field. Moving to Main Menu Mode."); string name = inputField.text; if (name.Equals("")) { MM.OutputText("Invalid scan name."); } else { PlacenoteManager.instance.SaveMap(name); MM.instance.SwitchModes(mainMenuMode); } }
/** * For iterating between map list elements */ public void OnVerticalSwipe(SwipeData data) { if (data.Direction != SwipeDirection.Down && data.Direction != SwipeDirection.Up) { return; } if (data.Direction == SwipeDirection.Up) { if (PM.instance.mMapListStart == PM.instance.mMapListIdx && PM.instance.mMapListStart == 0) { PM.instance.mMapListEnd = PM.instance.mMapList.Count - 1; PM.instance.mMapListStart = Mathf.Max(0, PM.instance.mMapListEnd - 9); UpdateList(); } else if (PM.instance.mMapListStart == PM.instance.mMapListIdx && PM.instance.mMapListStart != 0) { PM.instance.mMapListStart--; PM.instance.mMapListEnd--; UpdateList(); } PM.instance.mMapListIdx -= 1; PM.instance.mMapListIdx += PM.instance.mMapList.Count; } else if (data.Direction == SwipeDirection.Down) { if (PM.instance.mMapListEnd == PM.instance.mMapListIdx && PM.instance.mMapListEnd < PM.instance.mMapList.Count - 1) { PM.instance.mMapListStart++; PM.instance.mMapListEnd++; UpdateList(); } else if (PM.instance.mMapListEnd == PM.instance.mMapListIdx && PM.instance.mMapListEnd >= PM.instance.mMapList.Count - 1) { PM.instance.mMapListStart = 0; PM.instance.mMapListEnd = Mathf.Min(PM.instance.mMapListStart + 9, PM.instance.mMapList.Count - 1); UpdateList(); } PM.instance.mMapListIdx += 1; } PM.instance.mMapListIdx = PM.instance.mMapListIdx % PM.instance.mMapList.Count; HighlightElement(mapListPanel, listContentParent); PM.instance.selectedMapInfo = PM.instance.mMapList[PM.instance.mMapListIdx]; MM.OutputText(PM.instance.selectedMapInfo.metadata.name); }
public void SeedFirstListElement() { if (PM.instance.mMapList.Count == 0) { MM.OutputText("There are no scans in your area."); } else { if (PM.instance.mMapListEnd == 0) { PM.instance.mMapListEnd = Mathf.Min(9, PM.instance.mMapList.Count - 1); } for (int i = PM.instance.mMapListStart; i <= PM.instance.mMapListEnd; i++) { AddMapToList(PM.instance.mMapList[i]); } HighlightElement(mapListPanel, listContentParent); } }
public override void SetupMode() { mapListPanel.SetActive(true); //clear current List foreach (Transform t in listContentParent.transform) { Destroy(t.gameObject); } listContentParent.DetachChildren(); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element(MAP_LIST_NAME, OnSelectMapList)); elements.Add(new MM.Element("Cancel", OnSelectCancel)); MM.instance.index = 0; MM.instance.elements = elements; MM.instance.currentPanel = mapListPanel; MM.instance.listTransform = listContentParent; // Set up event handlers TapSwipeDetector.OnSwipe += OnHorizontalSwipe; TapSwipeDetector.OnSwipe += OnVerticalSwipe; TapSwipeDetector.OnTap += OnMapListTap; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; // Output intro MM.OutputText("Choose a map from the list."); //Load maps if (PM.instance.LoadMapList(SeedFirstListElement)) { //Debug.Log("Loading. Moving to Map List Mode."); } else { MM.OutputText("ARVI is still loading, please stand by."); } }
public override void SetupMode() { audioCuePanel.SetActive(true); // Set up list, seed w/ the first element contentPanel = (RectTransform)audioCuePanel.transform .Find("AudioListPanel") .Find("Viewport") .Find("Content"); Audio audio = AudioLibrary.instance.library[audioLibraryIndex]; foreach (Audio curAudio in AudioLibrary.instance.library) { AddAudioCueListElement(curAudio.id); } AM.instance.PauseCandidateAudioCueSound(); AM.instance.ChangeCandidateAudioCueClip(audio); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element(AUDIO_CUE_LIST_NAME, OnSelectAudioCueList)); elements.Add(new MM.Element("Cancel", OnSelectCancel)); MM.instance.elements = elements; MM.instance.index = 0; MM.instance.listTransform = contentPanel; MM.instance.currentPanel = audioCuePanel; HighlightAudioElement(audioCuePanel, audioLibraryIndex, contentPanel); storedAudioInfoElement = storedAudioInfoElements[audioLibraryIndex]; // Set up event handlers TapSwipeDetector.OnSwipe += OnHorizontalSwipe; TapSwipeDetector.OnSwipe += OnVerticalSwipe; TapSwipeDetector.OnTap += OnAudioCueListTap; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; // Output intro MM.OutputText("Choose an audio cue from the list."); }
public override void SetupMode() { mainMenuPanel.SetActive(true); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element("Scanning", OnSelectScanning)); elements.Add(new MM.Element("Localizing", OnSelectLocalizing)); MM.instance.elements = elements; MM.instance.currentPanel = mainMenuPanel; MM.instance.index = 0; HighlightElement(mainMenuPanel); // Set up event handlers TapSwipeDetector.OnSwipe += OnSwipeDefault; TapSwipeDetector.OnTap += OutputCurrentElement; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; // Output intro MM.OutputText("Welcome to ARVI. Please select a mode."); }
public override void SetupMode() { localizePanel.SetActive(true); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element("Cancel", OnSelectCancel)); MM.instance.elements = elements; MM.instance.index = 0; MM.instance.currentPanel = localizePanel; HighlightElement(localizePanel); // Set up event handlers TapSwipeDetector.OnTap += OutputCurrentElement; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; //Calling Placenote to localize PM.instance.StartLocalize(); // Output intro MM.OutputText("Scan the area around you to localize yourself."); }
public override void SetupMode() { newMapPanel.SetActive(true); // Set up elements List <MM.Element> elements = new List <MM.Element>(); elements.Add(new MM.Element("Add audio cue", OnSelectAddAudioCue)); elements.Add(new MM.Element("Cancel", OnSelectCancel)); elements.Add(new MM.Element("Save map", OnSelectSave)); MM.instance.elements = elements; MM.instance.index = 0; MM.instance.currentPanel = newMapPanel; HighlightElement(newMapPanel); // Set up event handlers TapSwipeDetector.OnSwipe += OnSwipeDefault; TapSwipeDetector.OnTap += OutputCurrentElement; TapSwipeDetector.OnDoubleTap += OnDoubleTapDefault; // Output current element name MM.OutputText("Creating a new map. Please scan the environment slowly to collect data."); }
public void OutputCurrentElement() { MM.OutputText(MM.instance.elements[MM.instance.index].name); }