public void CreateButtons(IUIAction uiAction, RectTransform rt) { IEnumerable <Lesson> lessons = this.rootObject.lesson as IEnumerable <Lesson>; foreach (Lesson lesson in lessons) { GameObject obj = (GameObject)UnityEngine.Object.Instantiate(this.sequence.PrefabBtn); Button btn = obj.GetComponent <Button>(); if (btn == null) { continue; } Lesson currentLesson = lesson; obj.name = currentLesson.name; obj.transform.SetParent(rt, false); Text text = obj.GetComponentInChildren <Text>(); string newName = currentLesson.name; if (currentLesson.available == false) { newName = newName + " (Not available)"; } else { btn.onClick.AddListener(() => { Save.SerializeInPlayerPrefs(ConstString.CurrentData, currentLesson); uiAction.LoadScene("ChooseExercises"); }); } text.text = newName; } }
protected virtual void OnDestroy() { m_receiver = null; m_actionmodule = null; Dispose(); }
public void ClosePanel() { PanelUnit panelUnit = stackShownPanels.Peek(); if (null != panelUnit) { IUIAction uIAction = panelUnit as IUIAction; uIAction.Close(); PanelMoveOut(uIAction); stackShownPanels.Pop(); } }
private IList <IUIAction> GetUIActions() { IList <IUIAction> uiActions = new List <IUIAction>(); string alias = this.ActionRef.Action.Split('.')[0].ToLower(); string actionName = this.ActionRef.Action.Split('.')[1]; TestIncludeRef includeRef = this.Includes.Where(item => item.Alias.ToLower() == alias).FirstOrDefault(); string filePath = Path.Combine(Configuration.Current.UITest.BasePath, includeRef.Path); XmlNode uiSteps = XmlHelper.GetNodeByXPath(filePath, String.Format("/steps/step[@name='{0}']", actionName)); foreach (XmlNode uiStepAction in uiSteps.ChildNodes) { IUIAction uiAction = UIActionFactory.Create(uiStepAction, this.TestCase.WebDriver); uiAction.TestCaseAction = this; uiActions.Add(uiAction); } return(uiActions); }
public void OpenPanel <T>() where T : PanelUnit, new() { IUIAction uIAction = null; string panelName = typeof(T).Name; PanelUnit panelUnit = GetPanelInCache(panelName); if (null == panelUnit) { T t = new T(); panelUnit = t as PanelUnit; GameObject panel = LoadModule.Ins.Load <GameObject>(ResEnum.UI, panelName); uIAction = t as IUIAction; uIAction.root = panel; uIAction.Init(); } else { uIAction = panelUnit as IUIAction; } uIAction.Refresh(); stackShownPanels.Push(panelUnit); PanelMoveIn(panelUnit); }
public override void Write(IUIAction uiAction) { this.workSheet.Cells[this.currentRow, 4].Value = string.Format("{0}-{1}", uiAction.Type.ToString(), uiAction.Element); this.workSheet.Cells[this.currentRow, 5].Value = uiAction.Status.ToString(); this.currentRow++; }
public void OnConnectModuleAction(IUIAction module) { m_action = module; }
public override void Write(IUIAction uiAction) { string str = string.Format("IUIAction:{0}-{1}-{2}", uiAction.Type.ToString(), uiAction.Element, uiAction.Status.ToString()); System.Console.WriteLine(str); }
public void ConnectActionModule(IUIAction module) { m_actionmodule = module; }
private void PanelMoveOut(IUIAction uIAction) { }
private void PanelMoveIn(IUIAction uIAction) { }