Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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)
{