init
This commit is contained in:
50
Runtime/Scripts/OutlineSettingsExtensions.cs
Normal file
50
Runtime/Scripts/OutlineSettingsExtensions.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2019-2021 Alexander Bogarsukov. All rights reserved.
|
||||
// See the LICENSE.md file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityFx.Outline
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="IOutlineSettings"/>.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class OutlineSettingsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether outline should use alpha testing.
|
||||
/// </summary>
|
||||
/// <seealso cref="IsDepthTestingEnabled(IOutlineSettings)"/>
|
||||
/// <seealso cref="IsBlurEnabled(IOutlineSettings)"/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool IsAlphaTestingEnabled(this IOutlineSettings settings)
|
||||
{
|
||||
return (settings.OutlineRenderMode & OutlineRenderFlags.EnableAlphaTesting) != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether outline should use depth testing.
|
||||
/// </summary>
|
||||
/// <seealso cref="IsAlphaTestingEnabled(IOutlineSettings)"/>
|
||||
/// <seealso cref="IsBlurEnabled(IOutlineSettings)"/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool IsDepthTestingEnabled(this IOutlineSettings settings)
|
||||
{
|
||||
return (settings.OutlineRenderMode & OutlineRenderFlags.EnableDepthTesting) != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether outline frame should be blurred.
|
||||
/// </summary>
|
||||
/// <seealso cref="IsAlphaTestingEnabled(IOutlineSettings)"/>
|
||||
/// <seealso cref="IsDepthTestingEnabled(IOutlineSettings)"/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool IsBlurEnabled(this IOutlineSettings settings)
|
||||
{
|
||||
return (settings.OutlineRenderMode & OutlineRenderFlags.Blurred) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user