This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| static class Extensions | |
| { | |
| public static void LoadJsonFile<T> (T overwriteTarget, string filePath = "appData.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef COLOR_COLLECT | |
| #define COLOR_COLLECT | |
| float3 rgb2hsv(float3 c) | |
| { | |
| float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); | |
| float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); | |
| float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); | |
| float d = q.x - min(q.w, q.y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float2 d = _MainTex_TexelSize.xy; | |
| fixed4 c = tex2D(_MainTex, uv);//元のテクスチャ | |
| fixed4 o = tex2D(_Overlay, uv/(d*256));//feltのテクスチャが入る。uvが伸びないように調整してる | |
| //HSLを調整したかったら使ってもいいけど無視してもいい! | |
| float4 hslDelta = lerp(_HSL1, _HSL2, uv2.y); | |
| float3 hsl = RGBToHSL(c.rgb); | |
| hsl = saturate(hsl + hslDelta); | |
| half3 c2 = HSLToRGB(hsl.rgb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var drag = Mathf.Exp(-_drag * deltaTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "Hidden/ShikakuKirakira" | |
| { | |
| Properties | |
| { | |
| _Speed ("speed", Float) = 2 | |
| _Scale ("scale", Float) = 10 | |
| _Size ("size", Float) = 0.5 | |
| } | |
| CGINCLUDE | |
| #include "UnityCG.cginc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.IO; | |
| using System.Collections; | |
| public class SaveData : MonoBehaviour | |
| { | |
| public int data1; | |
| public float data2; | |
| public string data3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.Rendering; | |
| using System.Collections; | |
| public class MassMeshes : MonoBehaviour | |
| { | |
| public Mesh origin; | |
| public int numMeshes; | |
| public Material drawMat; | |
| public bool castShadow = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "Unlit/Billboard-CastShadow" | |
| { | |
| Properties | |
| { | |
| _DC ("diffuse", Color) = (0.5,0.5,0.5,1) | |
| _SC ("Specular color (RGB), roughness (A)", Color) = (0.5,0.5,0.5,0.5) | |
| _Size ("size", Float) = 1 | |
| } | |
| CGINCLUDE | |
| #define UNITY_PASS_SHADOWCASTER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "Custom/ShadowCaster" { | |
| Properties { | |
| _Color ("Color", Color) = (1,1,1,1) | |
| _MainTex ("Albedo (RGB)", 2D) = "white" {} | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" } | |
| LOD 200 | |
| // ---- shadow caster pass: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lPos / local position / v.vertex | |
| wPos / world position / mul(_Object2World, v.vertex) | |
| vPos / view position / mul(UNITY_MATRIX_MV, v.vertex) | |
| cPos / clip Position / mul(UNITY_MATRIX_MVP, v.vertex) |