├── .gitignore
├── .idea
└── .idea.UnityUtil
│ └── .idea
│ ├── .gitignore
│ ├── encodings.xml
│ ├── indexLayout.xml
│ └── vcs.xml
├── .vsconfig
├── Assets
├── Example.meta
├── Example
│ ├── Camera.meta
│ ├── Camera
│ │ ├── MaterialImageEffectSample.mat
│ │ ├── MaterialImageEffectSample.mat.meta
│ │ ├── MaterialImageEffectSample.shader
│ │ └── MaterialImageEffectSample.shader.meta
│ ├── Geometry.meta
│ ├── Geometry
│ │ ├── LineSegmentGpuTest.compute
│ │ ├── LineSegmentGpuTest.compute.meta
│ │ ├── LineSegmentGpuTest.cs
│ │ ├── LineSegmentGpuTest.cs.meta
│ │ ├── LineSegmentTest.cs
│ │ └── LineSegmentTest.cs.meta
│ ├── Transform.meta
│ └── Transform
│ │ ├── NoChildAutoDestroySampleGenerateChild.cs
│ │ └── NoChildAutoDestroySampleGenerateChild.cs.meta
├── Scenes.meta
└── Scenes
│ ├── LineSegmentGpuTest.unity
│ ├── LineSegmentGpuTest.unity.meta
│ ├── LineSegmentTest.unity
│ ├── LineSegmentTest.unity.meta
│ ├── MaterialImageEffect.unity
│ ├── MaterialImageEffect.unity.meta
│ ├── NoChildAutoDestroy.unity
│ └── NoChildAutoDestroy.unity.meta
├── Packages
├── ga.fuquna.unityutil
│ ├── Animation.meta
│ ├── Animation
│ │ ├── AnimatorExtension.cs
│ │ ├── AnimatorExtension.cs.meta
│ │ ├── AnimatorStarter.cs
│ │ ├── AnimatorStarter.cs.meta
│ │ ├── RandomAnimatorController.cs
│ │ ├── RandomAnimatorController.cs.meta
│ │ ├── RandomStartAnimator.cs
│ │ ├── RandomStartAnimator.cs.meta
│ │ ├── ScaledCurve.cs
│ │ └── ScaledCurve.cs.meta
│ ├── Camera.meta
│ ├── Camera
│ │ ├── ApplyTexToCamera.cs
│ │ ├── ApplyTexToCamera.cs.meta
│ │ ├── CameraTargetTexture.cs
│ │ ├── CameraTargetTexture.cs.meta
│ │ ├── CameraTexture.cs
│ │ ├── CameraTexture.cs.meta
│ │ ├── CaptureFrameBuffer.cs
│ │ ├── CaptureFrameBuffer.cs.meta
│ │ ├── CopyMainCamera.cs
│ │ ├── CopyMainCamera.cs.meta
│ │ ├── MaterialImageEffect.cs
│ │ ├── MaterialImageEffect.cs.meta
│ │ ├── MultiCameraToCamera.cs
│ │ ├── MultiCameraToCamera.cs.meta
│ │ ├── MultiCameraToCamera.mat
│ │ ├── MultiCameraToCamera.mat.meta
│ │ ├── TexBlend.shader
│ │ └── TexBlend.shader.meta
│ ├── Extension.meta
│ ├── Extension
│ │ ├── BoundsExtension.cs
│ │ ├── BoundsExtension.cs.meta
│ │ ├── Collision2DExtension.cs
│ │ ├── Collision2DExtension.cs.meta
│ │ ├── ColorExtension.cs
│ │ ├── ColorExtension.cs.meta
│ │ ├── ComputeShaderExtension.cs
│ │ ├── ComputeShaderExtension.cs.meta
│ │ ├── EnumExtension.cs
│ │ ├── EnumExtension.cs.meta
│ │ ├── EnumerableExtension.cs
│ │ ├── EnumerableExtension.cs.meta
│ │ ├── GameObjectExtension.cs
│ │ ├── GameObjectExtension.cs.meta
│ │ ├── MaterialPropertyBlockExtension.cs
│ │ ├── MaterialPropertyBlockExtension.cs.meta
│ │ ├── MonoBehaviorExtension.cs
│ │ ├── MonoBehaviorExtension.cs.meta
│ │ ├── RectExtension.cs
│ │ ├── RectExtension.cs.meta
│ │ ├── TransformExtension.cs
│ │ ├── TransformExtension.cs.meta
│ │ ├── VectorExtension.cs
│ │ └── VectorExtension.cs.meta
│ ├── Geometry.meta
│ ├── Geometry
│ │ ├── LineSegment.cs
│ │ ├── LineSegment.cs.meta
│ │ ├── LineSegment.hlsl
│ │ ├── LineSegment.hlsl.meta
│ │ ├── Primitive2D.cs
│ │ └── Primitive2D.cs.meta
│ ├── Logic.meta
│ ├── Logic
│ │ ├── AudioSourceOnEditor.cs
│ │ ├── AudioSourceOnEditor.cs.meta
│ │ ├── Easing.cs
│ │ ├── Easing.cs.meta
│ │ ├── KeepTimeFlag.cs
│ │ ├── KeepTimeFlag.cs.meta
│ │ ├── OverrideSingletonMonoBehaviour.cs
│ │ ├── OverrideSingletonMonoBehaviour.cs.meta
│ │ ├── Rational.cs
│ │ ├── Rational.cs.meta
│ │ ├── SingletonMonoBehaviour.cs
│ │ ├── SingletonMonoBehaviour.cs.meta
│ │ ├── StateMachine.cs
│ │ └── StateMachine.cs.meta
│ ├── Random.meta
│ ├── Random
│ │ ├── CustomRandom.cs
│ │ ├── CustomRandom.cs.meta
│ │ ├── Rand.cs
│ │ ├── Rand.cs.meta
│ │ ├── RandomForMaterialPropertyBlock.meta
│ │ └── RandomForMaterialPropertyBlock
│ │ │ ├── RandomForMaterialProperty.cs
│ │ │ ├── RandomForMaterialProperty.cs.meta
│ │ │ ├── RandomHSVForMaterialProperty.cs
│ │ │ └── RandomHSVForMaterialProperty.cs.meta
│ ├── Shaders.meta
│ ├── Shaders
│ │ ├── Additive.mat
│ │ ├── Additive.mat.meta
│ │ ├── Additive.shader
│ │ ├── Additive.shader.meta
│ │ ├── Tone.cginc
│ │ └── Tone.cginc.meta
│ ├── Texture.meta
│ ├── Texture
│ │ ├── TextureUtil.cs
│ │ └── TextureUtil.cs.meta
│ ├── Transform.meta
│ ├── Transform
│ │ ├── AutoRot.cs
│ │ ├── AutoRot.cs.meta
│ │ ├── NoChildAutoDestroy.cs
│ │ └── NoChildAutoDestroy.cs.meta
│ ├── UnityUtil.asmdef
│ ├── UnityUtil.asmdef.meta
│ ├── package.json
│ └── package.json.meta
├── manifest.json
└── packages-lock.json
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── MemorySettings.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── PackageManagerSettings.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── SceneTemplateSettings.json
├── TagManager.asset
├── TimeManager.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
├── VersionControlSettings.asset
└── XRSettings.asset
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # This .gitignore file should be placed at the root of your Unity project directory
2 | #
3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
4 | #
5 | /[Ll]ibrary/
6 | /[Tt]emp/
7 | /[Oo]bj/
8 | /[Bb]uild/
9 | /[Bb]uilds/
10 | /[Ll]ogs/
11 | /[Uu]ser[Ss]ettings/
12 |
13 | # MemoryCaptures can get excessive in size.
14 | # They also could contain extremely sensitive data
15 | /[Mm]emoryCaptures/
16 |
17 | # Recordings can get excessive in size
18 | /[Rr]ecordings/
19 |
20 | # Uncomment this line if you wish to ignore the asset store tools plugin
21 | # /[Aa]ssets/AssetStoreTools*
22 |
23 | # Autogenerated Jetbrains Rider plugin
24 | /[Aa]ssets/Plugins/Editor/JetBrains*
25 |
26 | # Visual Studio cache directory
27 | .vs/
28 |
29 | # Gradle cache directory
30 | .gradle/
31 |
32 | # Autogenerated VS/MD/Consulo solution and project files
33 | ExportedObj/
34 | .consulo/
35 | *.csproj
36 | *.unityproj
37 | *.sln
38 | *.suo
39 | *.tmp
40 | *.user
41 | *.userprefs
42 | *.pidb
43 | *.booproj
44 | *.svd
45 | *.pdb
46 | *.mdb
47 | *.opendb
48 | *.VC.db
49 |
50 | # Unity3D generated meta files
51 | *.pidb.meta
52 | *.pdb.meta
53 | *.mdb.meta
54 |
55 | # Unity3D generated file on crash reports
56 | sysinfo.txt
57 |
58 | # Builds
59 | *.apk
60 | *.aab
61 | *.unitypackage
62 | *.app
63 |
64 | # Crashlytics generated file
65 | crashlytics-build.properties
66 |
67 | # Packed Addressables
68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
69 |
70 | # Temporary auto-generated Android Assets
71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta
72 | /[Aa]ssets/[Ss]treamingAssets/aa/*
--------------------------------------------------------------------------------
/.idea/.idea.UnityUtil/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Rider ignored files
5 | /modules.xml
6 | /contentModel.xml
7 | /projectSettingsUpdater.xml
8 | /.idea.UnityUtil.iml
9 | # Editor-based HTTP Client requests
10 | /httpRequests/
11 | # Datasource local storage ignored files
12 | /dataSources/
13 | /dataSources.local.xml
14 | # GitHub Copilot persisted chat sessions
15 | /copilot/chatSessions
16 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUtil/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUtil/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUtil/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.vsconfig:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "components": [
4 | "Microsoft.VisualStudio.Workload.ManagedGame"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/Assets/Example.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 75caaae291c6de74f8241863b844704d
3 | folderAsset: yes
4 | timeCreated: 1476351914
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Example/Camera.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e673bc8a199deb645b76443e0d031fac
3 | folderAsset: yes
4 | timeCreated: 1476689833
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Example/Camera/MaterialImageEffectSample.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_PrefabParentObject: {fileID: 0}
8 | m_PrefabInternal: {fileID: 0}
9 | m_Name: MaterialImageEffectSample
10 | m_Shader: {fileID: 4800000, guid: d86c4d09891397445accbbafbe0ff195, type: 3}
11 | m_ShaderKeywords: _EMISSION
12 | m_LightmapFlags: 1
13 | m_EnableInstancingVariants: 0
14 | m_DoubleSidedGI: 0
15 | m_CustomRenderQueue: -1
16 | stringTagMap: {}
17 | disabledShaderPasses: []
18 | m_SavedProperties:
19 | serializedVersion: 3
20 | m_TexEnvs:
21 | - _BumpMap:
22 | m_Texture: {fileID: 0}
23 | m_Scale: {x: 1, y: 1}
24 | m_Offset: {x: 0, y: 0}
25 | - _DetailAlbedoMap:
26 | m_Texture: {fileID: 0}
27 | m_Scale: {x: 1, y: 1}
28 | m_Offset: {x: 0, y: 0}
29 | - _DetailMask:
30 | m_Texture: {fileID: 0}
31 | m_Scale: {x: 1, y: 1}
32 | m_Offset: {x: 0, y: 0}
33 | - _DetailNormalMap:
34 | m_Texture: {fileID: 0}
35 | m_Scale: {x: 1, y: 1}
36 | m_Offset: {x: 0, y: 0}
37 | - _EmissionMap:
38 | m_Texture: {fileID: 0}
39 | m_Scale: {x: 1, y: 1}
40 | m_Offset: {x: 0, y: 0}
41 | - _MainTex:
42 | m_Texture: {fileID: 0}
43 | m_Scale: {x: 1, y: 1}
44 | m_Offset: {x: 0, y: 0}
45 | - _MetallicGlossMap:
46 | m_Texture: {fileID: 0}
47 | m_Scale: {x: 1, y: 1}
48 | m_Offset: {x: 0, y: 0}
49 | - _OcclusionMap:
50 | m_Texture: {fileID: 0}
51 | m_Scale: {x: 1, y: 1}
52 | m_Offset: {x: 0, y: 0}
53 | - _ParallaxMap:
54 | m_Texture: {fileID: 0}
55 | m_Scale: {x: 1, y: 1}
56 | m_Offset: {x: 0, y: 0}
57 | m_Floats:
58 | - _BumpScale: 1
59 | - _Cutoff: 0.5
60 | - _DetailNormalMapScale: 1
61 | - _DstBlend: 0
62 | - _GlossMapScale: 1
63 | - _Glossiness: 0.5
64 | - _GlossyReflections: 1
65 | - _Metallic: 0
66 | - _Mode: 0
67 | - _OcclusionStrength: 1
68 | - _Parallax: 0.02
69 | - _SmoothnessTextureChannel: 0
70 | - _SpecularHighlights: 1
71 | - _SrcBlend: 1
72 | - _UVSec: 0
73 | - _ZWrite: 1
74 | m_Colors:
75 | - _Color: {r: 1, g: 1, b: 1, a: 1}
76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
77 |
--------------------------------------------------------------------------------
/Assets/Example/Camera/MaterialImageEffectSample.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2040432807788aa42a96278888dcdec9
3 | timeCreated: 1476689890
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Example/Camera/MaterialImageEffectSample.shader:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 | Shader "Hidden/MaterialImageEffectSample"
4 | {
5 | Properties
6 | {
7 | _MainTex ("Texture", 2D) = "white" {}
8 | }
9 | SubShader
10 | {
11 | // No culling or depth
12 | Cull Off ZWrite Off ZTest Always
13 |
14 | Pass
15 | {
16 | CGPROGRAM
17 | #pragma vertex vert
18 | #pragma fragment frag
19 |
20 | #include "UnityCG.cginc"
21 |
22 | struct appdata
23 | {
24 | float4 vertex : POSITION;
25 | float2 uv : TEXCOORD0;
26 | };
27 |
28 | struct v2f
29 | {
30 | float2 uv : TEXCOORD0;
31 | float4 vertex : SV_POSITION;
32 | };
33 |
34 | v2f vert (appdata v)
35 | {
36 | v2f o;
37 | o.vertex = UnityObjectToClipPos(v.vertex);
38 | o.uv = v.uv;
39 | return o;
40 | }
41 |
42 | sampler2D _MainTex;
43 |
44 | fixed4 frag (v2f i) : SV_Target
45 | {
46 | fixed4 col = tex2D(_MainTex, i.uv);
47 | // just invert the colors
48 | col = 1 - col;
49 | return col;
50 | }
51 | ENDCG
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Assets/Example/Camera/MaterialImageEffectSample.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d86c4d09891397445accbbafbe0ff195
3 | timeCreated: 1476689910
4 | licenseType: Pro
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Example/Geometry.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1c1bddec43d58b84da3501ccb72ce69f
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Example/Geometry/LineSegmentGpuTest.compute:
--------------------------------------------------------------------------------
1 | #pragma kernel CSMain
2 |
3 | #include "Packages/ga.fuquna.unityutil/Geometry/LineSegment.hlsl"
4 |
5 | struct Output
6 | {
7 | int hasHit;
8 | float2 hitPoint;
9 | float2 closestPoint0;
10 | float2 closestPoint1;
11 | float distance0;
12 | float distance1;
13 | int isLeft0;
14 | int isLeft1;
15 | };
16 |
17 | float2 _Point;
18 | StructuredBuffer _LineSegmentBuffer;
19 | RWStructuredBuffer