Skip to content

Instantly share code, notes, and snippets.

@onotchi
onotchi / BuildPostprocessor.cs
Created April 12, 2023 05:01
UnityでBuild後にUnity.exeのファイル更新日時を上書きする
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
public class BuildPostprocessor
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
@onotchi
onotchi / UVCreator.cs
Created December 1, 2019 12:07
UnityEditor上でMeshにUV2-UV4を追加する。
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
namespace Onoty3D
{
enum UVType
{
//UV1,
@onotchi
onotchi / cginc
Last active August 11, 2018 02:30
UTS2のVertExmotion対応(抜粋)
struct VertexInput {
float4 vertex : POSITION;
float4 color : COLOR; //★
float3 normal : NORMAL;
float4 tangent : TANGENT;
float2 texcoord0 : TEXCOORD0;
};
---
@onotchi
onotchi / UnlitPlanarDecal.Shader
Created August 1, 2018 08:20
Planar手法でデカールを表示するシェーダー
Shader "Onoty3D/Unlit/PlanarDecal"
{
Properties
{
_Color("Color", Color) = (1, 1, 1, 1)
_MainTex("MainTex", 2D) = "white" {}
_DecalColor("Decal Color", Color) = (1, 1, 1, 1)
_DecalTex("Decal", 2D) = "white" {}
[KeywordEnum(X, Y, Z)] _Planar ("Decal Planar", int) = 0
[KeywordEnum(Front, Back, Both)] _Side ("Decal Side", int) = 0
@onotchi
onotchi / InsideChecker.cs
Last active June 11, 2017 10:36
指定範囲のモデルをボクセルで生成し直す
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Onoty3D.VoxelGenerator.Scripts
{
[Serializable]
public class InsideChecker
{
//生成したボクセルに設定するレイヤー
@onotchi
onotchi / ParticlePainter.cs
Created May 17, 2017 15:13
Ink Painterを使って、パーティクルの衝突でインクを塗る
using System.Collections.Generic;
using Es.InkPainter;
using UnityEngine;
namespace Onoty3D
{
public class ParticlePainter : MonoBehaviour
{
public Brush Brush = null;
public ParticleSystem Particle;
@onotchi
onotchi / ToonLitDecal.shader
Created May 16, 2017 14:51
UV2利用で左右非対称デカール表現
Shader "PronamaChan/Toon/Lit Decal" {
Properties {
_Color("Main Color", Color) = (0.5,0.5,0.5,1)
_DecalColor ("Decal Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_DecalTex("Decal (RGBA)", 2D) = "black" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {}
[Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK
}
@onotchi
onotchi / BlendShapeValueChangerYuno.cs
Created May 11, 2017 13:56
高崎柚乃ちゃんの表情を変化させる
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Onoty3D
{
public class BlendShapeValueChangerYuno : MonoBehaviour
{
/// <summary>
@onotchi
onotchi / ToonLitZowa2.shader
Created May 11, 2017 13:52
ゾワゾワするシェーダー
Shader "Onoty3D/Toon/Lit ZowaZowa" {
Properties{
_Color("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex("Base (RGB)", 2D) = "white" {}
_Ramp("Toon Ramp (RGB)", 2D) = "gray" {}
[Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK
_YBorder("YBorder", float) = 0
_YRange("YRange", float) = 0.005
_Volume("Volume", float) = 0.001
@onotchi
onotchi / TongueMorph.cs
Created May 11, 2017 13:50
メッシュの頂点を動かして、プロ生ちゃんの舌を操作する
using System.Linq;
using UnityEngine;
namespace PronamaChan
{
public class TongueMorph : MonoBehaviour
{
private class DefaultVertex
{
public int Index { get; set; }