Skip to content

Commit 7622fcd

Browse files
committed
Merge branch 'release/0.3.0'
2 parents 227776a + ed081d7 commit 7622fcd

31 files changed

+840
-165
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
education, socio-economic status, nationality, personal appearance, race,
10+
religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <arvtesh@gmail.com>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+

.github/CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing guide
2+
3+
First off, thank you for considering contributing to UnityFx. It's people like you that make UnityFx such a great tool. Feel welcome and read the following sections in order to know what and how to work on something. If you get stuck at any point you can create a [ticket on GitHub](https://github.com/Arvtesh/UnityFx.Outline/issues).
4+
5+
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
6+
7+
## Ground Rules
8+
9+
* Ensure cross-platform compatibilty for every change you make.
10+
* Create issues for any major changes and enhancements that you wish to make (make sure that the reported issue is not a duplicate of an existing one).
11+
* Don't add any classes to the codebase unless absolutely needed.
12+
* Please follow the coding style conventions used in the library.
13+
14+

.github/SUPPORT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Support guide
2+
3+
First of all thank you for using *UnityFx.Outline*.
4+
5+
For **help**, **support**, **questions** and **ideas** please use **[Unity forums thread](https://forum.unity.com/threads/tt)**.
6+
Please **_do not_** raise an issue on GitHub.
7+
8+
You can get general information on the library and answers to frequently asked questions in [README](../README.md).

Assets/Examples/Prefabs.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_PrefabParentObject: {fileID: 0}
7+
m_PrefabInternal: {fileID: 0}
8+
m_GameObject: {fileID: 0}
9+
m_Enabled: 1
10+
m_EditorHideFlags: 0
11+
m_Script: {fileID: 11500000, guid: 57d0c11168277cf4eb3b4b89706e6aa5, type: 3}
12+
m_Name: OutlineLayers
13+
m_EditorClassIdentifier:
14+
_layers:
15+
- _outlineColor: {r: 1, g: 0, b: 0, a: 1}
16+
_outlineWidth: 6
17+
- _outlineColor: {r: 0.8382353, g: 0.75, b: 0, a: 1}
18+
_outlineWidth: 3

Assets/Examples/Prefabs/OutlineLayers.asset.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Examples/Scenes/Outline.unity

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ MonoBehaviour:
277277
_outlineGos:
278278
- {fileID: 1579373802}
279279
- {fileID: 748173439}
280-
_outlineColor: {r: 1, g: 0, b: 0, a: 1}
281-
_outlineWidth: 8
282280
--- !u!114 &692811818
283281
MonoBehaviour:
284282
m_ObjectHideFlags: 0
@@ -291,6 +289,7 @@ MonoBehaviour:
291289
m_Name:
292290
m_EditorClassIdentifier:
293291
_outlineResources: {fileID: 11400000, guid: d28e70f030b1a634db9a6a6d5478ef19, type: 2}
292+
_outlineLayers: {fileID: 11400000, guid: 3a6c3b3c5f6e3ad4ab8e09fc219865bd, type: 2}
294293
--- !u!1 &748173439
295294
GameObject:
296295
m_ObjectHideFlags: 0

Assets/Examples/Scripts/OutlineEffectBuilder.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public class OutlineEffectBuilder : MonoBehaviour
1818

1919
[SerializeField]
2020
private GameObject[] _outlineGos;
21-
[SerializeField]
22-
private Color _outlineColor = Color.red;
23-
[SerializeField]
24-
[Range(OutlineRenderer.MinWidth, OutlineRenderer.MaxWidth)]
25-
private int _outlineWidth = 5;
2621

2722
#pragma warning restore 0649
2823

@@ -42,7 +37,15 @@ private void Awake()
4237

4338
if (_outlineLayer == null)
4439
{
45-
_outlineLayer = _outlineEffect.AddLayer();
40+
if (_outlineEffect.OutlineLayers.Count > 0)
41+
{
42+
_outlineLayer = _outlineEffect.OutlineLayers[0];
43+
}
44+
else
45+
{
46+
_outlineLayer = new OutlineLayer();
47+
_outlineEffect.OutlineLayers.Add(_outlineLayer);
48+
}
4649
}
4750
}
4851

@@ -53,17 +56,20 @@ private void OnValidate()
5356
_outlineEffect = GetComponent<OutlineEffect>();
5457
}
5558

56-
if (_outlineLayer == null)
59+
if (_outlineEffect.OutlineLayers.Count > 0)
60+
{
61+
_outlineLayer = _outlineEffect.OutlineLayers[0];
62+
}
63+
else
5764
{
58-
_outlineLayer = _outlineEffect.AddLayer();
65+
_outlineLayer = new OutlineLayer();
66+
_outlineEffect.OutlineLayers.Add(_outlineLayer);
5967
}
6068

