A game made in Unity3D for the second Touhou Fan Game Jam
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update

+382 -2
+143
Assets/ColorizedShader.shader
··· 1 + // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 + 3 + Shader "Sprites/Colorized" 4 + { 5 + Properties 6 + { 7 + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 8 + _Color ("Tint", Color) = (1,1,1,1) 9 + [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 10 + [HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1) 11 + [HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1) 12 + [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} 13 + [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 14 + } 15 + 16 + SubShader 17 + { 18 + Tags 19 + { 20 + "Queue"="Transparent" 21 + "IgnoreProjector"="True" 22 + "RenderType"="Transparent" 23 + "PreviewType"="Plane" 24 + "CanUseSpriteAtlas"="True" 25 + } 26 + 27 + Cull Off 28 + Lighting Off 29 + ZWrite Off 30 + Blend One OneMinusSrcAlpha 31 + 32 + Pass 33 + { 34 + CGPROGRAM 35 + #pragma vertex SpriteVert 36 + #pragma fragment SpriteFrag 37 + #pragma target 2.0 38 + #pragma multi_compile_instancing 39 + #pragma multi_compile _ PIXELSNAP_ON 40 + #pragma multi_compile _ ETC1_EXTERNAL_ALPHA 41 + // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 42 + 43 + #ifndef UNITY_SPRITES_INCLUDED 44 + #define UNITY_SPRITES_INCLUDED 45 + 46 + #include "UnityCG.cginc" 47 + 48 + #ifdef UNITY_INSTANCING_ENABLED 49 + 50 + UNITY_INSTANCING_BUFFER_START(PerDrawSprite) 51 + // SpriteRenderer.Color while Non-Batched/Instanced. 52 + UNITY_DEFINE_INSTANCED_PROP(fixed4, unity_SpriteRendererColorArray) 53 + // this could be smaller but that's how bit each entry is regardless of type 54 + UNITY_DEFINE_INSTANCED_PROP(fixed2, unity_SpriteFlipArray) 55 + UNITY_INSTANCING_BUFFER_END(PerDrawSprite) 56 + 57 + #define _RendererColor UNITY_ACCESS_INSTANCED_PROP(PerDrawSprite, unity_SpriteRendererColorArray) 58 + #define _Flip UNITY_ACCESS_INSTANCED_PROP(PerDrawSprite, unity_SpriteFlipArray) 59 + 60 + #endif // instancing 61 + 62 + CBUFFER_START(UnityPerDrawSprite) 63 + #ifndef UNITY_INSTANCING_ENABLED 64 + fixed4 _RendererColor; 65 + fixed2 _Flip; 66 + #endif 67 + float _EnableExternalAlpha; 68 + CBUFFER_END 69 + 70 + // Material Color. 71 + fixed4 _Color; 72 + 73 + struct appdata_t 74 + { 75 + float4 vertex : POSITION; 76 + float4 color : COLOR; 77 + float2 texcoord : TEXCOORD0; 78 + UNITY_VERTEX_INPUT_INSTANCE_ID 79 + }; 80 + 81 + struct v2f 82 + { 83 + float4 vertex : SV_POSITION; 84 + fixed4 color : COLOR; 85 + float2 texcoord : TEXCOORD0; 86 + UNITY_VERTEX_OUTPUT_STEREO 87 + }; 88 + 89 + inline float4 UnityFlipSprite(in float3 pos, in fixed2 flip) 90 + { 91 + return float4(pos.xy * flip, pos.z, 1.0); 92 + } 93 + 94 + v2f SpriteVert(appdata_t IN) 95 + { 96 + v2f OUT; 97 + 98 + UNITY_SETUP_INSTANCE_ID (IN); 99 + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 100 + 101 + OUT.vertex = UnityFlipSprite(IN.vertex, _Flip); 102 + OUT.vertex = UnityObjectToClipPos(OUT.vertex); 103 + OUT.texcoord = IN.texcoord; 104 + OUT.color = IN.color; 105 + 106 + #ifdef PIXELSNAP_ON 107 + OUT.vertex = UnityPixelSnap (OUT.vertex); 108 + #endif 109 + 110 + return OUT; 111 + } 112 + 113 + sampler2D _MainTex; 114 + sampler2D _AlphaTex; 115 + 116 + fixed4 SampleSpriteTexture (float2 uv, fixed4 rendererColor) 117 + { 118 + fixed4 color = tex2D (_MainTex, uv); 119 + float greyscale = (color.r + color.g + color.b) / 3; 120 + 121 + #if ETC1_EXTERNAL_ALPHA 122 + fixed4 alpha = tex2D (_AlphaTex, uv); 123 + color.a = lerp (color.a, alpha.r, _EnableExternalAlpha); 124 + #endif 125 + 126 + fixed4 newColor = lerp(rendererColor, _Color, greyscale); 127 + newColor.a = color.a; 128 + 129 + return newColor; 130 + } 131 + 132 + fixed4 SpriteFrag(v2f IN) : SV_Target 133 + { 134 + fixed4 c = SampleSpriteTexture (IN.texcoord, IN.color); 135 + c.rgb *= c.a; 136 + return c; 137 + } 138 + 139 + #endif // UNITY_SPRITES_INCLUDED 140 + ENDCG 141 + } 142 + } 143 + }
+9
Assets/ColorizedShader.shader.meta
··· 1 + fileFormatVersion: 2 2 + guid: 1f402c9cca8268247b340b0ab3d9bbaf 3 + ShaderImporter: 4 + externalObjects: {} 5 + defaultTextures: [] 6 + nonModifiableTextures: [] 7 + userData: 8 + assetBundleName: 9 + assetBundleVariant:
+76
Assets/ColorizedSprite.mat
··· 1 + %YAML 1.1 2 + %TAG !u! tag:unity3d.com,2011: 3 + --- !u!21 &2100000 4 + Material: 5 + serializedVersion: 6 6 + m_ObjectHideFlags: 0 7 + m_PrefabParentObject: {fileID: 0} 8 + m_PrefabInternal: {fileID: 0} 9 + m_Name: ColorizedSprite 10 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 + m_ShaderKeywords: 12 + m_LightmapFlags: 4 13 + m_EnableInstancingVariants: 0 14 + m_DoubleSidedGI: 0 15 + m_CustomRenderQueue: -1 16 + stringTagMap: {} 17 + disabledShaderPasses: [] 18 + m_SavedProperties: 19 + serializedVersion: 3 20 + m_TexEnvs: 21 + - _BumpMap: 22 + m_Texture: {fileID: 0} 23 + m_Scale: {x: 1, y: 1} 24 + m_Offset: {x: 0, y: 0} 25 + - _DetailAlbedoMap: 26 + m_Texture: {fileID: 0} 27 + m_Scale: {x: 1, y: 1} 28 + m_Offset: {x: 0, y: 0} 29 + - _DetailMask: 30 + m_Texture: {fileID: 0} 31 + m_Scale: {x: 1, y: 1} 32 + m_Offset: {x: 0, y: 0} 33 + - _DetailNormalMap: 34 + m_Texture: {fileID: 0} 35 + m_Scale: {x: 1, y: 1} 36 + m_Offset: {x: 0, y: 0} 37 + - _EmissionMap: 38 + m_Texture: {fileID: 0} 39 + m_Scale: {x: 1, y: 1} 40 + m_Offset: {x: 0, y: 0} 41 + - _MainTex: 42 + m_Texture: {fileID: 0} 43 + m_Scale: {x: 1, y: 1} 44 + m_Offset: {x: 0, y: 0} 45 + - _MetallicGlossMap: 46 + m_Texture: {fileID: 0} 47 + m_Scale: {x: 1, y: 1} 48 + m_Offset: {x: 0, y: 0} 49 + - _OcclusionMap: 50 + m_Texture: {fileID: 0} 51 + m_Scale: {x: 1, y: 1} 52 + m_Offset: {x: 0, y: 0} 53 + - _ParallaxMap: 54 + m_Texture: {fileID: 0} 55 + m_Scale: {x: 1, y: 1} 56 + m_Offset: {x: 0, y: 0} 57 + m_Floats: 58 + - _BumpScale: 1 59 + - _Cutoff: 0.5 60 + - _DetailNormalMapScale: 1 61 + - _DstBlend: 0 62 + - _GlossMapScale: 1 63 + - _Glossiness: 0.5 64 + - _GlossyReflections: 1 65 + - _Metallic: 0 66 + - _Mode: 0 67 + - _OcclusionStrength: 1 68 + - _Parallax: 0.02 69 + - _SmoothnessTextureChannel: 0 70 + - _SpecularHighlights: 1 71 + - _SrcBlend: 1 72 + - _UVSec: 0 73 + - _ZWrite: 1 74 + m_Colors: 75 + - _Color: {r: 1, g: 1, b: 1, a: 1} 76 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+8
Assets/ColorizedSprite.mat.meta
··· 1 + fileFormatVersion: 2 2 + guid: 6a20f1fa507f4564ebbf49b34a040392 3 + NativeFormatImporter: 4 + externalObjects: {} 5 + mainObjectFileID: 2100000 6 + userData: 7 + assetBundleName: 8 + assetBundleVariant:
+19
Assets/GameOverDialogue.cs
··· 1 + using System.Collections; 2 + using System.Collections.Generic; 3 + using UnityEngine; 4 + using UnityEngine.SceneManagement; 5 + 6 + public class GameOverDialogue : MonoBehaviour { 7 + 8 + public void GameOver() { 9 + Time.timeScale = 0f; 10 + gameObject.SetActive(true); 11 + } 12 + 13 + public void ResetTimescale() { 14 + Time.timeScale = 1f; 15 + } 16 + 17 + public void LoadScene(string scene) => SceneManager.LoadScene(scene); 18 + 19 + }
+11
Assets/GameOverDialogue.cs.meta
··· 1 + fileFormatVersion: 2 2 + guid: 18dde449872211449b032e8865978e21 3 + MonoImporter: 4 + externalObjects: {} 5 + serializedVersion: 2 6 + defaultReferences: [] 7 + executionOrder: 0 8 + icon: {instanceID: 0} 9 + userData: 10 + assetBundleName: 11 + assetBundleVariant:
+17 -2
Assets/Prefabs/Reactor.prefab
··· 65 65 adaptiveTiling: 0 66 66 m_AutoTiling: 0 67 67 serializedVersion: 2 68 - m_Size: {x: 0.16, y: 0.16} 68 + m_Size: {x: 1, y: 1.3} 69 69 m_EdgeRadius: 0 70 70 --- !u!114 &114048743918507266 71 71 MonoBehaviour: ··· 78 78 m_Script: {fileID: 11500000, guid: c4f689f15bd27384388402ef6c135807, type: 3} 79 79 m_Name: 80 80 m_EditorClassIdentifier: 81 + ReactorDestroyed: 82 + m_PersistentCalls: 83 + m_Calls: 84 + - m_Target: {fileID: 0} 85 + m_MethodName: GameOver 86 + m_Mode: 1 87 + m_Arguments: 88 + m_ObjectArgument: {fileID: 0} 89 + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 90 + m_IntArgument: 0 91 + m_FloatArgument: 0 92 + m_StringArgument: 93 + m_BoolArgument: 0 94 + m_CallState: 2 95 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, 96 + Culture=neutral, PublicKeyToken=null 81 97 ReactorHealth: 100 82 98 DefaultEnemyDamage: 1 83 - Explosion: {fileID: 139366, guid: b185c1a9cf067374586d095111b15bd1, type: 2} 84 99 --- !u!212 &212879190304776402 85 100 SpriteRenderer: 86 101 m_ObjectHideFlags: 1
+4
Assets/Scripts/Reactor.cs
··· 1 1 using System.Collections; 2 2 using System.Collections.Generic; 3 3 using UnityEngine; 4 + using UnityEngine.Events; 4 5 5 6 public class Reactor : MonoBehaviour { 7 + 8 + public UnityEvent ReactorDestroyed; 6 9 7 10 public float ReactorHealth = 100f; 8 11 public float DefaultEnemyDamage = 5f; ··· 32 35 } 33 36 ReactorCurrentHealth -= damage; 34 37 if (ReactorCurrentHealth <= 0) { 38 + ReactorDestroyed.Invoke(); 35 39 Debug.Log("Game over!"); 36 40 Debug.Break(); 37 41 }
Assets/Sprites/PowerUp.png

