Skip to content

Instantly share code, notes, and snippets.

@ruccho
ruccho / Fang Preview.lua
Last active February 1, 2020 08:40
A Lua script for Aseprite that shows auto tiling preview for FangAutoTile ( https://assetstore.unity.com/packages/tools/sprite-management/fang-auto-tile-132602 ).
----------------------------------------------------------------------
-- 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
using System.Threading;
using UnityEngine;
public class FPSAdjuster : MonoBehaviour
{
[SerializeField, Min(1)]
private int fps;
[SerializeField]
private bool useThreadSleep = false;
@ruccho
ruccho / AutoVersion.cs
Last active May 3, 2020 04:40
Unityで再生ボタンを押すたびにプロジェクトのバージョンを上げるスクリプト。Editorフォルダに入れて使ってください。
using UnityEditor;
using System.Linq;
namespace Ruccho.Utilities
{
public class AutoVersion
{
[InitializeOnLoadMethod]
private static void RegisterEditorIncrementEvent()
@ruccho
ruccho / PersistentSerializedProperty.cs
Last active June 1, 2020 07:31
SerializedPropertyに対して配列操作によるインデックスの変更を追跡し、データの同一性を確保するためのラッパークラス
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Ruccho.Utilities
{
/// <summary>
@ruccho
ruccho / MaterialExposition.cs
Last active October 25, 2020 18:11
uGUI ImageとかのマテリアルパラメータをAnimatorで制御したいときにSerializeFieldに露出するのに便利なクラス。本体 (MaterialExposition.cs) と使用サンプル (MaterialExpositionSample.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;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Ruccho.Utilities
{
public class LockerSubject
{
public bool IsLocked => Keys.Count > 0;
@ruccho
ruccho / PostProcessProfileExposition.cs
Last active May 29, 2021 07:57
PostProcessingStackのVolumeのパラメータをSerializeFieldとして露出し、Animatorなどで制御可能にするやつ
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);
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 / InstAnime.cs
Last active March 12, 2022 07:33
UniTaskベースのコンパクトなアニメーションライブラリ。工事中
using System;
using System.Threading;
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Triggers;
using UnityEngine;
using UnityEngine.UI;
namespace InstAnime
{
public abstract class InstantAnimator : IDisposable
@ruccho
ruccho / C932_net6.html
Created October 1, 2022 14:27
Shift_JIS table in Unity / .Net Framework 4.8 / .NET 6
<!DOCTYPE html>
<html>
<body>
<table>
<tr>
<th></th>
<th>0</th>
<th>1</th>
<th>2</th>