Ejemplo n.º 1
0
        /************************************************************************************************************************/

        /// <summary>[Assert-Only] Disables the specified warnings and returns those that were previously enabled.</summary>
        /// <example><code>
        /// var warnings = WarningType.All.DisableTemporarily();
        /// // Do stuff.
        /// warnings.Enable();
        /// </code></example>
        public static WarningType DisableTemporarily(this WarningType type)
        {
            var previous = type;

            type.Disable();
            return(previous & type);
        }
Ejemplo n.º 2
0
        public static void SetEnabled(this WarningType type, bool enable)
        {
#if UNITY_ASSERTIONS
            if (enable)
            {
                type.Enable();
            }
            else
            {
                type.Disable();
            }
#endif
        }