├── .gitattributes ├── .gitignore ├── .gitmodules ├── Assets ├── Camera.meta ├── Camera │ ├── PostProcess.cs │ ├── PostProcess.cs.meta │ ├── PostProcess.mat │ ├── PostProcess.mat.meta │ ├── PostProcess.shader │ └── PostProcess.shader.meta ├── MC_Cross.meta ├── MC_Cross │ ├── Cross.cs │ ├── Cross.cs.meta │ ├── Cross.mat │ ├── Cross.mat.meta │ ├── Cross.shader │ ├── Cross.shader.meta │ ├── TimeLine.meta │ └── TimeLine │ │ ├── Bump.signal │ │ ├── Bump.signal.meta │ │ ├── Cross.playable │ │ ├── Cross.playable.meta │ │ ├── Finish.signal │ │ ├── Finish.signal.meta │ │ ├── Random.signal │ │ ├── Random.signal.meta │ │ ├── Start.signal │ │ └── Start.signal.meta ├── MC_Cube.meta ├── MC_Cube │ ├── Cube.cs │ ├── Cube.cs.meta │ ├── Cube.mat │ ├── Cube.mat.meta │ ├── Cube.playable │ ├── Cube.playable.meta │ ├── Cube.shader │ ├── Cube.shader.meta │ ├── CubeUnit.cs │ ├── CubeUnit.cs.meta │ ├── Ring.mat │ ├── Ring.mat.meta │ ├── Ring.shader │ └── Ring.shader.meta ├── MC_Drop.meta ├── MC_Drop │ ├── Drop.cs │ ├── Drop.cs.meta │ ├── Drop.mat │ ├── Drop.mat.meta │ ├── Drop.shader │ ├── Drop.shader.meta │ ├── Timeline.meta │ └── Timeline │ │ ├── Drop.playable │ │ ├── Drop.playable.meta │ │ ├── LetterLerp.signal │ │ └── LetterLerp.signal.meta ├── Main.unity ├── Main.unity.meta ├── MarchingCube.meta ├── MarchingCube │ ├── Cginc.meta │ ├── Cginc │ │ ├── DF_Letters.cginc │ │ ├── DF_Letters.cginc.meta │ │ ├── DF_Primitive.cginc │ │ ├── DF_Primitive.cginc.meta │ │ ├── DF_Twist.cginc │ │ ├── DF_Twist.cginc.meta │ │ ├── DF_Utils.cginc │ │ ├── DF_Utils.cginc.meta │ │ ├── Easing.cginc │ │ ├── Easing.cginc.meta │ │ ├── Lighting.cginc │ │ ├── Lighting.cginc.meta │ │ ├── MarchingCubeFooterCommon.cginc │ │ ├── MarchingCubeFooterCommon.cginc.meta │ │ ├── MarchingCubeFooterDeferred.cginc │ │ ├── MarchingCubeFooterDeferred.cginc.meta │ │ ├── MarchingCubeFooterWireframe.cginc │ │ ├── MarchingCubeFooterWireframe.cginc.meta │ │ ├── MarchingCubeHeader.cginc │ │ └── MarchingCubeHeader.cginc.meta │ ├── MC_Base.cs │ ├── MC_Base.cs.meta │ ├── MarchingCubeDefines.cs │ ├── MarchingCubeDefines.cs.meta │ ├── MarchingCubeDrawMesh.cs │ └── MarchingCubeDrawMesh.cs.meta ├── Packages.meta ├── Packages │ ├── 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 │ ├── unity-gist.meta │ └── unity-gist │ │ ├── Cginc.meta │ │ ├── Cginc │ │ ├── ConstantUtil.cginc │ │ ├── ConstantUtil.cginc.meta │ │ ├── FunctionUtil.cginc │ │ ├── FunctionUtil.cginc.meta │ │ ├── GaussianBlur.cginc │ │ ├── GaussianBlur.cginc.meta │ │ ├── PhotoShopMath.cginc │ │ ├── PhotoShopMath.cginc.meta │ │ ├── RandomUtil.cginc │ │ ├── RandomUtil.cginc.meta │ │ ├── RotationUtil.cginc │ │ ├── RotationUtil.cginc.meta │ │ ├── SimplexNoise.cginc │ │ └── SimplexNoise.cginc.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── Script.meta │ │ ├── Script │ │ ├── ComputeBufferUtil.cs │ │ ├── ComputeBufferUtil.cs.meta │ │ ├── ComputeShaderUtil.cs │ │ ├── ComputeShaderUtil.cs.meta │ │ ├── ObjectPoolBuffer.cs │ │ ├── ObjectPoolBuffer.cs.meta │ │ ├── Recorder.cs │ │ ├── Recorder.cs.meta │ │ ├── RendertextureUtil.cs │ │ ├── RendertextureUtil.cs.meta │ │ ├── SimplexNoise.cs │ │ ├── SimplexNoise.cs.meta │ │ ├── SingletonMonoBehaviour.cs │ │ └── SingletonMonoBehaviour.cs.meta │ │ ├── Wireframe.meta │ │ └── Wireframe │ │ ├── CustomLighting.cginc │ │ ├── CustomLighting.cginc.meta │ │ ├── CustomLighting.shader │ │ ├── CustomLighting.shader.meta │ │ ├── Tessellation.cginc │ │ ├── Tessellation.cginc.meta │ │ ├── Tessellation.shader │ │ ├── Tessellation.shader.meta │ │ ├── Wireframing.cginc │ │ ├── Wireframing.cginc.meta │ │ ├── Wireframing.shader │ │ └── Wireframing.shader.meta ├── Resources.meta └── Resources │ ├── DOTweenSettings.asset │ └── DOTweenSettings.asset.meta ├── Imgs ├── cross.gif ├── cube.png ├── drop.png ├── editor1.PNG ├── editor2.PNG └── editor3.PNG ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.psb filter=lfs diff=lfs merge=lfs -text 2 | *.psd filter=lfs diff=lfs merge=lfs -text 3 | *.png filter=lfs diff=lfs merge=lfs -text 4 | *.sbs filter=lfs diff=lfs merge=lfs -text 5 | *.gif filter=lfs diff=lfs merge=lfs -text -------------------------------------------------------------------------------- /.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/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | /[Cc]apture*/ 13 | 14 | # Never ignore Asset meta data 15 | !/[Aa]ssets/**/*.meta 16 | 17 | # Uncomment this line if you wish to ignore the asset store tools plugin 18 | # /[Aa]ssets/AssetStoreTools* 19 | 20 | # Autogenerated Jetbrains Rider plugin 21 | [Aa]ssets/Plugins/Editor/JetBrains* 22 | 23 | # Visual Studio cache directory 24 | .vs/ 25 | 26 | # Gradle cache directory 27 | .gradle/ 28 | 29 | # Autogenerated VS/MD/Consulo solution and project files 30 | ExportedObj/ 31 | .consulo/ 32 | *.csproj 33 | *.unityproj 34 | *.sln 35 | *.suo 36 | *.tmp 37 | *.user 38 | *.userprefs 39 | *.pidb 40 | *.booproj 41 | *.svd 42 | *.pdb 43 | *.mdb 44 | *.opendb 45 | *.VC.db 46 | 47 | # Unity3D generated meta files 48 | *.pidb.meta 49 | *.pdb.meta 50 | *.mdb.meta 51 | 52 | # Unity3D generated file on crash reports 53 | sysinfo.txt 54 | 55 | # Builds 56 | *.apk 57 | *.unitypackage 58 | 59 | # Crashlytics generated file 60 | crashlytics-build.properties 61 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Assets/Packages/unity-gist"] 2 | path = Assets/Packages/unity-gist 3 | url = git@github.com:komietty/unity-gist.git 4 | -------------------------------------------------------------------------------- /Assets/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7681f2437be2a02478252c1e55c24011 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class PostProcess : MonoBehaviour { 6 | 7 | public Material mat; 8 | public int pass; 9 | public Vector2Int split; 10 | 11 | void OnRenderImage(RenderTexture src, RenderTexture dst) { 12 | mat.SetVector("_Split", new Vector4(split.x, split.y, 0, 0)); 13 | Graphics.Blit(src, dst, mat, pass); 14 | } 15 | 16 | void UpdateSplit(int x, int y) { split = new Vector2Int(x, y); } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68a2ccb42b5543e41bd82ca46f4dc5b4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.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: PostProcess 11 | m_Shader: {fileID: 4800000, guid: 4a50f1d8e9579ec4eb72a2f9dcc8e248, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95eb54914191b1b4b986bdb42b3210f4 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/PostProcess" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _Tex01 ("Tex01", 2D) = "white" {} 7 | } 8 | SubShader 9 | { 10 | Cull Off ZWrite Off ZTest Always 11 | 12 | CGINCLUDE 13 | 14 | #include "UnityCG.cginc" 15 | sampler2D _MainTex; 16 | sampler2D _Tex01; 17 | float4 _MainTex_TexelSize; 18 | float2 _Split; 19 | 20 | 21 | float2 split(float2 inUV) { 22 | return frac(inUV * _Split.xy); 23 | } 24 | 25 | fixed4 frag_base(v2f_img i) : SV_Target{ 26 | float2 uv = split(i.uv); 27 | fixed4 c = tex2D(_MainTex, uv); 28 | return c; 29 | } 30 | 31 | fixed4 mask_horizontal(v2f_img i) : SV_Target { 32 | fixed4 c = tex2D(_MainTex, i.uv); 33 | uint uv = (uint)(i.uv.y * _MainTex_TexelSize.w); 34 | bool flag = uv % 8 == 0; 35 | return flag ? c : 0; 36 | } 37 | 38 | fixed4 mask_diagonal(v2f_img i) : SV_Target { 39 | fixed4 c = tex2D(_MainTex, i.uv); 40 | uint2 uv = (uint2)(i.uv.xy * _MainTex_TexelSize.zw); 41 | bool flag = (uv.x + uv.y) % 8 == 0; 42 | return flag ? c : 0; 43 | } 44 | 45 | ENDCG 46 | 47 | Pass 48 | { 49 | CGPROGRAM 50 | #pragma vertex vert_img 51 | #pragma fragment frag_base 52 | ENDCG 53 | } 54 | 55 | Pass 56 | { 57 | CGPROGRAM 58 | #pragma vertex vert_img 59 | #pragma fragment mask_horizontal 60 | ENDCG 61 | } 62 | 63 | Pass 64 | { 65 | CGPROGRAM 66 | #pragma vertex vert_img 67 | #pragma fragment mask_diagonal 68 | ENDCG 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/Camera/PostProcess.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a50f1d8e9579ec4eb72a2f9dcc8e248 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MC_Cross.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81bda998c6f4b3042ac889ef5f91854a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using DG.Tweening; 5 | 6 | public class Cross : MC_Base { 7 | [Header("Cross")] 8 | public Vector4 noise; // xyz: offset, w: strength 9 | Sequence bumpSeq; 10 | IEnumerator noiseOffsetCO; 11 | IEnumerator noiseStrengthCO; 12 | 13 | void Start() { 14 | } 15 | 16 | protected override void Update() { 17 | // if (randomRot) { 18 | // transform.rotation = Random.rotation; 19 | // } 20 | // else if (!freeze) { 21 | // var t = Time.time * rotSpeed; 22 | // pillers.transform.rotation = Quaternion.Euler( 23 | // Mathf.Sin(t) * 180, 24 | // 0, 25 | // Mathf.Sin(Mathf.PerlinNoise(t, t)) * 180 26 | // ); 27 | // } 28 | 29 | base.Update(); 30 | noise.y += 0.05f; 31 | mat.SetVector("_Noise", noise); 32 | } 33 | 34 | public void SetNoiseStrength(float v) { 35 | bumpSeq.Kill(); 36 | noise.w = v; 37 | noiseStrengthCO = SinNoiseStrengthCO(); 38 | StartCoroutine(noiseStrengthCO); 39 | } 40 | 41 | 42 | public void SetRandomOffset() { 43 | if (noiseOffsetCO != null) StopCoroutine(noiseOffsetCO); 44 | noiseOffsetCO = SetRandomOffsetCO(20); 45 | StartCoroutine(noiseOffsetCO); 46 | } 47 | 48 | IEnumerator SetRandomOffsetCO(int loop) { 49 | for (var i = 0; i < loop; i++) { 50 | yield return new WaitForEndOfFrame(); 51 | yield return new WaitForEndOfFrame(); 52 | yield return new WaitForEndOfFrame(); 53 | noise.x = Random.value * 100; 54 | noise.y = Random.value * 100; 55 | noise.z = Random.value * 100; 56 | } 57 | } 58 | 59 | IEnumerator SinNoiseStrengthCO() { 60 | while (true) { 61 | yield return new WaitForEndOfFrame(); 62 | noise.w = 1f + Mathf.Sin(Time.deltaTime) * 0.25f; 63 | } 64 | } 65 | 66 | public void Bump(int loop) { 67 | bumpSeq.Kill(); 68 | bumpSeq = DOTween.Sequence() 69 | .OnStart(() => noise.w = 0.3f) 70 | .Append(DOTween.To(() => noise.w, v => noise.w = v, 0f, 0.5f)) 71 | .AppendInterval(0.8f) 72 | .SetLoops(loop, LoopType.Restart) 73 | .Play(); 74 | } 75 | 76 | public void Reset() { } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78155da344e58224f84295c21cd6e1e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.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: Cross 11 | m_Shader: {fileID: 4800000, guid: 6479f08927a164a47bf322f61ccd20c8, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _NoiseStrength: 2.25 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 1 74 | - _UVSec: 0 75 | - _ZWrite: 1 76 | m_Colors: 77 | - _Color: {r: 1, g: 1, b: 1, a: 1} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | - _Noise: {r: 0, g: 76.70008, b: 0, a: 1.0049996} 80 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fe8300f7bca4f5469d6780de5f00190 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Cross" 2 | { 3 | Properties { 4 | _Noise("Noise", Vector) = (0, 0, 0, 0) 5 | } 6 | SubShader 7 | { 8 | CGINCLUDE 9 | #include "../MarchingCube/Cginc/MarchingCubeHeader.cginc" 10 | #include "../MarchingCube/Cginc/DF_Primitive.cginc" 11 | #include "../MarchingCube/Cginc/DF_Utils.cginc" 12 | #include "../Packages/unity-gist/Cginc/SimplexNoise.cginc" 13 | float4 _Noise; 14 | 15 | float DistanceFunction(float3 p, float3 q) 16 | { 17 | float result; 18 | float _c = -cross(q + snoise3D(float4(p + _Noise.xyz, 1)) * _Noise.w); 19 | result = _c; 20 | return result + 0.5; 21 | }; 22 | 23 | #include "../MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc" 24 | ENDCG 25 | 26 | Pass 27 | { 28 | Tags {"LightMode" = "ForwardBase"} 29 | CGPROGRAM 30 | #pragma target 5.0 31 | #pragma vertex vert 32 | #pragma geometry geom_wire 33 | #pragma fragment frag_wire_alt 34 | 35 | float4 frag_wire_alt(g2f_wire i) : SV_Target 36 | { 37 | float4 col = float4(_DiffuseColor.rgb, 1); 38 | float3 barys; 39 | barys.xy = i.barycentricCoordinates; 40 | barys.z = 1 - barys.x - barys.y; 41 | float3 deltas = fwidth(barys); 42 | float3 smoothing = deltas * _WireframeSmoothing; 43 | float3 thickness = deltas * _WireframeThickness; 44 | barys = smoothstep(thickness, thickness + smoothing, barys); 45 | float minBary = min(barys.x, min(barys.y, barys.z)); 46 | float3 wCol = (i.worldPos.z < 0)? _WireframeColor : float3(1, 0, 0); 47 | return float4(lerp(wCol, col.rgb, minBary).xyz, 1.0); 48 | } 49 | 50 | ENDCG 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/MC_Cross/Cross.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6479f08927a164a47bf322f61ccd20c8 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e25c98843b6e25a4cafcdd26ed6cbf28 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Bump.signal: -------------------------------------------------------------------------------- 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: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} 13 | m_Name: Bump 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Bump.signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b1b16642c7a78d4cb87870129596693 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Cross.playable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e22f195955ed51e47920951b4e9766f0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Finish.signal: -------------------------------------------------------------------------------- 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: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} 13 | m_Name: Finish 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Finish.signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38fe087bfdc06634eb3f13bc2ef5ad0f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Random.signal: -------------------------------------------------------------------------------- 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: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} 13 | m_Name: Random 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Random.signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae304c81cebb2fb4895c995ec7b20352 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Start.signal: -------------------------------------------------------------------------------- 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: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} 13 | m_Name: Start 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/MC_Cross/TimeLine/Start.signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5de2220fc8386164889b130c5bfbc6aa 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cube.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2946e61fa344ce429a68eb840243fd1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Linq; 4 | 5 | public class Cube : MC_Base 6 | { 7 | public GameObject[] cubes; 8 | public GameObject objs; 9 | public float loopTime; 10 | public float rotSpeed; 11 | 12 | public IEnumerator Rotate(Vector3 targetDir) { 13 | var t = loopTime; 14 | var q = Quaternion.FromToRotation(Vector3.forward, targetDir); 15 | while(t > 0 && objs.transform.rotation != q) { 16 | yield return new WaitForEndOfFrame(); 17 | var step = rotSpeed * Time.deltaTime; 18 | objs.transform.rotation = Quaternion.RotateTowards(objs.transform.rotation, q, step); 19 | t -= Time.deltaTime; 20 | } 21 | StartCoroutine(Rotate(Random.onUnitSphere)); 22 | } 23 | 24 | void Start() { 25 | StartCoroutine(Rotate(Random.onUnitSphere)); 26 | } 27 | 28 | protected override void Update() { 29 | base.Update(); 30 | 31 | drawer.mat.SetVectorArray("_Trans", cubes.Select(c => 32 | new Vector4( 33 | c.transform.position.x, 34 | c.transform.position.y, 35 | c.transform.position.z, 36 | c.transform.localScale.x) 37 | ).ToArray() 38 | ); 39 | drawer.mat.SetVectorArray("_Rots", cubes.Select(c => (Vector4)c.transform.rotation.eulerAngles * Mathf.Deg2Rad).ToArray()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b62005d905b216489e6f3d6f0ef26d8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.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: Cube 11 | m_Shader: {fileID: 4800000, guid: 1e10c3f7659708a46bcaa63cd941371e, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce148581f5074d6418d2881772c2dce2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.playable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c175fd8aa3fcb6f4fa7a59d6c1b2379e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Cube" 2 | { 3 | Properties { } 4 | SubShader 5 | { 6 | CGINCLUDE 7 | #include "../MarchingCube/Cginc/MarchingCubeHeader.cginc" 8 | #include "../MarchingCube/Cginc/DF_Primitive.cginc" 9 | #include "../MarchingCube/Cginc/DF_Utils.cginc" 10 | #include "../Packages/unity-gist/Cginc/SimplexNoise.cginc" 11 | float4 _Trans[3]; 12 | float4 _Rots[3]; 13 | 14 | float DistanceFunction(float3 p, float3 q) 15 | { 16 | float3 _q; 17 | q += snoise3D(float4(q, 1)); 18 | _q = q - _Trans[0].xyz; 19 | 20 | _q = rotate(_q, _Rots[0].x, float3(1, 0, 0)); 21 | _q = rotate(_q, _Rots[0].y, float3(0, 1, 0)); 22 | _q = rotate(_q, _Rots[0].z, float3(0, 0, 1)); 23 | float d1 = -box(_q, _Trans[0].w) + 0.5; 24 | 25 | _q = q - _Trans[1].xyz; 26 | _q = rotate(_q, _Rots[1].x, float3(1, 0, 0)); 27 | _q = rotate(_q, _Rots[1].y, float3(0, 1, 0)); 28 | _q = rotate(_q, _Rots[1].z, float3(0, 0, 1)); 29 | float d2 = -box(_q, _Trans[1].w) + 0.5; 30 | 31 | _q = q - _Trans[2].xyz; 32 | _q = rotate(_q, _Rots[2].x, float3(1, 0, 0)); 33 | _q = rotate(_q, _Rots[2].y, float3(0, 1, 0)); 34 | _q = rotate(_q, _Rots[2].z, float3(0, 0, 1)); 35 | float d3 = -box(_q, _Trans[2].w) + 0.5; 36 | 37 | float o1 = smoothMax(d1, d2, 9); 38 | float o2 = smoothMax(o1, d3, 9); 39 | return o2; 40 | }; 41 | 42 | #include "../MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc" 43 | ENDCG 44 | 45 | Pass 46 | { 47 | Tags {"LightMode" = "ForwardBase"} 48 | CGPROGRAM 49 | #pragma target 5.0 50 | #pragma vertex vert 51 | #pragma geometry geom_wire 52 | #pragma fragment frag_wire_alt 53 | 54 | float4 frag_wire_alt(g2f_wire i) : SV_Target 55 | { 56 | float4 col = float4(_DiffuseColor.rgb, 1); 57 | float3 barys; 58 | barys.xy = i.barycentricCoordinates; 59 | barys.z = 1 - barys.x - barys.y; 60 | float3 deltas = fwidth(barys); 61 | float3 smoothing = deltas * _WireframeSmoothing; 62 | float3 thickness = deltas * _WireframeThickness; 63 | barys = smoothstep(thickness, thickness + smoothing, barys); 64 | float minBary = min(barys.x, min(barys.y, barys.z)); 65 | float3 wCol = (abs(i.worldPos.z) < 1.37)? _WireframeColor : float3(1, 0, 0); 66 | return float4(lerp(wCol, col.rgb, minBary).xyz, 1.0); 67 | } 68 | ENDCG 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Cube.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e10c3f7659708a46bcaa63cd941371e 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MC_Cube/CubeUnit.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class CubeUnit : MonoBehaviour { 6 | 7 | public float radius; 8 | public float speed; 9 | 10 | void Update() { 11 | var t = Time.time * speed; 12 | transform.position = new Vector3(Mathf.Cos(t), 0, Mathf.Sin(t)) * radius; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/MC_Cube/CubeUnit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71542789f20d53649bb7cd07b22f0d49 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Ring.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: Ring 11 | m_Shader: {fileID: 4800000, guid: 012d381105e261e4fbafa4a7f07e40bc, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Ring.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0422f1f8e939314a9ad9c763d2cc277 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Ring.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Ring" 2 | { 3 | Properties { } 4 | SubShader 5 | { 6 | CGINCLUDE 7 | #include "../MarchingCube/Cginc/MarchingCubeHeader.cginc" 8 | #include "../MarchingCube/Cginc/DF_Primitive.cginc" 9 | #include "../MarchingCube/Cginc/DF_Utils.cginc" 10 | #include "../Packages/unity-gist/Cginc/SimplexNoise.cginc" 11 | 12 | float DistanceFunction(float3 p, float3 q) 13 | { 14 | q += snoise3D(float4(q, 1)); 15 | float d0 = -torus(q, float2(0.3, 0.03)); 16 | 17 | return d0 + 0.5; 18 | }; 19 | 20 | #include "../MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc" 21 | ENDCG 22 | 23 | Pass 24 | { 25 | Tags {"LightMode" = "ForwardBase"} 26 | CGPROGRAM 27 | #pragma target 5.0 28 | #pragma vertex vert 29 | #pragma geometry geom_wire 30 | #pragma fragment frag_wire_alt 31 | 32 | float4 frag_wire_alt(g2f_wire i) : SV_Target 33 | { 34 | float4 col = float4(_DiffuseColor.rgb, 1); 35 | float3 barys; 36 | barys.xy = i.barycentricCoordinates; 37 | barys.z = 1 - barys.x - barys.y; 38 | float3 deltas = fwidth(barys); 39 | float3 smoothing = deltas * _WireframeSmoothing; 40 | float3 thickness = deltas * _WireframeThickness; 41 | barys = smoothstep(thickness, thickness + smoothing, barys); 42 | float minBary = min(barys.x, min(barys.y, barys.z)); 43 | float3 wCol = (abs(i.worldPos.z) < 1.5)? _WireframeColor : float3(1, 0, 0); 44 | return float4(lerp(wCol, col.rgb, minBary).xyz, 1.0); 45 | } 46 | ENDCG 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/MC_Cube/Ring.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 012d381105e261e4fbafa4a7f07e40bc 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MC_Drop.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2af410e977d5b7444b1a9625725d472d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Linq; 3 | using DG.Tweening; 4 | 5 | public class Drop : MC_Base { 6 | 7 | [Header("Drop")] 8 | [Range(0, 1)] public float lerpVal; 9 | public Vector4 letterLerp; 10 | public GameObject[] balls; 11 | public int pattern; 12 | 13 | protected override void Update() { 14 | base.Update(); 15 | 16 | drawer.mat.SetFloat("_LerpVal", lerpVal); 17 | drawer.mat.SetInt("_Pattern", pattern); 18 | drawer.mat.SetVector("_LetterLerp", letterLerp); 19 | drawer.mat.SetVectorArray("_Params", balls.Select(b => 20 | new Vector4( 21 | b.transform.position.x, 22 | b.transform.position.y, 23 | b.transform.position.z, 24 | b.transform.localScale.x / 2) 25 | ).ToArray() 26 | ); 27 | } 28 | 29 | public void Lerp() { 30 | var i = Mathf.FloorToInt(Random.value * 4); 31 | var to = letterLerp[i] > 0.5f ? 0 : 1; 32 | if (i == 2) pattern = Random.value > 0.5 ? 1 : 0; 33 | DOTween.To(() => letterLerp[i], v => letterLerp[i] = v, to, 1f); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1f29befa5bd691479cbe6d64ece608a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.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: Drop 11 | m_Shader: {fileID: 4800000, guid: 0b2984f5df350d7449b54e68875b9e2c, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _EmissionIntensity: 0 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0 66 | - _GlossyReflections: 1 67 | - _Lerp: 0 68 | - _LerpVal: 0 69 | - _Metallic: 0 70 | - _Mode: 0 71 | - _OcclusionStrength: 1 72 | - _Parallax: 0.02 73 | - _Param02: 0.3 74 | - _Scale: 0.015625 75 | - _SegmentNum: 64 76 | - _SmoothnessTextureChannel: 0 77 | - _SpecularHighlights: 1 78 | - _SrcBlend: 1 79 | - _Threashold: 0.47 80 | - _UVSec: 0 81 | - _WireframeSmoothing: 0.61 82 | - _WireframeThickness: 0.43 83 | - _ZWrite: 1 84 | m_Colors: 85 | - _Color: {r: 1, g: 1, b: 1, a: 1} 86 | - _DiffuseColor: {r: 0, g: 0, b: 0, a: 1} 87 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 88 | - _Paaram01: {r: 0, g: 0, b: 0, a: 1} 89 | - _Param01: {r: 0, g: 0.25, b: 0, a: 0.01} 90 | - _Param02: {r: 0.54, g: 0, b: 0, a: 0.01} 91 | - _WireframeColor: {r: 1, g: 1, b: 1, a: 1} 92 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f4e177fe342bd54c9866a1d3fe4c254 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Drop" 2 | { 3 | Properties { } 4 | SubShader 5 | { 6 | CGINCLUDE 7 | #include "../MarchingCube/Cginc/MarchingCubeHeader.cginc" 8 | #include "../MarchingCube/Cginc/DF_Letters.cginc" 9 | float4 _Params[2]; 10 | float4 _LetterLerp; 11 | int _Pattern; 12 | 13 | float DistanceFunction(float3 p, float3 q) 14 | { 15 | float result = 0; 16 | 17 | // drops 18 | float s01 = -sphere(q - _Params[0].xyz, _Params[0].w); 19 | float s02 = -sphere(q - _Params[1].xyz, _Params[1].w); 20 | float drp = smoothMax(s01, s02, 20); 21 | 22 | // env 23 | float3 pos = float3(0, 0.34, 0); 24 | float4 nrm = float4(0, 1, 0, 0); 25 | float env = max(-plane(p - pos, -nrm), -plane(p + pos, nrm)); 26 | 27 | // letters 28 | float3 rot = float3(-sin(_Time.y) * 2, cos(_Time.z), sin(_Time.z)); 29 | float1 rad = PI * 0.87; 30 | float3 oft = float3(.5, 0, 0); 31 | float3 q1 = rotate(q + oft * 3, rad, rot); 32 | float3 q2 = rotate(q + oft , rad, rot); 33 | float3 q3 = rotate(q - oft , rad, rot); 34 | float3 q4 = rotate(q - oft * 3, rad, rot); 35 | bool f = _Pattern == 0; 36 | 37 | float ltr1 = Lerp( capitalB(q1) , -cross(q1), _LetterLerp.x); 38 | float ltr2 = Lerp( capitalE(q2), -cross(q2), _LetterLerp.y); 39 | float ltr3 = Lerp(f ? capitalE(q3) : capitalA(q3), -cross(q3), _LetterLerp.z); 40 | float ltr4 = Lerp( capitalR(q4), -cross(q4), _LetterLerp.w); 41 | 42 | float ltr = max(max(ltr1, ltr2), max(ltr3, ltr4)); 43 | 44 | result = smoothMax(env, smoothMax(ltr, drp, 10), 20); 45 | return result + 0.5; 46 | }; 47 | 48 | #include "../MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc" 49 | ENDCG 50 | 51 | Pass 52 | { 53 | Tags {"LightMode" = "ForwardBase"} 54 | CGPROGRAM 55 | #pragma target 5.0 56 | #pragma vertex vert 57 | #pragma geometry geom_wire 58 | #pragma fragment frag_wire_alt 59 | 60 | float4 frag_wire_alt(g2f_wire i) : SV_Target 61 | { 62 | float4 col = float4(_DiffuseColor.rgb, 1); 63 | float3 barys; 64 | barys.xy = i.barycentricCoordinates; 65 | barys.z = 1 - barys.x - barys.y; 66 | float3 deltas = fwidth(barys); 67 | float3 smoothing = deltas * _WireframeSmoothing; 68 | float3 thickness = deltas * _WireframeThickness; 69 | barys = smoothstep(thickness, thickness + smoothing, barys); 70 | float minBary = min(barys.x, min(barys.y, barys.z)); 71 | return float4(lerp(_WireframeColor, col.rgb, minBary).xyz, 1.0); 72 | } 73 | ENDCG 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Drop.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b2984f5df350d7449b54e68875b9e2c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Timeline.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45d2d9ec6074abe4db6cc1c7eb15413b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Timeline/Drop.playable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5553cdf45de5d5c4895f364195f13530 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Timeline/LetterLerp.signal: -------------------------------------------------------------------------------- 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: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3} 13 | m_Name: LetterLerp 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/MC_Drop/Timeline/LetterLerp.signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 993c44941d83dfa45863d07d2fe4e9f0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MarchingCube.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f948940c8d5729d48a11441e182a7f18 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3870dcbdf6426f04799440bc81971f5a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Letters.cginc: -------------------------------------------------------------------------------- 1 | #ifndef distfunc_letters 2 | #define distfunc_letters 3 | #include "DF_Utils.cginc" 4 | #include "Easing.cginc" 5 | #include "DF_Primitive.cginc" 6 | 7 | #define LP float3(-0.25, 0, 0) 8 | #define RP float3( 0.25, 0, 0) 9 | #define TP float3( 0, 0.4, 0) 10 | #define MP float3( 0, 0, 0) 11 | #define BP float3( 0, -0.4, 0) // bottom position 12 | #define VS float3(0.15, 0.9, 0.15) // vertical size 13 | #define HS float3(0.6, 0.15, 0.15) // horizontal size 14 | #define XA float3(1, 0, 0) // x axis 15 | #define YA float3(0, 1, 0) // y axis 16 | #define ZA float3(0, 0, 1) // z axis 17 | 18 | float v_line_L(float3 p) { return -box(p - LP, VS); } 19 | float v_line_R(float3 p) { return -box(p - RP, VS); } 20 | float h_line_T(float3 p) { return -box(p - TP, HS); } 21 | float h_line_M(float3 p) { return -box(p - MP, HS); } 22 | float h_line_B(float3 p) { return -box(p - BP, HS); } 23 | 24 | float capitalA(float3 p) { 25 | float3 size = float3(0.15, 0.95, 0.15); 26 | float1 s1 = -box(rotate(p, PI * 0.87, ZA) + float3(-0.15, -0.1, 0), size); 27 | float1 s2 = -box(rotate(p, -PI * 0.87, ZA) + float3(0.15, -0.1, 0), size); 28 | float1 s3 = -box(p + float3(0, 0.2, 0), float3(0.4, 0.1, 0.03)); 29 | return max(s3, max(s1, s2)); 30 | } 31 | 32 | float capitalB(float3 p) { 33 | float s1 = -box(rotate(p - float3(0, -0.03, 0), -PI * 0.01, ZA) - LP, VS); 34 | bool f = p.x > -0.3; 35 | float s2 = f ? -link(rotate(p - float3(-0.15, 0.2, 0), PI * 0.5, ZA), 0.3, 0.2, 0.07) : -100; 36 | float s3 = f ? -link(rotate(p - float3(-0.15, -0.2, 0), PI * 0.5, ZA), 0.3, 0.2, 0.07) : -100; 37 | return max(max(s1, s2), s3); 38 | } 39 | 40 | float capitalE(float3 p) { 41 | float s1 = v_line_L(rotate(p, -PI * 0.01, ZA)); 42 | float s2 = -box(p - TP - float3(0.01, 0, 0), HS); 43 | float s3 = -box(p - MP, float3(0.4, HS.y, HS.z * 0.2)); 44 | float s4 = h_line_B(p); 45 | return max(max(s1, s2), max(s3, s4)); 46 | } 47 | 48 | float capitalD(float3 p) { 49 | float s1 = v_line_L(rotate(p, -PI * 0.01, ZA)); 50 | float3 q = p - float3(-0.3, 0, 0); 51 | float s2 = p.x > -0.35 ? -link(rotate(q, PI * 0.5, ZA), 0.3, 0.4, 0.07) : -100; 52 | return max(s1, s2); 53 | } 54 | 55 | float capitalP(float3 p) { 56 | float s1 = -box(rotate(p - float3(0, -0.03, 0), -PI * 0.01, ZA) - LP, float3(VS.x, VS.y * 1.05, VS.z)); 57 | float s2 = p.x > -0.3 ? -link(rotate(p - float3(-0.15, 0.2, 0), PI * 0.5, ZA), 0.3, 0.2, 0.07) : -100; 58 | return max(s1, s2); 59 | } 60 | 61 | float capitalR(float3 p) { 62 | float s1 = -box(rotate(p - float3(0, -0.03, 0), -PI * 0.01, ZA) - LP, float3(VS.x * 0.9, VS.y * 1.05, VS.z * 0.9)); 63 | float s2 = p.x > -0.3 ? -link(rotate(p - float3(-0.15, 0.2, 0), PI * 0.5, ZA), 0.3, 0.2, 0.07) : -100; 64 | float s3 = -box(rotate(p, -PI * 0.87, ZA) + float3(0.1, -0.35, 0), float3(0.15, 0.5, 0.15)); 65 | return max(max(s1, s2), s3); 66 | } 67 | 68 | float capitalL(float3 p) { 69 | float s1 = v_line_L(p); 70 | float s2 = h_line_B(p); 71 | return max(s1, s2); 72 | } 73 | 74 | float Lerp(float v1, float v2, float l) { 75 | float v3 = smoothMax(v1, v2, 8); 76 | return (l < 0.5) ? lerp(v1, v3, EaseInOutQuint(l * 2)) : lerp(v3, v2, EaseInOutQuint(l * 2 - 1)); 77 | } 78 | 79 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Letters.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0f68cddbf4a0044590109820850292a 3 | timeCreated: 1505057443 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Primitive.cginc: -------------------------------------------------------------------------------- 1 | #ifndef distfunc_primitive_h 2 | #define distfunc_primitive_h 3 | // source : http://iquilezles.org/www/articles/distfunctions/distfunctions.htm 4 | // p : position, r : radius, s: size, n : normal 5 | 6 | inline float sphere(float3 p, float r) { return length(p) - r; } 7 | inline float roundBox(float3 p, float3 s, float round) { return length(max(abs(p) - s * 0.5, 0)) - round; } 8 | inline float box(float3 p, float3 s) { return roundBox(p, s, 0); } 9 | inline float torus(float3 p, float2 r) { return length(float2(length(p.xy) - r.x, p.z)) - r.y; } 10 | inline float plane(float3 p, float4 n) { return dot(p, n.xyz) + n.w; } 11 | inline float ellipsoid(float3 p, float3 r) { return (length(p / r) - 1) * min(min(r.x, r.y), r.z); } 12 | inline float hex(float2 p, float2 h) { float2 q = abs(p); return max(q.x - h.y, max(q.x + q.y*0.57735, q.y*1.1547) - h.x); } 13 | inline float hexagonalPrismY(float3 p, float2 h) { float3 q = abs(p); return max(q.y - h.y, max(q.z * 0.866025 + q.x * 0.5, q.x) - h.x); } 14 | inline float link(float3 p, float l, float r1, float r2) { float3 q = float3(p.x, max(abs(p.y) - l, 0), p.z); return length(float2(length(q.xy) - r1, q.z)) - r2; } 15 | 16 | inline float cylinder(float3 p, float2 r) { 17 | float2 d = abs(float2(length(p.xy), p.z)) - r; 18 | return min(max(d.x, d.y), 0) + length(max(d, .0)); 19 | } 20 | 21 | inline float capsule(float3 p, float3 start, float3 end, float radius) { 22 | float3 pa = p - start, ba = end - start; 23 | float h = clamp(dot(pa, ba) / dot(ba, ba), 0, 1); 24 | return length(pa - ba * h) - radius; 25 | } 26 | 27 | 28 | inline float cross(float3 p) { 29 | float b1 = box(p - float3(0, 0.23, 0), float3(0.6, 0.15, 0.15)); 30 | float b2 = box(p, float3(0.15, 1, 0.15)); 31 | return min(b1, b2); 32 | } 33 | 34 | 35 | // 3Dnization of 2D 36 | 37 | inline float sdVesica(float2 p, float r, float d) 38 | { 39 | p = abs(p); 40 | float b = sqrt(r * r - d * d); 41 | return ((p.y - b) * d > p.x * b) ? length(p - float2(0, b)) : length(p - float2(-d, 0)) - r; 42 | } 43 | 44 | float sdCross(float2 p, float2 b, float r) 45 | { 46 | p = abs(p); 47 | p = (p.y > p.x) ? p.yx : p.xy; 48 | float2 q = p - b; 49 | float k = max(q.y, q.x); 50 | float2 w = (k > 0.0) ? q : float2(b.y - p.x, -k); 51 | return sign(k) * length(max(w, 0.0)) + r; 52 | } 53 | 54 | float opExtrussion(float3 p, float sdf, float h) 55 | { 56 | float2 w = float2(sdf, abs(p.z) - h); 57 | return min(max(w.x, w.y), 0.0) + length(max(w, 0.0)); 58 | } 59 | 60 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Primitive.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c679b5cd34b99c440a62a343dccd3e73 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Twist.cginc: -------------------------------------------------------------------------------- 1 | #ifndef df_twist 2 | #define df_twist 3 | 4 | float3 twistY(float3 p, float power) 5 | { 6 | float s = sin(power * p.y); 7 | float c = cos(power * p.y); 8 | float3x3 m = float3x3( 9 | c, 0.0, -s, 10 | 0.0, 1.0, 0.0, 11 | s, 0.0, c 12 | ); 13 | return mul(m, p); 14 | } 15 | 16 | float3 twistX(float3 p, float power) 17 | { 18 | float s = sin(power * p.y); 19 | float c = cos(power * p.y); 20 | float3x3 m = float3x3( 21 | 1.0, 0.0, 0.0, 22 | 0.0, c, s, 23 | 0.0, -s, c 24 | ); 25 | return mul(m, p); 26 | } 27 | 28 | float3 twistZ(float3 p, float power) 29 | { 30 | float s = sin(power * p.y); 31 | float c = cos(power * p.y); 32 | float3x3 m = float3x3( 33 | c, s, 0.0, 34 | -s, c, 0.0, 35 | 0.0, 0.0, 1.0 36 | ); 37 | return mul(m, p); 38 | } 39 | 40 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Twist.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fdf1bb6777a08c4095425f910ed708b 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Utils.cginc: -------------------------------------------------------------------------------- 1 | #ifndef utils_h 2 | #define utils_h 3 | 4 | #define PI 3.14159265358979 5 | 6 | float3 mod(float3 a, float3 b) { return frac(abs(a / b)) * abs(b); } 7 | float3 mod(float3 a, float1 b) { return frac(abs(a / b)) * abs(b); } 8 | float2 mod(float2 a, float1 b) { return frac(abs(a / b)) * abs(b); } 9 | float1 mod(float1 a, float1 b) { return frac(abs(a / b)) * abs(b); } 10 | 11 | float3 reflect(float3 p, bool flip) { return float3(abs(p.x), p.yz); } 12 | float3 repeat(float3 pos, float3 span) { return mod(pos, span) - span * 0.5; } 13 | 14 | float smoothMax(float d1, float d2, float k) { return log(exp( k * d1) + exp( k * d2)) / k; } 15 | float smoothMin(float d1, float d2, float k) { return -log(exp(-k * d1) + exp(-k * d2)) / k; } 16 | float smoothSub(float d1, float d2, float k) { return -log(exp(-k * d1) + exp( k * d2)) / k; } 17 | 18 | 19 | float3 rotate(float3 p, float angle, float3 axis) 20 | { 21 | float3 a = normalize(axis); 22 | float s = sin(angle); 23 | float c = cos(angle); 24 | float r = 1.0 - c; 25 | float3x3 m = float3x3( 26 | a.x * a.x * r + c, 27 | a.y * a.x * r + a.z * s, 28 | a.z * a.x * r - a.y * s, 29 | a.x * a.y * r - a.z * s, 30 | a.y * a.y * r + c, 31 | a.z * a.y * r + a.x * s, 32 | a.x * a.z * r + a.y * s, 33 | a.y * a.z * r - a.x * s, 34 | a.z * a.z * r + c 35 | ); 36 | return mul(m, p); 37 | } 38 | 39 | float nrand(float2 co) 40 | { 41 | return frac(sin(dot(co.xy, float2(12.9898, 78.233))) * 43758.5453); 42 | } 43 | 44 | float3 nrand3(float2 co) 45 | { 46 | float3 a = frac(cos(co.x*8.3e-3 + co.y)*float3(1.3e5, 4.7e5, 2.9e5)); 47 | float3 b = frac(sin(co.x*0.3e-3 + co.y)*float3(8.1e5, 1.0e5, 0.1e5)); 48 | float3 c = lerp(a, b, 0.5); 49 | return c; 50 | } 51 | 52 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/DF_Utils.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b82d88d04e443ad40862ceb89cbb3dfa 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/Easing.cginc: -------------------------------------------------------------------------------- 1 | #ifndef EASING_INCLUDED 2 | #define EASING_INCLUDED 3 | 4 | float EaseInQuad(float t) { return t * t; } 5 | 6 | float EaseOutQuad(float t) { return t * (2 - t); } 7 | 8 | float EaseInOutQuad(float t) { return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t; } 9 | 10 | float EaseInOutCubic(float t) { return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; } 11 | 12 | float EaseInOutQuart(float t) { return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; } 13 | 14 | float EaseInOutQuint(float t) { return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; } 15 | 16 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/Easing.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d95f2734f21662a4f9fbf313823c6470 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/Lighting.cginc: -------------------------------------------------------------------------------- 1 | #ifndef LIGHTING_UTIL_INCLUDED 2 | #define LIGHTING_UTIL_INCLUDED 3 | 4 | #include "AutoLight.cginc" 5 | 6 | UnityLight CreateLight(float3 wpos, float3 normal) 7 | { 8 | UnityLight light; 9 | #if defined(POINT) || defined(SPOT) || defined(POINT_COOKIE) 10 | light.dir = normalize(_WorldSpaceLightPos0.xyz - wpos); 11 | #else 12 | light.dir = _WorldSpaceLightPos0.xyz; 13 | #endif 14 | 15 | UNITY_LIGHT_ATTENUATION(attenuation, 0, wpos); 16 | light.color = _LightColor0.rgb * attenuation; 17 | light.ndotl = DotClamped(normal, light.dir); 18 | return light; 19 | }; 20 | 21 | UnityIndirect CreateIndirectLight_FWDBASE(float3 normal) 22 | { 23 | UnityIndirect indirectLight; 24 | indirectLight.diffuse = 0; 25 | indirectLight.specular = 0; 26 | indirectLight.diffuse += max(0, ShadeSH9(float4(normal, 1))); 27 | return indirectLight; 28 | }; 29 | 30 | UnityIndirect CreateIndirectLight_VERTEXLIGHT(float3 vertexLightColor) 31 | { 32 | UnityIndirect indirectLight; 33 | indirectLight.diffuse = 0; 34 | indirectLight.specular = 0; 35 | indirectLight.diffuse = vertexLightColor; 36 | return indirectLight; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/Lighting.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71fca9acd0b96cc4b94965de559a15ce 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterCommon.cginc: -------------------------------------------------------------------------------- 1 | #ifndef MARCHINGCUBE_FOOTER_COMMON_INCLUDED 2 | #define MARCHINGCUBE_FOOTER_COMMON_INCLUDED 3 | 4 | // memo 5 | // coordinate is -0.5 ~ 0.5 in each dimention 6 | 7 | #include "MarchingCubeHeader.cginc" 8 | 9 | float Sample(float x, float y, float z) 10 | { 11 | float3 s = _SegmentNum; 12 | bool f = x <= 1 || y <= 1 || z <= 1 || x >= s.x - 1 || y >= s.y - 1 || z >= s.z - 1; 13 | float3 p = float3(x, y, z) / s - (0.5).xxx; 14 | return f ? 0 : DistanceFunction(p, p * _Aspect); 15 | } 16 | 17 | float Sample(float3 p) { return Sample(p.x, p.y, p.z); } 18 | 19 | float getOffset(float val1, float val2) 20 | { 21 | // when drawn, one have to be greater than threshold, other have to be smaller than threshold 22 | // suppose (val1 = th + a, val2 = th - b), or (val1 = th - a, val2 = th - b) under 0 < a, b 23 | // the returned value is always a / (a + b) which represents linear interpolation 24 | float delta = val2 - val1; 25 | return delta == 0 ? 0.5 : (_Threashold - val1) / delta; 26 | } 27 | 28 | float3 getNormal(float fX, float fY, float fZ) 29 | { 30 | float3 normal; 31 | float offset = 1.0; 32 | normal.x = Sample(fX - offset, fY, fZ) - Sample(fX + offset, fY, fZ); 33 | normal.y = Sample(fX, fY - offset, fZ) - Sample(fX, fY + offset, fZ); 34 | normal.z = Sample(fX, fY, fZ - offset) - Sample(fX, fY, fZ + offset); 35 | return normal; 36 | } 37 | 38 | 39 | float3 getNormal(float3 f) { return getNormal(f.x, f.y, f.z); } 40 | 41 | float2 barycentricCoordinateArr(uint i) { return float2((i == 0) ? 1 : 0, (i == 1) ? 1 : 0); } 42 | 43 | v2g vert(appdata v) 44 | { 45 | v2g o = (v2g) 0; 46 | o.pos = v.vertex; 47 | return o; 48 | } 49 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterCommon.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d35e0c81e18f5746962f399b608cd5a 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterDeferred.cginc: -------------------------------------------------------------------------------- 1 | #ifndef MARCHINGCUBE_FOOTER_DEFERRED_INCLUDED 2 | #define MARCHINGCUBE_FOOTER_DEFERRED_INCLUDED 3 | 4 | #include "MarchingCubeHeader.cginc" 5 | #include "MarchingCubeFooterCommon.cginc" 6 | 7 | [maxvertexcount(15)] 8 | void geom_light(point v2g input[1], inout TriangleStream outStream) 9 | { 10 | g2f_light o = (g2f_light) 0; 11 | int i, j; 12 | float1 cubeValue[8]; 13 | float3 edgeVertices[12] = ZERO_ARRAY; 14 | float3 edgeNormals[12] = ZERO_ARRAY; 15 | float3 pos = input[0].pos.xyz; 16 | float3 defpos = pos; 17 | 18 | for (i = 0; i < 8; i++) cubeValue[i] = Sample(pos + vertexOffset[i]); 19 | 20 | pos *= _Scale; 21 | pos -= 0.5; 22 | 23 | int flagIndex = 0; 24 | 25 | for (i = 0; i < 8; i++) 26 | if (cubeValue[i] <= _Threashold) flagIndex |= (1 << i); 27 | 28 | int edgeFlags = cubeEdgeFlags[flagIndex]; 29 | if ((edgeFlags == 0) || (edgeFlags == 255)) return; 30 | 31 | float1 offset = 0.5; 32 | float3 vertex; 33 | for (i = 0; i < 12; i++) { 34 | if ((edgeFlags & (1 << i)) != 0) { 35 | offset = getOffset(cubeValue[edgeConnection[i].x], cubeValue[edgeConnection[i].y]); 36 | vertex = (vertexOffset[edgeConnection[i].x] + offset * edgeDirection[i]); 37 | edgeVertices[i] = pos + vertex * _Scale; 38 | edgeNormals[i] = getNormal(defpos + vertex); 39 | } 40 | } 41 | 42 | int vindex = 0; 43 | int findex = 0; 44 | for (i = 0; i < 5; i++) { 45 | findex = flagIndex * 16 + 3 * i; 46 | if (triangleConnectionTable[findex] < 0) break; 47 | 48 | for (j = 0; j < 3; j++) { 49 | vindex = triangleConnectionTable[findex + j]; 50 | float4 ppos = mul(_Matrix, float4(edgeVertices[vindex], 1)); 51 | o.pos = UnityObjectToClipPos(ppos); 52 | float3 norm = UnityObjectToWorldNormal(normalize(edgeNormals[vindex])); 53 | o.normal = normalize(mul(_Matrix, float4(norm, 0))); 54 | outStream.Append(o); 55 | } 56 | outStream.RestartStrip(); 57 | } 58 | } 59 | 60 | void frag_light(g2f_light IN, out half4 outDiffuse : SV_Target0, 61 | out half4 outSpecSmoothness : SV_Target1, 62 | out half4 outNormal : SV_Target2, 63 | out half4 outEmission : SV_Target3) 64 | { 65 | fixed3 normal = IN.normal; 66 | float3 worldPos = IN.worldPos; 67 | fixed3 worldViewDir = normalize(UnityWorldSpaceViewDir(worldPos)); 68 | 69 | SurfaceOutputStandard o = (SurfaceOutputStandard) 0; 70 | o.Albedo = _DiffuseColor.rgb; 71 | o.Emission = _EmissionColor * _EmissionIntensity; 72 | o.Metallic = _Metallic; 73 | o.Smoothness = _Glossiness; 74 | o.Alpha = 1.0; 75 | o.Occlusion = 1.0; 76 | o.Normal = normal; 77 | 78 | UnityGI gi; 79 | UNITY_INITIALIZE_OUTPUT(UnityGI, gi); 80 | gi.indirect.diffuse = 0; 81 | gi.indirect.specular = 0; 82 | gi.light.color = 0; 83 | gi.light.dir = half3(0, 1, 0); 84 | gi.light.ndotl = LambertTerm(o.Normal, gi.light.dir); 85 | 86 | UnityGIInput giInput; 87 | UNITY_INITIALIZE_OUTPUT(UnityGIInput, giInput); 88 | giInput.light = gi.light; 89 | giInput.worldPos = worldPos; 90 | giInput.worldViewDir = worldViewDir; 91 | giInput.atten = 1.0; 92 | 93 | giInput.ambient = IN.sh; 94 | 95 | giInput.probeHDR[0] = unity_SpecCube0_HDR; 96 | giInput.probeHDR[1] = unity_SpecCube1_HDR; 97 | 98 | LightingStandard_GI(o, giInput, gi); 99 | 100 | outEmission = LightingStandard_Deferred(o, worldViewDir, gi, outDiffuse, outSpecSmoothness, outNormal); 101 | outDiffuse.a = 1.0; 102 | } 103 | 104 | 105 | [maxvertexcount(15)] 106 | void geom_shadow(point v2g input[1], inout TriangleStream outStream) 107 | { 108 | g2f_shadow o = (g2f_shadow) 0; 109 | int i, j; 110 | float cubeValue[8]; 111 | float3 edgeVertices[12] = ZERO_ARRAY; 112 | float3 edgeNormals[12] = ZERO_ARRAY; 113 | float3 pos = input[0].pos.xyz; 114 | float3 defpos = pos; 115 | 116 | for (i = 0; i < 8; i++) 117 | cubeValue[i] = Sample(pos + vertexOffset[i]); 118 | 119 | pos *= _Scale; 120 | pos -= 0.5; 121 | 122 | int flagIndex = 0; 123 | 124 | for (i = 0; i < 8; i++) 125 | if (cubeValue[i] <= _Threashold) flagIndex |= (1 << i); 126 | 127 | int edgeFlags = cubeEdgeFlags[flagIndex]; 128 | if ((edgeFlags == 0) || (edgeFlags == 255)) return; 129 | 130 | float offset = 0.5; 131 | float3 vertex; 132 | for (i = 0; i < 12; i++) { 133 | if ((edgeFlags & (1 << i)) != 0) { 134 | offset = getOffset(cubeValue[edgeConnection[i].x], cubeValue[edgeConnection[i].y], _Threashold); 135 | vertex = (vertexOffset[edgeConnection[i].x] + offset * edgeDirection[i]); 136 | edgeVertices[i] = pos + vertex * _Scale; 137 | edgeNormals[i] = getNormal(defpos + vertex); 138 | } 139 | } 140 | 141 | int vindex = 0; 142 | int findex = 0; 143 | for (i = 0; i < 5; i++) { 144 | findex = flagIndex * 16 + 3 * i; 145 | if (triangleConnectionTable[findex] < 0) break; 146 | 147 | for (j = 0; j < 3; j++) { 148 | vindex = triangleConnectionTable[findex + j]; 149 | float4 ppos = mul(_Matrix, float4(edgeVertices[vindex], 1)); 150 | float3 norm = UnityObjectToWorldNormal(normalize(edgeNormals[vindex])); 151 | float4 lpos1 = mul(unity_WorldToObject, ppos); 152 | o.pos = UnityClipSpaceShadowCasterPos(lpos1, normalize(mul(_Matrix, float4(norm, 0)))); 153 | o.pos = UnityApplyLinearShadowBias(o.pos); 154 | o.hpos = o.pos; 155 | outStream.Append(o); 156 | } 157 | outStream.RestartStrip(); 158 | } 159 | } 160 | 161 | float4 frag_shadow(g2f_shadow i) : SV_Target 162 | { 163 | return i.hpos.z / i.hpos.w; 164 | } 165 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterDeferred.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512bd869f64286e42b33d21f20778804 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc: -------------------------------------------------------------------------------- 1 | #ifndef MARCHINGCUBE_FOOTER_WIREFRAME_INCLUDED 2 | #define MARCHINGCUBE_FOOTER_WIREFRAME_INCLUDED 3 | 4 | #include "MarchingCubeHeader.cginc" 5 | #include "MarchingCubeFooterCommon.cginc" 6 | 7 | [maxvertexcount(15)] 8 | void geom_wire(point v2g input[1], inout TriangleStream outStream) 9 | { 10 | g2f_wire o = (g2f_wire) 0; 11 | int i, j; 12 | float1 cubeValue[8]; 13 | float3 edgeVrts[12] = ZERO_ARRAY; 14 | float3 edgeNrms[12] = ZERO_ARRAY; 15 | float3 pos = input[0].pos.xyz; 16 | float3 defpos = pos; 17 | 18 | for (i = 0; i < 8; i++) 19 | cubeValue[i] = Sample(pos + vertexOffset[i]); 20 | 21 | pos = pos * _Scale - 0.5; 22 | 23 | int flagIndex = 0; 24 | for (i = 0; i < 8; i++) 25 | if (cubeValue[i] <= _Threashold) flagIndex |= (1 << i); 26 | 27 | int edgeFlags = cubeEdgeFlags[flagIndex]; 28 | if (edgeFlags == 0 || edgeFlags == 255) return; 29 | 30 | for (i = 0; i < 12; i++) { 31 | if ((edgeFlags & (1 << i)) != 0) { 32 | int2 ec = edgeConnection[i]; 33 | float1 offset = getOffset(cubeValue[ec.x], cubeValue[ec.y]); 34 | float3 vertex = vertexOffset[ec.x] + offset * edgeDirection[i]; 35 | edgeVrts[i] = pos + vertex * _Scale; 36 | edgeNrms[i] = getNormal(defpos + vertex); 37 | } 38 | } 39 | 40 | for (i = 0; i < 5; i++) { 41 | int fid = flagIndex * 16 + 3 * i; 42 | if (triangleConnectionTable[fid] < 0) break; 43 | for (j = 0; j < 3; j++) { 44 | int vid = triangleConnectionTable[fid + j]; 45 | float4 _pos = mul(_Matrix, float4(edgeVrts[vid], 1)); 46 | float3 _nrm = UnityObjectToWorldNormal(normalize(edgeNrms[vid])); 47 | o.pos = UnityObjectToClipPos(_pos); 48 | o.worldPos = mul(unity_ObjectToWorld, _pos); 49 | o.normal = normalize(mul(_Matrix, float4(_nrm, 0))); 50 | o.barycentricCoordinates = barycentricCoordinateArr(j); 51 | outStream.Append(o); 52 | } 53 | outStream.RestartStrip(); 54 | } 55 | } 56 | 57 | float4 frag_wire(g2f_wire i) : SV_Target 58 | { 59 | float3 albedo = _DiffuseColor.rgb; 60 | float3 specularTint; 61 | float oneMinusReflectivity; 62 | albedo = DiffuseAndSpecularFromMetallic(albedo, _Metallic, specularTint, oneMinusReflectivity); 63 | float4 col = UNITY_BRDF_PBS(albedo, specularTint, oneMinusReflectivity, _Glossiness, i.normal, normalize(UnityWorldSpaceViewDir(i.worldPos)), CreateLight(i.worldPos, i.normal), CreateIndirectLight_FWDBASE(i.normal)); 64 | float3 barys; 65 | barys.xy = i.barycentricCoordinates; 66 | barys.z = 1 - barys.x - barys.y; 67 | float3 deltas = fwidth(barys); 68 | float3 smoothing = deltas * _WireframeSmoothing; 69 | float3 thickness = deltas * _WireframeThickness; 70 | barys = smoothstep(thickness, thickness + smoothing, barys); 71 | float minBary = min(barys.x, min(barys.y, barys.z)); 72 | return float4(lerp(_WireframeColor, col.rgb, minBary).xyz, 1.0); 73 | } 74 | 75 | #endif -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeFooterWireframe.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9463d970ab17af94c931de1b864033c5 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeHeader.cginc: -------------------------------------------------------------------------------- 1 | #ifndef MARCHINGCUBE_HEADER_INCLUDED 2 | #define MARCHINGCUBE_HEADER_INCLUDED 3 | 4 | #include "UnityPBSLighting.cginc" 5 | #include "Lighting.cginc" 6 | 7 | #define ZERO_ARRAY { (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx, (0).xxx }; 8 | 9 | struct appdata 10 | { 11 | float4 vertex : POSITION; 12 | }; 13 | struct v2g 14 | { 15 | float4 pos : SV_POSITION; 16 | }; 17 | struct g2f_wire 18 | { 19 | float4 pos : SV_POSITION; 20 | float3 normal : NORMAL; 21 | float4 worldPos : TEXCOORD0; 22 | half3 sh : TEXCOORD1; 23 | float2 barycentricCoordinates : TEXCOORD2; 24 | }; 25 | 26 | struct g2f_light 27 | { 28 | float4 pos : SV_POSITION; 29 | float3 normal : NORMAL; 30 | float4 worldPos : TEXCOORD3; 31 | half3 sh : TEXCOORD4; 32 | }; 33 | 34 | struct g2f_shadow 35 | { 36 | float4 pos : SV_POSITION; 37 | float4 hpos : TEXCOORD5; 38 | }; 39 | 40 | float3 _SegmentNum; 41 | float3 _Scale; 42 | float3 _Aspect; 43 | float _Threashold; 44 | float4 _DiffuseColor; 45 | float4x4 _Matrix; 46 | float _EmissionIntensity; 47 | half3 _EmissionColor; 48 | half _Glossiness; 49 | half _Metallic; 50 | float3 _WireframeColor; 51 | float _WireframeSmoothing; 52 | float _WireframeThickness; 53 | float _LerpVal; 54 | 55 | StructuredBuffer vertexOffset; 56 | StructuredBuffer cubeEdgeFlags; 57 | StructuredBuffer edgeConnection; 58 | StructuredBuffer edgeDirection; 59 | StructuredBuffer triangleConnectionTable; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Assets/MarchingCube/Cginc/MarchingCubeHeader.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1cd7c640c51a494380c0e6e6ac38961 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MarchingCube/MC_Base.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MC_Base : MonoBehaviour 6 | { 7 | public MarchingCubeDrawMesh drawer; 8 | public Vector3Int segments; 9 | public Material mat; 10 | public Color diffuseColor = Color.green; 11 | public Color emissionColor = Color.black; 12 | public float emissionIntensity = 0; 13 | public Color wireframeColor = Color.white; 14 | [Range(-1, 1)] public float threashold = 0.5f; 15 | [Range(0, 10)] public float wireframeSmoothness = 0.5f; 16 | [Range(0, 10)] public float wireframeThickness = 0.5f; 17 | [Range(0, 1)] public float metallic = 0; 18 | [Range(0, 1)] public float glossiness = 0.5f; 19 | 20 | protected virtual void OnEnable() { 21 | drawer.mat = mat; 22 | drawer.segments = segments; 23 | } 24 | 25 | protected virtual void Update() { 26 | drawer.mat.SetFloat("_Threashold", threashold); 27 | drawer.mat.SetFloat("_Metallic", metallic); 28 | drawer.mat.SetFloat("_Glossiness", glossiness); 29 | drawer.mat.SetFloat("_EmissionIntensity", emissionIntensity); 30 | drawer.mat.SetColor("_DiffuseColor", diffuseColor); 31 | drawer.mat.SetColor("_EmissionColor", emissionColor); 32 | drawer.mat.SetColor("_WireframeColor", wireframeColor); 33 | drawer.mat.SetFloat("_WireframeSmoothing", wireframeSmoothness); 34 | drawer.mat.SetFloat("_WireframeThickness", wireframeThickness); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/MarchingCube/MC_Base.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4b15ebc504168940a87c6872ad52c6c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MarchingCube/MarchingCubeDefines.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49a6d411e9fd2f8439ce5908d695537e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MarchingCube/MarchingCubeDrawMesh.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class MarchingCubeDrawMesh : MonoBehaviour { 4 | 5 | public enum AspectFitting { Max, Min } 6 | public Material mat; 7 | public Vector3Int segments; 8 | public int scale; 9 | public AspectFitting fitting = AspectFitting.Min; 10 | int vertexMax = 0; 11 | Mesh mesh; 12 | Vector3 renderScale; 13 | public Vector3 aspect { get; private set; } 14 | MarchingCubeDefines mcDefines = null; 15 | 16 | void Initialize() { 17 | mesh = new Mesh(); 18 | vertexMax = segments.x * segments.y * segments.z; 19 | if(fitting == AspectFitting.Min) aspect = (Vector3)segments / Mathf.Min(Mathf.Min(segments.x, segments.y), segments.z); 20 | else aspect = (Vector3)segments / Mathf.Max(Mathf.Max(segments.x, segments.y), segments.z); 21 | renderScale = new Vector3(1f / segments.x, 1f / segments.y, 1f / segments.z); 22 | mcDefines = new MarchingCubeDefines(); 23 | transform.localScale = scale * aspect; 24 | CreateMesh(); 25 | } 26 | 27 | void CreateMesh() { 28 | var vertices = new Vector3[vertexMax]; 29 | var indices = new int[vertexMax]; 30 | for (int j = 0; j < vertexMax; j++) { 31 | vertices[j].x = j % segments.x; 32 | vertices[j].y = (j / segments.x) % segments.y; 33 | vertices[j].z = (j / (segments.x * segments.y)) % segments.z; 34 | indices[j] = j; 35 | } 36 | if (vertexMax > 65535) mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; 37 | mesh.vertices = vertices; 38 | mesh.SetIndices(indices, MeshTopology.Points, 0); 39 | mesh.bounds = new Bounds(transform.position, Vector3.one); 40 | } 41 | 42 | void RenderMesh() { 43 | mat.SetVector("_SegmentNum", (Vector3)segments); 44 | mat.SetVector("_Scale", renderScale); 45 | mat.SetVector("_Aspect", aspect); 46 | mat.SetMatrix("_Matrix", Matrix4x4.TRS(transform.position, transform.rotation, transform.localScale)); 47 | mat.SetBuffer("vertexOffset", mcDefines.vertexOffsetBuffer); 48 | mat.SetBuffer("cubeEdgeFlags", mcDefines.cubeEdgeFlagsBuffer); 49 | mat.SetBuffer("edgeConnection", mcDefines.edgeConnectionBuffer); 50 | mat.SetBuffer("edgeDirection", mcDefines.edgeDirectionBuffer); 51 | mat.SetBuffer("triangleConnectionTable", mcDefines.triangleConnectionTableBuffer); 52 | Graphics.DrawMesh(mesh, Matrix4x4.identity, mat, 0); 53 | } 54 | 55 | void Start() { 56 | Initialize(); 57 | } 58 | 59 | void Update() { 60 | if (mat != null) RenderMesh(); 61 | } 62 | 63 | void OnDestroy() { 64 | mcDefines.ReleaseBuffer(); 65 | Destroy(mesh); 66 | } 67 | 68 | void OnDrawGizmos() { 69 | Gizmos.color = Color.red; 70 | Gizmos.DrawWireCube(Vector3.zero, scale * aspect); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Assets/MarchingCube/MarchingCubeDrawMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 321899d9822fd05449dad8688239bb91 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34cef75c045924c4f957b3825f1b11e4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1af15179e019e754aa190ef46c8a63f6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ae72607bbbbc4a47891f7a16ad47ffb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/DOTween.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34192c5e0d14aee43a0e86cc4823268a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/DOTween.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/komietty/unity-marching-cubes/d8213ddf18205e4bf424569f75537f986adce514/Assets/Packages/Demigiant/DOTween/DOTween.dll -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/DOTween.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a811bde74b26b53498b4f6d872b09b6d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eadc06c645b2fdb418ec8730a0230224 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/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/Packages/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e2c6224d345d9249acfa6e8ef40bb2d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/DOTweenEditor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/komietty/unity-marching-cubes/d8213ddf18205e4bf424569f75537f986adce514/Assets/Packages/Demigiant/DOTween/Editor/DOTweenEditor.dll -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45d5034162d6cf04dbe46da84fc7d074 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 1 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18e488d4c190c88458b135d77e4823e7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e6ca81af7b3fdbecc7069b8644047713af97c8e311cd3da97e75eff0b973faa 3 | size 1565 4 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8da095e39e9b4df488dfd436f81116d6 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 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 | internalID: 0 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | secondaryTextures: [] 85 | spritePackingTag: 86 | pSDRemoveMatte: 0 87 | pSDShowRemoveMatteOption: 0 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Footer.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b1bccfb25ef58988d123ade538e28637da988dfaf33272067b641f34582e7b89 3 | size 4409 4 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Footer.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7051dba417b3d53409f2918f1ea4938d 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 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 | internalID: 0 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | secondaryTextures: [] 85 | spritePackingTag: 86 | pSDRemoveMatte: 0 87 | pSDShowRemoveMatteOption: 0 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Footer_dark.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2bc04d9700e60b53aa4741c4580d61e490b1192d3ea4f98f4437a2e776057a5a 3 | size 4429 4 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 519694efe2bb2914788b151fbd8c01f4 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 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 | internalID: 0 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | secondaryTextures: [] 85 | spritePackingTag: 86 | pSDRemoveMatte: 0 87 | pSDShowRemoveMatteOption: 0 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/komietty/unity-marching-cubes/d8213ddf18205e4bf424569f75537f986adce514/Assets/Packages/Demigiant/DOTween/Editor/Imgs/Header.jpg -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78a59ca99f8987941adb61f9e14a06a7 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 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 | internalID: 0 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | secondaryTextures: [] 85 | spritePackingTag: 86 | pSDRemoveMatte: 0 87 | pSDShowRemoveMatteOption: 0 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Modules.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86a16dea52fc22e4982a375fefd705b7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | #if false // 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/Packages/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/Packages/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/Packages/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | #if false && (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/Packages/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/Packages/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | #if false && (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/Packages/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/Packages/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/Packages/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/Packages/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 false // 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 false // 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 false // 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 false // 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/Packages/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/Packages/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/Packages/Demigiant/DOTween/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fccfc62abf2eb0a4db614853430894fd 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddf3cfeb1e10ad94da966eee5dae8707 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9141b5f1bed14d240867e4f6efa36f98 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/ConstantUtil.cginc: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANT_UTIL 2 | #define CONSTANT_UTIL 3 | 4 | #define PI 3.14159265359 5 | #define PI2 6.283185307189 6 | #define E 2.71828182846 7 | 8 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/ConstantUtil.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fb0c8eb8b9094147a4fdd7a8a1b47f3 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/FunctionUtil.cginc: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTION_UTIL 2 | #define FUNCTION_UTIL 3 | 4 | float pulse(float a, float b, float x) 5 | { 6 | return step(a, x) - step(b, x); 7 | } 8 | 9 | float smoothpulse(float a1, float a2, float b1, float b2, float x) 10 | { 11 | return smoothstep(a1, a2, x) - smoothstep(b1, b2, x); 12 | } 13 | 14 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/FunctionUtil.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56cdd9fab69856a418da8fd34c0f1322 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/GaussianBlur.cginc: -------------------------------------------------------------------------------- 1 | #ifndef GAUSSIANBLUR 2 | #define GAUSSIANBLUR 3 | #include "ConstantUtil.cginc" 4 | 5 | sampler2D _BlurTex; 6 | float4 DirectionalGaussianBlur(int samples, float2 dir, float SD, float blurSize, float aspct, float2 i_uv) 7 | { 8 | float invSamples = 1.0 / (samples - 1); 9 | float dispersion = SD * SD; 10 | float sum; 11 | float4 col; 12 | for (int i = 0; i < samples; i++) 13 | { 14 | float offset = (i * invSamples - 0.5) * blurSize * aspct; 15 | float2 uv = i_uv + dir * offset; 16 | float gauss = pow(E, -pow(offset, 2) / (2 * dispersion)) / sqrt(PI2 * dispersion); 17 | sum += gauss; 18 | col += tex2D(_BlurTex, uv) * gauss; 19 | } 20 | col /= sum; 21 | return col; 22 | } 23 | 24 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/GaussianBlur.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d7138bced6b3c640929fb1d4b016217 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/PhotoShopMath.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a96d0ff47c1753e45a8f3695d7a1d97f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/RandomUtil.cginc: -------------------------------------------------------------------------------- 1 | #ifndef RANDOMUTIL 2 | #define RANDOMUTIL 3 | #include "ConstantUtil.cginc" 4 | inline float rnd(float2 p) { 5 | return frac(sin(dot(p, float2(12.9898, 78.233))) * 43758.5453); 6 | } 7 | inline float3 rnd3(float2 p) { 8 | return 2.0 * (float3(rnd(p * 1), rnd(p * 2), rnd(p * 3)) - 0.5); 9 | } 10 | inline float rndSimple(float i) { 11 | return frac(sin(dot(float2(i, i * i) * 0.01, float2(12.9898, 78.233))) * 43758.5453); 12 | } 13 | inline float2 rndInsideCircle(float2 p) { 14 | float d = rnd(p.xy); 15 | float theta = rnd(p.yx) * PI * 2; 16 | return d * float2(cos(theta), sin(theta)); 17 | } 18 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/RandomUtil.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b81b15c0d99f7044e9cf0370a7085899 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/RotationUtil.cginc: -------------------------------------------------------------------------------- 1 | #ifndef ROTATION_UTIL 2 | #define ROTATION_UTIL 3 | 4 | float4 rotate(float4 v, float angle, float3 axis) 5 | { 6 | float3 a = normalize(axis); 7 | float s = sin(angle); 8 | float c = cos(angle); 9 | float r = 1.0 - c; 10 | float3x3 m = float3x3( 11 | a.x * a.x * r + c, 12 | a.y * a.x * r + a.z * s, 13 | a.z * a.x * r - a.y * s, 14 | a.x * a.y * r - a.z * s, 15 | a.y * a.y * r + c, 16 | a.z * a.y * r + a.x * s, 17 | a.x * a.z * r + a.y * s, 18 | a.y * a.z * r - a.x * s, 19 | a.z * a.z * r + c 20 | ); 21 | return float4(mul(m, v.xyz), 1); 22 | } 23 | 24 | float4x4 rotateMtx(float angle, float axis) 25 | { 26 | float3 a = normalize(axis); 27 | float s = sin(angle); 28 | float c = cos(angle); 29 | float r = 1.0 - c; 30 | float4x4 m = float4x4( 31 | a.x * a.x * r + c, 32 | a.y * a.x * r + a.z * s, 33 | a.z * a.x * r - a.y * s, 34 | 0, 35 | a.x * a.y * r - a.z * s, 36 | a.y * a.y * r + c, 37 | a.z * a.y * r + a.x * s, 38 | 0, 39 | a.x * a.z * r + a.y * s, 40 | a.y * a.z * r - a.x * s, 41 | a.z * a.z * r + c, 42 | 0, 43 | 0, 44 | 0, 45 | 0, 46 | 0 47 | ); 48 | return m; 49 | } 50 | 51 | float2 rotate2D(float2 v, float theta) 52 | { 53 | return float2(v.x * cos(theta) - v.y * sin(theta), v.x * sin(theta) + v.y * cos(theta)); 54 | } 55 | 56 | float2 lookAt2D(float2 v, float2 currDir, float2 nextDir) 57 | { 58 | float theta = acos(dot(currDir, nextDir)); 59 | int sn = sign(cross(float3(currDir, 0), float3(nextDir, 0)).z); 60 | return rotate2D(v, sn * theta); 61 | } 62 | 63 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/RotationUtil.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 182f1b1e5dfa5e342b3083fc3d129700 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/SimplexNoise.cginc: -------------------------------------------------------------------------------- 1 | #ifndef NOISE4D_INCLUDED 2 | #define NOISE4D_INCLUDED 3 | 4 | float4 mod289(float4 x) 5 | { 6 | return x - floor(x * (1.0 / 289.0)) * 289.0; 7 | } 8 | 9 | float mod289(float x) 10 | { 11 | return x - floor(x * (1.0 / 289.0)) * 289.0; 12 | } 13 | 14 | float4 permute(float4 x) 15 | { 16 | return mod289(((x * 34.0) + 1.0) * x); 17 | } 18 | 19 | float permute(float x) 20 | { 21 | return mod289(((x * 34.0) + 1.0) * x); 22 | } 23 | 24 | float4 taylorInvSqrt(float4 r) 25 | { 26 | return 1.79284291400159 - 0.85373472095314 * r; 27 | } 28 | 29 | float taylorInvSqrt(float r) 30 | { 31 | return 1.79284291400159 - 0.85373472095314 * r; 32 | } 33 | 34 | float4 grad4(float j, float4 ip) 35 | { 36 | const float4 ones = float4(1.0, 1.0, 1.0, -1.0); 37 | float4 p, s; 38 | 39 | p.xyz = floor(frac((j).xxx * ip.xyz) * 7.0) * ip.z - 1.0; 40 | p.w = 1.5 - dot(abs(p.xyz), ones.xyz); 41 | s = float4(p < 0.0); 42 | p.xyz = p.xyz + (s.xyz * 2.0 - 1.0) * s.www; 43 | 44 | return p; 45 | } 46 | 47 | // (sqrt(5) - 1)/4 = F4, used once below 48 | #define F4 0.309016994374947451 49 | 50 | float snoise(float4 v) 51 | { 52 | const float4 C = float4(0.138196601125011, // (5 - sqrt(5))/20 G4 53 | 0.276393202250021, // 2 * G4 54 | 0.414589803375032, // 3 * G4 55 | -0.447213595499958); // -1 + 4 * G4 56 | 57 | // First corner 58 | float4 i = floor(v + dot(v, (F4).xxxx)); 59 | float4 x0 = v - i + dot(i, C.xxxx); 60 | 61 | // Other corners 62 | 63 | // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) 64 | float4 i0; 65 | float3 isX = step(x0.yzw, x0.xxx); 66 | float3 isYZ = step(x0.zww, x0.yyz); 67 | // i0.x = dot( isX, float3( 1.0 ) ); 68 | i0.x = isX.x + isX.y + isX.z; 69 | i0.yzw = 1.0 - isX; 70 | // i0.y += dot( isYZ.xy, float2( 1.0 ) ); 71 | i0.y += isYZ.x + isYZ.y; 72 | i0.zw += 1.0 - isYZ.xy; 73 | i0.z += isYZ.z; 74 | i0.w += 1.0 - isYZ.z; 75 | 76 | // i0 now contains the unique values 0,1,2,3 in each channel 77 | float4 i3 = clamp(i0, 0.0, 1.0); 78 | float4 i2 = clamp(i0 - 1.0, 0.0, 1.0); 79 | float4 i1 = clamp(i0 - 2.0, 0.0, 1.0); 80 | 81 | // x0 = x0 - 0.0 + 0.0 * C.xxxx 82 | // x1 = x0 - i1 + 1.0 * C.xxxx 83 | // x2 = x0 - i2 + 2.0 * C.xxxx 84 | // x3 = x0 - i3 + 3.0 * C.xxxx 85 | // x4 = x0 - 1.0 + 4.0 * C.xxxx 86 | float4 x1 = x0 - i1 + C.xxxx; 87 | float4 x2 = x0 - i2 + C.yyyy; 88 | float4 x3 = x0 - i3 + C.zzzz; 89 | float4 x4 = x0 + C.wwww; 90 | 91 | // Permutations 92 | i = mod289(i); 93 | float j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x); 94 | float4 j1 = permute(permute(permute(permute( 95 | i.w + float4(i1.w, i2.w, i3.w, 1.0)) 96 | + i.z + float4(i1.z, i2.z, i3.z, 1.0)) 97 | + i.y + float4(i1.y, i2.y, i3.y, 1.0)) 98 | + i.x + float4(i1.x, i2.x, i3.x, 1.0)); 99 | 100 | // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope 101 | // 7*7*6 = 294, which is close to the ring size 17*17 = 289. 102 | float4 ip = float4(1.0 / 294.0, 1.0 / 49.0, 1.0 / 7.0, 0.0); 103 | 104 | float4 p0 = grad4(j0, ip); 105 | float4 p1 = grad4(j1.x, ip); 106 | float4 p2 = grad4(j1.y, ip); 107 | float4 p3 = grad4(j1.z, ip); 108 | float4 p4 = grad4(j1.w, ip); 109 | 110 | // Normalise gradients 111 | float4 norm = taylorInvSqrt(float4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); 112 | p0 *= norm.x; 113 | p1 *= norm.y; 114 | p2 *= norm.z; 115 | p3 *= norm.w; 116 | p4 *= taylorInvSqrt(dot(p4, p4)); 117 | 118 | // Mix contributions from the five corners 119 | float3 m0 = max(0.6 - float3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0); 120 | float2 m1 = max(0.6 - float2(dot(x3, x3), dot(x4, x4)), 0.0); 121 | m0 = m0 * m0; 122 | m1 = m1 * m1; 123 | return 49.0 * (dot(m0 * m0, float3(dot(p0, x0), dot(p1, x1), dot(p2, x2))) 124 | + dot(m1 * m1, float2(dot(p3, x3), dot(p4, x4)))); 125 | 126 | } 127 | 128 | float2 snoise2D(float4 x) 129 | { 130 | float s = snoise(x); 131 | float s1 = snoise(float4(x.y - 19.1, x.z + 33.4, x.x + 47.2, x.w)); 132 | float2 c = float2(s, s1); 133 | return c; 134 | } 135 | 136 | float3 snoise3D(float4 x) 137 | { 138 | float s = snoise(x); 139 | float s1 = snoise(float4(x.y - 19.1, x.z + 33.4, x.x + 47.2, x.w)); 140 | float s2 = snoise(float4(x.z + 74.2, x.x - 124.5, x.y + 99.4, x.w)); 141 | float3 c = float3(s, s1, s2); 142 | return c; 143 | } 144 | 145 | float3 curlNoise(float4 p) 146 | { 147 | 148 | const float e = 0.0009765625; 149 | float4 dx = float4(e, 0.0, 0.0, 0.0); 150 | float4 dy = float4(0.0, e, 0.0, 0.0); 151 | float4 dz = float4(0.0, 0.0, e, 0.0); 152 | 153 | float3 p_x0 = snoise3D(p - dx); 154 | float3 p_x1 = snoise3D(p + dx); 155 | float3 p_y0 = snoise3D(p - dy); 156 | float3 p_y1 = snoise3D(p + dy); 157 | float3 p_z0 = snoise3D(p - dz); 158 | float3 p_z1 = snoise3D(p + dz); 159 | 160 | float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y; 161 | float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z; 162 | float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x; 163 | 164 | const float divisor = 1.0 / (2.0 * e); 165 | return normalize(float3(x, y, z) * divisor); 166 | } 167 | 168 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Cginc/SimplexNoise.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de7eacdf601156746abfbda6be044212 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/README.md: -------------------------------------------------------------------------------- 1 | `git submodule add git@github.com:komietty/unity-gist.git Assets/Packages/unity-gist` 2 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95e99ae5e3a1c3343a29ff758e1bf386 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d1a620d33f4c4f4d9aa8bfa6c2202d9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ComputeBufferUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace kmty.gist { 5 | 6 | public class ComputeBufferUtil { 7 | 8 | static public void Dispose(ComputeBuffer buff) { 9 | if (buff != null) { 10 | buff.Release(); 11 | buff = null; 12 | } 13 | } 14 | static public void Swap(ref ComputeBuffer src, ref ComputeBuffer dst) { 15 | ComputeBuffer tmp = src; 16 | src = dst; 17 | dst = tmp; 18 | } 19 | } 20 | 21 | public class PingPongBuffer : System.IDisposable { 22 | 23 | protected ComputeBuffer buffer0, buffer1; 24 | public ComputeBuffer Read => buffer0; 25 | public ComputeBuffer Write => buffer1; 26 | 27 | public PingPongBuffer(int count, int stride, ComputeBufferType type = ComputeBufferType.Default) { 28 | buffer0 = new ComputeBuffer(count, stride, type); 29 | buffer1 = new ComputeBuffer(count, stride, type); 30 | } 31 | public void SetData(Array data) { 32 | buffer0.SetData(data); 33 | buffer1.SetData(data); 34 | } 35 | public void SetCounterValue(uint counter) { 36 | buffer0.SetCounterValue(counter); 37 | buffer1.SetCounterValue(counter); 38 | } 39 | public void Swap() { 40 | var tmp = buffer0; 41 | buffer0 = buffer1; 42 | buffer1 = tmp; 43 | } 44 | public void Dispose() { 45 | buffer0.Dispose(); 46 | buffer1.Dispose(); 47 | } 48 | public static implicit operator ComputeBuffer(PingPongBuffer buf) => buf.Read; 49 | } 50 | } -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ComputeBufferUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 726c9d40e5d91b843b646ef90d80969c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ComputeShaderUtil.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace kmty.gist { 4 | public static class ComputeShaderUtil { 5 | public static void Dispatch1D(ComputeShader compute, int kernel, int count) { 6 | uint tx, ty, tz; 7 | compute.GetKernelThreadGroupSizes(kernel, out tx, out ty, out tz); 8 | compute.Dispatch(kernel, GetKernelBlock(count, (int)tx), (int)ty, (int)tz); 9 | } 10 | public static void Dispatch2D(ComputeShader compute, int kernel, int width, int height) { 11 | uint tx, ty, tz; 12 | compute.GetKernelThreadGroupSizes(kernel, out tx, out ty, out tz); 13 | compute.Dispatch(kernel, GetKernelBlock(width, (int)tx), GetKernelBlock(height, (int)ty), 1); 14 | } 15 | public static void Dispatch3D(ComputeShader compute, int kernel, int width, int height, int depth) { 16 | uint tx, ty, tz; 17 | compute.GetKernelThreadGroupSizes(kernel, out tx, out ty, out tz); 18 | compute.Dispatch(kernel, GetKernelBlock(width, (int)tx), GetKernelBlock(height, (int)ty), GetKernelBlock(depth, (int)tz)); 19 | } 20 | static int GetKernelBlock(int count, int blockSize) => (count + blockSize - 1) / blockSize; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ComputeShaderUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 033e235d002040043902d59bf1144f8a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ObjectPoolBuffer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace kmty.gist { 4 | 5 | public class ObjectPoolBuffer : System.IDisposable { 6 | 7 | public ComputeBuffer PoolBuffer => poolBuffer; 8 | public ComputeBuffer CountBuffer => countBuffer; 9 | 10 | protected ComputeBuffer poolBuffer, countBuffer; 11 | public uint[] countArgs = new uint[] { 1, 1, 0, 0, 0 }; 12 | 13 | public ObjectPoolBuffer(int count) { 14 | poolBuffer = new ComputeBuffer(count, sizeof(int), ComputeBufferType.Append); 15 | poolBuffer.SetCounterValue(0); 16 | countBuffer = new ComputeBuffer(5, sizeof(uint), ComputeBufferType.IndirectArguments); 17 | countBuffer.SetData(countArgs); 18 | } 19 | 20 | public uint CopyPoolSize(bool copyToInstanceCounter = false) { 21 | int offset = copyToInstanceCounter ? 1 : 0; 22 | countBuffer.SetData(countArgs); 23 | ComputeBuffer.CopyCount(poolBuffer, countBuffer, offset * 4); 24 | countBuffer.GetData(countArgs); 25 | return countArgs[offset]; 26 | } 27 | 28 | public void Rest() { 29 | poolBuffer.SetCounterValue(0); 30 | countArgs = new uint[] { 1, 1, 0, 0, 0 }; 31 | countBuffer.SetData(countArgs); 32 | } 33 | 34 | public virtual void Dispose() { 35 | poolBuffer.Dispose(); 36 | countBuffer.Dispose(); 37 | } 38 | } 39 | } 40 | 41 | // memo 42 | // IndirectArguments Buffer layout 43 | //0:3 IndexCountPerInstance 44 | //4:7 InstanceCount 45 | //8:11 StartIndexLocation 46 | //12:15 BaseVertexLocation 47 | //16:19 StartInstanceLocation 48 | //20:35 Padding 49 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/ObjectPoolBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 804c16e270af8fa4f815560518392cda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/Recorder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace kmty.gist { 4 | public class Recorder : MonoBehaviour { 5 | 6 | public string folderName; 7 | public int framerate = 60; 8 | public int maxRecordSeconds = 180; 9 | public bool recode = false; 10 | int frameCount; 11 | 12 | void Start() { 13 | if (recode) StartRecording(); 14 | } 15 | 16 | void StartRecording() { 17 | System.IO.Directory.CreateDirectory(folderName); 18 | Time.captureFramerate = framerate; 19 | frameCount = -1; 20 | } 21 | 22 | void Update() { 23 | if (!string.IsNullOrEmpty(folderName) && frameCount > 0 && frameCount < framerate * maxRecordSeconds && recode) 24 | ScreenCapture.CaptureScreenshot($"{folderName}/frame{frameCount.ToString("0000")}.png"); 25 | frameCount++; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/Recorder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73ff8ca4e52ae84194c193074d5a8f0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/RendertextureUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using UnityEngine; 4 | 5 | namespace kmty.gist { 6 | public class RenderTextureUtil { 7 | static public void Build(ref RenderTexture tgt, int w, int h, int d = 0, bool randomWrite = true, RenderTextureFormat f = 0) { 8 | if (tgt != null) { 9 | UnityEngine.Object.Destroy(tgt); 10 | tgt = null; 11 | } 12 | tgt = new RenderTexture(w, h, d, f); 13 | tgt.enableRandomWrite = randomWrite; 14 | tgt.Create(); 15 | } 16 | static public void Rebuild(RenderTexture src, ref RenderTexture tgt) { 17 | if (src != null && (tgt == null || tgt.width != src.width || tgt.height != src.height)) 18 | Build(ref tgt, src.width, src.height, src.depth, src.enableRandomWrite, src.format); 19 | } 20 | static public void Clear(RenderTexture tgt) { 21 | if (tgt == null) return; 22 | var store = RenderTexture.active; 23 | RenderTexture.active = tgt; 24 | GL.Clear(true, true, Color.clear); 25 | RenderTexture.active = store; 26 | } 27 | static public void Destroy(RenderTexture tgt) { 28 | if (tgt != null) { 29 | UnityEngine.Object.Destroy(tgt); 30 | tgt = null; 31 | } 32 | } 33 | static public void savePng(RenderTexture rt, string path) { 34 | Texture2D tex = new Texture2D(rt.width, rt.height, TextureFormat.RGB24, false); 35 | RenderTexture.active = rt; 36 | tex.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0); 37 | tex.Apply(); 38 | byte[] bytes = tex.EncodeToPNG(); 39 | UnityEngine.Object.Destroy(tex); 40 | File.WriteAllBytes(Application.dataPath + $"{path}.png", bytes); 41 | } 42 | } 43 | 44 | public class PingPongRenderTexture : IDisposable { 45 | protected RenderTexture rt0, rt1; 46 | public RenderTexture Read => rt0; 47 | public RenderTexture Write => rt1; 48 | 49 | public PingPongRenderTexture(int w, int h, int depth, RenderTextureFormat format, FilterMode filter = FilterMode.Point) { 50 | 51 | rt0 = new RenderTexture(w, h, depth, format) { 52 | filterMode = filter, 53 | wrapMode = TextureWrapMode.Clamp, 54 | hideFlags = HideFlags.HideAndDontSave, 55 | enableRandomWrite = true 56 | }; 57 | rt1 = new RenderTexture(w, h, depth, format) { 58 | filterMode = filter, 59 | wrapMode = TextureWrapMode.Clamp, 60 | hideFlags = HideFlags.HideAndDontSave, 61 | enableRandomWrite = true 62 | }; 63 | rt0.Create(); 64 | rt1.Create(); 65 | } 66 | 67 | public PingPongRenderTexture(RenderTexture rt) { 68 | rt0 = new RenderTexture(rt); 69 | rt1 = new RenderTexture(rt); 70 | rt0.Create(); 71 | rt1.Create(); 72 | } 73 | 74 | public void Copy() { 75 | Graphics.Blit(rt0, rt1); 76 | } 77 | 78 | public void Swap() { 79 | var tmp = rt0; 80 | rt0 = rt1; 81 | rt1 = tmp; 82 | } 83 | 84 | public void Dispose() { 85 | RenderTextureUtil.Destroy(rt0); 86 | RenderTextureUtil.Destroy(rt1); 87 | } 88 | 89 | public static implicit operator RenderTexture(PingPongRenderTexture prt) => prt.Read; 90 | } 91 | } -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/RendertextureUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: caf842787bda4074ea654f1b93d19a52 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/SimplexNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb7469c897df9834eb17784c730b553f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/SingletonMonoBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace kmty.gist { 4 | public abstract class SingletonMonoBehaviour : MonoBehaviour where T : SingletonMonoBehaviour { 5 | static T instance; 6 | bool _inited = false; 7 | 8 | public static T Instance { 9 | get { 10 | if (instance == null) { 11 | instance = (T)FindObjectOfType(typeof(T)); 12 | if (instance == null) Debug.LogWarning(typeof(T) + " is nothing"); 13 | } 14 | return instance; 15 | } 16 | } 17 | 18 | public static T GetInstance() => instance; 19 | 20 | protected virtual void Awake() { 21 | CheckInstance(); 22 | SingletonInitialize(); 23 | } 24 | 25 | bool CheckInstance() { 26 | if (instance == null) { 27 | instance = (T)this; 28 | return true; 29 | } 30 | else if (Instance == this) return true; 31 | 32 | Destroy(this); 33 | return false; 34 | } 35 | void SingletonInitialize() { 36 | if (_inited == false) _inited = true; 37 | 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Script/SingletonMonoBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4240c5df62d9e7b47aeba4a1b33d567c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8365bd50ffca0946bbb047abecd324a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/CustomLighting.cginc: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOM_LIGHTING_INCLUDED 2 | #define CUSTOM_LIGHTING_INCLUDED 3 | 4 | #include "UnityPBSLighting.cginc" 5 | #include "AutoLight.cginc" 6 | 7 | sampler2D _MainTex; 8 | float4 _MainTex_ST; 9 | float _Smoothness; 10 | float4 _ATint; 11 | float _Metallic; 12 | 13 | struct appdata 14 | { 15 | float4 vertex : POSITION; 16 | float3 normal : NORMAL; 17 | float2 uv : TEXCOORD0; 18 | }; 19 | 20 | struct v2f 21 | { 22 | float4 vertex : SV_POSITION; 23 | float2 uv : TEXCOORD0; 24 | float3 normal : TEXCOORD1; 25 | float3 wpos : TEXCOORD2; 26 | #if defined(VERTEXLIGHT_ON) 27 | float3 vertexLightColor : TEXCOORD3; 28 | #endif 29 | }; 30 | 31 | void ComputeVertexLightColor (inout v2f i) 32 | { 33 | #if defined(VERTEXLIGHT_ON) 34 | i.vertexLightColor = Shade4PointLights( 35 | unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, 36 | unity_LightColor[0].rgb, unity_LightColor[1].rgb, 37 | unity_LightColor[2].rgb, unity_LightColor[3].rgb, 38 | unity_4LightAtten0, i.worldPos, i.normal 39 | ); 40 | #endif 41 | }; 42 | 43 | v2f vert (appdata v) 44 | { 45 | v2f o; 46 | o.vertex = UnityObjectToClipPos(v.vertex); 47 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 48 | o.normal = UnityObjectToWorldNormal(v.normal); 49 | o.wpos = mul(unity_ObjectToWorld, v.vertex); 50 | ComputeVertexLightColor(o); 51 | return o; 52 | } 53 | 54 | UnityLight CreateLight (v2f i) 55 | { 56 | UnityLight light; 57 | #if defined(POINT) || defined(SPOT) || defined(POINT_COOKIE) 58 | light.dir = normalize(_WorldSpaceLightPos0.xyz - i.wpos); 59 | #else 60 | light.dir = _WorldSpaceLightPos0.xyz; 61 | #endif 62 | 63 | UNITY_LIGHT_ATTENUATION(attenuation, 0, i.wpos); 64 | light.color = _LightColor0.rgb * attenuation; 65 | light.ndotl = DotClamped(i.normal, light.dir); 66 | return light; 67 | }; 68 | 69 | UnityIndirect CreateIndirectLight (v2f i) 70 | { 71 | UnityIndirect indirectLight; 72 | indirectLight.diffuse = 0; 73 | indirectLight.specular = 0; 74 | 75 | #if defined(VERTEXLIGHT_ON) 76 | indirectLight.diffuse = i.vertexLightColor; 77 | #endif 78 | #if defined(FORWARD_BASE_PASS) 79 | indirectLight.diffuse += max(0, ShadeSH9(float4(i.normal, 1))); 80 | #endif 81 | 82 | return indirectLight; 83 | }; 84 | 85 | fixed4 frag (v2f i) : SV_Target 86 | { 87 | i.normal = normalize(i.normal); 88 | float3 albedo = tex2D(_MainTex, i.uv).rgb * _ATint.rgb; 89 | float3 viewerDir = normalize(_WorldSpaceCameraPos - i.wpos); 90 | float3 specularTint; 91 | float oneMinusReflectivity; 92 | 93 | albedo = DiffuseAndSpecularFromMetallic(albedo, _Metallic, specularTint, oneMinusReflectivity); 94 | 95 | return UNITY_BRDF_PBS( 96 | albedo, 97 | specularTint, 98 | oneMinusReflectivity, 99 | _Smoothness, 100 | i.normal, 101 | viewerDir, 102 | CreateLight(i), 103 | CreateIndirectLight(i) 104 | ); 105 | } 106 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/CustomLighting.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67b328d8c18d5d7428b390445de47844 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/CustomLighting.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/CustomLighting" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Albedo", 2D) = "white" {} 6 | _Smoothness ("Smoothness", Range(0, 1)) = 0.5 7 | _ATint ("ATint", Color) = (1, 1, 1, 1) 8 | [Gamma]_Metallic ("Metallic", Range(0, 1)) = 0.5 9 | } 10 | SubShader 11 | { 12 | Pass 13 | { 14 | Tags {"LightMode" = "ForwardBase"} 15 | 16 | CGPROGRAM 17 | #pragma target 3.0 18 | #pragma multi_compile _ VERTEXLIGHT_ON 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #define FORWARD_BASE_PASS 22 | #include "CustomLighting.cginc" 23 | ENDCG 24 | } 25 | 26 | Pass 27 | { 28 | Tags {"LightMode" = "ForwardAdd"} 29 | Blend One One 30 | ZWrite Off 31 | 32 | CGPROGRAM 33 | #pragma target 3.0 34 | #pragma multi_compile_fwdadd 35 | #pragma vertex vert 36 | #pragma fragment frag 37 | #include "CustomLighting.cginc" 38 | ENDCG 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/CustomLighting.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1864894953bca5d4e8c42c4298e5e423 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Tessellation.cginc: -------------------------------------------------------------------------------- 1 | #ifndef TESSELLATION_INCLUDED 2 | #define TESSELLATION_INCLUDED 3 | 4 | #include "UnityCG.cginc" 5 | 6 | float3 _WireframeColor; 7 | float _WireframeSmoothing; 8 | float _WireframeThickness; 9 | float _Tesselletionfactor0; 10 | float _Tesselletionfactor1; 11 | float _TessellationEdgeLen; 12 | 13 | struct VertexData 14 | { 15 | UNITY_VERTEX_INPUT_INSTANCE_ID 16 | float4 vertex : POSITION; 17 | float3 normal : NORMAL; 18 | float4 tangent : TANGENT; 19 | float2 uv1 : TEXCOORD1; 20 | float2 uv2 : TEXCOORD2; 21 | }; 22 | 23 | struct v2t 24 | { 25 | float4 vertex : INTERNALTESSPOS; 26 | float3 normal : NORMAL; 27 | float4 tangent : TANGENT; 28 | float2 uv1 : TEXCOORD1; 29 | float2 uv2 : TEXCOORD2; 30 | }; 31 | 32 | struct t2g 33 | { 34 | float4 vertex : SV_POSITION; 35 | float3 normal : TEXCOORD3; 36 | float3 wpos : TEXCOORD4; 37 | }; 38 | 39 | struct TessellationFactors 40 | { 41 | float edge[3] : SV_TessFactor; 42 | float inside : SV_InsideTessFactor; 43 | }; 44 | 45 | struct g2f 46 | { 47 | t2g data; 48 | float2 barycentricCoordinates : TEXCOORD5; 49 | }; 50 | 51 | v2t vert (VertexData v) 52 | { 53 | v2t p; 54 | p.vertex = v.vertex; 55 | p.normal = v.normal; 56 | p.tangent = v.tangent; 57 | p.uv1 = v.uv1; 58 | p.uv2 = v.uv2; 59 | return p; 60 | } 61 | 62 | [UNITY_domain("tri")] 63 | [UNITY_outputcontrolpoints(3)] 64 | [UNITY_outputtopology("triangle_cw")] 65 | [UNITY_partitioning("fractional_even")] 66 | [UNITY_patchconstantfunc("MyPatchConstantFunction")] 67 | v2t hurl (InputPatch patch, uint id : SV_OutputControlPointID) 68 | { 69 | return patch[id]; 70 | } 71 | 72 | float TessellationEdgeFactor (v2t cp0, v2t cp1) 73 | { 74 | #if defined(_TESSELLATION_EDGE) 75 | float3 p0 = mul(unity_ObjectToWorld, float4(cp0.vertex.xyz, 1)).xyz; 76 | float3 p1 = mul(unity_ObjectToWorld, float4(cp1.vertex.xyz, 1)).xyz; 77 | float edgeLength = distance(p0, p1); 78 | return edgeLength / _TessellationEdgeLen; 79 | #else 80 | return _Tesselletionfactor0; 81 | #endif 82 | } 83 | 84 | TessellationFactors MyPatchConstantFunction (InputPatch patch) 85 | { 86 | TessellationFactors f; 87 | f.edge[0] = TessellationEdgeFactor(patch[1], patch[2]); 88 | f.edge[1] = TessellationEdgeFactor(patch[2], patch[0]); 89 | f.edge[2] = TessellationEdgeFactor(patch[0], patch[1]); 90 | f.inside = (f.edge[0] + f.edge[1] + f.edge[2]) * (1 / 3.0); 91 | return f; 92 | } 93 | 94 | [UNITY_domain("tri")] 95 | t2g dmin (TessellationFactors factors, OutputPatch patch, float3 barycentricCoordinates : SV_DomainLocation) 96 | { 97 | VertexData data; 98 | #define MY_DOMAIN_PROGRAM_INTERPOLATE(fieldName) data.fieldName = patch[0].fieldName * barycentricCoordinates.x + patch[1].fieldName * barycentricCoordinates.y + patch[2].fieldName * barycentricCoordinates.z; 99 | MY_DOMAIN_PROGRAM_INTERPOLATE(vertex) 100 | MY_DOMAIN_PROGRAM_INTERPOLATE(normal) 101 | MY_DOMAIN_PROGRAM_INTERPOLATE(tangent) 102 | MY_DOMAIN_PROGRAM_INTERPOLATE(uv1) 103 | MY_DOMAIN_PROGRAM_INTERPOLATE(uv2) 104 | 105 | t2g o; 106 | o.vertex = UnityObjectToClipPos(data.vertex); 107 | o.normal = UnityObjectToWorldNormal(data.normal); 108 | o.wpos = mul(unity_ObjectToWorld, data.vertex); 109 | return o; 110 | } 111 | 112 | [maxvertexcount(3)] 113 | void geom (triangle t2g i[3], inout TriangleStream stream) 114 | { 115 | float3 p0 = i[0].wpos; 116 | float3 p1 = i[1].wpos; 117 | float3 p2 = i[2].wpos; 118 | float3 triangleNormal = normalize(cross(p1 - p0, p2 - p0)); 119 | 120 | g2f g0, g1, g2; 121 | g0.data = i[0]; 122 | g1.data = i[1]; 123 | g2.data = i[2]; 124 | g0.data.normal = triangleNormal; 125 | g1.data.normal = triangleNormal; 126 | g2.data.normal = triangleNormal; 127 | g0.barycentricCoordinates = float2(1, 0); 128 | g1.barycentricCoordinates = float2(0, 1); 129 | g2.barycentricCoordinates = float2(0, 0); 130 | stream.Append(g0); 131 | stream.Append(g1); 132 | stream.Append(g2); 133 | } 134 | 135 | fixed4 frag (g2f i) : SV_Target 136 | { 137 | i.data.normal = normalize(i.data.normal); 138 | float3 barys; 139 | barys.xy = i.barycentricCoordinates; 140 | barys.z = 1 - barys.x - barys.y; 141 | float3 deltas = fwidth(barys); 142 | float3 smoothing = deltas * _WireframeSmoothing; 143 | float3 thickness = deltas * _WireframeThickness; 144 | barys = smoothstep(thickness, thickness + smoothing, barys); 145 | float minBary = min(barys.x, min(barys.y, barys.z)); 146 | return float4(lerp(_WireframeColor, 0, minBary), 1.0); 147 | } 148 | 149 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Tessellation.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b95198c8cd3900408cd84e0579968c3 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Tessellation.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/Tessellation" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Albedo", 2D) = "white" {} 6 | _Smoothness ("Smoothness", Range(0, 1)) = 0.5 7 | _ATint ("ATint", Color) = (1, 1, 1, 1) 8 | [Gamma] _Metallic ("Metallic", Range(0, 1)) = 0.5 9 | _WireframeColor ("Wireframe Color", Color) = (0, 0, 0) 10 | _WireframeSmoothing ("Wireframe Smoothing", Range(0, 10)) = 1 11 | _WireframeThickness ("Wireframe Thickness", Range(0, 10)) = 1 12 | _Tesselletionfactor0 ("TesselletionFactor0", Range(1, 64)) = 1.0 13 | _Tesselletionfactor1 ("TesselletionFactor1", Range(1, 64)) = 1.0 14 | _TessellationEdgeLen ("Tessellation Edge Length", Range(0.1, 1)) = 0.5 15 | 16 | } 17 | SubShader 18 | { 19 | Pass 20 | { 21 | CGPROGRAM 22 | #pragma target 4.6 23 | #pragma shader_feature _TESSELLATION_EDGE 24 | #include "Tessellation.cginc" 25 | #define _TESSELLATION_EDGE true 26 | #pragma vertex vert 27 | #pragma hull hurl 28 | #pragma domain dmin 29 | #pragma geometry geom 30 | #pragma fragment frag 31 | ENDCG 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Tessellation.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12b97dc475ffe714e87b511a723bc73b 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Wireframing.cginc: -------------------------------------------------------------------------------- 1 | #ifndef WIREFRAMING_INCLUDED 2 | #define WIREFRAMING_INCLUDED 3 | 4 | #include "UnityCG.cginc" 5 | 6 | float3 _WireframeColor; 7 | float _WireframeSmoothing; 8 | float _WireframeThickness; 9 | 10 | struct appdata 11 | { 12 | float4 vertex : POSITION; 13 | float3 normal : NORMAL; 14 | }; 15 | 16 | struct v2g 17 | { 18 | float4 vertex : SV_POSITION; 19 | float3 normal : TEXCOORD0; 20 | float3 wpos : TEXCOORD1; 21 | }; 22 | 23 | struct g2f 24 | { 25 | v2g data; 26 | float2 barycentricCoordinates : TEXCOORD2; 27 | }; 28 | 29 | v2g vert (appdata v) 30 | { 31 | v2g o; 32 | o.vertex = UnityObjectToClipPos(v.vertex); 33 | o.normal = UnityObjectToWorldNormal(v.normal); 34 | o.wpos = mul(unity_ObjectToWorld, v.vertex); 35 | return o; 36 | } 37 | 38 | [maxvertexcount(3)] 39 | void geom (triangle v2g i[3], inout TriangleStream stream) 40 | { 41 | float3 p0 = i[0].wpos; 42 | float3 p1 = i[1].wpos; 43 | float3 p2 = i[2].wpos; 44 | float3 triangleNormal = normalize(cross(p1 - p0, p2 - p0)); 45 | 46 | g2f g0, g1, g2; 47 | g0.data = i[0]; 48 | g1.data = i[1]; 49 | g2.data = i[2]; 50 | 51 | g0.data.normal = triangleNormal; 52 | g1.data.normal = triangleNormal; 53 | g2.data.normal = triangleNormal; 54 | 55 | g0.barycentricCoordinates = float2(1, 0); 56 | g1.barycentricCoordinates = float2(0, 1); 57 | g2.barycentricCoordinates = float2(0, 0); 58 | 59 | stream.Append(g0); 60 | stream.Append(g1); 61 | stream.Append(g2); 62 | } 63 | 64 | float4 frag (g2f i) : SV_Target 65 | { 66 | i.data.normal = normalize(i.data.normal); 67 | float3 albedo = 0; 68 | float3 barys; 69 | barys.xy = i.barycentricCoordinates; 70 | barys.z = 1 - barys.x - barys.y; 71 | float3 deltas = fwidth(barys); 72 | float3 smoothing = deltas * _WireframeSmoothing; 73 | float3 thickness = deltas * _WireframeThickness; 74 | barys = smoothstep(thickness, thickness + smoothing, barys); 75 | float minBary = min(barys.x, min(barys.y, barys.z)); 76 | return float4(lerp(_WireframeColor, albedo, minBary).xyz, 1.0); 77 | } 78 | 79 | #endif -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Wireframing.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc73d49ba33915045952bec9d9ecc36c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Wireframing.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/Wireframing" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Albedo", 2D) = "white" {} 6 | _Smoothness ("Smoothness", Range(0, 1)) = 0.5 7 | _ATint ("ATint", Color) = (1, 1, 1, 1) 8 | [Gamma] _Metallic ("Metallic", Range(0, 1)) = 0.5 9 | _WireframeColor ("Wireframe Color", Color) = (0, 0, 0) 10 | _WireframeSmoothing ("Wireframe Smoothing", Range(0, 10)) = 1 11 | _WireframeThickness ("Wireframe Thickness", Range(0, 10)) = 1 12 | } 13 | SubShader 14 | { 15 | Pass 16 | { 17 | Tags {"LightMode" = "ForwardBase"} 18 | 19 | CGPROGRAM 20 | #pragma target 3.0 21 | #pragma multi_compile _ VERTEXLIGHT_ON 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | #define FORWARD_BASE_PASS 25 | #include "CustomLighting.cginc" 26 | ENDCG 27 | } 28 | 29 | Pass 30 | { 31 | Tags {"LightMode" = "ForwardAdd"} 32 | Blend One One 33 | ZWrite Off 34 | 35 | CGPROGRAM 36 | #pragma target 3.0 37 | #pragma multi_compile_fwdadd 38 | #pragma vertex vert 39 | #pragma fragment frag 40 | #include "CustomLighting.cginc" 41 | ENDCG 42 | } 43 | 44 | Pass 45 | { 46 | Blend SrcColor OneMinusSrcColor 47 | 48 | CGPROGRAM 49 | #pragma target 4.0 50 | #include "Wireframing.cginc" 51 | #pragma vertex vert 52 | #pragma geometry geom 53 | #pragma fragment frag 54 | ENDCG 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Packages/unity-gist/Wireframe/Wireframing.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91b846f6589dd2f41b4f83859e8bc622 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7532a036071ab5f4c981e72dc2be014e 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: 0 39 | physicsEnabled: 0 40 | physics2DEnabled: 0 41 | spriteEnabled: 0 42 | uiEnabled: 0 43 | textMeshProEnabled: 0 44 | tk2DEnabled: 0 45 | showPlayingTweens: 0 46 | showPausedTweens: 0 47 | -------------------------------------------------------------------------------- /Assets/Resources/DOTweenSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fb08147110e67d47bb42e78e87f3170 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Imgs/cross.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:13ddfb7f5a469b01893d795a06e14cf0f15a3c0f92c69f33da02b4d0216df6d1 3 | size 11602901 4 | -------------------------------------------------------------------------------- /Imgs/cube.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f5ac48b449bf6d74c2497067c0015ccc8d3e9d2e58b7b2d5375da009e3f2c27 3 | size 529279 4 | -------------------------------------------------------------------------------- /Imgs/drop.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66a4b1e9a2108f6f3c3a1c350dc736686cc42baad03f8fe15869f2fa51102946 3 | size 561528 4 | -------------------------------------------------------------------------------- /Imgs/editor1.PNG: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d4c806b0e9c5b96f4266a6c25871713bff19e505cd7c029b692186ab5ab22284 3 | size 283804 4 | -------------------------------------------------------------------------------- /Imgs/editor2.PNG: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:81710af85be6321cc7fbaf834857215af95087ff50cf47cc80807586fbe7933f 3 | size 282583 4 | -------------------------------------------------------------------------------- /Imgs/editor3.PNG: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b25612f5a6772b9219044b2598edd1a7b5f2fff40fb11f0333778b14e9de6c4a 3 | size 301891 4 | -------------------------------------------------------------------------------- /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": "2.0.8", 6 | "com.unity.analytics": "3.3.2", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.ext.nunit": "1.0.0", 9 | "com.unity.ide.rider": "1.1.0", 10 | "com.unity.ide.vscode": "1.1.2", 11 | "com.unity.package-manager-ui": "2.2.0", 12 | "com.unity.purchasing": "2.0.6", 13 | "com.unity.test-framework": "1.0.13", 14 | "com.unity.textmeshpro": "2.0.1", 15 | "com.unity.timeline": "1.1.0", 16 | "com.unity.ugui": "1.0.0", 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 | -------------------------------------------------------------------------------- /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 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /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: 11 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: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /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 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /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: 7 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;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | -------------------------------------------------------------------------------- /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/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: 4 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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.2.12f1 2 | m_EditorVersionWithRevision: 2019.2.12f1 (b1a7e1fb4fa5) 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: 5 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 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 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: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Standalone: 5 227 | WebGL: 3 228 | Windows Store Apps: 5 229 | XboxOne: 5 230 | iPhone: 2 231 | tvOS: 2 232 | -------------------------------------------------------------------------------- /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 | - NoRender 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.33333334 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 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 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_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /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 | # unity-marching-cubes 2 | 3 | Unity marching cubes module with forward rendering. This module was used for video performance @ Shibuya Stream in Tokyo. 4 | 5 | ## Demo 6 | 7 | ![img](Imgs/cross.gif) 8 | 9 | ![img](Imgs/editor1.PNG) 10 | 11 | ![img](Imgs/editor2.PNG) 12 | 13 | ![img](Imgs/editor3.PNG) 14 | 15 | ## Compatibility 16 | 17 | tested on Unity 2019.2.12f1, windows10 (RTX 2080 max-q, GTX 1060). 18 | 19 | ## Usage 20 | `git submodule add git@github.com:komietty/unity-gist.git Assets/Packages/unity-gist` 21 | 22 | ## Sources 23 | Polygonising a scalar field - http://paulbourke.net/geometry/polygonise/ 24 | 25 | ## License 26 | [MIT](LICENSE) 27 | --------------------------------------------------------------------------------