// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { MenuRegion region = _data.ManiMenuParent.RegionDetection(_data.ActivePalm.transform.position); switch (region) { case MenuRegion.UPPER: animator.SetInteger(_hash_toolSelectedInt, 0); break; case MenuRegion.RIGHT: animator.SetInteger(_hash_toolSelectedInt, 1); break; case MenuRegion.LOWER: animator.SetInteger(_hash_toolSelectedInt, 2); break; case MenuRegion.LEFT: break; case MenuRegion.MIDDLE: break; } }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { MenuRegion region = _data.CreateMenuParent.RegionDetection(_data.ActivePalm.transform.position); switch (region) { case MenuRegion.UPPER: m_selectedItem = CreateMenuItem.CUBE; animator.SetBool(m_hash_itemSelectedBool, true); break; case MenuRegion.RIGHT: m_selectedItem = CreateMenuItem.CYLINDER; animator.SetBool(m_hash_itemSelectedBool, true); break; case MenuRegion.LOWER: m_selectedItem = CreateMenuItem.CONE; animator.SetBool(m_hash_itemSelectedBool, true); break; case MenuRegion.LEFT: m_selectedItem = CreateMenuItem.SPHERE; animator.SetBool(m_hash_itemSelectedBool, true); break; case MenuRegion.MIDDLE: m_selectedItem = CreateMenuItem.NULL; animator.SetBool(m_hash_itemSelectedBool, false); break; } _data.Selected_createItem = m_selectedItem; }
private void TViewRegion_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { TreeNode sNode = TViewRegion.GetNodeAt(e.X, e.Y); if (sNode != null) { MenuRegion.Tag = sNode; MenuRegion.Show(TViewRegion, e.X, e.Y); } } }
public virtual MenuRegion RegionDetection(Vector3 palmPos_curr) { Vector3 local_curr = Vector3.ProjectOnPlane(this.transform.InverseTransformPoint(palmPos_curr), Vector3.forward) - m_palmPos_init; MenuRegion region = FoamUtils.checkMenuRegion(local_curr, m_menu_center, m_bound_UppL, m_bound_UppR, m_bound_LowL, m_bound_LowR, inner_radius); if (region == m_currentRegion) { return(region); } m_currentRegion = region; switch (region) { case MenuRegion.UPPER: this.HighlightSprite(0); break; case MenuRegion.RIGHT: this.HighlightSprite(1); break; case MenuRegion.LOWER: this.HighlightSprite(2); break; case MenuRegion.LEFT: this.HighlightSprite(3); break; case MenuRegion.MIDDLE: this.HighlightSprite(-1); break; } return(region); }
private static List<SysNavigation> GetSysNavigation(int roleId, int subSys, MenuRegion region) { string vSql = string.Format(QuerySql, roleId, subSys, GetNavigationRegionFilter(region)); QueryCommand cmd = new QueryCommand(vSql); //AppContext.ActPage.LogMessage(vSql); return DataService.ExecuteListTypedResult<SysNavigation>(cmd); }
private static string GetNavigationRegionFilter(MenuRegion region) { switch (region) { case MenuRegion.Main: return "AND [Sys_Navigation].[IsMainNav]=1"; case MenuRegion.Header: return "AND [Sys_Navigation].[IsHeader]=1"; case MenuRegion.Foot: return "AND [Sys_Navigation].[IsFooter]=1"; case MenuRegion.Left: string[] arrDepth = AppContext.ActPage.CurrentNav.Depth.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); return string.Format("AND (charindex('/{0}/',Depth) > 0)", arrDepth[0]); default: return string.Empty; } }
public virtual SysNavigation RenderNav(SysNavigation item, MenuRegion region) { if (region == MenuRegion.Main) { if (string.IsNullOrEmpty(item.OthName)) item.NavName = item.SecName; else item.NavName = item.OthName; if (Utilities.Compare(item.NavUrl, "/Company/CompanyItemEdit.aspx") && AppContext.CurrentSysId == (int)SubSystem.Company) { var t = CompanyBLL.GetCompanyTypeById(AppContext.Context.User.CompanyId.Value); if (t == CompanyType.AdCompany) { item.NavUrl = "/Company/CompanyAdsClicked.aspx"; } else if (t == CompanyType.SpecialCompany) { item.NavUrl = "/Company/CompanyItemUsed.aspx"; } } } return item; }