public SwitchLine AddSwitch(string title, bool isOn) { var gameObject = Instantiate(prefabUiSwitch, objList.transform); SwitchLine switchLine = gameObject.GetComponentInChildren <SwitchLine>(); switchLine.SetData(title, isOn); return(switchLine); }
public static void ReconnectSwitchLine() { if (MapMgr.Instance.CurMapType == MapMgr.MapType.Map_None || MapMgr.Instance.CurMapType == MapMgr.MapType.Map_Login || MapMgr.Instance.CurMapType == MapMgr.MapType.Map_SelectRole) { return; } LuaTable G = LuaMgr.Instance.GetLuaEnv().Global; SwitchLine fun = G.GetInPath <SwitchLine>("Common.ReconnectSwitchLine"); if (fun != null) { fun(); } }
public void SetData(ProjectionSite projectionSite, ApplicationManager applicationManager) { if (firstTime) { FileBrowser.AddQuickLink("Projects", applicationManager.rootPath + applicationManager.projectsFolder, null); FileBrowser.AddQuickLink("Users", "C:\\Users", null); firstTime = false; } _projectionSite = projectionSite; _applicationManager = applicationManager; this.colorAlert = applicationManager.colorAlert; _project = new Project() { createdBy = applicationManager.users.current.email, updatedBy = applicationManager.users.current.email, projectionSite = _projectionSite, path = applicationManager.rootPath + applicationManager.projectsFolder, siteId = _projectionSite.id, siteVersionId = _projectionSite.versionId }; scrollbar.value = 1; //set scrollbar to top //clear the transform foreach (Transform child in objList.transform) { Destroy(child.gameObject); } //build listing AddHeader("PROJECT SETTINGS"); _inputName = AddEditTextLine("NAME", _project.name); _inputName.colorAltert = this.colorAlert; _inputName.input.Select(); _folderLine = AddTextLineButton("FOLDER", _project.path, imgFolderIcon, false); _folderLine.OnButtonClick += _folderLine_OnButtonClick; _newFolderLine = AddSwitch("CREATE NEW FOLDER", true); //build listing AddHeader("PROJECTION SITE"); AddTextLine("NAME", _projectionSite.name); AddTextLine("VERSION", _projectionSite.version); switch (_projectionSite.status) { case ProjectionSiteStatus.Unknown: AddTextLine("VERSION STATUS", "UNKNOWN"); break; case ProjectionSiteStatus.OutOfDate: AddTextLine("VERSION STATUS", "OUT OF DATE", false, true); break; case ProjectionSiteStatus.NotOnServer: AddTextLine("VERSION STATUS", "NOT ON SERVER", false, true); break; case ProjectionSiteStatus.UpToDate: AddTextLine("VERSION STATUS", "UP TO DATE"); break; case ProjectionSiteStatus.NewOnServer: AddTextLine("VERSION STATUS", "NEW"); break; } }