Skip to content

Instantly share code, notes, and snippets.

Avatar

sasanon sasanon

  • Kanagawa, Japan
View GitHub Profile
View DataStageEditor.cs
using UnityEngine;
using UnityEditor;
[CanEditMultipleObjects]
[CustomEditor(typeof(DataStage))]
public class DataStageEditor : Editor {
public override void OnInspectorGUI()
{
// Get this Stage-Data
DataStage dataStage = target as DataStage;
View DataStage.cs
using UnityEngine;
using System.Collections;
[CreateAssetMenu(menuName = "Stage Data")]
public class DataStage : ScriptableObject {
public DataCharacter[] characters;
public DataItem[] items;
}
[System.Serializable]
@sasanon
sasanon / NoiseDistGrabTexture.shader
Last active Oct 23, 2018
Unity Noise-Distortion Shader (GrabTexture)
View NoiseDistGrabTexture.shader
Shader "Sasami/NoiseDistGrabTexture"
{
Properties
{
_NoiseTilingOffset ("NoiseTex Tiling(x,y)/Offset(z,w)", Vector) = (0.1,0.1,0,0)
_NoiseSizeScroll ("NoiseTex Size(x,y)/Scroll(z,w)" , Vector) = (16,16,0,0)
_DistortionPower ("Distortion Power", Float ) = 0
_NormalScale ("Normal Scale", Float ) = 0
_SpecularPower ("Specular Power", Range(0.0, 1.0) ) = 0
@sasanon
sasanon / NoiseDistAddAlpha.shader
Last active Oct 22, 2018
Unity Noise-Distortion Shader (Add-Alpha Texture)
View NoiseDistAddAlpha.shader
Shader "Sasami/NoiseDistAddAlpha"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_BaseColor ("Base Color" , Color ) = (1,1,1,1)
_AddAlphaColor ("Add Alpha Color", Color ) = (0,0,0,1)
_NoiseTilingOffset ("NoiseTex Tiling(x,y)/Offset(z,w)", Vector) = (0.1,0.1,0,0)
_NoiseSizeScroll ("NoiseTex Size(x,y)/Scroll(z,w)" , Vector) = (16,16,0,0)
@sasanon
sasanon / NoiseGradation.shader
Last active Oct 21, 2018
Unity Noise-Gradation Shader
View NoiseGradation.shader
Shader "Sasami/NoiseGradation"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_NoiseTilingOffset ("NoiseTex Tiling(x,y)/Offset(z,w)", Vector) = (0.1,0.1,0,0)
_NoiseSizeScroll ("NoiseTex Size(x,y)/Scroll(z,w)" , Vector) = (16,16,0,0)
_BaseColor ("Base Color" , Color ) = (1,1,1,1)
_GradationColor ("Gradation Color", Color ) = (0,0,0,1)
}
@sasanon
sasanon / NoiseSample.shader
Last active Oct 22, 2018
Unity Noise-Shader Sample
View NoiseSample.shader
Shader "Sasami/NoiseSample"
{
Properties
{
_NoiseTilingOffset ("NoiseTex Tiling(x,y)/Offset(z,w)", Vector) = (0.1,0.1,0,0)
_NoiseSizeScroll ("NoiseTex Size(x,y)/Scroll(z,w)" , Vector) = (16,16,0,0)
}
SubShader
{
Tags { "RenderType"="Opaque" }
@sasanon
sasanon / SasamiNoise.cginc
Last active Oct 22, 2018
Unity Noise-Shader Library
View SasamiNoise.cginc
#ifndef SASAMI_NOISE_INCLUDED
#define SASAMI_NOISE_INCLUDED
#include "UnityCG.cginc"
// TRANSFORM_TEX相当の処理(vertexシェーダーでの変換)
fixed2 TRANSFORM_NOISE_TEX(fixed2 uv, fixed4 tilingOffset, fixed4 sizeScroll) {
// 仮想ノイズテクスチャサイズ, Tiling, Offsetの適用
uv = uv * tilingOffset.xy * sizeScroll.xy + tilingOffset.zw;
View Niku.shader
Shader "Sasa/Meat"
{
Properties
{
_MainTex ("Main Tex", 2D) = "white" {}
_DarkColor ("Dark Color", Color) = (0.5,0.5,0.5,1)
_LightColor ("Light Color", Color) = (0.5,0.5,0.5,1)
}
SubShader