Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
Added a folder of examples.
Small update of the code introducing TODOs and checking the REANDERPIPELINE sets
  • Loading branch information
Leandro Peres committed Jul 6, 2020
1 parent a2b1048 commit bf7a570
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 43 deletions.
15 changes: 15 additions & 0 deletions Assets/Plugins/Colorblindness/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.3] - 05/07/2020
### Added
- Samples/UI;
- Samples/Prefab;
- Changelog file.

### Changed
- Added samples and author sections on package.json;
- Added TODOs on *Colorblindness.cs*;
- Added *Debug.LogError* when `!RENDERPIPELINE`.
7 changes: 7 additions & 0 deletions Assets/Plugins/Colorblindness/CHANGELOG.md.meta

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1559938653264469866
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5419598688879735967}
- component: {fileID: 3910616064272172218}
m_Layer: 0
m_Name: '[Accessibility]'
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5419598688879735967
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1559938653264469866}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3910616064272172218
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1559938653264469866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dcdee695cf57f3545af7d3a3c6663677, type: 3}
m_Name:
m_EditorClassIdentifier:
changeKey: 282

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

Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ GameObject:
- component: {fileID: 272201129}
- component: {fileID: 272201128}
- component: {fileID: 272201131}
- component: {fileID: 272201132}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
Expand Down Expand Up @@ -400,7 +399,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Bits: 32
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
Expand All @@ -420,7 +419,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 272201127}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalPosition: {x: 4.17, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 29762620}
Expand Down Expand Up @@ -458,19 +457,6 @@ MonoBehaviour:
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
--- !u!114 &272201132
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 272201127}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dcdee695cf57f3545af7d3a3c6663677, type: 3}
m_Name:
m_EditorClassIdentifier:
changeKey: 282
--- !u!1 &1548480098
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -622,31 +608,13 @@ GameObject:
- component: {fileID: 2035061989}
- component: {fileID: 2035061988}
- component: {fileID: 2035061987}
- component: {fileID: 2035061986}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2035061986
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2035061985}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &2035061987
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -711,3 +679,77 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1001 &6686560002171750875
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1559938653264469866, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_Name
value: '[Accessibility Manager]'
objectReference: {fileID: 0}
- target: {fileID: 1559938653264469866, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5419598688879735967, guid: 9ea7fd5fa8a954e9f86ff707bc560576,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9ea7fd5fa8a954e9f86ff707bc560576, type: 3}
18 changes: 14 additions & 4 deletions Assets/Plugins/Colorblindness/Scripts/Colorblindness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class Colorblindness : MonoBehaviour
{
public KeyCode changeKey = KeyCode.F1;

// TODO: Clear saved settings

Volume[] volumes;
VolumeComponent lastFilter;

Expand All @@ -47,6 +49,14 @@ int currentType

public static Colorblindness Instance { get; private set; }

[UnityEditor.Callbacks.DidReloadScripts]
private static void OnScriptsReloaded()
{
#if !RENDERPIPELINE
Debug.LogError("There is no type of <b>SRP</b> included in this project.");
#endif
}

void Awake()
{
if (Instance == null)
Expand Down Expand Up @@ -98,15 +108,15 @@ public void Change(int filterIndex = -1)
void InitChange()
{
if (volumes == null) return;
#if UNITY_EDITOR
// TODO: Use a public event system to announce the change of the activated filter
Debug.Log($"Color changed to <b>{(ColorblindTypes)currentType} {currentType}</b>/{maxType}");
#endif

StartCoroutine(ApplyFilter());

PlayerPrefs.SetInt("Accessibility.ColorblindType", currentType);
currentType++;

#if UNITY_EDITOR
Debug.Log($"Color changed to <b>{(ColorblindTypes)currentType} {currentType}</b>/{maxType}");
#endif
}

IEnumerator ApplyFilter()
Expand Down
25 changes: 22 additions & 3 deletions Assets/Plugins/Colorblindness/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.sohne.colorblindness",
"displayName": "Colorblindness",
"version": "0.0.2",
"version": "0.0.3",
"unity": "2018.4",
"license": "MIT",
"description": "Post-processing effects manager for Unity3D (URP & HDRP) in order to simulate different color palettes for color blind.",
Expand All @@ -10,5 +10,24 @@
"colorblind",
"color filter"
],
"dependencies": {}
}
"dependencies": {
"com.unity.render-pipelines.core": "4.10.0-preview"
},
"author": {
"name": "SOHNE",
"email": "leandroperes@protonmail.com",
"url": "https://github.com/SOHNE"
},
"samples": [
{
"displayName": "Prefabs",
"description": "Simple prefabs",
"path": "Samples~/Prefabs"
},
{
"displayName": "UI",
"description": "Simple example using primarily UI elements",
"path": "Samples~/UI"
}
]
}
2 changes: 1 addition & 1 deletion ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GraphicsSettings:
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_CustomRenderPipeline: {fileID: 11400000, guid: b9bf5e57070e7474f9b02c159ec455d3,
m_CustomRenderPipeline: {fileID: 11400000, guid: e76bbf79ad892449f8067735a1d225e1,
type: 2}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
Expand Down

0 comments on commit bf7a570

Please sign in to comment.