Skip to content

Instantly share code, notes, and snippets.

Avatar
😇

EsProgram EsProgram

😇
View GitHub Profile
@EsProgram
EsProgram / UVChecker.cs
Last active Jun 24, 2022
UnityでUVを確認するエディタ拡張
View UVChecker.cs
using System.Collections;
using System.Text;
using UnityEditor;
using UnityEngine;
public class UVChecker : EditorWindow
{
private GameObject targetGameObject;
private MeshFilter targetMeshFilter;
private Texture2D tex;
View ParticleAutoDestroy.cs
using System.Collections;
using UnityEngine;
/// <summary>
/// パーティクルの自動破棄
/// </summary>
public class ParticleAutoDestroy : MonoBehaviour
{
private void Start()
{
@EsProgram
EsProgram / SceneViewCamera.cs
Last active Dec 12, 2021
Unityのカメラ用スクリプト。Sceneビューのようなマウス操作でカメラを移動可能にする。
View SceneViewCamera.cs
using UnityEngine;
/// <summary>
/// GameビューにてSceneビューのようなカメラの動きをマウス操作によって実現する
/// </summary>
[RequireComponent(typeof(Camera))]
public class SceneViewCamera : MonoBehaviour
{
[SerializeField, Range(0.1f, 10f)]
private float wheelSpeed = 1f;
@EsProgram
EsProgram / UnityCopyAssetMenuSample.cs
Created Aug 26, 2020
プロジェクトビュー右クリックした時のメニューから好きな適当なアセットをコピーしてくるサンプル
View UnityCopyAssetMenuSample.cs
using UnityEditor;
using UnityEngine;
using System.IO;
public class UnityCopyAssetMenuSample
{
[MenuItem("Assets/Create/好きなパス")]
private static void 作る()
{
// NOTE: プロジェクトビュー右クリックから、任意のアセットをコピー
@EsProgram
EsProgram / NextPage.shader
Created Mar 12, 2016
ページめくる感じのアニメーションできるシェーダー
View NextPage.shader
Shader "MBL/NextPage"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_PageTex("PageTexture", 2D) = "white" {}
_AlphaMask("AlphaMask", Range(0, 1)) = 0.1
_Flip("Flip",Range(-1, 1)) = 0
}
SubShader
View Easing.cs
//=================================================================================================/
/// <summary>
/// Easing関数
/// https://easings.net/ja
/// https://gist.github.com/gre/1650294
/// </summary>
//=================================================================================================/
public static class Easing
{
//=================================================================================================/
@EsProgram
EsProgram / Nega.shader
Created Jan 31, 2018
なざわにき 用
View Nega.shader
Shader "NazawaOssuOssu/Nega"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Lerp("Lerp", RANGE(0, 1)) = 1
}
SubShader
{
Tags{"Queue"="Transparent"}
View WaterSurface.shader
Shader "Es/WaveformProvider/Sample/WaterSurface"
{
Properties
{
[HideInInspector]
_WaveInputTex("Wave Input Texture", 2D) = "black" {}
_RefTex("Ref",2D) = "black" {}
_BumpMap("Normalmap", 2D) = "bump" {}
_BumpAmt("BumpAmt", Range(0,100)) = 0
@EsProgram
EsProgram / LocalNormalMapCreator.cs
Last active Dec 28, 2017
Meshのローカル座標系における法線情報を指定サイズのテクスチャに焼いて保存するUnityEditor拡張。InkPainter( https://github.com/EsProgram/InkPainter ) を利用する。この法線テクスチャ情報を使うサンプルのスクリプトとShaderもついでに乗っけとく
View LocalNormalMapCreator.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.IO;
using Es.InkPainter;
public class LocalNormalMapCreator : EditorWindow
{
@EsProgram
EsProgram / ReplaceRenderTextureSample.cs
Created Dec 5, 2017
Sample replacing RenderTexture with InkPainter.
View ReplaceRenderTextureSample.cs
using System.Linq;
using UnityEngine;
using Es.InkPainter;
public class ReplaceRenderTextureSample : MonoBehaviour
{
[SerializeField]
InkCanvas canvas;
[SerializeField]