/// <summary> /// On context menu trigger enter. /// </summary> /// <param name="hitInfo">Raycast hit info of target.</param> private void OnMenuTriggerEnter(RaycastHit hitInfo) { if (Handler == null) { LogUtility.LogWarning("Do nothing on menu trigger enter: The handler of menu trigger is null."); return; } menuForm = Handler.OnMenuTriggerEnter(hitInfo); }
/// <summary> /// On context menu trigger exit. /// </summary> /// <returns></returns> private void OnMenuTriggerExit() { if (Handler == null) { LogUtility.LogWarning("Do nothing on menu trigger exit: The handler of menu trigger is null."); return; } Handler.OnMenuTriggerExit(menuForm); menuForm = null; }
/// <summary> /// On context menu trigger exit. /// </summary> /// <param name="menuForm">Instance of context menu form.</param> public virtual void OnMenuTriggerExit(IContextMenuForm menuForm) { if (menuForm == null || menuForm.IsDisposed) { return; } if (menuForm.IsOpen) { UIFormManager.Instance.CloseForm(menuForm); } }
private void Start() { //Open menu by UIFormManager to create form instance. var menuFormEx = UIFormManager.Instance.OpenForm <ContextMenuFormExtend>(); menuFormEx.BgColor = Color.black; menuForm = menuFormEx; menuForm.RefreshElements(menuElementDatas); //Close it to hide the form instance. menuForm.Close(); }