void InitNodeObject() { /* Generate menuItem Row Scroll View */ GameObject itemRow = Instantiate(menuItemRowPref); itemRow.transform.SetParent(menuItemRoot.transform); itemRow.GetComponent <RectTransform>().anchoredPosition = new Vector2(-2000, 0); itemRow.transform.localScale = Vector3.one; /* Generate Root menuItem */ for (int i = 0; i < nodesMap["Root"].ChildNodes.Count; ++i) { GameObject newObject = Instantiate(menuItemPref); /* Transform Settings */ newObject.transform.SetParent(itemRow.transform.Find("Viewport").Find("Content")); newObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(250 * i - 500, 0); newObject.transform.localScale = Vector3.one; newObject.name = "MenuItem_" + i; MMenuItem menuItem = newObject.GetComponent <MMenuItem>(); EditorMenuTable.EditorMenuProperty menuProperty = EditorMenuTable.Instance.GetProperty(nodesMap["Root"].ChildNodes[i].Alias); menuItem.SetImage(menuProperty.imagePath); menuItem.Alias = menuProperty.alias; menuItemMap.Add(menuProperty.alias, menuItem); } /* Item의 시작 애니메이션 트리거 */ //menuItemRoot.GetComponent<Animator>().SetTrigger("Start"); }
private Boolean isActivated(MMenuItem mi) { String hopper = mi.ProductHopper; String product = CConfig.GetProduct(); Boolean required = CProductFilter.IsRequiredByProduct(hopper); return(required); }
private void addMenuGroup(String caption, Boolean isOnlyAdmin, String productHopper) { MMenuItem mi = new MMenuItem(new CTable("")); mi.Caption = caption; mi.IsOnlyAdmin = isOnlyAdmin; mi.ProductHopper = productHopper; menuOrders.Add(mi); }
public IEnumerator SelectedItem(MMenuItem menuItem) { /* Wait 상태가 될 때 까지 대기. 연속으로 여러 입력됐을 경우를 대비. */ for (; ;) { if (menuRootAnimator.GetCurrentAnimatorStateInfo(0).IsName("Wait")) { break; } yield return(new WaitForFixedUpdate()); } /* 선택한 아이템의 레벨과 마지막 선택한 아이템의 레벨이 같다면 마지막 선택 아이템 선택해제. */ { List <MMenuItem> selectItLevel = GetSameLeveItems(menuItem.Alias); foreach (var menuIt in selectItLevel) { if (menuIt == GetLastSelecteItem()) { DeselectItem(); break; } } } /* Item에 자식 노드가 없다면 */ if (nodesMap[menuItem.Alias].ChildNodes.Count <= 0) { selectedNodeAliasList.Add(menuItem.Alias); menuItem.GetComponent <Animator>().SetTrigger("Select"); selectedItem.transform.Find("ItemImage").GetComponent <Image>().sprite = menuItem.imageObject.sprite; yield break; } selectedNodeAliasList.Add(menuItem.Alias); GenerateChildNode(menuItem.Alias); menuItemRoot.GetComponent <Animator>().SetTrigger("Select"); menuItem.GetComponent <Animator>().SetTrigger("Select"); /* 같은 레벨의 MenuItem 오브젝트들을 찾고 버튼을 비활성화. */ if (selectedNodeAliasList.Count > 0) { /* 로직 : 노드의 부모를 찾아 그 자식들을 찾는다. */ List <MMenuItem> rowMenuItems = GetSameLeveItems(GetLastSelectedNode().Alias); foreach (var rowMenuItem in rowMenuItems) { rowMenuItem.GetComponent <Button>().enabled = false; } } }
private MMenuItem addMenuItemConfig(String mname, String cname, String rname) { MMenuItem mnuItem = new MMenuItem(new CTable("")); mnuItem.MenuName = mname; mnuItem.ClassName = cname; mnuItem.AccessRightName = rname; menuItemConfigs.Add(mname, mnuItem); return(mnuItem); }
private void addMenuItem(String groupKey, String menuName, String caption, String img, int grp, String criteria, String accessRight, RoutedEventHandler evt, String productHopper) { ArrayList tempArr = new ArrayList(); if (menuMaps.Contains(groupKey)) { tempArr = (ArrayList)menuMaps[groupKey]; } else { menuMaps.Add(groupKey, tempArr); } MMenuItem mni = addMenuItemConfig(menuName, criteria, accessRight); mni.Group = grp.ToString(); mni.Caption = caption; mni.Image = img; mni.MenuEvent = evt; mni.ProductHopper = productHopper; tempArr.Add(mni); }
private CCriteriaBase getMenuCriteria(String mnuName) { MMenuItem m = (MMenuItem)menuItemConfigs[mnuName]; if (m == null) { return(null); } if (m.ClassName.Equals("")) { return(null); } CUtil.EnableForm(false, this); CCriteriaBase cr = null; if (mnuName.Equals("mnuCashIn")) { cr = FactoryCriteria.GetObject(m.ClassName, new MCashDocIn(new CTable(""))); } else if (mnuName.Equals("mnuCashOut")) { cr = FactoryCriteria.GetObject(m.ClassName, new MCashDocOut(new CTable(""))); } else { cr = FactoryCriteria.GetObject(m.ClassName); } criteriaInitFunc(mnuName, cr); CUtil.EnableForm(true, this); return(cr); }