This is a binary file and will not be displayed.

+95
Assets/Sprites/PowerUp.png.meta
··· 1 + fileFormatVersion: 2 2 + guid: d47286a6a5b9a6c40a695034f41db095 3 + TextureImporter: 4 + fileIDToRecycleName: {} 5 + externalObjects: {} 6 + serializedVersion: 5 7 + mipmaps: 8 + mipMapMode: 0 9 + enableMipMap: 0 10 + sRGBTexture: 1 11 + linearTexture: 0 12 + fadeOut: 0 13 + borderMipMap: 0 14 + mipMapsPreserveCoverage: 0 15 + alphaTestReferenceValue: 0.5 16 + mipMapFadeDistanceStart: 1 17 + mipMapFadeDistanceEnd: 3 18 + bumpmap: 19 + convertToNormalMap: 0 20 + externalNormalMap: 0 21 + heightScale: 0.25 22 + normalMapFilter: 0 23 + isReadable: 0 24 + grayScaleToAlpha: 0 25 + generateCubemap: 6 26 + cubemapConvolution: 0 27 + seamlessCubemap: 0 28 + textureFormat: 1 29 + maxTextureSize: 2048 30 + textureSettings: 31 + serializedVersion: 2 32 + filterMode: 0 33 + aniso: -1 34 + mipBias: -1 35 + wrapU: 1 36 + wrapV: 1 37 + wrapW: 1 38 + nPOTScale: 0 39 + lightmap: 0 40 + compressionQuality: 50 41 + spriteMode: 1 42 + spriteExtrude: 1 43 + spriteMeshType: 1 44 + alignment: 0 45 + spritePivot: {x: 0.5, y: 0.5} 46 + spritePixelsToUnits: 75 47 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 + spriteGenerateFallbackPhysicsShape: 1 49 + alphaUsage: 1 50 + alphaIsTransparency: 1 51 + spriteTessellationDetail: -1 52 + textureType: 8 53 + textureShape: 1 54 + singleChannelComponent: 0 55 + maxTextureSizeSet: 0 56 + compressionQualitySet: 0 57 + textureFormatSet: 0 58 + platformSettings: 59 + - serializedVersion: 2 60 + buildTarget: DefaultTexturePlatform 61 + maxTextureSize: 2048 62 + resizeAlgorithm: 0 63 + textureFormat: -1 64 + textureCompression: 1 65 + compressionQuality: 50 66 + crunchedCompression: 0 67 + allowsAlphaSplitting: 0 68 + overridden: 0 69 + androidETC2FallbackOverride: 0 70 + - serializedVersion: 2 71 + buildTarget: Standalone 72 + maxTextureSize: 2048 73 + resizeAlgorithm: 0 74 + textureFormat: -1 75 + textureCompression: 1 76 + compressionQuality: 50 77 + crunchedCompression: 0 78 + allowsAlphaSplitting: 0 79 + overridden: 0 80 + androidETC2FallbackOverride: 0 81 + spriteSheet: 82 + serializedVersion: 2 83 + sprites: [] 84 + outline: [] 85 + physicsShape: [] 86 + bones: [] 87 + spriteID: 7aa6643158526104990855fbbc2310a5 88 + vertices: [] 89 + indices: 90 + edges: [] 91 + weights: [] 92 + spritePackingTag: 93 + userData: 94 + assetBundleName: 95 + assetBundleVariant: