Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abogarsukov committed Aug 31, 2019
2 parents 7622fcd + d5457c5 commit 5570e08
Show file tree
Hide file tree
Showing 32 changed files with 1,274 additions and 444 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[Uu]nity[Pp]ackage[Mm]anager/

Assets/Plugins/UnityFx.Outline/CHANGELOG.md
Assets/Plugins/UnityFx.Outline/CHANGELOG.md.meta
Assets/AssetStoreTools*

# Visual Studio cache directory
Expand Down
10 changes: 7 additions & 3 deletions Assets/Examples/Prefabs/OutlineLayers.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
_layers:
- _outlineColor: {r: 1, g: 0, b: 0, a: 1}
_outlineWidth: 6
- _outlineColor: {r: 0.8382353, g: 0.75, b: 0, a: 1}
_outlineWidth: 3
_outlineWidth: 7
_outlineIntensity: 2
_outlineMode: 1
- _outlineColor: {r: 0.22794117, g: 0.8455882, b: 0, a: 1}
_outlineWidth: 8
_outlineIntensity: 2
_outlineMode: 0
5 changes: 4 additions & 1 deletion Assets/Examples/Scenes/Outline.unity
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Camera:
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
Expand Down Expand Up @@ -503,7 +504,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
_outlineResources: {fileID: 11400000, guid: d28e70f030b1a634db9a6a6d5478ef19, type: 2}
_outlineColor: {r: 0, g: 1, b: 0, a: 1}
_outlineWidth: 8
_outlineWidth: 12
_outlineIntensity: 2
_outlineMode: 1
--- !u!23 &1789341923
MeshRenderer:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace UnityFx.Outline
public class OutlineBehaviourEditor : Editor
{
private OutlineBehaviour _effect;
private bool _renderersOpened;
private bool _camerasOpened;

private void OnEnable()
Expand All @@ -24,6 +25,25 @@ public override void OnInspectorGUI()
{
base.OnInspectorGUI();

_renderersOpened = EditorGUILayout.Foldout(_renderersOpened, "Renderers", true);

if (_renderersOpened)
{
EditorGUI.BeginDisabledGroup(true);
EditorGUI.indentLevel += 1;

var rendererNumber = 1;

foreach (var renderer in _effect.OutlineRenderers)
{
EditorGUILayout.ObjectField("#" + rendererNumber.ToString(), renderer, typeof(Renderer), true);
rendererNumber++;
}

EditorGUI.indentLevel -= 1;
EditorGUI.EndDisabledGroup();
}

_camerasOpened = EditorGUILayout.Foldout(_camerasOpened, "Cameras", true);

if (_camerasOpened)
Expand All @@ -36,6 +56,7 @@ public override void OnInspectorGUI()
foreach (var camera in _effect.Cameras)
{
EditorGUILayout.ObjectField("#" + cameraNumber.ToString(), camera, typeof(Camera), true);
cameraNumber++;
}

EditorGUI.indentLevel -= 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ MonoBehaviour:
m_Name: OutlineResources
m_EditorClassIdentifier:
RenderShader: {fileID: 4800000, guid: ac20fbf75bafe454aba5ef3c098349df, type: 3}
PostProcessShader: {fileID: 4800000, guid: 41c9acbf41c8245498ac9beab378de12, type: 3}
HPassShader: {fileID: 4800000, guid: 41c9acbf41c8245498ac9beab378de12, type: 3}
VPassBlendShader: {fileID: 4800000, guid: 1df0cb1700e142f4ca3b28297d3957da, type: 3}
47 changes: 47 additions & 0 deletions Assets/Plugins/UnityFx.Outline/Runtime/Scripts/IOutlineSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (C) 2019 Alexander Bogarsukov. All rights reserved.
// See the LICENSE.md file in the project root for more information.

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

namespace UnityFx.Outline
{
/// <summary>
/// Defines outline settings.
/// </summary>
public interface IOutlineSettings
{
/// <summary>
/// Gets or sets outline color.
/// </summary>
/// <seealso cref="OutlineWidth"/>
/// <seealso cref="OutlineMode"/>
Color OutlineColor { get; set; }

/// <summary>
/// Gets or sets outline width in pixels. Allowed range is [<see cref="OutlineRenderer.MinWidth"/>, <see cref="OutlineRenderer.MaxWidth"/>].
/// </summary>
/// <seealso cref="OutlineColor"/>
/// <seealso cref="OutlineMode"/>
int OutlineWidth { get; set; }

/// <summary>
/// Gets or sets outline intensity value. Allowed range is [<see cref="OutlineRenderer.MinIntensity"/>, <see cref="OutlineRenderer.MaxIntensity"/>].
/// </summary>
float OutlineIntensity { get; set; }

/// <summary>
/// Gets or sets outline mode.
/// </summary>
/// <seealso cref="OutlineWidth"/>
/// <seealso cref="OutlineColor"/>
OutlineMode OutlineMode { get; set; }

/// <summary>
/// Forces the settings to be re-applied and the outline to be re-rendered.
/// </summary>
void Invalidate();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5570e08

Please sign in to comment.