コード例 #1
0
 /// <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);
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
        /// <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);
            }
        }
コード例 #4
0
        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();
        }