Skip to content

Instantly share code, notes, and snippets.

View VolumeProfileExposition.cs
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
namespace Ruccho.Utilities
{
public abstract class VolumeProfileExposition
{
public abstract void Update(VolumeProfile profile);
@ruccho
ruccho / PostProcessProfileExposition.cs
Last active May 29, 2021
PostProcessingStackのVolumeのパラメータをSerializeFieldとして露出し、Animatorなどで制御可能にするやつ
View PostProcessProfileExposition.cs
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
namespace Ruccho.Utilities
{
public abstract class PostProcessSettingsExposition
{
public abstract void Update(PostProcessProfile profile);
View LockerSubject.cs
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Ruccho.Utilities
{
public class LockerSubject
{
public bool IsLocked => Keys.Count > 0;
@ruccho
ruccho / MaterialExposition.cs
Last active Oct 25, 2020
uGUI ImageとかのマテリアルパラメータをAnimatorで制御したいときにSerializeFieldに露出するのに便利なクラス。本体 (MaterialExposition.cs) と使用サンプル (MaterialExpositionSample.cs)
View MaterialExposition.cs
using System;
using UnityEngine;
namespace Ruccho.Utilities
{
public abstract class MaterialExposition<T> where T : IEquatable<T>
{
protected Material target = default;
private T tempValue = default;
private int propertyKey = default;
@ruccho
ruccho / InsertPlayerLoopSample.cs
Created Aug 31, 2020
PlayerLoopに任意の処理を挿入するヘルパークラスと使用サンプル
View InsertPlayerLoopSample.cs
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public class InsertPlayerLoopSample
{
public struct SampleCustomUpdate{}
[RuntimeInitializeOnLoadMethod]
private static void RegisterCustomPlayerLoop()
@ruccho
ruccho / PersistentSerializedProperty.cs
Last active Jun 1, 2020
SerializedPropertyに対して配列操作によるインデックスの変更を追跡し、データの同一性を確保するためのラッパークラス
View PersistentSerializedProperty.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Ruccho.Utilities
{
/// <summary>
@ruccho
ruccho / AutoVersion.cs
Last active May 3, 2020
Unityで再生ボタンを押すたびにプロジェクトのバージョンを上げるスクリプト。Editorフォルダに入れて使ってください。
View AutoVersion.cs
using UnityEditor;
using System.Linq;
namespace Ruccho.Utilities
{
public class AutoVersion
{
[InitializeOnLoadMethod]
private static void RegisterEditorIncrementEvent()
View FPSAdjuster.cs
using System.Threading;
using UnityEngine;
public class FPSAdjuster : MonoBehaviour
{
[SerializeField, Min(1)]
private int fps;
[SerializeField]
private bool useThreadSleep = false;
@ruccho
ruccho / Fang Preview.lua
Last active Feb 1, 2020
A Lua script for Aseprite that shows auto tiling preview for FangAutoTile ( https://assetstore.unity.com/packages/tools/sprite-management/fang-auto-tile-132602 ).
View Fang Preview.lua
----------------------------------------------------------------------
-- Auto tiling preview for FangAutoTile (https://assetstore.unity.com/packages/tools/sprite-management/fang-auto-tile-132602).
--
-- It works for all color modes (RGB/GRAY/INDEXED).
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end
@ruccho
ruccho / BG_DottedWave.shader
Created Oct 31, 2019
背景用シェーダー。Quadとかに貼ってつかってください。
View BG_DottedWave.shader
Shader "Unlit/BG_DottedWave"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_UpperColor("Upper Color", Color) = (1.0,1.0,1.0,1.0)
_LowerColor("Lower Color", Color) = (1.0,1.0,1.0,1.0)
_SurfaceHeight("Surface Height", Float) = 0.5