├── .gitignore
├── .gitmodules
├── .vsconfig
├── Assets
├── Demigiant.meta
├── Demigiant
│ ├── DOTween.meta
│ └── DOTween
│ │ ├── DOTween.XML
│ │ ├── DOTween.XML.meta
│ │ ├── DOTween.dll
│ │ ├── DOTween.dll.meta
│ │ ├── Editor.meta
│ │ ├── Editor
│ │ ├── DOTweenEditor.XML
│ │ ├── DOTweenEditor.XML.meta
│ │ ├── DOTweenEditor.dll
│ │ ├── DOTweenEditor.dll.meta
│ │ ├── Imgs.meta
│ │ └── Imgs
│ │ │ ├── DOTweenIcon.png
│ │ │ ├── DOTweenIcon.png.meta
│ │ │ ├── Footer.png
│ │ │ ├── Footer.png.meta
│ │ │ ├── Footer_dark.png
│ │ │ ├── Footer_dark.png.meta
│ │ │ ├── Header.jpg
│ │ │ └── Header.jpg.meta
│ │ ├── Modules.meta
│ │ ├── Modules
│ │ ├── DOTweenModuleAudio.cs
│ │ ├── DOTweenModuleAudio.cs.meta
│ │ ├── DOTweenModulePhysics.cs
│ │ ├── DOTweenModulePhysics.cs.meta
│ │ ├── DOTweenModulePhysics2D.cs
│ │ ├── DOTweenModulePhysics2D.cs.meta
│ │ ├── DOTweenModuleSprite.cs
│ │ ├── DOTweenModuleSprite.cs.meta
│ │ ├── DOTweenModuleUI.cs
│ │ ├── DOTweenModuleUI.cs.meta
│ │ ├── DOTweenModuleUnityVersion.cs
│ │ ├── DOTweenModuleUnityVersion.cs.meta
│ │ ├── DOTweenModuleUtils.cs
│ │ └── DOTweenModuleUtils.cs.meta
│ │ ├── readme.txt
│ │ └── readme.txt.meta
├── HSVPicker.meta
├── HSVPicker
│ ├── Editor.meta
│ ├── Editor
│ │ ├── BoxSliderEditor.cs
│ │ └── BoxSliderEditor.cs.meta
│ ├── Enums.meta
│ ├── Enums
│ │ ├── ColorValues.cs
│ │ └── ColorValues.cs.meta
│ ├── Events.meta
│ ├── Events
│ │ ├── ColorChangedEvent.cs
│ │ ├── ColorChangedEvent.cs.meta
│ │ ├── HSVChangedEvent.cs
│ │ └── HSVChangedEvent.cs.meta
│ ├── Other.meta
│ ├── Other
│ │ ├── ColorPickerTester.cs
│ │ ├── ColorPickerTester.cs.meta
│ │ ├── TiltWindow.cs
│ │ └── TiltWindow.cs.meta
│ ├── Picker 2.0.prefab
│ ├── Picker 2.0.prefab.meta
│ ├── PickerTest.unity
│ ├── PickerTest.unity.meta
│ ├── Resources.meta
│ ├── Resources
│ │ ├── Shaders.meta
│ │ └── Shaders
│ │ │ ├── Compute.meta
│ │ │ └── Compute
│ │ │ ├── GenerateSVTexture.compute
│ │ │ └── GenerateSVTexture.compute.meta
│ ├── UI.meta
│ ├── UI
│ │ ├── ColorImage.cs
│ │ ├── ColorImage.cs.meta
│ │ ├── ColorLabel.cs
│ │ ├── ColorLabel.cs.meta
│ │ ├── ColorPicker.cs
│ │ ├── ColorPicker.cs.meta
│ │ ├── ColorPresets.cs
│ │ ├── ColorPresets.cs.meta
│ │ ├── ColorSlider.cs
│ │ ├── ColorSlider.cs.meta
│ │ ├── ColorSliderImage.cs
│ │ ├── ColorSliderImage.cs.meta
│ │ ├── HexColorField.cs
│ │ ├── HexColorField.cs.meta
│ │ ├── SVBoxSlider.cs
│ │ └── SVBoxSlider.cs.meta
│ ├── UtilityScripts.meta
│ └── UtilityScripts
│ │ ├── BoxSlider.cs
│ │ ├── BoxSlider.cs.meta
│ │ ├── HSVUtil.cs
│ │ └── HSVUtil.cs.meta
├── Klak.meta
├── Klak
│ ├── Video.meta
│ └── Video
│ │ ├── ProcAmp.meta
│ │ └── ProcAmp
│ │ ├── Editor.meta
│ │ ├── Editor
│ │ ├── ProcAmpEditor.cs
│ │ ├── ProcAmpEditor.cs.meta
│ │ ├── ProcAmpMaterialEditor.cs
│ │ ├── ProcAmpMaterialEditor.cs.meta
│ │ ├── Test Card.png
│ │ └── Test Card.png.meta
│ │ ├── ProcAmp.cs
│ │ ├── ProcAmp.cs.meta
│ │ ├── Shaders.meta
│ │ └── Shaders
│ │ ├── ProcAmp.cginc
│ │ ├── ProcAmp.cginc.meta
│ │ ├── ProcAmp.shader
│ │ ├── ProcAmp.shader.meta
│ │ ├── ProcAmpBlit.shader
│ │ └── ProcAmpBlit.shader.meta
├── PlayerPrefsX.meta
├── PlayerPrefsX
│ ├── PlayerPrefsX.cs
│ └── PlayerPrefsX.cs.meta
├── Resources.meta
├── Resources
│ ├── DOTweenSettings.asset
│ └── DOTweenSettings.asset.meta
├── Test.meta
├── Test
│ ├── Keying.meta
│ ├── Keying
│ │ ├── KeyingMat.mat
│ │ ├── KeyingMat.mat.meta
│ │ ├── Test_Keying.unity
│ │ ├── Test_Keying.unity.meta
│ │ ├── chroma-key-2096590_1280.jpg
│ │ └── chroma-key-2096590_1280.jpg.meta
│ ├── PhotoAnim.meta
│ ├── PhotoAnim
│ │ ├── Test_PhotoAnim.unity
│ │ ├── Test_PhotoAnim.unity.meta
│ │ ├── Test_PhotoAnimController.cs
│ │ └── Test_PhotoAnimController.cs.meta
│ ├── PhotoTool.meta
│ └── PhotoTool
│ │ ├── Test_PhotoTool.cs
│ │ ├── Test_PhotoTool.cs.meta
│ │ ├── Test_PhotoTool.unity
│ │ └── Test_PhotoTool.unity.meta
└── gm_PhotoTool.meta
├── Logs
└── Packages-Update.log
├── Packages
├── manifest.json
└── packages-lock.json
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── PackageManagerSettings.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
└── XRSettings.asset
├── README.md
└── readme_information
├── Sample_Keying.gif
├── Sample_PhotoAnimController.gif
└── Sample_PhotoTool.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | [Ll]ibrary/
2 | [Tt]emp/
3 | [Oo]bj/
4 | [Bb]uild/
5 | [Bb]uilds/
6 |
7 |
8 | # Visual Studio cache directory
9 | .vs/
10 |
11 | # Gradle cache directory
12 | .gradle/
13 |
14 | # Autogenerated VS/MD/Consulo solution and project files
15 | ExportedObj/
16 | .consulo/
17 | *.csproj
18 | *.unityproj
19 | *.sln
20 | *.suo
21 | *.tmp
22 | *.user
23 | *.userprefs
24 | *.pidb
25 | *.booproj
26 | *.svd
27 | *.pdb
28 | *.mdb
29 | *.opendb
30 | *.VC.db
31 |
32 | # Unity3D generated meta files
33 | *.pidb.meta
34 | *.pdb.meta
35 | *.mdb.meta
36 |
37 | # Unity3D Generated File On Crash Reports
38 | sysinfo.txt
39 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Assets/gm_PhotoTool"]
2 | path = Assets/gm_PhotoTool
3 | url = https://github.com/GimChuang/gm_PhotoTool
4 |
--------------------------------------------------------------------------------
/.vsconfig:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "components": [
4 | "Microsoft.VisualStudio.Workload.ManagedGame"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/Assets/Demigiant.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: da85300f4fac2704dbc533a82d1d2a4e
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 363e518bc8bdb704abf52039b90b5bd3
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 34192c5e0d14aee43a0e86cc4823268a
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/DOTween.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a811bde74b26b53498b4f6d872b09b6d
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | - first:
17 | Editor: Editor
18 | second:
19 | enabled: 0
20 | settings:
21 | DefaultValueInitialized: true
22 | - first:
23 | Windows Store Apps: WindowsStoreApps
24 | second:
25 | enabled: 0
26 | settings:
27 | CPU: AnyCPU
28 | userData:
29 | assetBundleName:
30 | assetBundleVariant:
31 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e6ca7f673a93dc4498fedfbc33451319
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DOTweenEditor
5 |
6 |
7 |
8 |
9 | Starts the update loop of tween in the editor. Has no effect during playMode.
10 |
11 | Eventual callback to call after every update
12 |
13 |
14 |
15 | Stops the update loop and clears the onPreviewUpdated callback.
16 |
17 | If TRUE also resets the tweened objects to their original state
18 |
19 |
20 |
21 | Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings.
22 |
23 | The tween to ready
24 | If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc)
25 | If TRUE prevents the tween from being auto-killed at completion
26 | If TRUE starts playing the tween immediately
27 |
28 |
29 |
30 | Checks that the given editor texture use the correct import settings,
31 | and applies them if they're incorrect.
32 |
33 |
34 |
35 |
36 | Returns TRUE if setup is required
37 |
38 |
39 |
40 |
41 | Returns TRUE if the file/directory at the given path exists.
42 |
43 | Path, relative to Unity's project folder
44 |
45 |
46 |
47 |
48 | Converts the given project-relative path to a full path,
49 | with backward (\) slashes).
50 |
51 |
52 |
53 |
54 | Converts the given full path to a path usable with AssetDatabase methods
55 | (relative to Unity's project folder, and with the correct Unity forward (/) slashes).
56 |
57 |
58 |
59 |
60 | Connects to a asset.
61 | If the asset already exists at the given path, loads it and returns it.
62 | Otherwise, either returns NULL or automatically creates it before loading and returning it
63 | (depending on the given parameters).
64 |
65 | Asset type
66 | File path (relative to Unity's project folder)
67 | If TRUE and the requested asset doesn't exist, forces its creation
68 |
69 |
70 |
71 | Full path for the given loaded assembly, assembly file included
72 |
73 |
74 |
75 |
76 | Adds the given global define if it's not already present
77 |
78 |
79 |
80 |
81 | Removes the given global define if it's present
82 |
83 |
84 |
85 |
86 | Returns TRUE if the given global define is present in all the
87 | or only in the given , depending on passed parameters.
88 |
89 |
90 | to use. Leave NULL to check in all of them.
91 |
92 |
93 |
94 | Not used as menu item anymore, but as a utiity function
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e2c6224d345d9249acfa6e8ef40bb2d
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 45d5034162d6cf04dbe46da84fc7d074
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | Any:
13 | second:
14 | enabled: 0
15 | settings: {}
16 | - first:
17 | Editor: Editor
18 | second:
19 | enabled: 1
20 | settings:
21 | DefaultValueInitialized: true
22 | - first:
23 | Windows Store Apps: WindowsStoreApps
24 | second:
25 | enabled: 0
26 | settings:
27 | CPU: AnyCPU
28 | userData:
29 | assetBundleName:
30 | assetBundleVariant:
31 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4d8354bc7a856e14b9d98530c343b438
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8da095e39e9b4df488dfd436f81116d6
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | externalObjects: {}
6 | serializedVersion: 7
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 128
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 128
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | vertices: []
80 | indices:
81 | edges: []
82 | weights: []
83 | spritePackingTag:
84 | pSDRemoveMatte: 0
85 | pSDShowRemoveMatteOption: 0
86 | userData:
87 | assetBundleName:
88 | assetBundleVariant:
89 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7051dba417b3d53409f2918f1ea4938d
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | externalObjects: {}
6 | serializedVersion: 7
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 256
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 256
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | vertices: []
80 | indices:
81 | edges: []
82 | weights: []
83 | spritePackingTag:
84 | pSDRemoveMatte: 0
85 | pSDShowRemoveMatteOption: 0
86 | userData:
87 | assetBundleName:
88 | assetBundleVariant:
89 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 519694efe2bb2914788b151fbd8c01f4
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | externalObjects: {}
6 | serializedVersion: 7
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -1
31 | maxTextureSize: 1024
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 1024
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | vertices: []
80 | indices:
81 | edges: []
82 | weights: []
83 | spritePackingTag:
84 | pSDRemoveMatte: 0
85 | pSDShowRemoveMatteOption: 0
86 | userData:
87 | assetBundleName:
88 | assetBundleVariant:
89 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78a59ca99f8987941adb61f9e14a06a7
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | externalObjects: {}
6 | serializedVersion: 7
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 512
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 512
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | vertices: []
80 | indices:
81 | edges: []
82 | weights: []
83 | spritePackingTag:
84 | pSDRemoveMatte: 0
85 | pSDShowRemoveMatteOption: 0
86 | userData:
87 | assetBundleName:
88 | assetBundleVariant:
89 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 09e8752d977b85542bfafb6e07832a1b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if true // MODULE_MARKER
5 | using System;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 | using UnityEngine;
9 | #if UNITY_5 || UNITY_2017_1_OR_NEWER
10 | using UnityEngine.Audio; // Required for AudioMixer
11 | #endif
12 |
13 | #pragma warning disable 1591
14 | namespace DG.Tweening
15 | {
16 | public static class DOTweenModuleAudio
17 | {
18 | #region Shortcuts
19 |
20 | #region Audio
21 |
22 | /// Tweens an AudioSource's volume to the given value.
23 | /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
24 | /// The end value to reach (0 to 1)The duration of the tween
25 | public static TweenerCore DOFade(this AudioSource target, float endValue, float duration)
26 | {
27 | if (endValue < 0) endValue = 0;
28 | else if (endValue > 1) endValue = 1;
29 | TweenerCore t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration);
30 | t.SetTarget(target);
31 | return t;
32 | }
33 |
34 | /// Tweens an AudioSource's pitch to the given value.
35 | /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
36 | /// The end value to reachThe duration of the tween
37 | public static TweenerCore DOPitch(this AudioSource target, float endValue, float duration)
38 | {
39 | TweenerCore t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration);
40 | t.SetTarget(target);
41 | return t;
42 | }
43 |
44 | #endregion
45 |
46 | #if UNITY_5 || UNITY_2017_1_OR_NEWER
47 | #region AudioMixer (Unity 5 or Newer)
48 |
49 | /// Tweens an AudioMixer's exposed float to the given value.
50 | /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
51 | /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
52 | /// Name given to the exposed float to set
53 | /// The end value to reachThe duration of the tween
54 | public static TweenerCore DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
55 | {
56 | TweenerCore t = DOTween.To(()=> {
57 | float currVal;
58 | target.GetFloat(floatName, out currVal);
59 | return currVal;
60 | }, x=> target.SetFloat(floatName, x), endValue, duration);
61 | t.SetTarget(target);
62 | return t;
63 | }
64 |
65 | #region Operation Shortcuts
66 |
67 | ///
68 | /// Completes all tweens that have this target as a reference
69 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
70 | /// and returns the total number of tweens completed
71 | /// (meaning the tweens that don't have infinite loops and were not already complete)
72 | ///
73 | /// For Sequences only: if TRUE also internal Sequence callbacks will be fired,
74 | /// otherwise they will be ignored
75 | public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
76 | {
77 | return DOTween.Complete(target, withCallbacks);
78 | }
79 |
80 | ///
81 | /// Kills all tweens that have this target as a reference
82 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
83 | /// and returns the total number of tweens killed.
84 | ///
85 | /// If TRUE completes the tween before killing it
86 | public static int DOKill(this AudioMixer target, bool complete = false)
87 | {
88 | return DOTween.Kill(target, complete);
89 | }
90 |
91 | ///
92 | /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
93 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
94 | /// and returns the total number of tweens flipped.
95 | ///
96 | public static int DOFlip(this AudioMixer target)
97 | {
98 | return DOTween.Flip(target);
99 | }
100 |
101 | ///
102 | /// Sends to the given position all tweens that have this target as a reference
103 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
104 | /// and returns the total number of tweens involved.
105 | ///
106 | /// Time position to reach
107 | /// (if higher than the whole tween duration the tween will simply reach its end)
108 | /// If TRUE will play the tween after reaching the given position, otherwise it will pause it
109 | public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
110 | {
111 | return DOTween.Goto(target, to, andPlay);
112 | }
113 |
114 | ///
115 | /// Pauses all tweens that have this target as a reference
116 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
117 | /// and returns the total number of tweens paused.
118 | ///
119 | public static int DOPause(this AudioMixer target)
120 | {
121 | return DOTween.Pause(target);
122 | }
123 |
124 | ///
125 | /// Plays all tweens that have this target as a reference
126 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
127 | /// and returns the total number of tweens played.
128 | ///
129 | public static int DOPlay(this AudioMixer target)
130 | {
131 | return DOTween.Play(target);
132 | }
133 |
134 | ///
135 | /// Plays backwards all tweens that have this target as a reference
136 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
137 | /// and returns the total number of tweens played.
138 | ///
139 | public static int DOPlayBackwards(this AudioMixer target)
140 | {
141 | return DOTween.PlayBackwards(target);
142 | }
143 |
144 | ///
145 | /// Plays forward all tweens that have this target as a reference
146 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
147 | /// and returns the total number of tweens played.
148 | ///
149 | public static int DOPlayForward(this AudioMixer target)
150 | {
151 | return DOTween.PlayForward(target);
152 | }
153 |
154 | ///
155 | /// Restarts all tweens that have this target as a reference
156 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
157 | /// and returns the total number of tweens restarted.
158 | ///
159 | public static int DORestart(this AudioMixer target)
160 | {
161 | return DOTween.Restart(target);
162 | }
163 |
164 | ///
165 | /// Rewinds all tweens that have this target as a reference
166 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
167 | /// and returns the total number of tweens rewinded.
168 | ///
169 | public static int DORewind(this AudioMixer target)
170 | {
171 | return DOTween.Rewind(target);
172 | }
173 |
174 | ///
175 | /// Smoothly rewinds all tweens that have this target as a reference
176 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
177 | /// and returns the total number of tweens rewinded.
178 | ///
179 | public static int DOSmoothRewind(this AudioMixer target)
180 | {
181 | return DOTween.SmoothRewind(target);
182 | }
183 |
184 | ///
185 | /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
186 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
187 | /// and returns the total number of tweens involved.
188 | ///
189 | public static int DOTogglePause(this AudioMixer target)
190 | {
191 | return DOTween.TogglePause(target);
192 | }
193 |
194 | #endregion
195 |
196 | #endregion
197 | #endif
198 |
199 | #endregion
200 | }
201 | }
202 | #endif
203 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b766d08851589514b97afb23c6f30a70
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dae9aa560b4242648a3affa2bfabc365
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 | using UnityEngine;
9 |
10 | #pragma warning disable 1591
11 | namespace DG.Tweening
12 | {
13 | public static class DOTweenModulePhysics2D
14 | {
15 | #region Shortcuts
16 |
17 | #region Rigidbody2D Shortcuts
18 |
19 | /// Tweens a Rigidbody2D's position to the given value.
20 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
21 | /// The end value to reachThe duration of the tween
22 | /// If TRUE the tween will smoothly snap all values to integers
23 | public static TweenerCore DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
24 | {
25 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
26 | t.SetOptions(snapping).SetTarget(target);
27 | return t;
28 | }
29 |
30 | /// Tweens a Rigidbody2D's X position to the given value.
31 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
32 | /// The end value to reachThe duration of the tween
33 | /// If TRUE the tween will smoothly snap all values to integers
34 | public static TweenerCore DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
35 | {
36 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration);
37 | t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
38 | return t;
39 | }
40 |
41 | /// Tweens a Rigidbody2D's Y position to the given value.
42 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
43 | /// The end value to reachThe duration of the tween
44 | /// If TRUE the tween will smoothly snap all values to integers
45 | public static TweenerCore DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
46 | {
47 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration);
48 | t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
49 | return t;
50 | }
51 |
52 | /// Tweens a Rigidbody2D's rotation to the given value.
53 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
54 | /// The end value to reachThe duration of the tween
55 | public static TweenerCore DORotate(this Rigidbody2D target, float endValue, float duration)
56 | {
57 | TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
58 | t.SetTarget(target);
59 | return t;
60 | }
61 |
62 | #region Special
63 |
64 | /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
65 | /// Returns a Sequence instead of a Tweener.
66 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
67 | /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
68 | /// The end value to reach
69 | /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
70 | /// Total number of jumps
71 | /// The duration of the tween
72 | /// If TRUE the tween will smoothly snap all values to integers
73 | public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
74 | {
75 | if (numJumps < 1) numJumps = 1;
76 | float startPosY = 0;
77 | float offsetY = -1;
78 | bool offsetYSet = false;
79 | Sequence s = DOTween.Sequence();
80 | Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
81 | .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
82 | .SetLoops(numJumps * 2, LoopType.Yoyo)
83 | .OnStart(() => startPosY = target.position.y);
84 | s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
85 | .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
86 | ).Join(yTween)
87 | .SetTarget(target).SetEase(DOTween.defaultEaseType);
88 | yTween.OnUpdate(() => {
89 | if (!offsetYSet) {
90 | offsetYSet = true;
91 | offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
92 | }
93 | Vector3 pos = target.position;
94 | pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
95 | target.MovePosition(pos);
96 | });
97 | return s;
98 | }
99 |
100 | #endregion
101 |
102 | #endregion
103 |
104 | #endregion
105 | }
106 | }
107 | #endif
108 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 230fe34542e175245ba74b4659dae700
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using UnityEngine;
7 | using DG.Tweening.Core;
8 | using DG.Tweening.Plugins.Options;
9 |
10 | #pragma warning disable 1591
11 | namespace DG.Tweening
12 | {
13 | public static class DOTweenModuleSprite
14 | {
15 | #region Shortcuts
16 |
17 | #region SpriteRenderer
18 |
19 | /// Tweens a SpriteRenderer's color to the given value.
20 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
21 | /// The end value to reachThe duration of the tween
22 | public static TweenerCore DOColor(this SpriteRenderer target, Color endValue, float duration)
23 | {
24 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
25 | t.SetTarget(target);
26 | return t;
27 | }
28 |
29 | /// Tweens a Material's alpha color to the given value.
30 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
31 | /// The end value to reachThe duration of the tween
32 | public static TweenerCore DOFade(this SpriteRenderer target, float endValue, float duration)
33 | {
34 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
35 | t.SetTarget(target);
36 | return t;
37 | }
38 |
39 | /// Tweens a SpriteRenderer's color using the given gradient
40 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
41 | /// Also stores the image as the tween's target so it can be used for filtered operations
42 | /// The gradient to useThe duration of the tween
43 | public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
44 | {
45 | Sequence s = DOTween.Sequence();
46 | GradientColorKey[] colors = gradient.colorKeys;
47 | int len = colors.Length;
48 | for (int i = 0; i < len; ++i) {
49 | GradientColorKey c = colors[i];
50 | if (i == 0 && c.time <= 0) {
51 | target.color = c.color;
52 | continue;
53 | }
54 | float colorDuration = i == len - 1
55 | ? duration - s.Duration(false) // Verifies that total duration is correct
56 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
57 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
58 | }
59 | return s;
60 | }
61 |
62 | #endregion
63 |
64 | #region Blendables
65 |
66 | #region SpriteRenderer
67 |
68 | /// Tweens a SpriteRenderer's color to the given value,
69 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
70 | /// instead than fight each other as multiple DOColor would do.
71 | /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
72 | /// The value to tween toThe duration of the tween
73 | public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
74 | {
75 | endValue = endValue - target.color;
76 | Color to = new Color(0, 0, 0, 0);
77 | return DOTween.To(() => to, x => {
78 | Color diff = x - to;
79 | to = x;
80 | target.color += diff;
81 | }, endValue, duration)
82 | .Blendable().SetTarget(target);
83 | }
84 |
85 | #endregion
86 |
87 | #endregion
88 |
89 | #endregion
90 | }
91 | }
92 | #endif
93 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 188918ab119d93148aa0de59ccf5286b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a060394c03331a64392db53a10e7f2d1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | using System;
5 | using UnityEngine;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 |
9 | #pragma warning disable 1591
10 | namespace DG.Tweening
11 | {
12 | ///
13 | /// Shortcuts/functions that are not strictly related to specific Modules
14 | /// but are available only on some Unity versions
15 | ///
16 | public static class DOTweenModuleUnityVersion
17 | {
18 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER
19 | #region Unity 4.3 or Newer
20 |
21 | #region Material
22 |
23 | /// Tweens a Material's color using the given gradient
24 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
25 | /// Also stores the image as the tween's target so it can be used for filtered operations
26 | /// The gradient to useThe duration of the tween
27 | public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
28 | {
29 | Sequence s = DOTween.Sequence();
30 | GradientColorKey[] colors = gradient.colorKeys;
31 | int len = colors.Length;
32 | for (int i = 0; i < len; ++i) {
33 | GradientColorKey c = colors[i];
34 | if (i == 0 && c.time <= 0) {
35 | target.color = c.color;
36 | continue;
37 | }
38 | float colorDuration = i == len - 1
39 | ? duration - s.Duration(false) // Verifies that total duration is correct
40 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
41 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
42 | }
43 | return s;
44 | }
45 | /// Tweens a Material's named color property using the given gradient
46 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
47 | /// Also stores the image as the tween's target so it can be used for filtered operations
48 | /// The gradient to use
49 | /// The name of the material property to tween (like _Tint or _SpecColor)
50 | /// The duration of the tween
51 | public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
52 | {
53 | Sequence s = DOTween.Sequence();
54 | GradientColorKey[] colors = gradient.colorKeys;
55 | int len = colors.Length;
56 | for (int i = 0; i < len; ++i) {
57 | GradientColorKey c = colors[i];
58 | if (i == 0 && c.time <= 0) {
59 | target.SetColor(property, c.color);
60 | continue;
61 | }
62 | float colorDuration = i == len - 1
63 | ? duration - s.Duration(false) // Verifies that total duration is correct
64 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
65 | s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
66 | }
67 | return s;
68 | }
69 |
70 | #endregion
71 |
72 | #endregion
73 | #endif
74 |
75 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
76 | #region Unity 5.3 or Newer
77 |
78 | #region CustomYieldInstructions
79 |
80 | ///
81 | /// Returns a that waits until the tween is killed or complete.
82 | /// It can be used inside a coroutine as a yield.
83 | /// Example usage:yield return myTween.WaitForCompletion(true);
84 | ///
85 | public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
86 | {
87 | if (!t.active) {
88 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
89 | return null;
90 | }
91 | return new DOTweenCYInstruction.WaitForCompletion(t);
92 | }
93 |
94 | ///
95 | /// Returns a that waits until the tween is killed or rewinded.
96 | /// It can be used inside a coroutine as a yield.
97 | /// Example usage:yield return myTween.WaitForRewind();
98 | ///
99 | public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
100 | {
101 | if (!t.active) {
102 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
103 | return null;
104 | }
105 | return new DOTweenCYInstruction.WaitForRewind(t);
106 | }
107 |
108 | ///
109 | /// Returns a that waits until the tween is killed.
110 | /// It can be used inside a coroutine as a yield.
111 | /// Example usage:yield return myTween.WaitForKill();
112 | ///
113 | public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
114 | {
115 | if (!t.active) {
116 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
117 | return null;
118 | }
119 | return new DOTweenCYInstruction.WaitForKill(t);
120 | }
121 |
122 | ///
123 | /// Returns a that waits until the tween is killed or has gone through the given amount of loops.
124 | /// It can be used inside a coroutine as a yield.
125 | /// Example usage:yield return myTween.WaitForElapsedLoops(2);
126 | ///
127 | /// Elapsed loops to wait for
128 | public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
129 | {
130 | if (!t.active) {
131 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
132 | return null;
133 | }
134 | return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
135 | }
136 |
137 | ///
138 | /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
139 | /// It can be used inside a coroutine as a yield.
140 | /// Example usage:yield return myTween.WaitForPosition(2.5f);
141 | ///
142 | /// Position (loops included, delays excluded) to wait for
143 | public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
144 | {
145 | if (!t.active) {
146 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
147 | return null;
148 | }
149 | return new DOTweenCYInstruction.WaitForPosition(t, position);
150 | }
151 |
152 | ///
153 | /// Returns a that waits until the tween is killed or started
154 | /// (meaning when the tween is set in a playing state the first time, after any eventual delay).
155 | /// It can be used inside a coroutine as a yield.
156 | /// Example usage:yield return myTween.WaitForStart();
157 | ///
158 | public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
159 | {
160 | if (!t.active) {
161 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
162 | return null;
163 | }
164 | return new DOTweenCYInstruction.WaitForStart(t);
165 | }
166 |
167 | #endregion
168 |
169 | #endregion
170 | #endif
171 |
172 | #if UNITY_2018_1_OR_NEWER
173 | #region Unity 2018.1 or Newer
174 |
175 | #region Material
176 |
177 | /// Tweens a Material's named texture offset property with the given ID to the given value.
178 | /// Also stores the material as the tween's target so it can be used for filtered operations
179 | /// The end value to reach
180 | /// The ID of the material property to tween (also called nameID in Unity's manual)
181 | /// The duration of the tween
182 | public static TweenerCore DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
183 | {
184 | if (!target.HasProperty(propertyID)) {
185 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
186 | return null;
187 | }
188 | TweenerCore t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration);
189 | t.SetTarget(target);
190 | return t;
191 | }
192 |
193 | /// Tweens a Material's named texture scale property with the given ID to the given value.
194 | /// Also stores the material as the tween's target so it can be used for filtered operations
195 | /// The end value to reach
196 | /// The ID of the material property to tween (also called nameID in Unity's manual)
197 | /// The duration of the tween
198 | public static TweenerCore DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
199 | {
200 | if (!target.HasProperty(propertyID)) {
201 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
202 | return null;
203 | }
204 | TweenerCore t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration);
205 | t.SetTarget(target);
206 | return t;
207 | }
208 |
209 | #endregion
210 |
211 | #endregion
212 | #endif
213 | }
214 |
215 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
216 | // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
217 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
218 |
219 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
220 | public static class DOTweenCYInstruction
221 | {
222 | public class WaitForCompletion : CustomYieldInstruction
223 | {
224 | public override bool keepWaiting { get {
225 | return t.active && !t.IsComplete();
226 | }}
227 | readonly Tween t;
228 | public WaitForCompletion(Tween tween)
229 | {
230 | t = tween;
231 | }
232 | }
233 |
234 | public class WaitForRewind : CustomYieldInstruction
235 | {
236 | public override bool keepWaiting { get {
237 | return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
238 | }}
239 | readonly Tween t;
240 | public WaitForRewind(Tween tween)
241 | {
242 | t = tween;
243 | }
244 | }
245 |
246 | public class WaitForKill : CustomYieldInstruction
247 | {
248 | public override bool keepWaiting { get {
249 | return t.active;
250 | }}
251 | readonly Tween t;
252 | public WaitForKill(Tween tween)
253 | {
254 | t = tween;
255 | }
256 | }
257 |
258 | public class WaitForElapsedLoops : CustomYieldInstruction
259 | {
260 | public override bool keepWaiting { get {
261 | return t.active && t.CompletedLoops() < elapsedLoops;
262 | }}
263 | readonly Tween t;
264 | readonly int elapsedLoops;
265 | public WaitForElapsedLoops(Tween tween, int elapsedLoops)
266 | {
267 | t = tween;
268 | this.elapsedLoops = elapsedLoops;
269 | }
270 | }
271 |
272 | public class WaitForPosition : CustomYieldInstruction
273 | {
274 | public override bool keepWaiting { get {
275 | return t.active && t.position * (t.CompletedLoops() + 1) < position;
276 | }}
277 | readonly Tween t;
278 | readonly float position;
279 | public WaitForPosition(Tween tween, float position)
280 | {
281 | t = tween;
282 | this.position = position;
283 | }
284 | }
285 |
286 | public class WaitForStart : CustomYieldInstruction
287 | {
288 | public override bool keepWaiting { get {
289 | return t.active && !t.playedOnce;
290 | }}
291 | readonly Tween t;
292 | public WaitForStart(Tween tween)
293 | {
294 | t = tween;
295 | }
296 | }
297 | }
298 | #endif
299 | }
300 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 63c02322328255542995bd02b47b0457
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | using System;
5 | using System.Reflection;
6 | using UnityEngine;
7 | using DG.Tweening.Core;
8 | using DG.Tweening.Plugins.Core.PathCore;
9 | using DG.Tweening.Plugins.Options;
10 |
11 | #pragma warning disable 1591
12 | namespace DG.Tweening
13 | {
14 | ///
15 | /// Utility functions that deal with available Modules.
16 | /// Modules defines:
17 | /// - DOTAUDIO
18 | /// - DOTPHYSICS
19 | /// - DOTPHYSICS2D
20 | /// - DOTSPRITE
21 | /// - DOTUI
22 | /// Extra defines set and used for implementation of external assets:
23 | /// - DOTWEEN_TMP ► TextMesh Pro
24 | /// - DOTWEEN_TK2D ► 2D Toolkit
25 | ///
26 | public static class DOTweenModuleUtils
27 | {
28 | static bool _initialized;
29 |
30 | #region Reflection
31 |
32 | ///
33 | /// Called via Reflection by DOTweenComponent on Awake
34 | ///
35 | #if UNITY_2018_1_OR_NEWER
36 | [UnityEngine.Scripting.Preserve]
37 | #endif
38 | public static void Init()
39 | {
40 | if (_initialized) return;
41 |
42 | _initialized = true;
43 | DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
44 |
45 | #if UNITY_EDITOR
46 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
47 | UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
48 | #else
49 | UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged;
50 | #endif
51 | #endif
52 | }
53 |
54 | #if UNITY_2018_1_OR_NEWER
55 | #pragma warning disable
56 | [UnityEngine.Scripting.Preserve]
57 | // Just used to preserve methods when building, never called
58 | static void Preserver()
59 | {
60 | Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
61 | MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
62 | }
63 | #pragma warning restore
64 | #endif
65 |
66 | #endregion
67 |
68 | #if UNITY_EDITOR
69 | // Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
70 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
71 | static void PlaymodeStateChanged()
72 | #else
73 | static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state)
74 | #endif
75 | {
76 | if (DOTween.instance == null) return;
77 | DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused);
78 | }
79 | #endif
80 |
81 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
82 | // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
83 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
84 |
85 | public static class Physics
86 | {
87 | // Called via DOTweenExternalCommand callback
88 | public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
89 | {
90 | #if true // PHYSICS_MARKER
91 | if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
92 | else trans.rotation = newRot;
93 | #else
94 | trans.rotation = newRot;
95 | #endif
96 | }
97 |
98 | // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
99 | public static bool HasRigidbody2D(Component target)
100 | {
101 | #if true // PHYSICS2D_MARKER
102 | return target.GetComponent() != null;
103 | #else
104 | return false;
105 | #endif
106 | }
107 |
108 | #region Called via Reflection
109 |
110 |
111 | // Called via Reflection by DOTweenPathInspector
112 | // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
113 | #if UNITY_2018_1_OR_NEWER
114 | [UnityEngine.Scripting.Preserve]
115 | #endif
116 | public static bool HasRigidbody(Component target)
117 | {
118 | #if true // PHYSICS_MARKER
119 | return target.GetComponent() != null;
120 | #else
121 | return false;
122 | #endif
123 | }
124 |
125 | // Called via Reflection by DOTweenPath
126 | #if UNITY_2018_1_OR_NEWER
127 | [UnityEngine.Scripting.Preserve]
128 | #endif
129 | public static TweenerCore CreateDOTweenPathTween(
130 | MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
131 | ){
132 | TweenerCore t;
133 | #if true // PHYSICS_MARKER
134 | Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null;
135 | if (tweenRigidbody && rBody != null) {
136 | t = isLocal
137 | ? rBody.DOLocalPath(path, duration, pathMode)
138 | : rBody.DOPath(path, duration, pathMode);
139 | } else {
140 | t = isLocal
141 | ? target.transform.DOLocalPath(path, duration, pathMode)
142 | : target.transform.DOPath(path, duration, pathMode);
143 | }
144 | #else
145 | t = isLocal
146 | ? target.transform.DOLocalPath(path, duration, pathMode)
147 | : target.transform.DOPath(path, duration, pathMode);
148 | #endif
149 | return t;
150 | }
151 |
152 | #endregion
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7bcaf917d9cf5b84090421a5a2abe42e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/readme.txt:
--------------------------------------------------------------------------------
1 | DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant
2 |
3 | // IMPORTANT!!! /////////////////////////////////////////////
4 | // Upgrading DOTween from versions older than 1.2.000 ///////
5 | // (or DOTween Pro older than 1.0.000) //////////////////////
6 | -------------------------------------------------------------
7 | If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully.
8 | 1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry
9 | 2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
10 | 3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup
11 | 4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only)
12 |
13 | // GET STARTED //////////////////////////////////////////////
14 |
15 | - After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween.
16 | - In your code, add "using DG.Tweening" to each class where you want to use DOTween.
17 | - You're ready to tween. Check out the links below for full documentation and license info.
18 |
19 |
20 | // LINKS ///////////////////////////////////////////////////////
21 |
22 | DOTween website (documentation, examples, etc): http://dotween.demigiant.com
23 | DOTween license: http://dotween.demigiant.com/license.php
24 | DOTween repository (Google Code): https://code.google.com/p/dotween/
25 | Demigiant website (documentation, examples, etc): http://www.demigiant.com
26 |
27 | // NOTES //////////////////////////////////////////////////////
28 |
29 | - DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/readme.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fccfc62abf2eb0a4db614853430894fd
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/HSVPicker.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 23371cc964348c240b759eeeeb4d63aa
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2a9e9df3c14e9034eb587348635c8f09
3 | folderAsset: yes
4 | DefaultImporter:
5 | userData:
6 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Editor/BoxSliderEditor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using UnityEngine;
3 | using UnityEngine.UI;
4 |
5 | namespace UnityEditor.UI
6 | {
7 | [CustomEditor(typeof(BoxSlider), true)]
8 | [CanEditMultipleObjects]
9 | public class BoxSliderEditor : SelectableEditor
10 | {
11 |
12 | SerializedProperty m_HandleRect;
13 | SerializedProperty m_MinValue;
14 | SerializedProperty m_MaxValue;
15 | SerializedProperty m_WholeNumbers;
16 | SerializedProperty m_Value;
17 | SerializedProperty m_ValueY;
18 | SerializedProperty m_OnValueChanged;
19 |
20 | protected override void OnEnable()
21 | {
22 | base.OnEnable();
23 | m_HandleRect = serializedObject.FindProperty("m_HandleRect");
24 |
25 | m_MinValue = serializedObject.FindProperty("m_MinValue");
26 | m_MaxValue = serializedObject.FindProperty("m_MaxValue");
27 | m_WholeNumbers = serializedObject.FindProperty("m_WholeNumbers");
28 | m_Value = serializedObject.FindProperty("m_Value");
29 | m_ValueY = serializedObject.FindProperty("m_ValueY");
30 | m_OnValueChanged = serializedObject.FindProperty("m_OnValueChanged");
31 | }
32 |
33 | public override void OnInspectorGUI()
34 | {
35 | base.OnInspectorGUI();
36 | EditorGUILayout.Space();
37 |
38 | serializedObject.Update();
39 |
40 | EditorGUILayout.PropertyField(m_HandleRect);
41 |
42 | if (m_HandleRect.objectReferenceValue != null)
43 | {
44 | EditorGUI.BeginChangeCheck();
45 |
46 |
47 | EditorGUILayout.PropertyField(m_MinValue);
48 | EditorGUILayout.PropertyField(m_MaxValue);
49 | EditorGUILayout.PropertyField(m_WholeNumbers);
50 | EditorGUILayout.Slider(m_Value, m_MinValue.floatValue, m_MaxValue.floatValue);
51 | EditorGUILayout.Slider(m_ValueY, m_MinValue.floatValue, m_MaxValue.floatValue);
52 |
53 | // Draw the event notification options
54 | EditorGUILayout.Space();
55 | EditorGUILayout.PropertyField(m_OnValueChanged);
56 | }
57 | else
58 | {
59 | EditorGUILayout.HelpBox("Specify a RectTransform for the slider fill or the slider handle or both. Each must have a parent RectTransform that it can slide within.", MessageType.Info);
60 | }
61 |
62 | serializedObject.ApplyModifiedProperties();
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Editor/BoxSliderEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8701e045b26e51f4eb345f2ccb3c13f5
3 | timeCreated: 1426804458
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Enums.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5d3904d3d18ddd544820bd8518990fee
3 | folderAsset: yes
4 | timeCreated: 1442586617
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Enums/ColorValues.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | public enum ColorValues
4 | {
5 | R,
6 | G,
7 | B,
8 | A,
9 |
10 | Hue,
11 | Saturation,
12 | Value
13 | }
14 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Enums/ColorValues.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 859a1720e083e504cb68917f781e87c7
3 | timeCreated: 1442586608
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Events.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6bb0d49c64210014e9a24ed9345928c2
3 | folderAsset: yes
4 | timeCreated: 1442747310
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Events/ColorChangedEvent.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System;
3 | using UnityEngine.Events;
4 |
5 | [Serializable]
6 | public class ColorChangedEvent : UnityEvent
7 | {
8 |
9 | }
--------------------------------------------------------------------------------
/Assets/HSVPicker/Events/ColorChangedEvent.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ff46fbecea7739f4690e4285c88f53c5
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Events/HSVChangedEvent.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine.Events;
2 |
3 | public class HSVChangedEvent : UnityEvent
4 | {
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Events/HSVChangedEvent.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3d95ce8fba3dbbf4eb14411412169b88
3 | timeCreated: 1442747317
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Other.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 304681ea793fc054aa8ed2beab28d0b1
3 | folderAsset: yes
4 | timeCreated: 1442751317
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Other/ColorPickerTester.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | public class ColorPickerTester : MonoBehaviour
4 | {
5 |
6 | public new Renderer renderer;
7 | public ColorPicker picker;
8 |
9 | public Color Color = Color.red;
10 |
11 | // Use this for initialization
12 | void Start ()
13 | {
14 | picker.onValueChanged.AddListener(color =>
15 | {
16 | renderer.material.color = color;
17 | Color = color;
18 | });
19 |
20 | renderer.material.color = picker.CurrentColor;
21 |
22 | picker.CurrentColor = Color;
23 | }
24 |
25 | // Update is called once per frame
26 | void Update () {
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Other/ColorPickerTester.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 06851a815227e5044b0e3c1bf9b3a282
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Other/TiltWindow.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | public class TiltWindow : MonoBehaviour
4 | {
5 | public Vector2 range = new Vector2(5f, 3f);
6 |
7 | Transform mTrans;
8 | Quaternion mStart;
9 | Vector2 mRot = Vector2.zero;
10 |
11 | void Start ()
12 | {
13 | mTrans = transform;
14 | mStart = mTrans.localRotation;
15 | }
16 |
17 | void Update ()
18 | {
19 | Vector3 pos = Input.mousePosition;
20 |
21 | float halfWidth = Screen.width * 0.5f;
22 | float halfHeight = Screen.height * 0.5f;
23 | float x = Mathf.Clamp((pos.x - halfWidth) / halfWidth, -1f, 1f);
24 | float y = Mathf.Clamp((pos.y - halfHeight) / halfHeight, -1f, 1f);
25 | mRot = Vector2.Lerp(mRot, new Vector2(x, y), Time.deltaTime * 5f);
26 |
27 | mTrans.localRotation = mStart * Quaternion.Euler(-mRot.y * range.y, mRot.x * range.x, 0f);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Other/TiltWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f2aa04a3e088320429a06194a3483daa
3 | timeCreated: 1426051352
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Picker 2.0.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 916ee089a0d7b63419075f91e1c657ec
3 | timeCreated: 1442747914
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/PickerTest.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ce46c07f0028e314ab7767577ab5e7a6
3 | DefaultImporter:
4 | userData:
5 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bd468b65ce2696a47b55d96071049cd2
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Resources/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: acc12c1634f947c45b5695d82a386862
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Resources/Shaders/Compute.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 839724c1a36343947a4629e5ce362e30
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/Resources/Shaders/Compute/GenerateSVTexture.compute:
--------------------------------------------------------------------------------
1 | #pragma kernel CSMain
2 |
3 | RWTexture2D Texture;
4 |
5 | float2 TextureSize;
6 | float Hue;
7 |
8 | float4 HUEtoRGB(float h)
9 | {
10 | float r = abs(h * 6 - 3) - 1;
11 | float g = 2 - abs(h * 6 - 2);
12 | float b = 2 - abs(h * 6 - 4);
13 | return saturate(float4(r, g, b, 1));
14 | }
15 |
16 | float4 HSVtoRGB(float h, float s, float v)
17 | {
18 | float4 rgb = HUEtoRGB(h);
19 | return ((rgb - 1) * s + 1) * v;
20 | }
21 |
22 | [numthreads(32, 32, 1)]
23 | void CSMain(uint3 id : SV_DispatchThreadID)
24 | {
25 | if (id.x > (uint)TextureSize.x || id.y > (uint)TextureSize.y)
26 | return;
27 |
28 | Texture[id.xy] = HSVtoRGB(Hue, id.x / TextureSize.x, id.y / TextureSize.y);
29 | }
--------------------------------------------------------------------------------
/Assets/HSVPicker/Resources/Shaders/Compute/GenerateSVTexture.compute.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 06ff10007fb33fe44a062956d2249bb2
3 | ComputeShaderImporter:
4 | externalObjects: {}
5 | currentAPIMask: 4
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2b5fe4e314cbd9944bcaa93e814e9bd5
3 | folderAsset: yes
4 | timeCreated: 1442586536
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorImage.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | [RequireComponent(typeof(Image))]
5 | public class ColorImage : MonoBehaviour
6 | {
7 | public ColorPicker picker;
8 |
9 | private Image image;
10 |
11 | private void Awake()
12 | {
13 | image = GetComponent();
14 | picker.onValueChanged.AddListener(ColorChanged);
15 | }
16 |
17 | private void OnDestroy()
18 | {
19 | picker.onValueChanged.RemoveListener(ColorChanged);
20 | }
21 |
22 | private void ColorChanged(Color newColor)
23 | {
24 | image.color = newColor;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorImage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6bca58eb07ad66b498a2f158bcb13225
3 | timeCreated: 1442675622
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorLabel.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | [RequireComponent(typeof(Text))]
5 | public class ColorLabel : MonoBehaviour
6 | {
7 | public ColorPicker picker;
8 |
9 | public ColorValues type;
10 |
11 | public string prefix = "R: ";
12 | public float minValue = 0;
13 | public float maxValue = 255;
14 |
15 | public int precision = 0;
16 |
17 | private Text label;
18 |
19 | private void Awake()
20 | {
21 | label = GetComponent();
22 |
23 | }
24 |
25 | private void OnEnable()
26 | {
27 | if (Application.isPlaying && picker != null)
28 | {
29 | picker.onValueChanged.AddListener(ColorChanged);
30 | picker.onHSVChanged.AddListener(HSVChanged);
31 | }
32 | }
33 |
34 | private void OnDestroy()
35 | {
36 | if (picker != null)
37 | {
38 | picker.onValueChanged.RemoveListener(ColorChanged);
39 | picker.onHSVChanged.RemoveListener(HSVChanged);
40 | }
41 | }
42 |
43 | #if UNITY_EDITOR
44 | private void OnValidate()
45 | {
46 | label = GetComponent();
47 | UpdateValue();
48 | }
49 | #endif
50 |
51 | private void ColorChanged(Color color)
52 | {
53 | UpdateValue();
54 | }
55 |
56 | private void HSVChanged(float hue, float sateration, float value)
57 | {
58 | UpdateValue();
59 | }
60 |
61 | private void UpdateValue()
62 | {
63 | if (picker == null)
64 | {
65 | label.text = prefix + "-";
66 | }
67 | else
68 | {
69 | float value = minValue + (picker.GetValue(type) * (maxValue - minValue));
70 |
71 | label.text = prefix + ConvertToDisplayString(value);
72 | }
73 | }
74 |
75 | private string ConvertToDisplayString(float value)
76 | {
77 | if (precision > 0)
78 | return value.ToString("f " + precision);
79 | else
80 | return Mathf.FloorToInt(value).ToString();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorLabel.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6b10e832a32d2d14facd8a3f489ee8d6
3 | timeCreated: 1442587803
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorPicker.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | public class ColorPicker : MonoBehaviour
4 | {
5 | private float _hue = 0;
6 | private float _saturation = 0;
7 | private float _brightness = 0;
8 |
9 | private float _red = 1;
10 | private float _green = 0;
11 | private float _blue = 0;
12 |
13 | private float _alpha = 1;
14 |
15 | public ColorChangedEvent onValueChanged = new ColorChangedEvent();
16 | public HSVChangedEvent onHSVChanged = new HSVChangedEvent();
17 |
18 | public Color CurrentColor
19 | {
20 | get
21 | {
22 | return new Color(_red, _green, _blue, _alpha);
23 | }
24 | set
25 | {
26 | if (CurrentColor == value)
27 | return;
28 |
29 | _red = value.r;
30 | _green = value.g;
31 | _blue = value.b;
32 | _alpha = value.a;
33 |
34 | RGBChanged();
35 |
36 | SendChangedEvent();
37 | }
38 | }
39 |
40 | private void Start()
41 | {
42 | RGBChanged();
43 | SendChangedEvent();
44 | }
45 |
46 | public float H
47 | {
48 | get
49 | {
50 | return _hue;
51 | }
52 | set
53 | {
54 | if (_hue == value)
55 | return;
56 |
57 | _hue = value;
58 |
59 | HSVChanged();
60 |
61 | SendChangedEvent();
62 | }
63 | }
64 |
65 | public float S
66 | {
67 | get
68 | {
69 | return _saturation;
70 | }
71 | set
72 | {
73 | if (_saturation == value)
74 | return;
75 |
76 | _saturation = value;
77 |
78 | HSVChanged();
79 |
80 | SendChangedEvent();
81 | }
82 | }
83 |
84 | public float V
85 | {
86 | get
87 | {
88 | return _brightness;
89 | }
90 | set
91 | {
92 | if (_brightness == value)
93 | return;
94 |
95 | _brightness = value;
96 |
97 | HSVChanged();
98 |
99 | SendChangedEvent();
100 | }
101 | }
102 |
103 | public float R
104 | {
105 | get
106 | {
107 | return _red;
108 | }
109 | set
110 | {
111 | if (_red == value)
112 | return;
113 |
114 | _red = value;
115 |
116 | RGBChanged();
117 |
118 | SendChangedEvent();
119 | }
120 | }
121 |
122 | public float G
123 | {
124 | get
125 | {
126 | return _green;
127 | }
128 | set
129 | {
130 | if (_green == value)
131 | return;
132 |
133 | _green = value;
134 |
135 | RGBChanged();
136 |
137 | SendChangedEvent();
138 | }
139 | }
140 |
141 | public float B
142 | {
143 | get
144 | {
145 | return _blue;
146 | }
147 | set
148 | {
149 | if (_blue == value)
150 | return;
151 |
152 | _blue = value;
153 |
154 | RGBChanged();
155 |
156 | SendChangedEvent();
157 | }
158 | }
159 |
160 | private float A
161 | {
162 | get
163 | {
164 | return _alpha;
165 | }
166 | set
167 | {
168 | if (_alpha == value)
169 | return;
170 |
171 | _alpha = value;
172 |
173 | SendChangedEvent();
174 | }
175 | }
176 |
177 | private void RGBChanged()
178 | {
179 | HsvColor color = HSVUtil.ConvertRgbToHsv(CurrentColor);
180 |
181 | _hue = color.normalizedH;
182 | _saturation = color.normalizedS;
183 | _brightness = color.normalizedV;
184 | }
185 |
186 | private void HSVChanged()
187 | {
188 | Color color = HSVUtil.ConvertHsvToRgb(_hue * 360, _saturation, _brightness, _alpha);
189 |
190 | _red = color.r;
191 | _green = color.g;
192 | _blue = color.b;
193 | }
194 |
195 | private void SendChangedEvent()
196 | {
197 | onValueChanged.Invoke(CurrentColor);
198 | onHSVChanged.Invoke(_hue, _saturation, _brightness);
199 | }
200 |
201 | public void AssignColor(ColorValues type, float value)
202 | {
203 | switch (type)
204 | {
205 | case ColorValues.R:
206 | R = value;
207 | break;
208 | case ColorValues.G:
209 | G = value;
210 | break;
211 | case ColorValues.B:
212 | B = value;
213 | break;
214 | case ColorValues.A:
215 | A = value;
216 | break;
217 | case ColorValues.Hue:
218 | H = value;
219 | break;
220 | case ColorValues.Saturation:
221 | S = value;
222 | break;
223 | case ColorValues.Value:
224 | V = value;
225 | break;
226 | default:
227 | break;
228 | }
229 | }
230 |
231 | public float GetValue(ColorValues type)
232 | {
233 | switch (type)
234 | {
235 | case ColorValues.R:
236 | return R;
237 | case ColorValues.G:
238 | return G;
239 | case ColorValues.B:
240 | return B;
241 | case ColorValues.A:
242 | return A;
243 | case ColorValues.Hue:
244 | return H;
245 | case ColorValues.Saturation:
246 | return S;
247 | case ColorValues.Value:
248 | return V;
249 | default:
250 | throw new System.NotImplementedException("");
251 | }
252 | }
253 | }
254 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorPicker.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8262e4a8322117f4da079921eaa72834
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorPresets.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | public class ColorPresets : MonoBehaviour
5 | {
6 | public ColorPicker picker;
7 | public GameObject[] presets;
8 | public Image createPresetImage;
9 |
10 | void Awake()
11 | {
12 | // picker.onHSVChanged.AddListener(HSVChanged);
13 | picker.onValueChanged.AddListener(ColorChanged);
14 | }
15 |
16 | public void CreatePresetButton()
17 | {
18 | for (var i = 0; i < presets.Length; i++)
19 | {
20 | if (!presets[i].activeSelf)
21 | {
22 | presets[i].SetActive(true);
23 | presets[i].GetComponent().color = picker.CurrentColor;
24 | break;
25 | }
26 | }
27 | }
28 |
29 | public void PresetSelect(Image sender)
30 | {
31 | picker.CurrentColor = sender.color;
32 | }
33 |
34 | // Not working, it seems ConvertHsvToRgb() is broken. It doesn't work when fed
35 | // input h, s, v as shown below.
36 | // private void HSVChanged(float h, float s, float v)
37 | // {
38 | // createPresetImage.color = HSVUtil.ConvertHsvToRgb(h, s, v, 1);
39 | // }
40 | private void ColorChanged(Color color)
41 | {
42 | createPresetImage.color = color;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorPresets.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0923373e76e77402c9c53a2f1250ad3e
3 | timeCreated: 1456875791
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorSlider.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | ///
5 | /// Displays one of the color values of aColorPicker
6 | ///
7 | [RequireComponent(typeof(Slider))]
8 | public class ColorSlider : MonoBehaviour
9 | {
10 | public ColorPicker hsvpicker;
11 |
12 | ///
13 | /// Which value this slider can edit.
14 | ///
15 | public ColorValues type;
16 |
17 | private Slider slider;
18 |
19 | private bool listen = true;
20 |
21 | private void Awake()
22 | {
23 | slider = GetComponent();
24 |
25 | hsvpicker.onValueChanged.AddListener(ColorChanged);
26 | hsvpicker.onHSVChanged.AddListener(HSVChanged);
27 | slider.onValueChanged.AddListener(SliderChanged);
28 | }
29 |
30 | private void OnDestroy()
31 | {
32 | hsvpicker.onValueChanged.RemoveListener(ColorChanged);
33 | hsvpicker.onHSVChanged.RemoveListener(HSVChanged);
34 | slider.onValueChanged.RemoveListener(SliderChanged);
35 | }
36 |
37 | private void ColorChanged(Color newColor)
38 | {
39 | listen = false;
40 | switch (type)
41 | {
42 | case ColorValues.R:
43 | slider.normalizedValue = newColor.r;
44 | break;
45 | case ColorValues.G:
46 | slider.normalizedValue = newColor.g;
47 | break;
48 | case ColorValues.B:
49 | slider.normalizedValue = newColor.b;
50 | break;
51 | case ColorValues.A:
52 | slider.normalizedValue = newColor.a;
53 | break;
54 | default:
55 | break;
56 | }
57 | }
58 |
59 | private void HSVChanged(float hue, float saturation, float value)
60 | {
61 | listen = false;
62 | switch (type)
63 | {
64 | case ColorValues.Hue:
65 | slider.normalizedValue = hue; //1 - hue;
66 | break;
67 | case ColorValues.Saturation:
68 | slider.normalizedValue = saturation;
69 | break;
70 | case ColorValues.Value:
71 | slider.normalizedValue = value;
72 | break;
73 | default:
74 | break;
75 | }
76 | }
77 |
78 | private void SliderChanged(float newValue)
79 | {
80 | if (listen)
81 | {
82 | newValue = slider.normalizedValue;
83 | //if (type == ColorValues.Hue)
84 | // newValue = 1 - newValue;
85 |
86 | hsvpicker.AssignColor(type, newValue);
87 | }
88 | listen = true;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorSlider.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c600592efa0cf25479655321bf4fb08a
3 | timeCreated: 1442586558
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorSliderImage.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | [RequireComponent(typeof(RawImage)), ExecuteInEditMode()]
5 | public class ColorSliderImage : MonoBehaviour
6 | {
7 | public ColorPicker picker;
8 |
9 | ///
10 | /// Which value this slider can edit.
11 | ///
12 | public ColorValues type;
13 |
14 | public Slider.Direction direction;
15 |
16 | private RawImage image;
17 |
18 | private RectTransform rectTransform
19 | {
20 | get
21 | {
22 | return transform as RectTransform;
23 | }
24 | }
25 |
26 | private void Awake()
27 | {
28 | image = GetComponent();
29 |
30 | if(Application.isPlaying)
31 | RegenerateTexture();
32 | }
33 |
34 | private void OnEnable()
35 | {
36 | if (picker != null && Application.isPlaying)
37 | {
38 | picker.onValueChanged.AddListener(ColorChanged);
39 | picker.onHSVChanged.AddListener(HSVChanged);
40 | }
41 | }
42 |
43 | private void OnDisable()
44 | {
45 | if (picker != null)
46 | {
47 | picker.onValueChanged.RemoveListener(ColorChanged);
48 | picker.onHSVChanged.RemoveListener(HSVChanged);
49 | }
50 | }
51 |
52 | private void OnDestroy()
53 | {
54 | if (image.texture != null)
55 | DestroyImmediate(image.texture);
56 | }
57 |
58 | private void ColorChanged(Color newColor)
59 | {
60 | switch (type)
61 | {
62 | case ColorValues.R:
63 | case ColorValues.G:
64 | case ColorValues.B:
65 | case ColorValues.Saturation:
66 | case ColorValues.Value:
67 | RegenerateTexture();
68 | break;
69 | case ColorValues.A:
70 | case ColorValues.Hue:
71 | default:
72 | break;
73 | }
74 | }
75 |
76 | private void HSVChanged(float hue, float saturation, float value)
77 | {
78 | switch (type)
79 | {
80 | case ColorValues.R:
81 | case ColorValues.G:
82 | case ColorValues.B:
83 | case ColorValues.Saturation:
84 | case ColorValues.Value:
85 | RegenerateTexture();
86 | break;
87 | case ColorValues.A:
88 | case ColorValues.Hue:
89 | default:
90 | break;
91 | }
92 | }
93 |
94 | private void RegenerateTexture()
95 | {
96 | Color32 baseColor = picker != null ? picker.CurrentColor : Color.black;
97 |
98 | float h = picker != null ? picker.H : 0;
99 | float s = picker != null ? picker.S : 0;
100 | float v = picker != null ? picker.V : 0;
101 |
102 | Texture2D texture;
103 | Color32[] colors;
104 |
105 | bool vertical = direction == Slider.Direction.BottomToTop || direction == Slider.Direction.TopToBottom;
106 | bool inverted = direction == Slider.Direction.TopToBottom || direction == Slider.Direction.RightToLeft;
107 |
108 | int size;
109 | switch (type)
110 | {
111 | case ColorValues.R:
112 | case ColorValues.G:
113 | case ColorValues.B:
114 | case ColorValues.A:
115 | size = 255;
116 | break;
117 | case ColorValues.Hue:
118 | size = 360;
119 | break;
120 | case ColorValues.Saturation:
121 | case ColorValues.Value:
122 | size = 100;
123 | break;
124 | default:
125 | throw new System.NotImplementedException("");
126 | }
127 | if (vertical)
128 | texture = new Texture2D(1, size);
129 | else
130 | texture = new Texture2D(size, 1);
131 |
132 | texture.hideFlags = HideFlags.DontSave;
133 | colors = new Color32[size];
134 |
135 | switch (type)
136 | {
137 | case ColorValues.R:
138 | for (byte i = 0; i < size; i++)
139 | {
140 | colors[inverted ? size - 1 - i : i] = new Color32(i, baseColor.g, baseColor.b, 255);
141 | }
142 | break;
143 | case ColorValues.G:
144 | for (byte i = 0; i < size; i++)
145 | {
146 | colors[inverted ? size - 1 - i : i] = new Color32(baseColor.r, i, baseColor.b, 255);
147 | }
148 | break;
149 | case ColorValues.B:
150 | for (byte i = 0; i < size; i++)
151 | {
152 | colors[inverted ? size - 1 - i : i] = new Color32(baseColor.r, baseColor.g, i, 255);
153 | }
154 | break;
155 | case ColorValues.A:
156 | for (byte i = 0; i < size; i++)
157 | {
158 | colors[inverted ? size - 1 - i : i] = new Color32(i, i, i, 255);
159 | }
160 | break;
161 | case ColorValues.Hue:
162 | for (int i = 0; i < size; i++)
163 | {
164 | colors[inverted ? size - 1 - i : i] = HSVUtil.ConvertHsvToRgb(i, 1, 1, 1);
165 | }
166 | break;
167 | case ColorValues.Saturation:
168 | for (int i = 0; i < size; i++)
169 | {
170 | colors[inverted ? size - 1 - i : i] = HSVUtil.ConvertHsvToRgb(h * 360, (float)i / size, v, 1);
171 | }
172 | break;
173 | case ColorValues.Value:
174 | for (int i = 0; i < size; i++)
175 | {
176 | colors[inverted ? size - 1 - i : i] = HSVUtil.ConvertHsvToRgb(h * 360, s, (float)i / size, 1);
177 | }
178 | break;
179 | default:
180 | throw new System.NotImplementedException("");
181 | }
182 | texture.SetPixels32(colors);
183 | texture.Apply();
184 |
185 | if (image.texture != null)
186 | DestroyImmediate(image.texture);
187 | image.texture = texture;
188 |
189 | switch (direction)
190 | {
191 | case Slider.Direction.BottomToTop:
192 | case Slider.Direction.TopToBottom:
193 | image.uvRect = new Rect(0, 0, 2, 1);
194 | break;
195 | case Slider.Direction.LeftToRight:
196 | case Slider.Direction.RightToLeft:
197 | image.uvRect = new Rect(0, 0, 1, 2);
198 | break;
199 | default:
200 | break;
201 | }
202 | }
203 |
204 | }
205 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/ColorSliderImage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ca76dd9ad6eb204c9b0481aece34497
3 | timeCreated: 1442682013
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/HexColorField.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | [RequireComponent(typeof(InputField))]
5 | public class HexColorField : MonoBehaviour
6 | {
7 | public ColorPicker hsvpicker;
8 |
9 | public bool displayAlpha;
10 |
11 | private InputField hexInputField;
12 |
13 | private void Awake()
14 | {
15 | hexInputField = GetComponent();
16 |
17 | // Add listeners to keep text (and color) up to date
18 | hexInputField.onEndEdit.AddListener(UpdateColor);
19 | hsvpicker.onValueChanged.AddListener(UpdateHex);
20 | }
21 |
22 | private void OnDestroy()
23 | {
24 | hexInputField.onValueChanged.RemoveListener(UpdateColor);
25 | hsvpicker.onValueChanged.RemoveListener(UpdateHex);
26 | }
27 |
28 | private void UpdateHex(Color newColor)
29 | {
30 | hexInputField.text = ColorToHex(newColor);
31 | }
32 |
33 | private void UpdateColor(string newHex)
34 | {
35 | Color color;
36 | if (!newHex.StartsWith("#"))
37 | newHex = "#"+newHex;
38 | if (ColorUtility.TryParseHtmlString(newHex, out color))
39 | hsvpicker.CurrentColor = color;
40 | else
41 | Debug.Log("hex value is in the wrong format, valid formats are: #RGB, #RGBA, #RRGGBB and #RRGGBBAA (# is optional)");
42 | }
43 |
44 | private string ColorToHex(Color32 color)
45 | {
46 | return displayAlpha
47 | ? string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", color.r, color.g, color.b, color.a)
48 | : string.Format("#{0:X2}{1:X2}{2:X2}", color.r, color.g, color.b);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/HexColorField.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d85c534b3c1560544b09d0996dfeba84
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/SVBoxSlider.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 |
4 | [RequireComponent(typeof(BoxSlider), typeof(RawImage)), ExecuteInEditMode()]
5 | public class SVBoxSlider : MonoBehaviour
6 | {
7 | public ColorPicker picker;
8 |
9 | private BoxSlider slider;
10 | private RawImage image;
11 |
12 | private ComputeShader compute;
13 | private int kernelID;
14 | private RenderTexture renderTexture;
15 | private int textureWidth = 100;
16 | private int textureHeight = 100;
17 |
18 | private float lastH = -1;
19 | private bool listen = true;
20 |
21 | [SerializeField] private bool overrideComputeShader = false;
22 | private bool supportsComputeShaders = false;
23 |
24 | public RectTransform rectTransform
25 | {
26 | get
27 | {
28 | return transform as RectTransform;
29 | }
30 | }
31 |
32 | private void Awake()
33 | {
34 | slider = GetComponent();
35 | image = GetComponent();
36 | if(Application.isPlaying)
37 | {
38 | supportsComputeShaders = SystemInfo.supportsComputeShaders; //check for compute shader support
39 |
40 | #if PLATFORM_ANDROID
41 | supportsComputeShaders = false; //disable on android for now. Issue with compute shader
42 | #endif
43 |
44 | if (overrideComputeShader)
45 | {
46 | supportsComputeShaders = false;
47 | }
48 | if (supportsComputeShaders)
49 | InitializeCompute ();
50 | RegenerateSVTexture ();
51 | }
52 | }
53 |
54 | private void InitializeCompute()
55 | {
56 | if ( renderTexture == null )
57 | {
58 | renderTexture = new RenderTexture (textureWidth, textureHeight, 0, RenderTextureFormat.RGB111110Float);
59 | renderTexture.enableRandomWrite = true;
60 | renderTexture.Create ();
61 | }
62 |
63 | compute = Resources.Load ("Shaders/Compute/GenerateSVTexture");
64 | kernelID = compute.FindKernel ("CSMain");
65 |
66 | image.texture = renderTexture;
67 | }
68 |
69 |
70 | private void OnEnable()
71 | {
72 | if (Application.isPlaying && picker != null)
73 | {
74 | slider.onValueChanged.AddListener(SliderChanged);
75 | picker.onHSVChanged.AddListener(HSVChanged);
76 | }
77 | }
78 |
79 | private void OnDisable()
80 | {
81 | if (picker != null)
82 | {
83 | slider.onValueChanged.RemoveListener(SliderChanged);
84 | picker.onHSVChanged.RemoveListener(HSVChanged);
85 | }
86 | }
87 |
88 | private void OnDestroy()
89 | {
90 | if ( image.texture != null )
91 | {
92 | if ( supportsComputeShaders )
93 | renderTexture.Release ();
94 | else
95 | DestroyImmediate (image.texture);
96 | }
97 | }
98 |
99 | private void SliderChanged(float saturation, float value)
100 | {
101 | if (listen)
102 | {
103 | picker.AssignColor(ColorValues.Saturation, saturation);
104 | picker.AssignColor(ColorValues.Value, value);
105 | }
106 | listen = true;
107 | }
108 |
109 | private void HSVChanged(float h, float s, float v)
110 | {
111 | if (!lastH.Equals(h))
112 | {
113 | lastH = h;
114 | RegenerateSVTexture();
115 | }
116 |
117 | if (!s.Equals(slider.normalizedValue))
118 | {
119 | listen = false;
120 | slider.normalizedValue = s;
121 | }
122 |
123 | if (!v.Equals(slider.normalizedValueY))
124 | {
125 | listen = false;
126 | slider.normalizedValueY = v;
127 | }
128 | }
129 |
130 | private void RegenerateSVTexture()
131 | {
132 | if ( supportsComputeShaders )
133 | {
134 | float hue = picker != null ? picker.H : 0;
135 |
136 | compute.SetTexture (kernelID, "Texture", renderTexture);
137 | compute.SetFloats ("TextureSize", textureWidth, textureHeight);
138 | compute.SetFloat ("Hue", hue);
139 |
140 | var threadGroupsX = Mathf.CeilToInt (textureWidth / 32f);
141 | var threadGroupsY = Mathf.CeilToInt (textureHeight / 32f);
142 | compute.Dispatch (kernelID, threadGroupsX, threadGroupsY, 1);
143 | }
144 | else
145 | {
146 | double h = picker != null ? picker.H * 360 : 0;
147 |
148 | if ( image.texture != null )
149 | DestroyImmediate (image.texture);
150 |
151 | var texture = new Texture2D (textureWidth, textureHeight);
152 | texture.hideFlags = HideFlags.DontSave;
153 |
154 | for ( int s = 0; s < textureWidth; s++ )
155 | {
156 | Color32[] colors = new Color32[textureHeight];
157 | for ( int v = 0; v < textureHeight; v++ )
158 | {
159 | colors[v] = HSVUtil.ConvertHsvToRgb (h, (float)s / 100, (float)v / 100, 1);
160 | }
161 | texture.SetPixels32 (s, 0, 1, textureHeight, colors);
162 | }
163 | texture.Apply ();
164 |
165 | image.texture = texture;
166 | }
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UI/SVBoxSlider.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1e4240873631f724496efec97d7151b3
3 | timeCreated: 1442650713
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UtilityScripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2b33138f525222146865861432dbe845
3 | folderAsset: yes
4 | timeCreated: 1426051345
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UtilityScripts/BoxSlider.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 37c44bc94a9a7f241b5b552f3ff89458
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UtilityScripts/HSVUtil.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System;
3 |
4 |
5 |
6 | #region ColorUtilities
7 |
8 | public static class HSVUtil
9 | {
10 |
11 | public static HsvColor ConvertRgbToHsv(Color color)
12 | {
13 | return ConvertRgbToHsv((int)(color.r * 255), (int)(color.g * 255), (int)(color.b * 255));
14 | }
15 |
16 | //Converts an RGB color to an HSV color.
17 | public static HsvColor ConvertRgbToHsv(double r, double b, double g)
18 | {
19 | double delta, min;
20 | double h = 0, s, v;
21 |
22 | min = Math.Min(Math.Min(r, g), b);
23 | v = Math.Max(Math.Max(r, g), b);
24 | delta = v - min;
25 |
26 | if (v.Equals(0))
27 | s = 0;
28 | else
29 | s = delta / v;
30 |
31 | if (s.Equals(0))
32 | h = 360;
33 | else
34 | {
35 | if (r.Equals(v))
36 | h = (g - b) / delta;
37 | else if (g.Equals(v))
38 | h = 2 + (b - r) / delta;
39 | else if (b.Equals(v))
40 | h = 4 + (r - g) / delta;
41 |
42 | h *= 60;
43 | if (h <= 0.0)
44 | h += 360;
45 | }
46 |
47 | HsvColor hsvColor = new HsvColor();
48 | hsvColor.H = 360 - h;
49 | hsvColor.S = s;
50 | hsvColor.V = v / 255;
51 |
52 | return hsvColor;
53 |
54 | }
55 |
56 | // Converts an HSV color to an RGB color.
57 | public static Color ConvertHsvToRgb(double h, double s, double v, float alpha)
58 | {
59 |
60 | double r = 0, g = 0, b = 0;
61 |
62 | if (s.Equals(0))
63 | {
64 | r = v;
65 | g = v;
66 | b = v;
67 | }
68 |
69 | else
70 | {
71 | int i;
72 | double f, p, q, t;
73 |
74 |
75 | if (h.Equals(360))
76 | h = 0;
77 | else
78 | h = h / 60;
79 |
80 | i = (int)(h);
81 | f = h - i;
82 |
83 | p = v * (1.0 - s);
84 | q = v * (1.0 - (s * f));
85 | t = v * (1.0 - (s * (1.0f - f)));
86 |
87 |
88 | switch (i)
89 | {
90 | case 0:
91 | r = v;
92 | g = t;
93 | b = p;
94 | break;
95 |
96 | case 1:
97 | r = q;
98 | g = v;
99 | b = p;
100 | break;
101 |
102 | case 2:
103 | r = p;
104 | g = v;
105 | b = t;
106 | break;
107 |
108 | case 3:
109 | r = p;
110 | g = q;
111 | b = v;
112 | break;
113 |
114 | case 4:
115 | r = t;
116 | g = p;
117 | b = v;
118 | break;
119 |
120 | default:
121 | r = v;
122 | g = p;
123 | b = q;
124 | break;
125 | }
126 |
127 | }
128 |
129 | return new Color((float)r, (float)g, (float)b, alpha);
130 |
131 | }
132 | }
133 |
134 |
135 | #endregion ColorUtilities
136 |
137 |
138 | // Describes a color in terms of
139 | // Hue, Saturation, and Value (brightness)
140 | #region HsvColor
141 | public struct HsvColor
142 | {
143 | ///
144 | /// The Hue, ranges between 0 and 360
145 | ///
146 | public double H;
147 |
148 | ///
149 | /// The saturation, ranges between 0 and 1
150 | ///
151 | public double S;
152 |
153 | // The value (brightness), ranges between 0 and 1
154 | public double V;
155 |
156 | public float normalizedH
157 | {
158 | get
159 | {
160 | return (float)H / 360f;
161 | }
162 |
163 | set
164 | {
165 | H = (double)value * 360;
166 | }
167 | }
168 |
169 | public float normalizedS
170 | {
171 | get
172 | {
173 | return (float)S;
174 | }
175 | set
176 | {
177 | S = (double)value;
178 | }
179 | }
180 |
181 | public float normalizedV
182 | {
183 | get
184 | {
185 | return (float)V;
186 | }
187 | set
188 | {
189 | V = (double)value;
190 | }
191 | }
192 |
193 | public HsvColor(double h, double s, double v)
194 | {
195 | this.H = h;
196 | this.S = s;
197 | this.V = v;
198 | }
199 |
200 | public override string ToString()
201 | {
202 | return "{" + H.ToString("f2") + "," + S.ToString("f2") + "," + V.ToString("f2") + "}";
203 | }
204 | }
205 | #endregion HsvColor
206 |
207 |
208 |
209 |
210 |
--------------------------------------------------------------------------------
/Assets/HSVPicker/UtilityScripts/HSVUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f3189246d7fc204faba7a1e9c08e0af
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 |
--------------------------------------------------------------------------------
/Assets/Klak.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d80c83752a75c40649d0a3c49a424bd4
3 | folderAsset: yes
4 | timeCreated: 1452473625
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 859ace79004859e43b6a1dd03df4623c
3 | folderAsset: yes
4 | timeCreated: 1489805626
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5fd13eeb9a00a834790f92b9a2341a7f
3 | folderAsset: yes
4 | timeCreated: 1489591347
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1eb83b6d0a17012468dbaa921359f692
3 | folderAsset: yes
4 | timeCreated: 1489915446
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/ProcAmpEditor.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEditor;
3 |
4 | namespace Klak.Video
5 | {
6 | [CanEditMultipleObjects]
7 | [CustomEditor(typeof(ProcAmp))]
8 | public class ProcAmpEditor : Editor
9 | {
10 | SerializedProperty _sourceVideo;
11 | SerializedProperty _sourceTexture;
12 |
13 | SerializedProperty _brightness;
14 | SerializedProperty _contrast;
15 | SerializedProperty _saturation;
16 |
17 | SerializedProperty _temperature;
18 | SerializedProperty _tint;
19 |
20 | SerializedProperty _keying;
21 | SerializedProperty _keyColor;
22 | SerializedProperty _keyThreshold;
23 | SerializedProperty _keyTolerance;
24 | SerializedProperty _spillRemoval;
25 |
26 | SerializedProperty _trim;
27 | SerializedProperty _scale;
28 | SerializedProperty _offset;
29 |
30 | SerializedProperty _fadeToColor;
31 | SerializedProperty _opacity;
32 |
33 | SerializedProperty _targetTexture;
34 | SerializedProperty _targetImage;
35 | SerializedProperty _blitToScreen;
36 |
37 | static GUIContent _textTint = new GUIContent("Tint (cyan-purple)");
38 | static GUIContent _textThreshold = new GUIContent("Threshold");
39 | static GUIContent _textTolerance = new GUIContent("Tolerance");
40 | static GUIContent _textTrim = new GUIContent("Trim");
41 |
42 | static GUIContent[] _textsLTRB = {
43 | new GUIContent("L"), new GUIContent("T"),
44 | new GUIContent("R"), new GUIContent("B")
45 | };
46 |
47 | void OnEnable()
48 | {
49 | _sourceVideo = serializedObject.FindProperty("_sourceVideo");
50 | _sourceTexture = serializedObject.FindProperty("_sourceTexture");
51 |
52 | _brightness = serializedObject.FindProperty("_brightness");
53 | _contrast = serializedObject.FindProperty("_contrast");
54 | _saturation = serializedObject.FindProperty("_saturation");
55 |
56 | _temperature = serializedObject.FindProperty("_temperature");
57 | _tint = serializedObject.FindProperty("_tint");
58 |
59 | _keying = serializedObject.FindProperty("_keying");
60 | _keyColor = serializedObject.FindProperty("_keyColor");
61 | _keyThreshold = serializedObject.FindProperty("_keyThreshold");
62 | _keyTolerance = serializedObject.FindProperty("_keyTolerance");
63 | _spillRemoval = serializedObject.FindProperty("_spillRemoval");
64 |
65 | _trim = serializedObject.FindProperty("_trim");
66 | _scale = serializedObject.FindProperty("_scale");
67 | _offset = serializedObject.FindProperty("_offset");
68 |
69 | _fadeToColor = serializedObject.FindProperty("_fadeToColor");
70 | _opacity = serializedObject.FindProperty("_opacity");
71 |
72 | _targetTexture = serializedObject.FindProperty("_targetTexture");
73 | _targetImage = serializedObject.FindProperty("_targetImage");
74 | _blitToScreen = serializedObject.FindProperty("_blitToScreen");
75 | }
76 |
77 | public override void OnInspectorGUI()
78 | {
79 | serializedObject.Update();
80 |
81 | var procAmp = (ProcAmp)target;
82 |
83 | var showBoth = _sourceVideo.hasMultipleDifferentValues |
84 | _sourceTexture.hasMultipleDifferentValues;
85 |
86 | if (showBoth || _sourceTexture.objectReferenceValue == null)
87 | EditorGUILayout.PropertyField(_sourceVideo);
88 |
89 | if (showBoth || _sourceVideo.objectReferenceValue == null)
90 | EditorGUILayout.PropertyField(_sourceTexture);
91 |
92 | EditorGUILayout.Space();
93 |
94 | EditorGUILayout.PropertyField(_brightness);
95 | EditorGUILayout.PropertyField(_contrast);
96 | EditorGUILayout.PropertyField(_saturation);
97 |
98 | EditorGUILayout.Space();
99 |
100 | EditorGUILayout.PropertyField(_temperature);
101 | EditorGUILayout.PropertyField(_tint, _textTint);
102 |
103 | EditorGUILayout.Space();
104 |
105 | EditorGUILayout.PropertyField(_keying);
106 | EditorGUILayout.PropertyField(_keyColor);
107 |
108 | if (_keying.hasMultipleDifferentValues || _keying.boolValue)
109 | {
110 | EditorGUILayout.PropertyField(_keyThreshold, _textThreshold);
111 | EditorGUILayout.PropertyField(_keyTolerance, _textTolerance);
112 | EditorGUILayout.PropertyField(_spillRemoval);
113 | }
114 |
115 | EditorGUILayout.Space();
116 |
117 | Vector4Field(_trim, _textsLTRB, _textTrim);
118 | EditorGUILayout.PropertyField(_scale);
119 | EditorGUILayout.PropertyField(_offset);
120 |
121 | EditorGUILayout.Space();
122 |
123 | EditorGUILayout.PropertyField(_fadeToColor);
124 | EditorGUILayout.PropertyField(_opacity);
125 |
126 | if (procAmp.GetComponent() == null)
127 | {
128 | EditorGUILayout.Space();
129 | EditorGUILayout.PropertyField(_targetTexture);
130 | EditorGUILayout.PropertyField(_targetImage);
131 | EditorGUILayout.PropertyField(_blitToScreen);
132 | }
133 |
134 | serializedObject.ApplyModifiedProperties();
135 | }
136 |
137 | static void Vector4Field(SerializedProperty prop, GUIContent[] labels, GUIContent prefix)
138 | {
139 | var height = (EditorGUIUtility.wideMode ? 1 : 2) * EditorGUIUtility.singleLineHeight;
140 | var rect = EditorGUILayout.GetControlRect(true, height);
141 | var cur = prop.Copy();
142 | cur.NextVisible(true);
143 | EditorGUI.MultiPropertyField(rect, labels, cur, prefix);
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/ProcAmpEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f8ebc8d350193854aabfe55f8059be3a
3 | timeCreated: 1489973528
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/ProcAmpMaterialEditor.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.Rendering;
3 | using UnityEditor;
4 |
5 | namespace Klak.Video
6 | {
7 | class ProcAmpMaterialEditor : ShaderGUI
8 | {
9 | #region Private variables
10 |
11 | // Serialized properties
12 | MaterialProperty _mainTex;
13 | MaterialProperty _brightness;
14 | MaterialProperty _contrast;
15 | MaterialProperty _saturation;
16 | MaterialProperty _temperature;
17 | MaterialProperty _tint;
18 | MaterialProperty _keying;
19 | MaterialProperty _keyColor;
20 | MaterialProperty _keyThreshold;
21 | MaterialProperty _keyTolerance;
22 | MaterialProperty _spillRemoval;
23 | MaterialProperty _trim;
24 | MaterialProperty _scale;
25 | MaterialProperty _offset;
26 | MaterialProperty _fadeToColor;
27 | MaterialProperty _opacity;
28 |
29 | // Labels used in the trim property
30 | static GUIContent[] _textsLTRB = {
31 | new GUIContent("L"), new GUIContent("T"),
32 | new GUIContent("R"), new GUIContent("B")
33 | };
34 |
35 | #endregion
36 |
37 | #region Overridden methods
38 |
39 | // Inspector GUI function
40 | public override void OnGUI(MaterialEditor editor, MaterialProperty[] props)
41 | {
42 | // These references should be updated every time :(
43 | _mainTex = FindProperty("_MainTex", props);
44 | _brightness = FindProperty("_Brightness", props);
45 | _contrast = FindProperty("_Contrast", props);
46 | _saturation = FindProperty("_Saturation", props);
47 | _temperature = FindProperty("_Temperature", props);
48 | _tint = FindProperty("_Tint", props);
49 | _keying = FindProperty("_Keying", props);
50 | _keyColor = FindProperty("_KeyColor", props);
51 | _keyThreshold = FindProperty("_KeyThreshold", props);
52 | _keyTolerance = FindProperty("_KeyTolerance", props);
53 | _spillRemoval = FindProperty("_SpillRemoval", props);
54 | _trim = FindProperty("_Trim", props);
55 | _scale = FindProperty("_Scale", props);
56 | _offset = FindProperty("_Offset", props);
57 | _fadeToColor = FindProperty("_FadeToColor", props);
58 | _opacity = FindProperty("_Opacity", props);
59 |
60 | if (ShaderPropertiesGUI(editor.target as Material, editor))
61 | foreach (var m in _mainTex.targets)
62 | UpdateHiddenProperties((Material)m);
63 | }
64 |
65 | #endregion
66 |
67 | #region Private methods
68 |
69 | // GUI controls for properties
70 | // Returns true if the hidden properties should be updated.
71 | bool ShaderPropertiesGUI(Material material, MaterialEditor editor)
72 | {
73 | bool dirty = false;
74 |
75 | editor.TexturePropertySingleLine(new GUIContent("Source"), _mainTex);
76 |
77 | EditorGUILayout.Space();
78 |
79 | editor.ShaderProperty(_brightness, "Brightness");
80 | editor.ShaderProperty(_contrast, "Contrast");
81 | editor.ShaderProperty(_saturation, "Saturation");
82 |
83 | EditorGUILayout.Space();
84 |
85 | EditorGUI.BeginChangeCheck();
86 | editor.ShaderProperty(_temperature, "Temperature");
87 | editor.ShaderProperty(_tint, "Tint (cyan-purple)");
88 | dirty |= EditorGUI.EndChangeCheck();
89 |
90 | EditorGUILayout.Space();
91 |
92 | EditorGUI.BeginChangeCheck();
93 | editor.ShaderProperty(_keying, "Keying");
94 | editor.ShaderProperty(_keyColor, "Key Color");
95 | dirty |= EditorGUI.EndChangeCheck();
96 |
97 | if (_keying.floatValue > 0)
98 | {
99 | editor.ShaderProperty(_keyThreshold, "Threshold");
100 | editor.ShaderProperty(_keyTolerance, "Tolerance");
101 | editor.ShaderProperty(_spillRemoval, "Spill Removal");
102 | }
103 |
104 | EditorGUILayout.Space();
105 |
106 | EditorGUI.BeginChangeCheck();
107 | Vector4Field(_trim, _textsLTRB, "Trim");
108 | dirty |= EditorGUI.EndChangeCheck();
109 |
110 | Vector2Field(_scale, "Scale");
111 | Vector2Field(_offset, "Offset");
112 |
113 | EditorGUILayout.Space();
114 |
115 | editor.ShaderProperty(_fadeToColor, "Fade To Color");
116 |
117 | EditorGUI.BeginChangeCheck();
118 | editor.ShaderProperty(_opacity, "Opacity");
119 | dirty |= EditorGUI.EndChangeCheck();
120 |
121 | return dirty;
122 | }
123 |
124 | // Update the hidden properties based on the exposed ones.
125 | void UpdateHiddenProperties(Material material)
126 | {
127 | // Color balance
128 | var temp = material.GetFloat("_Temperature");
129 | var tint = material.GetFloat("_Tint");
130 | material.SetVector("_ColorBalance", ProcAmp.CalculateColorBalance(temp, tint));
131 |
132 | // Key color
133 | var ycgco = ProcAmp.RGB2YCgCo(material.GetColor("_KeyColor"));
134 | material.SetVector("_KeyCgCo", new Vector2(ycgco.y, ycgco.z));
135 |
136 | // Trimming
137 | var trim = material.GetVector("_Trim");
138 | material.SetVector("_TrimParams", new Vector4(
139 | trim.x, trim.w, 1 / (1 - trim.x - trim.z), 1 / (1 - trim.y - trim.w)
140 | ));
141 |
142 | if (material.GetFloat("_Opacity") == 1 && material.GetFloat("_Keying") == 0)
143 | {
144 | // Opaque
145 | material.SetInt("_SrcBlend", (int)BlendMode.One);
146 | material.SetInt("_DstBlend", (int)BlendMode.Zero);
147 | material.SetInt("_ZWrite", 1);
148 | material.SetOverrideTag("RenderType", "");
149 | material.renderQueue = -1;
150 | }
151 | else
152 | {
153 | // Transparent
154 | material.SetInt("_SrcBlend", (int)BlendMode.SrcAlpha);
155 | material.SetInt("_DstBlend", (int)BlendMode.OneMinusSrcAlpha);
156 | material.SetInt("_ZWrite", 0);
157 | material.SetOverrideTag("RenderType", "Transparent");
158 | material.renderQueue = (int)RenderQueue.Transparent;
159 | }
160 | }
161 |
162 | #endregion
163 |
164 | #region Special GUI controls
165 |
166 | static void Vector2Field(MaterialProperty prop, string label)
167 | {
168 | EditorGUI.BeginChangeCheck();
169 | EditorGUI.showMixedValue = prop.hasMixedValue;
170 | var newValue = EditorGUILayout.Vector2Field(label, prop.vectorValue);
171 | EditorGUI.showMixedValue = false;
172 | if (EditorGUI.EndChangeCheck()) prop.vectorValue = newValue;
173 | }
174 |
175 | static void Vector4Field(MaterialProperty prop, GUIContent[] labels, string prefix)
176 | {
177 | var height = (EditorGUIUtility.wideMode ? 1 : 2) * EditorGUIUtility.singleLineHeight;
178 | var rect = EditorGUILayout.GetControlRect(true, height);
179 |
180 | var v = prop.vectorValue;
181 | var fa = new [] { v.x, v.y, v.z, v.w };
182 |
183 | EditorGUI.BeginChangeCheck();
184 | EditorGUI.showMixedValue = prop.hasMixedValue;
185 | EditorGUI.MultiFloatField(rect, new GUIContent(prefix), labels, fa);
186 | EditorGUI.showMixedValue = false;
187 | if (EditorGUI.EndChangeCheck())
188 | prop.vectorValue = new Vector4(fa[0], fa[1], fa[2], fa[3]);
189 | }
190 |
191 | #endregion
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/ProcAmpMaterialEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7c269934dccf21548aa93ec1a33a456e
3 | timeCreated: 1489915446
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/Test Card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Klak/Video/ProcAmp/Editor/Test Card.png
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Editor/Test Card.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 84e27a62f23c2074fa3fff1f147cbc94
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 11
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 0
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 1
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 0
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 8
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | applyGammaDecoding: 1
61 | platformSettings:
62 | - serializedVersion: 3
63 | buildTarget: DefaultTexturePlatform
64 | maxTextureSize: 2048
65 | resizeAlgorithm: 0
66 | textureFormat: -1
67 | textureCompression: 0
68 | compressionQuality: 50
69 | crunchedCompression: 0
70 | allowsAlphaSplitting: 0
71 | overridden: 0
72 | androidETC2FallbackOverride: 0
73 | forceMaximumCompressionQuality_BC6H_BC7: 1
74 | - serializedVersion: 3
75 | buildTarget: Standalone
76 | maxTextureSize: 2048
77 | resizeAlgorithm: 0
78 | textureFormat: -1
79 | textureCompression: 0
80 | compressionQuality: 50
81 | crunchedCompression: 0
82 | allowsAlphaSplitting: 0
83 | overridden: 0
84 | androidETC2FallbackOverride: 0
85 | forceMaximumCompressionQuality_BC6H_BC7: 1
86 | spriteSheet:
87 | serializedVersion: 2
88 | sprites: []
89 | outline: []
90 | physicsShape: []
91 | bones: []
92 | spriteID: 5e97eb03825dee720800000000000000
93 | internalID: 0
94 | vertices: []
95 | indices:
96 | edges: []
97 | weights: []
98 | secondaryTextures: []
99 | spritePackingTag:
100 | pSDRemoveMatte: 0
101 | pSDShowRemoveMatteOption: 0
102 | userData:
103 | assetBundleName:
104 | assetBundleVariant:
105 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/ProcAmp.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c6340f3f997b9424b88bf87bae7ff08c
3 | timeCreated: 1489992008
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences:
8 | - _sourceVideo: {instanceID: 0}
9 | - _sourceTexture: {instanceID: 0}
10 | - _targetTexture: {instanceID: 0}
11 | - _targetImage: {instanceID: 0}
12 | - _shader: {fileID: 4800000, guid: fba7492978666a044b5985682ffa5cb5, type: 3}
13 | - _quadMesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
14 | - _offlineTexture: {fileID: 2800000, guid: 84e27a62f23c2074fa3fff1f147cbc94, type: 3}
15 | executionOrder: 0
16 | icon: {instanceID: 0}
17 | userData:
18 | assetBundleName:
19 | assetBundleVariant:
20 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 038acc682b1a66b4c85e5ecfb9ca44aa
3 | folderAsset: yes
4 | timeCreated: 1489591530
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmp.cginc:
--------------------------------------------------------------------------------
1 | #include "UnityCG.cginc"
2 |
3 | sampler2D _MainTex;
4 | float4 _MainTex_TexelSize;
5 |
6 | half _Brightness;
7 | half _Contrast;
8 | half _Saturation;
9 |
10 | half4 _ColorBalance;
11 |
12 | half2 _KeyCgCo;
13 | half _KeyThreshold;
14 | half _KeyTolerance;
15 | half _SpillRemoval;
16 |
17 | float4 _TrimParams;
18 | float2 _Scale;
19 | float2 _Offset;
20 |
21 | half4 _FadeToColor; // given in gamma
22 | half _Opacity;
23 |
24 | // RGB <-> YCgCo color space conversion
25 | half3 RGB2YCgCo(half3 rgb)
26 | {
27 | half3x3 m = {
28 | 0.25, 0.5, 0.25,
29 | -0.25, 0.5, -0.25,
30 | 0.50, 0.0, -0.50
31 | };
32 | return mul(m, rgb);
33 | }
34 |
35 | half3 YCgCo2RGB(half3 ycgco)
36 | {
37 | return half3(
38 | ycgco.x - ycgco.y + ycgco.z,
39 | ycgco.x + ycgco.y,
40 | ycgco.x - ycgco.y - ycgco.z
41 | );
42 | }
43 |
44 | // Color space conversion between linear RGB and LMS
45 | // based on the CIECAM02 model (CAT02).
46 | // http://en.wikipedia.org/wiki/LMS_color_space#CAT02
47 | half3 LRGB2LMS(half3 lrgb)
48 | {
49 | half3x3 m = {
50 | 3.90405e-1f, 5.49941e-1f, 8.92632e-3f,
51 | 7.08416e-2f, 9.63172e-1f, 1.35775e-3f,
52 | 2.31082e-2f, 1.28021e-1f, 9.36245e-1f
53 | };
54 | return mul(m, lrgb);
55 | }
56 |
57 | half3 LMS2LRGB(half3 lms)
58 | {
59 | half3x3 m = {
60 | 2.85847e+0f, -1.62879e+0f, -2.48910e-2f,
61 | -2.10182e-1f, 1.15820e+0f, 3.24281e-4f,
62 | -4.18120e-2f, -1.18169e-1f, 1.06867e+0f
63 | };
64 | return mul(m, lms);
65 | }
66 |
67 | // Chroma keying function
68 | half ChromaKeyAt(float2 uv)
69 | {
70 | half3 rgb = tex2D(_MainTex, uv);
71 |
72 | #if !defined(UNITY_COLORSPACE_GAMMA)
73 | rgb = LinearToGammaSpace(rgb);
74 | #endif
75 |
76 | half3 ycgco = RGB2YCgCo(rgb);
77 |
78 | // Chroma distance
79 | half d = distance(ycgco.yz, _KeyCgCo) * 10;
80 |
81 | return smoothstep(_KeyThreshold, _KeyThreshold + _KeyTolerance, d);
82 | }
83 |
84 | // Main ProcAmp function
85 | half4 ProcAmp(float2 uv)
86 | {
87 | half4 src = tex2D(_MainTex, uv);
88 | half3 rgb = src.rgb;
89 |
90 | #if defined(_KEYING)
91 |
92 | #if !defined(UNITY_COLORSPACE_GAMMA)
93 | rgb = LinearToGammaSpace(rgb);
94 | #endif
95 |
96 | // --vv-- gamma color --vv--
97 |
98 | // Calculate keys for surrounding four points and get the minima of them.
99 | // This works like a blur and dilate filter.
100 | float4 duv = _MainTex_TexelSize.xyxy * float4(-0.5, -0.5, 0.5, 0.5);
101 | half alpha = ChromaKeyAt(uv + duv.xy);
102 | alpha = min(alpha, ChromaKeyAt(uv + duv.zy));
103 | alpha = min(alpha, ChromaKeyAt(uv + duv.xw));
104 | alpha = min(alpha, ChromaKeyAt(uv + duv.zw));
105 |
106 | // Spill removal
107 | // What the following lines do is flattening the CgCo chroma values
108 | // so that dot(ycgco, _KeyCgCo) == 0.5. This shifts colors toward
109 | // the anticolor of the key color.
110 | half3 ycgco = RGB2YCgCo(rgb);
111 | half sub = dot(_KeyCgCo, ycgco.yz) / dot(_KeyCgCo, _KeyCgCo);
112 | ycgco.yz -= _KeyCgCo * (sub + 0.5) * _SpillRemoval;
113 | rgb = YCgCo2RGB(ycgco);
114 |
115 | #else
116 | half alpha = src.a;
117 | #endif
118 |
119 | #if defined(_KEYING) || defined(UNITY_COLORSPACE_GAMMA)
120 | rgb = GammaToLinearSpace(rgb);
121 | #endif
122 |
123 | // --vv-- linear color --vv--
124 |
125 | // Color balance
126 | rgb = saturate(LMS2LRGB(LRGB2LMS(rgb) * _ColorBalance));
127 |
128 | rgb = LinearToGammaSpace(rgb);
129 |
130 | // --vv-- gamma color --vv--
131 |
132 | // Brightness
133 | rgb = saturate(rgb + _Brightness);
134 |
135 | // Contrast
136 | rgb = saturate((rgb - 0.5) * _Contrast + 0.5);
137 |
138 | // Saturation
139 | half l = dot(rgb, half3(0.2126, 0.7152, 0.0722));
140 | rgb = saturate(lerp((half3)l, rgb, _Saturation));
141 |
142 | // Fade to color
143 | rgb = lerp(rgb, _FadeToColor.rgb, _FadeToColor.a);
144 |
145 | // Trimming
146 | half2 ob = abs(floor((uv - _TrimParams.xy) * _TrimParams.zw));
147 | half mask = saturate(1 - ob.x - ob.y);
148 |
149 | #if !defined(UNITY_COLORSPACE_GAMMA)
150 | rgb = GammaToLinearSpace(rgb);
151 | #endif
152 |
153 | return half4(rgb, alpha * _Opacity) * mask;
154 | }
155 |
156 | // Utilities for vertex shaders
157 |
158 | // UV coordinate transformation
159 | float2 TransformUV(float2 uv)
160 | {
161 | return (uv - _Offset - 0.5) / _Scale + 0.5;
162 | }
163 |
164 | // Aspect ratio conversion coefficient
165 | float AspectConversion()
166 | {
167 | float scr_aspect = _ScreenParams.y * (_ScreenParams.z - 1);
168 | float tex_rcp_aspect = _MainTex_TexelSize.y * _MainTex_TexelSize.z;
169 | return scr_aspect * tex_rcp_aspect;
170 | }
171 |
172 | float2 VertexAspectConversion()
173 | {
174 | float coeff = AspectConversion();
175 | return lerp(float2(coeff, 1), float2(1, 1 / coeff), coeff > 1);
176 | }
177 |
178 | float2 UVAspectConversion()
179 | {
180 | float coeff = AspectConversion();
181 | return lerp(float2(1 / coeff, 1), float2(1, coeff), coeff > 1);
182 | }
183 |
184 | // Move a quad to the near screen plane.
185 | float4 NearPlaneQuad(float4 vertex)
186 | {
187 | float4 p = UnityViewToClipPos(float4(vertex.xy, -1, 1));
188 | p.xy /= abs(p.xy);
189 | return p;
190 | }
191 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmp.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 49834d3a57fb15646944bb9222b2fd5c
3 | timeCreated: 1489591307
4 | licenseType: Pro
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmp.shader:
--------------------------------------------------------------------------------
1 | Shader "Klak/Video/ProcAmp"
2 | {
3 | Properties
4 | {
5 | _MainTex("", 2D) = "gray" {}
6 |
7 | // Basic adjustment
8 | _Brightness("", Range(-1, 1)) = 0
9 | _Contrast("", Range(-1, 2)) = 1
10 | _Saturation("", Range(0, 2)) = 1
11 |
12 | // Color balance
13 | [HideInInspector] _Temperature("", Range(-1, 1)) = 0
14 | [HideInInspector] _Tint("", Range(-1, 1)) = 0
15 | _ColorBalance("", Vector) = (1, 1, 1, 1)
16 |
17 | // Keying
18 | [Toggle(_KEYING)] _Keying("", Float) = 0
19 | [HideInInspector] _KeyColor("", Color) = (0, 1, 0, 0)
20 | _KeyCgCo("", Vector) = (0, 0, 0, 0)
21 | _KeyThreshold("", Range(0, 1)) = 0.5
22 | _KeyTolerance("", Range(0, 1)) = 0.2
23 | _SpillRemoval("", Range(0, 1)) = 0.5
24 |
25 | // Transform
26 | _Trim("", Vector) = (0, 0, 0, 0)
27 | [HideInInspector] _TrimParams("", Vector) = (0, 0, 0, 0)
28 | _Scale("", Vector) = (1, 1, 1, 1)
29 | _Offset("", Vector) = (0, 0, 0, 0)
30 |
31 | // Final tweaks
32 | [Gamma] _FadeToColor("", Color) = (0, 0, 0, 0)
33 | _Opacity("", Range(0, 1)) = 1
34 |
35 | // Blend mode control
36 | [HideInInspector] _SrcBlend("", Int) = 1
37 | [HideInInspector] _DstBlend("", Int) = 0
38 | [HideInInspector] _ZWrite("", Int) = 1
39 | }
40 | SubShader
41 | {
42 | Tags { "RenderType"="Opaque" }
43 | Pass
44 | {
45 | Blend [_SrcBlend] [_DstBlend]
46 | ZWrite [_Zwrite]
47 |
48 | CGPROGRAM
49 |
50 | #pragma vertex vert
51 | #pragma fragment frag
52 |
53 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA
54 | #pragma shader_feature _KEYING
55 |
56 | #include "ProcAmp.cginc"
57 |
58 | v2f_img vert(appdata_img v)
59 | {
60 | v2f_img o;
61 | o.pos = UnityObjectToClipPos(v.vertex);
62 | o.uv = TransformUV(v.texcoord);
63 | return o;
64 | }
65 |
66 | half4 frag(v2f_img i) : SV_Target
67 | {
68 | return ProcAmp(i.uv);
69 | }
70 |
71 | ENDCG
72 | }
73 | }
74 | CustomEditor "Klak.Video.ProcAmpMaterialEditor"
75 | }
76 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmp.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 07f5a8f5289b32245979ab54130524f6
3 | timeCreated: 1489911230
4 | licenseType: Pro
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmpBlit.shader:
--------------------------------------------------------------------------------
1 | Shader "Hidden/Klak/Video/ProcAmp Blit"
2 | {
3 | Properties
4 | {
5 | _MainTex("", 2D) = "gray" {}
6 | _BaseTex("", 2D) = "gray" {}
7 | _SrcBlend("", Int) = 1
8 | _DstBlend("", Int) = 0
9 | }
10 |
11 | SubShader
12 | {
13 | Cull Off ZWrite Off ZTest Always
14 |
15 | // ProcAmp with simple blit
16 | Pass
17 | {
18 | CGPROGRAM
19 |
20 | #pragma vertex vert
21 | #pragma fragment frag
22 |
23 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA
24 | #pragma multi_compile _ _KEYING
25 |
26 | #include "ProcAmp.cginc"
27 |
28 | v2f_img vert(appdata_img v)
29 | {
30 | v2f_img o;
31 | o.pos = UnityObjectToClipPos(v.vertex);
32 | o.uv = TransformUV(v.texcoord);
33 | return o;
34 | }
35 |
36 | half4 frag(v2f_img i) : SV_Target
37 | {
38 | return ProcAmp(i.uv);
39 | }
40 |
41 | ENDCG
42 | }
43 |
44 | // ProcAmp with screen blit
45 | Pass
46 | {
47 | Blend [_SrcBlend] [_DstBlend]
48 |
49 | CGPROGRAM
50 |
51 | #pragma vertex vert
52 | #pragma fragment frag
53 |
54 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA
55 | #pragma multi_compile _ _KEYING
56 |
57 | #include "ProcAmp.cginc"
58 |
59 | v2f_img vert(appdata_img v)
60 | {
61 | v2f_img o;
62 | o.pos = NearPlaneQuad(v.vertex);
63 | o.pos.xy *= VertexAspectConversion();
64 | o.uv = TransformUV(v.texcoord);
65 | return o;
66 | }
67 |
68 | half4 frag(v2f_img i) : SV_Target
69 | {
70 | return ProcAmp(i.uv);
71 | }
72 |
73 | ENDCG
74 | }
75 |
76 | // Simple screen blit
77 | Pass
78 | {
79 | Blend [_SrcBlend] [_DstBlend]
80 |
81 | CGPROGRAM
82 |
83 | #pragma vertex vert
84 | #pragma fragment frag
85 |
86 | #include "ProcAmp.cginc"
87 |
88 | v2f_img vert(appdata_img v)
89 | {
90 | v2f_img o;
91 | o.pos = NearPlaneQuad(v.vertex);
92 | o.pos.xy *= VertexAspectConversion();
93 | o.uv = v.texcoord;
94 | return o;
95 | }
96 |
97 | half4 frag(v2f_img i) : SV_Target
98 | {
99 | return tex2D(_MainTex, i.uv);
100 | }
101 |
102 | ENDCG
103 | }
104 |
105 | // ProcAmp as an image effect
106 | Pass
107 | {
108 | CGPROGRAM
109 |
110 | #pragma vertex vert
111 | #pragma fragment frag
112 |
113 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA
114 | #pragma multi_compile _ _KEYING
115 |
116 | #include "ProcAmp.cginc"
117 |
118 | sampler2D _BaseTex;
119 |
120 | struct v2f
121 | {
122 | float4 vertex : SV_POSITION;
123 | float2 uv0 : TEXCOORD0;
124 | float2 uv1 : TEXCOORD1;
125 | };
126 |
127 | v2f vert(appdata_img v)
128 | {
129 | v2f o;
130 | o.vertex = UnityObjectToClipPos(v.vertex);
131 | o.uv0 = TransformUV((v.texcoord - 0.5) * UVAspectConversion() + 0.5);
132 | o.uv1 = v.texcoord;
133 | return o;
134 | }
135 |
136 | half4 frag(v2f i) : SV_Target
137 | {
138 | half4 cv = ProcAmp(i.uv0);
139 | half4 cb = tex2D(_BaseTex, i.uv1);
140 | return half4(lerp(cb.rgb, cv.rgb, cv.a), cv.a);
141 | }
142 |
143 | ENDCG
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/Assets/Klak/Video/ProcAmp/Shaders/ProcAmpBlit.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fba7492978666a044b5985682ffa5cb5
3 | timeCreated: 1489936442
4 | licenseType: Pro
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PlayerPrefsX.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e8dbc559c69ee0a42ba28c58d512fb6b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/PlayerPrefsX/PlayerPrefsX.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fcd34d29b0bb27241ba8e3800379b3f3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6f8b85e0c6c636741a68cbb1825df8bc
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Resources/DOTweenSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 16995157, guid: a811bde74b26b53498b4f6d872b09b6d, type: 3}
13 | m_Name: DOTweenSettings
14 | m_EditorClassIdentifier:
15 | useSafeMode: 1
16 | safeModeOptions:
17 | nestedTweenFailureBehaviour: 0
18 | timeScale: 1
19 | useSmoothDeltaTime: 0
20 | maxSmoothUnscaledTime: 0.15
21 | rewindCallbackMode: 0
22 | showUnityEditorReport: 0
23 | logBehaviour: 0
24 | drawGizmos: 1
25 | defaultRecyclable: 0
26 | defaultAutoPlay: 3
27 | defaultUpdateType: 0
28 | defaultTimeScaleIndependent: 0
29 | defaultEaseType: 6
30 | defaultEaseOvershootOrAmplitude: 1.70158
31 | defaultEasePeriod: 0
32 | defaultAutoKill: 1
33 | defaultLoopType: 0
34 | showPreviewPanel: 1
35 | storeSettingsLocation: 0
36 | modules:
37 | showPanel: 0
38 | audioEnabled: 1
39 | physicsEnabled: 1
40 | physics2DEnabled: 1
41 | spriteEnabled: 1
42 | uiEnabled: 1
43 | textMeshProEnabled: 0
44 | tk2DEnabled: 0
45 | showPlayingTweens: 0
46 | showPausedTweens: 0
47 |
--------------------------------------------------------------------------------
/Assets/Resources/DOTweenSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 11ae09a93e5e18943a2a270ca613690d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 216674d055344a74194c0a2d54f1badc
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test/Keying.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3b0bc52b6965129448f458c8d890ec9e
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test/Keying/KeyingMat.mat:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!21 &2100000
4 | Material:
5 | serializedVersion: 6
6 | m_ObjectHideFlags: 0
7 | m_CorrespondingSourceObject: {fileID: 0}
8 | m_PrefabInstance: {fileID: 0}
9 | m_PrefabAsset: {fileID: 0}
10 | m_Name: KeyingMat
11 | m_Shader: {fileID: 4800000, guid: 07f5a8f5289b32245979ab54130524f6, type: 3}
12 | m_ShaderKeywords: _KEYING
13 | m_LightmapFlags: 4
14 | m_EnableInstancingVariants: 0
15 | m_DoubleSidedGI: 0
16 | m_CustomRenderQueue: 3000
17 | stringTagMap:
18 | RenderType: Transparent
19 | disabledShaderPasses: []
20 | m_SavedProperties:
21 | serializedVersion: 3
22 | m_TexEnvs:
23 | - _MainTex:
24 | m_Texture: {fileID: 2800000, guid: bb0b99a8c02e0b24e9d8f3634b3502bf, type: 3}
25 | m_Scale: {x: 1, y: 1}
26 | m_Offset: {x: 0, y: 0}
27 | m_Floats:
28 | - _Brightness: -0.15515137
29 | - _Contrast: 1.2272725
30 | - _DstBlend: 10
31 | - _KeyThreshold: 1
32 | - _KeyTolerance: 1
33 | - _Keying: 1
34 | - _Opacity: 1
35 | - _Saturation: 1
36 | - _SpillRemoval: 0
37 | - _SrcBlend: 5
38 | - _Temperature: 0
39 | - _Tint: 0
40 | - _ZWrite: 0
41 | m_Colors:
42 | - _ColorBalance: {r: 1.0000004, g: 0.9999993, b: 1.0000035, a: 0}
43 | - _FadeToColor: {r: 0, g: 0, b: 0, a: 0}
44 | - _KeyCgCo: {r: 0.2724203, g: -0.000000014901161, b: 0, a: 0}
45 | - _KeyColor: {r: 0, g: 1, b: 0, a: 1}
46 | - _Offset: {r: 0, g: 0, b: 0, a: 0}
47 | - _Scale: {r: 1, g: 1, b: 1, a: 1}
48 | - _Trim: {r: 0, g: 0, b: 0, a: 0}
49 | - _TrimParams: {r: 0, g: 0, b: 1, a: 1}
50 |
--------------------------------------------------------------------------------
/Assets/Test/Keying/KeyingMat.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5715076ad736ae84c8d23c5104d18d02
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2100000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test/Keying/Test_Keying.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2f9dbfeeec28d4d408f5ea05e5ac5f50
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Test/Keying/chroma-key-2096590_1280.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/Assets/Test/Keying/chroma-key-2096590_1280.jpg
--------------------------------------------------------------------------------
/Assets/Test/Keying/chroma-key-2096590_1280.jpg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bb0b99a8c02e0b24e9d8f3634b3502bf
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | externalObjects: {}
6 | serializedVersion: 7
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | - serializedVersion: 2
95 | buildTarget: Windows Store Apps
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | - serializedVersion: 2
106 | buildTarget: WebGL
107 | maxTextureSize: 2048
108 | resizeAlgorithm: 0
109 | textureFormat: -1
110 | textureCompression: 1
111 | compressionQuality: 50
112 | crunchedCompression: 0
113 | allowsAlphaSplitting: 0
114 | overridden: 0
115 | androidETC2FallbackOverride: 0
116 | spriteSheet:
117 | serializedVersion: 2
118 | sprites: []
119 | outline: []
120 | physicsShape: []
121 | bones: []
122 | spriteID:
123 | vertices: []
124 | indices:
125 | edges: []
126 | weights: []
127 | spritePackingTag:
128 | pSDRemoveMatte: 0
129 | pSDShowRemoveMatteOption: 0
130 | userData:
131 | assetBundleName:
132 | assetBundleVariant:
133 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoAnim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ddede1e04bef8264383cfc8aa451e468
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoAnim/Test_PhotoAnim.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 99c9720ab356a0642a771bea13969a05
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoAnim/Test_PhotoAnimController.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | public class Test_PhotoAnimController : MonoBehaviour
6 | {
7 |
8 | public PhotoAnimController photoAnimController;
9 |
10 | public KeyCode key_playCountDownAnim = KeyCode.A;
11 |
12 | void Start()
13 | {
14 |
15 | photoAnimController = FindObjectOfType();
16 | photoAnimController.Init();
17 |
18 | }
19 |
20 | void OnEnable()
21 | {
22 | PhotoAnimController.OnCountDownFinish += HandleCountDownFinish;
23 | PhotoAnimController.OnShotFinish += HandleShotFinish;
24 | }
25 |
26 | void OnDisable()
27 | {
28 | PhotoAnimController.OnCountDownFinish -= HandleCountDownFinish;
29 | PhotoAnimController.OnShotFinish -= HandleShotFinish;
30 | }
31 |
32 | void Update()
33 | {
34 |
35 | if (Input.GetKeyDown(key_playCountDownAnim))
36 | {
37 | photoAnimController.PlayCountDownAnim();
38 | }
39 | }
40 |
41 | void HandleCountDownFinish()
42 | {
43 | Debug.Log("Count Down Finish!");
44 | photoAnimController.PlayShotAnim();
45 | }
46 |
47 | void HandleShotFinish()
48 | {
49 | Debug.Log("Shot Finish!");
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoAnim/Test_PhotoAnimController.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9a883717c86b9814cbf1cb0ea39a5c94
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoTool.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c31450749c19b4a4099c949fc9dbc6ec
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoTool/Test_PhotoTool.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using UnityEngine.UI;
5 |
6 | public class Test_PhotoTool : MonoBehaviour {
7 |
8 | public int startX = 0;
9 | public int startY = 0;
10 | public int width = 1080;
11 | public int height = 1080;
12 |
13 | public PhotoTool photoTool;
14 |
15 | public RawImage rImg_photo;
16 |
17 | public KeyCode key_takePhoto = KeyCode.B;
18 |
19 | void OnEnable()
20 | {
21 | PhotoTool.OnPhotoTaken += HandlePhotoTaken;
22 | }
23 |
24 | void OnDisable()
25 | {
26 | PhotoTool.OnPhotoTaken -= HandlePhotoTaken;
27 | }
28 |
29 | void Start () {
30 |
31 | photoTool = FindObjectOfType();
32 | photoTool.Init(startX, startY, width, height);
33 |
34 | }
35 |
36 | void Update () {
37 |
38 | if (Input.GetKeyDown(key_takePhoto))
39 | {
40 | photoTool.TakePhoto();
41 | }
42 | }
43 |
44 | void HandlePhotoTaken(Texture2D _takenPhoto)
45 | {
46 | rImg_photo.texture = _takenPhoto;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoTool/Test_PhotoTool.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 360434afb2f56674088f8239244d29d0
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Test/PhotoTool/Test_PhotoTool.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9ad35f74d818f514082ff9cb8f375ca5
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/gm_PhotoTool.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5e02e1cab647508499ade2d7f4ba5ba4
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Logs/Packages-Update.log:
--------------------------------------------------------------------------------
1 |
2 | === Sun May 16 20:56:28 2021
3 |
4 | Packages were changed.
5 | Update Mode: updateDependencies
6 |
7 | The following packages were added:
8 | com.unity.2d.sprite@1.0.0
9 | com.unity.2d.tilemap@1.0.0
10 | com.unity.collab-proxy@1.2.16
11 | com.unity.ide.rider@1.1.4
12 | com.unity.ide.vscode@1.2.3
13 | com.unity.modules.androidjni@1.0.0
14 | com.unity.multiplayer-hlapi@1.0.6
15 | com.unity.test-framework@1.1.19
16 | com.unity.timeline@1.2.6
17 | com.unity.ugui@1.0.0
18 | com.unity.xr.legacyinputhelpers@2.1.6
19 | The following packages were updated:
20 | com.unity.ads from version 2.0.8 to 3.5.2
21 | com.unity.analytics from version 2.0.16 to 3.3.5
22 | com.unity.purchasing from version 2.0.3 to 2.2.1
23 | com.unity.textmeshpro from version 1.2.4 to 2.0.1
24 | The following packages were removed:
25 | com.unity.package-manager-ui@1.9.11
26 |
--------------------------------------------------------------------------------
/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.2d.sprite": "1.0.0",
4 | "com.unity.2d.tilemap": "1.0.0",
5 | "com.unity.ads": "3.5.2",
6 | "com.unity.analytics": "3.3.5",
7 | "com.unity.collab-proxy": "1.2.16",
8 | "com.unity.ide.rider": "1.1.4",
9 | "com.unity.ide.vscode": "1.2.3",
10 | "com.unity.multiplayer-hlapi": "1.0.6",
11 | "com.unity.purchasing": "2.2.1",
12 | "com.unity.test-framework": "1.1.19",
13 | "com.unity.textmeshpro": "2.0.1",
14 | "com.unity.timeline": "1.2.6",
15 | "com.unity.ugui": "1.0.0",
16 | "com.unity.xr.legacyinputhelpers": "2.1.6",
17 | "com.unity.modules.ai": "1.0.0",
18 | "com.unity.modules.androidjni": "1.0.0",
19 | "com.unity.modules.animation": "1.0.0",
20 | "com.unity.modules.assetbundle": "1.0.0",
21 | "com.unity.modules.audio": "1.0.0",
22 | "com.unity.modules.cloth": "1.0.0",
23 | "com.unity.modules.director": "1.0.0",
24 | "com.unity.modules.imageconversion": "1.0.0",
25 | "com.unity.modules.imgui": "1.0.0",
26 | "com.unity.modules.jsonserialize": "1.0.0",
27 | "com.unity.modules.particlesystem": "1.0.0",
28 | "com.unity.modules.physics": "1.0.0",
29 | "com.unity.modules.physics2d": "1.0.0",
30 | "com.unity.modules.screencapture": "1.0.0",
31 | "com.unity.modules.terrain": "1.0.0",
32 | "com.unity.modules.terrainphysics": "1.0.0",
33 | "com.unity.modules.tilemap": "1.0.0",
34 | "com.unity.modules.ui": "1.0.0",
35 | "com.unity.modules.uielements": "1.0.0",
36 | "com.unity.modules.umbra": "1.0.0",
37 | "com.unity.modules.unityanalytics": "1.0.0",
38 | "com.unity.modules.unitywebrequest": "1.0.0",
39 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
40 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
41 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
42 | "com.unity.modules.unitywebrequestwww": "1.0.0",
43 | "com.unity.modules.vehicles": "1.0.0",
44 | "com.unity.modules.video": "1.0.0",
45 | "com.unity.modules.vr": "1.0.0",
46 | "com.unity.modules.wind": "1.0.0",
47 | "com.unity.modules.xr": "1.0.0"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Packages/packages-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.2d.sprite": {
4 | "version": "1.0.0",
5 | "depth": 0,
6 | "source": "builtin",
7 | "dependencies": {}
8 | },
9 | "com.unity.2d.tilemap": {
10 | "version": "1.0.0",
11 | "depth": 0,
12 | "source": "builtin",
13 | "dependencies": {}
14 | },
15 | "com.unity.ads": {
16 | "version": "3.5.2",
17 | "depth": 0,
18 | "source": "registry",
19 | "dependencies": {
20 | "com.unity.ugui": "1.0.0"
21 | },
22 | "url": "https://packages.unity.com"
23 | },
24 | "com.unity.analytics": {
25 | "version": "3.3.5",
26 | "depth": 0,
27 | "source": "registry",
28 | "dependencies": {
29 | "com.unity.ugui": "1.0.0"
30 | },
31 | "url": "https://packages.unity.com"
32 | },
33 | "com.unity.collab-proxy": {
34 | "version": "1.2.16",
35 | "depth": 0,
36 | "source": "registry",
37 | "dependencies": {},
38 | "url": "https://packages.unity.com"
39 | },
40 | "com.unity.ext.nunit": {
41 | "version": "1.0.5",
42 | "depth": 1,
43 | "source": "registry",
44 | "dependencies": {},
45 | "url": "https://packages.unity.com"
46 | },
47 | "com.unity.ide.rider": {
48 | "version": "1.1.4",
49 | "depth": 0,
50 | "source": "registry",
51 | "dependencies": {
52 | "com.unity.test-framework": "1.1.1"
53 | },
54 | "url": "https://packages.unity.com"
55 | },
56 | "com.unity.ide.vscode": {
57 | "version": "1.2.3",
58 | "depth": 0,
59 | "source": "registry",
60 | "dependencies": {},
61 | "url": "https://packages.unity.com"
62 | },
63 | "com.unity.multiplayer-hlapi": {
64 | "version": "1.0.6",
65 | "depth": 0,
66 | "source": "registry",
67 | "dependencies": {
68 | "nuget.mono-cecil": "0.1.6-preview"
69 | },
70 | "url": "https://packages.unity.com"
71 | },
72 | "com.unity.purchasing": {
73 | "version": "2.2.1",
74 | "depth": 0,
75 | "source": "registry",
76 | "dependencies": {
77 | "com.unity.ugui": "1.0.0"
78 | },
79 | "url": "https://packages.unity.com"
80 | },
81 | "com.unity.test-framework": {
82 | "version": "1.1.19",
83 | "depth": 0,
84 | "source": "registry",
85 | "dependencies": {
86 | "com.unity.ext.nunit": "1.0.5",
87 | "com.unity.modules.imgui": "1.0.0",
88 | "com.unity.modules.jsonserialize": "1.0.0"
89 | },
90 | "url": "https://packages.unity.com"
91 | },
92 | "com.unity.textmeshpro": {
93 | "version": "2.0.1",
94 | "depth": 0,
95 | "source": "registry",
96 | "dependencies": {
97 | "com.unity.ugui": "1.0.0"
98 | },
99 | "url": "https://packages.unity.com"
100 | },
101 | "com.unity.timeline": {
102 | "version": "1.2.6",
103 | "depth": 0,
104 | "source": "registry",
105 | "dependencies": {},
106 | "url": "https://packages.unity.com"
107 | },
108 | "com.unity.ugui": {
109 | "version": "1.0.0",
110 | "depth": 0,
111 | "source": "builtin",
112 | "dependencies": {
113 | "com.unity.modules.ui": "1.0.0",
114 | "com.unity.modules.imgui": "1.0.0"
115 | }
116 | },
117 | "com.unity.xr.legacyinputhelpers": {
118 | "version": "2.1.6",
119 | "depth": 0,
120 | "source": "registry",
121 | "dependencies": {},
122 | "url": "https://packages.unity.com"
123 | },
124 | "nuget.mono-cecil": {
125 | "version": "0.1.6-preview",
126 | "depth": 1,
127 | "source": "registry",
128 | "dependencies": {},
129 | "url": "https://packages.unity.com"
130 | },
131 | "com.unity.modules.ai": {
132 | "version": "1.0.0",
133 | "depth": 0,
134 | "source": "builtin",
135 | "dependencies": {}
136 | },
137 | "com.unity.modules.androidjni": {
138 | "version": "1.0.0",
139 | "depth": 0,
140 | "source": "builtin",
141 | "dependencies": {}
142 | },
143 | "com.unity.modules.animation": {
144 | "version": "1.0.0",
145 | "depth": 0,
146 | "source": "builtin",
147 | "dependencies": {}
148 | },
149 | "com.unity.modules.assetbundle": {
150 | "version": "1.0.0",
151 | "depth": 0,
152 | "source": "builtin",
153 | "dependencies": {}
154 | },
155 | "com.unity.modules.audio": {
156 | "version": "1.0.0",
157 | "depth": 0,
158 | "source": "builtin",
159 | "dependencies": {}
160 | },
161 | "com.unity.modules.cloth": {
162 | "version": "1.0.0",
163 | "depth": 0,
164 | "source": "builtin",
165 | "dependencies": {
166 | "com.unity.modules.physics": "1.0.0"
167 | }
168 | },
169 | "com.unity.modules.director": {
170 | "version": "1.0.0",
171 | "depth": 0,
172 | "source": "builtin",
173 | "dependencies": {
174 | "com.unity.modules.audio": "1.0.0",
175 | "com.unity.modules.animation": "1.0.0"
176 | }
177 | },
178 | "com.unity.modules.imageconversion": {
179 | "version": "1.0.0",
180 | "depth": 0,
181 | "source": "builtin",
182 | "dependencies": {}
183 | },
184 | "com.unity.modules.imgui": {
185 | "version": "1.0.0",
186 | "depth": 0,
187 | "source": "builtin",
188 | "dependencies": {}
189 | },
190 | "com.unity.modules.jsonserialize": {
191 | "version": "1.0.0",
192 | "depth": 0,
193 | "source": "builtin",
194 | "dependencies": {}
195 | },
196 | "com.unity.modules.particlesystem": {
197 | "version": "1.0.0",
198 | "depth": 0,
199 | "source": "builtin",
200 | "dependencies": {}
201 | },
202 | "com.unity.modules.physics": {
203 | "version": "1.0.0",
204 | "depth": 0,
205 | "source": "builtin",
206 | "dependencies": {}
207 | },
208 | "com.unity.modules.physics2d": {
209 | "version": "1.0.0",
210 | "depth": 0,
211 | "source": "builtin",
212 | "dependencies": {}
213 | },
214 | "com.unity.modules.screencapture": {
215 | "version": "1.0.0",
216 | "depth": 0,
217 | "source": "builtin",
218 | "dependencies": {
219 | "com.unity.modules.imageconversion": "1.0.0"
220 | }
221 | },
222 | "com.unity.modules.subsystems": {
223 | "version": "1.0.0",
224 | "depth": 1,
225 | "source": "builtin",
226 | "dependencies": {
227 | "com.unity.modules.jsonserialize": "1.0.0"
228 | }
229 | },
230 | "com.unity.modules.terrain": {
231 | "version": "1.0.0",
232 | "depth": 0,
233 | "source": "builtin",
234 | "dependencies": {}
235 | },
236 | "com.unity.modules.terrainphysics": {
237 | "version": "1.0.0",
238 | "depth": 0,
239 | "source": "builtin",
240 | "dependencies": {
241 | "com.unity.modules.physics": "1.0.0",
242 | "com.unity.modules.terrain": "1.0.0"
243 | }
244 | },
245 | "com.unity.modules.tilemap": {
246 | "version": "1.0.0",
247 | "depth": 0,
248 | "source": "builtin",
249 | "dependencies": {
250 | "com.unity.modules.physics2d": "1.0.0"
251 | }
252 | },
253 | "com.unity.modules.ui": {
254 | "version": "1.0.0",
255 | "depth": 0,
256 | "source": "builtin",
257 | "dependencies": {}
258 | },
259 | "com.unity.modules.uielements": {
260 | "version": "1.0.0",
261 | "depth": 0,
262 | "source": "builtin",
263 | "dependencies": {
264 | "com.unity.modules.imgui": "1.0.0",
265 | "com.unity.modules.jsonserialize": "1.0.0"
266 | }
267 | },
268 | "com.unity.modules.umbra": {
269 | "version": "1.0.0",
270 | "depth": 0,
271 | "source": "builtin",
272 | "dependencies": {}
273 | },
274 | "com.unity.modules.unityanalytics": {
275 | "version": "1.0.0",
276 | "depth": 0,
277 | "source": "builtin",
278 | "dependencies": {
279 | "com.unity.modules.unitywebrequest": "1.0.0",
280 | "com.unity.modules.jsonserialize": "1.0.0"
281 | }
282 | },
283 | "com.unity.modules.unitywebrequest": {
284 | "version": "1.0.0",
285 | "depth": 0,
286 | "source": "builtin",
287 | "dependencies": {}
288 | },
289 | "com.unity.modules.unitywebrequestassetbundle": {
290 | "version": "1.0.0",
291 | "depth": 0,
292 | "source": "builtin",
293 | "dependencies": {
294 | "com.unity.modules.assetbundle": "1.0.0",
295 | "com.unity.modules.unitywebrequest": "1.0.0"
296 | }
297 | },
298 | "com.unity.modules.unitywebrequestaudio": {
299 | "version": "1.0.0",
300 | "depth": 0,
301 | "source": "builtin",
302 | "dependencies": {
303 | "com.unity.modules.unitywebrequest": "1.0.0",
304 | "com.unity.modules.audio": "1.0.0"
305 | }
306 | },
307 | "com.unity.modules.unitywebrequesttexture": {
308 | "version": "1.0.0",
309 | "depth": 0,
310 | "source": "builtin",
311 | "dependencies": {
312 | "com.unity.modules.unitywebrequest": "1.0.0",
313 | "com.unity.modules.imageconversion": "1.0.0"
314 | }
315 | },
316 | "com.unity.modules.unitywebrequestwww": {
317 | "version": "1.0.0",
318 | "depth": 0,
319 | "source": "builtin",
320 | "dependencies": {
321 | "com.unity.modules.unitywebrequest": "1.0.0",
322 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
323 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
324 | "com.unity.modules.audio": "1.0.0",
325 | "com.unity.modules.assetbundle": "1.0.0",
326 | "com.unity.modules.imageconversion": "1.0.0"
327 | }
328 | },
329 | "com.unity.modules.vehicles": {
330 | "version": "1.0.0",
331 | "depth": 0,
332 | "source": "builtin",
333 | "dependencies": {
334 | "com.unity.modules.physics": "1.0.0"
335 | }
336 | },
337 | "com.unity.modules.video": {
338 | "version": "1.0.0",
339 | "depth": 0,
340 | "source": "builtin",
341 | "dependencies": {
342 | "com.unity.modules.audio": "1.0.0",
343 | "com.unity.modules.ui": "1.0.0",
344 | "com.unity.modules.unitywebrequest": "1.0.0"
345 | }
346 | },
347 | "com.unity.modules.vr": {
348 | "version": "1.0.0",
349 | "depth": 0,
350 | "source": "builtin",
351 | "dependencies": {
352 | "com.unity.modules.jsonserialize": "1.0.0",
353 | "com.unity.modules.physics": "1.0.0",
354 | "com.unity.modules.xr": "1.0.0"
355 | }
356 | },
357 | "com.unity.modules.wind": {
358 | "version": "1.0.0",
359 | "depth": 0,
360 | "source": "builtin",
361 | "dependencies": {}
362 | },
363 | "com.unity.modules.xr": {
364 | "version": "1.0.0",
365 | "depth": 0,
366 | "source": "builtin",
367 | "dependencies": {
368 | "com.unity.modules.physics": "1.0.0",
369 | "com.unity.modules.jsonserialize": "1.0.0",
370 | "com.unity.modules.subsystems": "1.0.0"
371 | }
372 | }
373 | }
374 | }
375 |
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | m_Volume: 1
7 | Rolloff Scale: 1
8 | Doppler Factor: 1
9 | Default Speaker Mode: 2
10 | m_SampleRate: 0
11 | m_DSPBufferSize: 1024
12 | m_VirtualVoiceCount: 512
13 | m_RealVoiceCount: 32
14 | m_SpatializerPlugin:
15 | m_AmbisonicDecoderPlugin:
16 | m_DisableAudio: 0
17 | m_VirtualizeEffects: 1
18 |
--------------------------------------------------------------------------------
/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 7
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_DefaultSolverIterations: 6
13 | m_DefaultSolverVelocityIterations: 1
14 | m_QueriesHitBackfaces: 0
15 | m_QueriesHitTriggers: 1
16 | m_EnableAdaptiveForce: 0
17 | m_ClothInterCollisionDistance: 0
18 | m_ClothInterCollisionStiffness: 0
19 | m_ContactsGeneration: 1
20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 | m_AutoSimulation: 1
22 | m_AutoSyncTransforms: 1
23 | m_ClothInterCollisionSettingsToggle: 0
24 | m_ContactPairsMode: 0
25 | m_BroadphaseType: 0
26 | m_WorldBounds:
27 | m_Center: {x: 0, y: 0, z: 0}
28 | m_Extent: {x: 250, y: 250, z: 250}
29 | m_WorldSubdivisions: 8
30 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes:
8 | - enabled: 1
9 | path: Assets/Scenes/SampleScene.unity
10 | guid: 99c9720ab356a0642a771bea13969a05
11 | m_configObjects: {}
12 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 9
7 | m_ExternalVersionControlSupport: Visible Meta Files
8 | m_SerializationMode: 2
9 | m_LineEndingsForNewScripts: 2
10 | m_DefaultBehaviorMode: 0
11 | m_PrefabRegularEnvironment: {fileID: 0}
12 | m_PrefabUIEnvironment: {fileID: 0}
13 | m_SpritePackerMode: 0
14 | m_SpritePackerPaddingPower: 1
15 | m_EtcTextureCompressorBehavior: 1
16 | m_EtcTextureFastCompressor: 1
17 | m_EtcTextureNormalCompressor: 2
18 | m_EtcTextureBestCompressor: 4
19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref
20 | m_ProjectGenerationRootNamespace:
21 | m_CollabEditorSettings:
22 | inProgressEnabled: 1
23 | m_EnableTextureStreamingInEditMode: 1
24 | m_EnableTextureStreamingInPlayMode: 1
25 | m_AsyncShaderCompilation: 1
26 | m_EnterPlayModeOptionsEnabled: 0
27 | m_EnterPlayModeOptions: 3
28 | m_ShowLightmapResolutionOverlay: 1
29 | m_UseLegacyProbeSampleCount: 1
30 | m_AssetPipelineMode: 1
31 | m_CacheServerMode: 0
32 | m_CacheServerEndpoint:
33 | m_CacheServerNamespacePrefix: default
34 | m_CacheServerEnableDownload: 1
35 | m_CacheServerEnableUpload: 1
36 |
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 12
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 | m_PreloadedShaders: []
39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 | type: 0}
41 | m_CustomRenderPipeline: {fileID: 0}
42 | m_TransparencySortMode: 0
43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
44 | m_DefaultRenderingPath: 1
45 | m_DefaultMobileRenderingPath: 1
46 | m_TierSettings: []
47 | m_LightmapStripping: 0
48 | m_FogStripping: 0
49 | m_InstancingStripping: 0
50 | m_LightmapKeepPlain: 1
51 | m_LightmapKeepDirCombined: 1
52 | m_LightmapKeepDynamicPlain: 1
53 | m_LightmapKeepDynamicDirCombined: 1
54 | m_LightmapKeepShadowMask: 1
55 | m_LightmapKeepSubtractive: 1
56 | m_FogKeepLinear: 1
57 | m_FogKeepExp: 1
58 | m_FogKeepExp2: 1
59 | m_AlbedoSwatchInfos: []
60 | m_LightsUseLinearIntensity: 0
61 | m_LightsUseColorTemperature: 0
62 |
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 |
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshProjectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 | m_LastAgentTypeID: -887442657
73 | m_Settings:
74 | - serializedVersion: 2
75 | agentTypeID: 0
76 | agentRadius: 0.5
77 | agentHeight: 2
78 | agentSlope: 45
79 | agentClimb: 0.75
80 | ledgeDropHeight: 0
81 | maxJumpAcrossDistance: 0
82 | minRegionArea: 2
83 | manualCellSize: 0
84 | cellSize: 0.16666667
85 | manualTileSize: 0
86 | tileSize: 256
87 | accuratePlacement: 0
88 | debug:
89 | m_Flags: 0
90 | m_SettingNames:
91 | - Humanoid
92 |
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/ProjectSettings/PackageManagerSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 13960, guid: 0000000000000000e000000000000000, type: 0}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_ScopedRegistriesSettingsExpanded: 1
16 | oneTimeWarningShown: 0
17 | m_Registries:
18 | - m_Id: main
19 | m_Name:
20 | m_Url: https://packages.unity.com
21 | m_Scopes: []
22 | m_IsDefault: 1
23 | m_UserSelectedRegistryName:
24 | m_UserAddingNewScopedRegistry: 0
25 | m_RegistryInfoDraft:
26 | m_ErrorMessage:
27 | m_Original:
28 | m_Id:
29 | m_Name:
30 | m_Url:
31 | m_Scopes: []
32 | m_IsDefault: 0
33 | m_Modified: 0
34 | m_Name:
35 | m_Url:
36 | m_Scopes:
37 | -
38 | m_SelectedScopeIndex: 0
39 |
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 3
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_BaumgarteScale: 0.2
17 | m_BaumgarteTimeOfImpactScale: 0.75
18 | m_TimeToSleep: 0.5
19 | m_LinearSleepTolerance: 0.01
20 | m_AngularSleepTolerance: 2
21 | m_DefaultContactOffset: 0.01
22 | m_AutoSimulation: 1
23 | m_QueriesHitTriggers: 1
24 | m_QueriesStartInColliders: 1
25 | m_ChangeStopsCallbacks: 0
26 | m_CallbacksOnDisable: 1
27 | m_AutoSyncTransforms: 1
28 | m_AlwaysShowColliders: 0
29 | m_ShowColliderSleep: 1
30 | m_ShowColliderContacts: 0
31 | m_ShowColliderAABB: 0
32 | m_ContactArrowScale: 0.2
33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
38 |
--------------------------------------------------------------------------------
/ProjectSettings/PresetManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1386491679 &1
4 | PresetManager:
5 | m_ObjectHideFlags: 0
6 | m_DefaultList:
7 | - type:
8 | m_NativeTypeID: 108
9 | m_ManagedTypePPtr: {fileID: 0}
10 | m_ManagedTypeFallback:
11 | defaultPresets:
12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea,
13 | type: 2}
14 | - type:
15 | m_NativeTypeID: 1020
16 | m_ManagedTypePPtr: {fileID: 0}
17 | m_ManagedTypeFallback:
18 | defaultPresets:
19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6,
20 | type: 2}
21 | - type:
22 | m_NativeTypeID: 1006
23 | m_ManagedTypePPtr: {fileID: 0}
24 | m_ManagedTypeFallback:
25 | defaultPresets:
26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9,
27 | type: 2}
28 |
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2019.4.17f1
2 | m_EditorVersionWithRevision: 2019.4.17f1 (667c8606c536)
3 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 4
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Very Low
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 15
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 0
21 | blendWeights: 1
22 | textureQuality: 1
23 | anisotropicTextures: 0
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 0
27 | realtimeReflectionProbes: 0
28 | billboardsFaceCameraPosition: 0
29 | vSyncCount: 0
30 | lodBias: 0.3
31 | maximumLODLevel: 0
32 | particleRaycastBudget: 4
33 | asyncUploadTimeSlice: 2
34 | asyncUploadBufferSize: 4
35 | resolutionScalingFixedDPIFactor: 1
36 | excludedTargetPlatforms: []
37 | - serializedVersion: 2
38 | name: Low
39 | pixelLightCount: 0
40 | shadows: 0
41 | shadowResolution: 0
42 | shadowProjection: 1
43 | shadowCascades: 1
44 | shadowDistance: 20
45 | shadowNearPlaneOffset: 3
46 | shadowCascade2Split: 0.33333334
47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
48 | shadowmaskMode: 0
49 | blendWeights: 2
50 | textureQuality: 0
51 | anisotropicTextures: 0
52 | antiAliasing: 0
53 | softParticles: 0
54 | softVegetation: 0
55 | realtimeReflectionProbes: 0
56 | billboardsFaceCameraPosition: 0
57 | vSyncCount: 0
58 | lodBias: 0.4
59 | maximumLODLevel: 0
60 | particleRaycastBudget: 16
61 | asyncUploadTimeSlice: 2
62 | asyncUploadBufferSize: 4
63 | resolutionScalingFixedDPIFactor: 1
64 | excludedTargetPlatforms: []
65 | - serializedVersion: 2
66 | name: Medium
67 | pixelLightCount: 1
68 | shadows: 1
69 | shadowResolution: 0
70 | shadowProjection: 1
71 | shadowCascades: 1
72 | shadowDistance: 20
73 | shadowNearPlaneOffset: 3
74 | shadowCascade2Split: 0.33333334
75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
76 | shadowmaskMode: 0
77 | blendWeights: 2
78 | textureQuality: 0
79 | anisotropicTextures: 1
80 | antiAliasing: 0
81 | softParticles: 0
82 | softVegetation: 0
83 | realtimeReflectionProbes: 0
84 | billboardsFaceCameraPosition: 0
85 | vSyncCount: 1
86 | lodBias: 0.7
87 | maximumLODLevel: 0
88 | particleRaycastBudget: 64
89 | asyncUploadTimeSlice: 2
90 | asyncUploadBufferSize: 4
91 | resolutionScalingFixedDPIFactor: 1
92 | excludedTargetPlatforms: []
93 | - serializedVersion: 2
94 | name: High
95 | pixelLightCount: 2
96 | shadows: 2
97 | shadowResolution: 1
98 | shadowProjection: 1
99 | shadowCascades: 2
100 | shadowDistance: 40
101 | shadowNearPlaneOffset: 3
102 | shadowCascade2Split: 0.33333334
103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
104 | shadowmaskMode: 1
105 | blendWeights: 2
106 | textureQuality: 0
107 | anisotropicTextures: 1
108 | antiAliasing: 2
109 | softParticles: 0
110 | softVegetation: 1
111 | realtimeReflectionProbes: 1
112 | billboardsFaceCameraPosition: 1
113 | vSyncCount: 1
114 | lodBias: 1
115 | maximumLODLevel: 0
116 | particleRaycastBudget: 256
117 | asyncUploadTimeSlice: 2
118 | asyncUploadBufferSize: 4
119 | resolutionScalingFixedDPIFactor: 1
120 | excludedTargetPlatforms: []
121 | - serializedVersion: 2
122 | name: Very High
123 | pixelLightCount: 3
124 | shadows: 2
125 | shadowResolution: 2
126 | shadowProjection: 1
127 | shadowCascades: 2
128 | shadowDistance: 40
129 | shadowNearPlaneOffset: 3
130 | shadowCascade2Split: 0.33333334
131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
132 | shadowmaskMode: 1
133 | blendWeights: 4
134 | textureQuality: 0
135 | anisotropicTextures: 1
136 | antiAliasing: 4
137 | softParticles: 1
138 | softVegetation: 1
139 | realtimeReflectionProbes: 1
140 | billboardsFaceCameraPosition: 1
141 | vSyncCount: 1
142 | lodBias: 1.5
143 | maximumLODLevel: 0
144 | particleRaycastBudget: 1024
145 | asyncUploadTimeSlice: 2
146 | asyncUploadBufferSize: 4
147 | resolutionScalingFixedDPIFactor: 1
148 | excludedTargetPlatforms: []
149 | - serializedVersion: 2
150 | name: Ultra
151 | pixelLightCount: 4
152 | shadows: 2
153 | shadowResolution: 2
154 | shadowProjection: 1
155 | shadowCascades: 4
156 | shadowDistance: 150
157 | shadowNearPlaneOffset: 3
158 | shadowCascade2Split: 0.33333334
159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
160 | shadowmaskMode: 1
161 | blendWeights: 4
162 | textureQuality: 0
163 | anisotropicTextures: 1
164 | antiAliasing: 4
165 | softParticles: 1
166 | softVegetation: 1
167 | realtimeReflectionProbes: 1
168 | billboardsFaceCameraPosition: 1
169 | vSyncCount: 1
170 | lodBias: 2
171 | maximumLODLevel: 0
172 | particleRaycastBudget: 4096
173 | asyncUploadTimeSlice: 2
174 | asyncUploadBufferSize: 4
175 | resolutionScalingFixedDPIFactor: 1
176 | excludedTargetPlatforms: []
177 | m_PerPlatformDefaultQuality:
178 | Android: 2
179 | Nintendo 3DS: 5
180 | Nintendo Switch: 5
181 | PS4: 5
182 | PSP2: 2
183 | Standalone: 5
184 | Tizen: 2
185 | WebGL: 3
186 | WiiU: 5
187 | Windows Store Apps: 5
188 | XboxOne: 5
189 | iPhone: 2
190 | tvOS: 2
191 |
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | - PostProcessing
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.1
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | m_Enabled: 0
7 | m_TestMode: 0
8 | m_TestEventUrl:
9 | m_TestConfigUrl:
10 | m_TestInitMode: 0
11 | CrashReportingSettings:
12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate
14 | m_Enabled: 0
15 | m_CaptureEditorExceptions: 1
16 | UnityPurchasingSettings:
17 | m_Enabled: 0
18 | m_TestMode: 0
19 | UnityAnalyticsSettings:
20 | m_Enabled: 0
21 | m_InitializeOnStartup: 1
22 | m_TestMode: 0
23 | m_TestEventUrl:
24 | m_TestConfigUrl:
25 | UnityAdsSettings:
26 | m_Enabled: 0
27 | m_InitializeOnStartup: 1
28 | m_TestMode: 0
29 | m_IosGameId:
30 | m_AndroidGameId:
31 | m_GameIds: {}
32 | m_GameId:
33 | PerformanceReportingSettings:
34 | m_Enabled: 0
35 |
--------------------------------------------------------------------------------
/ProjectSettings/VFXManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!937362698 &1
4 | VFXManager:
5 | m_ObjectHideFlags: 0
6 | m_IndirectShader: {fileID: 0}
7 | m_CopyBufferShader: {fileID: 0}
8 | m_SortShader: {fileID: 0}
9 | m_StripUpdateShader: {fileID: 0}
10 | m_RenderPipeSettingsPath:
11 | m_FixedTimeStep: 0.016666668
12 | m_MaxDeltaTime: 0.05
13 |
--------------------------------------------------------------------------------
/ProjectSettings/XRSettings.asset:
--------------------------------------------------------------------------------
1 | {
2 | "m_SettingKeys": [
3 | "VR Device Disabled",
4 | "VR Device User Alert"
5 | ],
6 | "m_SettingValues": [
7 | "False",
8 | "False"
9 | ]
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnityPhotoTool
2 |
3 | Features
4 | ---
5 | - Take screenshots with your desired size and position.
6 | - Count down and flash light effect animation. ([DOTween](http://dotween.demigiant.com/) required)
7 | - Chroma keying and basic brightness, contrast, and saturation adjustment with the help of [ProcAmp by Keijiro](https://github.com/keijiro/ProcAmp), [HSV Color Picker by judah4](https://github.com/judah4/HSV-Color-Picker-Unity), and [PlayerPrefsX by Eric Haines](http://wiki.unity3d.com/index.php/ArrayPrefs2#C.23_-_PlayerPrefsX.cs).
8 |
9 | There are 3 sample scenes in this project:
10 | - **Test_PhotoTool** takes a screenshot and display it on a GUI Raw Image.
11 | - **Test_PhotoAnim** demonstrates how to set up simple count down and flash light animation.
12 | - **Test_Keying** applies chroma keying and color adjustment onto textures.
13 |
14 | ### 🌟 While the above scenes demonstrate how I use the scripts individually, [UnityPhotoBooth](https://github.com/GimChuang/UnityPhotoBooth) is a complete photo booth game using all these scripts together. Please check it out if you need it.
15 |
16 |
17 | How to Use
18 | ---
19 | ### PhotoTool.cs
20 |
21 | 
22 |
23 | #### Settings in the Inspector
24 | - Set `startX`, `startY`, `width`, and `height` for the region you want to take screenshots with. You can view the region you've set by checking `Debug On GUI`.
25 | #### Scripting Reference
26 | - `Init()` initializes a *Texture2D* for screenshots with startX, startY, width, and height. There's also an overload function `Init(int _startX, int _startY, int _width, int _height)` for overriding the settings.
27 | - `TakePhoto()` takes a screenshot and apply it to `tex2d_photo`.
28 | - `OnPhotoTaken(tex2d_photo)` is called after the screenshot is taken.
29 |
30 | ### PhotoAnimController.cs
31 |
32 | 
33 |
34 | #### Settings in the Inspector
35 | - Drag some *Transform* components into the `countDownElements` array. These *GameObjects* will be used in the countdown animation, which is driven by a [DOTween](http://dotween.demigiant.com/) Sequence.
36 | - Type in `duration_countDown` (in seconds). It's the duration of each `countDownElements`'s scaling animation.
37 | - Assign a UI Image to `Img_shot`. It'll be used in a "flash" animation driven by DOTween, too. `duration_shot` is the duration of the animation.
38 | - (Optional) You can also assign an *AudioSource* to `audio_shot` and it will be played with the flash animation.
39 |
40 | #### Scripting Reference
41 | - `Init()` MUST be called to initialize the DOTween tweeners/sequences.
42 | - `PlayCountDownAnim()` plays the countdown animation. `OnCountDownFinish()` is called when the animation finishes.
43 | - `PlayShotAnim()` plays the flash light animation (along with the `audio_shot` sound effect if it's assigned). `OnShotFinish()` is called when the animation finishes.
44 |
45 | ### KeyingColorPickers.cs, KeyingSliders.cs, and KeyingToggle.cs
46 |
47 | 
48 |
49 | These scripts are used to control values on materials using [ProcAmp](https://github.com/keijiro/ProcAmp) shader.
50 |
51 | - Assign a material using *Klak/Video/ProcAmp* shader to `keyingMaterial`
52 | - Type in `propertyName` eg. _KEYING, _Brightness. They are internally used by some functions such as [Material.SetFloat](https://docs.unity3d.com/2018.2/Documentation/ScriptReference/Material.SetFloat.html) and [PlayerPref.SetFloat](https://docs.unity3d.com/2018.2/Documentation/ScriptReference/PlayerPrefs.SetFloat.html).
53 | - (Optional) If `btn_resetDefault` is assigned, value of the color picker, sliders, and toggle will be set to default when `btn_resetDefault` is pressed.
54 | - (Optional) There is a **Panel-Keying** *Prefab* inside *gm_PhotoTool/Prefab/Panel-Keying*. It's a *UI Panel* which already contains a color picker, a toggle, and sliders. You can put it onto a *UI Canvas* and then set up values followng steps above.
55 |
56 |
57 | Notes
58 | ---
59 | This project uses Git submodule [gm_PhotoTool](https://github.com/GimChuang/gm_PhotoTool). If you want to clone this reposiory, you need to call
60 | ```
61 | git clone --recurse-submodules
62 | ```
63 |
64 |
65 | License
66 | ---
67 | MIT
68 |
69 |
70 | Acknowledgement
71 | ---
72 | This project uses [ProcAmp by Keijiro](https://github.com/keijiro/ProcAmp) and [HSV Color Picker by judah4](https://github.com/judah4/HSV-Color-Picker-Unity) to achieve chroma keying. Also uses [PlayerPrefsX by Eric Haines](http://wiki.unity3d.com/index.php/ArrayPrefs2#C.23_-_PlayerPrefsX.cs) to save colors with *PlayerPrefs*! 🙇♀️
73 |
--------------------------------------------------------------------------------
/readme_information/Sample_Keying.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/readme_information/Sample_Keying.gif
--------------------------------------------------------------------------------
/readme_information/Sample_PhotoAnimController.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/readme_information/Sample_PhotoAnimController.gif
--------------------------------------------------------------------------------
/readme_information/Sample_PhotoTool.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GimChuang/UnityPhotoTool/36cd759a4d6ad727c0edfd80ea0c52709a5ef6a1/readme_information/Sample_PhotoTool.gif
--------------------------------------------------------------------------------