void ReleaseDesignerOutlets() { if (GetButton != null) { GetButton.Dispose(); GetButton = null; } if (ResultTextView != null) { ResultTextView.Dispose(); ResultTextView = null; } if (SetupButton != null) { SetupButton.Dispose(); SetupButton = null; } if (topView != null) { topView.Dispose(); topView = null; } if (UrlTextField != null) { UrlTextField.Dispose(); UrlTextField = null; } }
private void LoadAvailableSetups() { string file; if (File.Exists(Application.persistentDataPath + "/saved_setups")) { file = File.ReadAllText(Application.persistentDataPath + "/saved_setups"); } else { //init file with default setups in case that no save file exists file = "{\"last_setup\":\"ARTABLE SETUP 1\",\"saved_setups\":[{\"setup_name\":\"ARTABLE SETUP 1\",\"connection\":{\"ip\":\"192.168.104.200\",\"port\":\"9090\"},\"table_dims\":{\"width\":\"1.5\",\"length\":\"0.7\"}},{\"setup_name\":\"ARTABLE SETUP 3\",\"connection\":{\"ip\":\"192.168.1.227\",\"port\":\"9090\"},\"table_dims\":{\"width\":\"1\",\"length\":\"0.6\"}}]}"; File.WriteAllText(Application.persistentDataPath + "/saved_setups", file); } setupsFileMsg = new SetupsFileMsg(JSONNode.Parse(file)); foreach (ARTableSetupMsg setup in setupsFileMsg.GetSavedSetups()) { var button = Instantiate(SetupButtonPrefab, SetupGrid.transform); SetupButton setupButton = button.GetComponent <SetupButton>(); setupButton.SetARTableSetup(setup); setupButton.SetButtonText(setup.GetSetupName()); } //set last session's active setup SetActiveSetup(setupsFileMsg.GetActiveSetupMsg()); }
public void AddNewSetup(ARTableSetupMsg new_setup) { setupsFileMsg.StoreNewSetup(new_setup); var button = Instantiate(SetupButtonPrefab, SetupGrid.transform); SetupButton setupButton = button.GetComponent <SetupButton>(); setupButton.SetARTableSetup(new_setup); setupButton.SetButtonText(new_setup.GetSetupName()); SaveSetups(); }
// Use this for initialization void Awake() { //setting filebrowser fb = new FileBrowser(0); fb.setLayout(0); fb.guiSkin = sk; fb.fileTexture = file; fb.directoryTexture = folder; fb.backTexture = back; fb.driveTexture = drive; fb.showSearch = true; fb.searchRecursively = true; playspeed = 1.0f; speedtext.text = "Play Speed: " + playspeed + "x"; camera3D.enabled = false; ////different action types //constructorActions = new List<Action> (); //constructorActions.Add (new LocationAction ()); //constructorActions.Add (new GazeAction ()); //constructorActions.Add (new HeadFaceAction ()); //constructorActions.Add (new UpperBodyAction ()); //constructorActions.Add (new LowerBodyAction ()); ////functions //functions = new Dictionary<string, Color> (); //functions.Add ("self_focused", Color.red); //functions.Add ("context_focused", Color.green); //functions.Add ("communication_focused", Color.blue); loadConfigFile(); actions = new List <Action> (); activeActions = new List <Action> (); timeline = GameObject.Find("Timeline").GetComponent <Slider> (); durationText = GameObject.Find("TextDuration").GetComponent <Text> (); currentText = GameObject.Find("CurrentText").GetComponent <Text> (); control = GameObject.Find("ButtonPlay").GetComponentInChildren <PlayButton> (); settings = GameObject.Find("Button Settings").GetComponentInChildren <SettingsButton> (); setupAnnotation = GameObject.Find("Button Setup").GetComponentInChildren <SetupButton> (); loadedFileText = GameObject.Find("LoadedFileText").GetComponent <Text> (); timeline.value = 0; current = 0; lastActionidx = 0; fileLoaded = false; timeline.interactable = false; dragging = false; saveInitialSetup(); }