public override void OnInspectorGUI() { UIManConfig config = target as UIManConfig; if (screenPath == null || dialogPath == null || bgPath == null) { screenPath = new PathBrowser(config.screenPrefabFolder, rootUrl); dialogPath = new PathBrowser(config.dialogPrefabFolder, rootUrl); bgPath = new PathBrowser(config.backgroundRootFolder, rootUrl); } LableHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.screenPrefabFolder = screenPath.Draw(screenGUI); config.dialogPrefabFolder = dialogPath.Draw(dialogGUI); config.backgroundRootFolder = bgPath.Draw(bgGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, all url must be child of Unity's Resources folder\n\n" + "If you don't want to use this fault path for your Screen/Dialog, apply UIDescriptor to your class to define custom path", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(target); }
public static IObservable <string> SelectPathChanges <T>(this PathBrowser <T> pathBrowser) where T : Control { return(Observable.FromEventPattern <TextChangedRoutedEventHandler, TextChangedRoutedEventArgs>( a => pathBrowser.TextChange += a, a => pathBrowser.TextChange -= a) .Select(a => a.EventArgs.Text)); }
public override void OnInspectorGUI() { var config = this.target as UIManConfig; if (this.namespaceField == null || this.screenPath == null || this.dialogPath == null || this.bgPath == null) { this.namespaceField = new TextFieldHelper(config.classNamespace); this.screenPath = new PathBrowser(config.screenPrefabFolder, Application.dataPath); this.dialogPath = new PathBrowser(config.dialogPrefabFolder, Application.dataPath); this.bgPath = new PathBrowser(config.backgroundRootFolder, Application.dataPath); this.animPath = new PathBrowser(config.animRootFolder, Application.dataPath); } LabelHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.classNamespace = this.namespaceField.Draw(this.namespaceGUI); config.screenPrefabFolder = this.screenPath.Draw(this.screenGUI); config.dialogPrefabFolder = this.dialogPath.Draw(this.dialogGUI); config.backgroundRootFolder = this.bgPath.Draw(this.bgGUI); config.animRootFolder = this.animPath.Draw(this.animRootGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, destination folder must be child of Unity's Resources folder.\n\n" + "If you don't want to use this default path for your Screen/Dialog, apply UIDescriptor to your class to define custom path.", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(this.target); }
private void PathBtn_Click(object sender, EventArgs e) { var result = PathBrowser.ShowDialog(); // Show plugin directory selection dialogue. if (result == System.Windows.Forms.DialogResult.OK) // If user pressed "OK", update plugin lists. { PathBox.Text = PathBrowser.SelectedPath; // Update displayed path text. //RefreshPlugins(); } }
public PathBrowser() { if( instance != null ) { Debug.LogError( "Trying to create two instances of singleton. Self destruction in 3..." ); Destroy( this ); return; } PathLibrary.Browser.Init( this ); instance = this; title = "Path browser"; }
public PathBrowser() { if (instance != null) { Debug.LogError("Trying to create two instances of singleton. Self destruction in 3..."); Destroy(this); return; } PathLibrary.Browser.Init(this); instance = this; title = "Path browser"; }
public void OnDestroy() { instance = null; PathLibrary.Browser.Instance.OnDestroy(); }
private void HandleGenericRequest(NodeMessage message) { try{ //string[] decoded; string[] decoded2 = new string[0]; /*if(message.Data != null) * decoded = message.Data.Split(new char[]{' '});*/ if (message.Data2 != null) { decoded2 = message.Data2.Split(new char[] { ' ' }); } switch (message.Action) { case "AVAILABLEQUOTA": this.StorageUsed = long.Parse(message.Data); break; case "BROWSE": // hub asks to browse a FS path HubWrite(new NodeMessage { Context = MessageContext.Generic, Synchroneous = true, Id = message.Id, Action = "BROWSE", Data = PathBrowser.GetPathBrowser().Browse(message.Data).ToJson <BrowseNode>() }); break; case "BROWSESPECIALOBJECTS": HubWrite(new NodeMessage { Context = MessageContext.Generic, Id = message.Id, Action = "BROWSESPECIALOBJECTS", Synchroneous = true, Data = ObjectsBrowser.BuildObjectsList() //.ToJson<BrowseNode>() }); break; case "BROWSEINDEX": HubWrite(new NodeMessage { Context = MessageContext.Generic, TaskId = message.TaskId, Id = message.Id, Action = "BROWSEINDEX", Synchroneous = true, Data = IndexBrowser.Browse(message.TaskId, message.Data, long.Parse(decoded2[0]), decoded2[1]).ToJson <BrowseNode>() }); break; case "CONFIGURATION": // Hub sends requested configuration upon successful authentication this.Configuration = message.Data.FromJson <NodeConfig>(); Utilities.ConfigManager.BuildConfFromHub(Configuration); this.ApplyConf(); // We check for storage sub-directories, and create them if needed if (Utilities.Storage.MakeStorageDirs()) { StartStorageListener(); } break; case "STORE": //Receive and store chunks StartStoreSession(message.Data.FromJson <PeerSession>()); HubWrite(new NodeMessage { // send confirmation, since "STORE" messages a re synchronous Context = MessageContext.Generic, TaskId = message.TaskId, Id = message.Id, Action = "STORE", Synchroneous = true }); break; case "DELETECHUNK": // delete 1 stored chunk (housekeeping operation) ReceiveDelete(message.Data.FromJson <PeerSession>(), message.Data2); break; /*case "VMS": * Virtualization.VirtualMachinesManager vmm = new Node.Virtualization.VirtualMachinesManager(); * * HubWrite("VMS "+vmm.BuildVmsJson()); * break;*/ default: throw new ProtocolViolationException(message); } } catch (Exception ex) { Logger.Append(Severity.ERROR, "message '" + message.ToString() + "' :" + ex.Message + " ---- " + ex.StackTrace); } }