6169
foreach (var go in _outlineGos)
6270
{
6371
if (go)
6472
{
65-
_outlineLayer.OutlineColor = _outlineColor;
66-
_outlineLayer.OutlineWidth = _outlineWidth;
6773
_outlineLayer.Add(go);
6874
}
6975
}

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

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/UnityFx.Outline/Editor.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/UnityFx.Outline/Editor/Scripts.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (C) 2019 Alexander Bogarsukov. All rights reserved.
2+
// See the LICENSE.md file in the project root for more information.
3+
4+
using System;
5+
using System.Collections;
6+
using System.Collections.Generic;
7+
using UnityEditor;
8+
using UnityEngine;
9+
10+
namespace UnityFx.Outline
11+
{
12+
[CustomEditor(typeof(OutlineBehaviour))]
13+
public class OutlineBehaviourEditor : Editor
14+
{
15+
private OutlineBehaviour _effect;
16+
private bool _camerasOpened;
17+
18+
private void OnEnable()
19+
{
20+
_effect = (OutlineBehaviour)target;
21+
}
22+
23+
public override void OnInspectorGUI()
24+
{
25+
base.OnInspectorGUI();
26+
27+
_camerasOpened = EditorGUILayout.Foldout(_camerasOpened, "Cameras", true);
28+
29+
if (_camerasOpened)
30+
{
31+
EditorGUI.BeginDisabledGroup(true);
32+
EditorGUI.indentLevel += 1;
33+
34+
var cameraNumber = 1;
35+
36+
foreach (var camera in _effect.Cameras)
37+
{
38+
EditorGUILayout.ObjectField("#" + cameraNumber.ToString(), camera, typeof(Camera), true);
39+
}
40+
41+
EditorGUI.indentLevel -= 1;
42+
EditorGUI.EndDisabledGroup();
43+
}
44+
}
45+
}
46+
}

Assets/Plugins/UnityFx.Outline/Editor/Scripts/OutlineBehaviourEditor.cs.meta

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Copyright (C) 2019 Alexander Bogarsukov. All rights reserved.
2+
// See the LICENSE.md file in the project root for more information.
3+
4+
using System;
5+
using System.Collections;
6+
using System.Collections.Generic;
7+
using UnityEditor;
8+
using UnityEngine;
9+
10+
namespace UnityFx.Outline
11+
{
12+
[CustomEditor(typeof(OutlineEffect))]
13+
public class OutlineEffectInspector : Editor
14+
{
15+
private OutlineEffect _effect;
16+
private bool _previewOpened;
17+
18+
private void OnEnable()
19+
{
20+
_effect = (OutlineEffect)target;
21+
}
22+
23+
public override void OnInspectorGUI()
24+
{
25+
base.OnInspectorGUI();
26+
27+
if (_effect.OutlineLayers.Count > 0)
28+
{
29+
_previewOpened = EditorGUILayout.Foldout(_previewOpened, "Preview", true);
30+
31+
if (_previewOpened)
32+
{
33+
EditorGUI.BeginDisabledGroup(true);
34+
35+
if (_effect.OutlineLayers.Count > 0)
36+
{
37+
for (var i = 0; i < _effect.OutlineLayers.Count; ++i)
38+
{
39+
var layer = _effect.OutlineLayers[i];
40+
var goIndex = 1;
41+
42+
EditorGUILayout.BeginHorizontal();
43+
EditorGUI.indentLevel = 1;
44+
EditorGUILayout.PrefixLabel("Layer #" + i.ToString());
45+
EditorGUI.indentLevel = 0;
46+
EditorGUILayout.IntField(layer.OutlineWidth, GUILayout.MaxWidth(100));
47+
EditorGUILayout.ColorField(layer.OutlineColor, GUILayout.MinWidth(100));
48+
EditorGUILayout.EndHorizontal();
49+
50+
if (layer.Count > 0)
51+
{
52+
foreach (var go in layer)
53+
{
54+
EditorGUI.indentLevel = 2;
55+
EditorGUILayout.ObjectField("#" + goIndex.ToString(), go, typeof(GameObject), true);
56+
EditorGUI.indentLevel = 0;
57+
58+
goIndex++;
59+
}
60+
}
61+
else
62+
{
63+
EditorGUI.indentLevel = 2;
64+
EditorGUILayout.LabelField("No objects.");
65+
EditorGUI.indentLevel = 0;
66+
}
67+
}
68+
}
69+
else
70+
{
71+
EditorGUI.indentLevel = 1;
72+
EditorGUILayout.LabelField("No layers.");
73+
EditorGUI.indentLevel = 0;
74+
}
75+
76+
EditorGUI.EndDisabledGroup();
77+
}
78+
}
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)