示例#1
0
        /// <summary>
        /// Opens the tooltip with the specified view model and anchor.
        /// If there is no tooltip instance it will output a warning, unless unity is running in headless mode.
        /// </summary>
        public static void Open <T>(T model, TooltipAnchorTarget anchor = default(TooltipAnchorTarget)) where T : TooltipViewModel
        {
            if (ReferenceEquals(instance, null))
            {
                if (!Essentials.IsRunningHeadless())                 // Servers and other headless apps dont care about tooltips
                {
                    Debug.LogWarning("Tried opening tooltip with no tooltip in the scene!");
                }
                return;
            }

            instance._Open(model, anchor);
        }
示例#2
0
        /// <summary>
        /// Immediately closes the tooltip.
        /// If there is no tooltip instance it will output a warning, unless unity is running in headless mode.
        /// </summary>
        public static void Close()
        {
            if (ReferenceEquals(instance, null))
            {
                if (!Essentials.IsRunningHeadless())                 // Servers and other headless apps dont care about tooltips
                {
                    Debug.LogWarning("Tried closing tooltip with no tooltip in the scene!");
                }
                return;
            }

            instance._Close();
        }