private void Awake() { // Important to not crash in editor if (Application.isEditor) { GameObject.Find("ARCore Device").active = false; } ActiveScreens = new List <GameObject>(); logger = LogManager.GetInstance().GetLogger(GetType()); logger.Debug("Awake!"); currentState = State.IDLE; // Use Awake instead of ctor nativeLocation = LocationAwarenessPlugin.GetInstance(); logger.Debug("Created LocationAwarenessPlugin"); gameObject.AddComponent <UnityLocationService>(); unityLocation = gameObject.GetComponent <UnityLocationService>(); logger.Debug("Added UnityLocationService to Controller"); gameObject.AddComponent <CineastApi>(); cineast = gameObject.GetComponent <CineastApi>(); logger.Debug("Added CineastApi to Controller"); headingDictionary = new HeadingDictionary(); uiManager.controller = this; logger.Debug("CineastApi Config: " + JsonUtility.ToJson(CineastUtils.Configuration)); }
// Use this for initialization void Start() { #if UNITY_ANDROID if (Session.Status == SessionStatus.ErrorApkNotAvailable) { AsyncTask <ApkInstallationStatus> task = Session.RequestApkInstallation(true); task.ThenAction(status => { logger.Debug("Status: {0}", status); }); } #endif logger.Debug("AR CORE STATUS: {0}", Session.Status); if (GameObject.FindWithTag("MainCamera") != null && GameObject.FindWithTag("MainCamera").GetComponent <ARCoreBackgroundRenderer>() != null) { logger.Debug("TAG APPROACH WORKING"); } /*if (GameObject.Find("First person Camera") == null) { * logger.Error("No first Person Camera Found!"); * return; * }*/ CalibrationUtility = GetComponent <CalibrationUtility>(); arCoreCam = GameObject.FindWithTag("MainCamera").GetComponent <Camera>(); ShowDebugUI(false); }
public void HandleInputUpdate(string input) { logger.Debug("Handling input with index (str) " + index); this.index = int.Parse(input); if (controller.ExistsResultIndex(this.index)) { DisplayPositiveMsg(index); } else { DisplayNegativeMsg(this.index); } }
public void Present(MultimediaObject mmo, bool loadInRange = true) { Debug.Log("Presenting " + mmo.id); //panelSwitcher.SwitchToDisplay(); panelManager.ShowPanel("display"); presenter.LoadImage(CineastUtils.GetImageUrl(mmo)); logger.Debug("URL: " + CineastUtils.GetImageUrl(mmo)); alphaController.SetAlpha(0.5f); if (controller.GetHeading(mmo) != -1) { headingDisplay.targetHeading = controller.GetHeading(mmo); } infoText.text = string.Format("Index: {0}\nDate: {1}", mmo.resultIndex, FormatDate(mmo)); activeMmo = mmo; if (loadInRange) { Debug.Log("LOAD IN RANGE"); List <MultimediaObject> inRangeList = controller.GetInRange(activeMmo); temporalSlider.Setup(inRangeList, activeMmo); // ArgumentNull in DatetimeParser, parameter name s } controller.StopLocationServices(); // TODO Remove activeMMO and restart location service }
private void GatherTimeRange() { lowerBound = defaultMinValue; upperBound = defaultMaxValue; if (!string.IsNullOrEmpty(lowerInput.text)) { try { lowerBound = int.Parse(lowerInput.text); logger.Debug("Lower Bound {0}(str), parsed: {1}", lowerInput.text, lowerBound); } catch (ArgumentException e) { // Silently ignore, since value is set smartyl } catch (FormatException ex) { // Silently ignore, since value is set smartly } } if (!string.IsNullOrEmpty(upperInput.text)) { try { upperBound = int.Parse(upperInput.text); logger.Debug("Upper Bound {0}(str), parsed: {1}", upperInput.text, upperBound); } catch (ArgumentException e) { // Silently ignoring } catch (FormatException ex) { // Silently ignoring } } logger.Debug("Gathered time range. From {0} to {1}", lowerBound, upperBound); }
public void ShowPopup(bool show) { popupShown = show; if (popupShown) { popupPanel.SetActive(true); } else { popupPanel.SetActive(false); } logger.Debug("Set popup to {0}", popupShown ? "active" : "inactive"); }
public static SaveState LoadData(bool deleteAfterRead = false) { SaveState state = null; if (ExistsPersitentData()) { state = ReadJson <SaveState>(GetFilePath()); logger.Debug("Read savestate from file"); if (deleteAfterRead) { File.Delete(GetFilePath()); logger.Debug("Deleted savestate file after reading"); } } return(state); }
public void EnableDoubleTap(bool enabled) { logger.Debug("Changing doubletap enabled from {0} to {1}", doubleTapEnabled, enabled); doubleTapEnabled = enabled; }
// maxDist in km public void SetMaxDistance(float maxDist) { logger.Debug("Max distance pre query filter: " + maxDist * 1000 + "m"); cineast.AddCineastFilter(new SpatialMaxDistanceFilter(maxDist * 1000, initialGeoLocation.latitude, initialGeoLocation.longitude)); }
public void SetGeoLocation(GeoLocation loc) { logger.Debug("Setting target location {0}" + loc); TargetLocation = loc; SetLocationLabel(TargetLocation); }
private void Awake() { logger = LogManager.GetInstance().GetLogger(GetType()); logger.Debug("Awake"); }
public void HandleSliding(float value) { logger.Debug("Handling value: " + value); if (!setupFinished) { logger.Debug("Setup not finished, returning"); return; } int index = GetClosestIndex(value); int key = new List <int>(dict.Keys)[index]; logger.Debug("Found key:" + key); if (dict.ContainsKey(key)) { logger.Debug("Current index: {0}, new index: {1}", currentIndex, index); if (currentIndex != index) { logger.Debug("Going to present new"); uiManger.Present(dict[key], false); currentIndex = index; SetSilderValue(currentIndex); } } else { logger.Debug("Was not in dict"); } }