Skip to content

Instantly share code, notes, and snippets.

----------------------------------------------------------------------
-- Generate Normal Map
--
-- It works only for RGB color mode.
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end
@ruccho
ruccho / Generate Normal Map for all frames.lua
Last active February 24, 2024 10:48
Lua script for Aseprite that generates normal map automatically from all frames of selected layers.
----------------------------------------------------------------------
-- Generate Normal Map
--
-- It works only for RGB color mode.
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end
@ruccho
ruccho / PbdStrip.cs
Created January 8, 2024 10:03
2D small-step XPBD strip implementation with bending constraint for Unity.
using System.Runtime.InteropServices;
using System.Threading;
using Unity.Burst;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
namespace Spring2D
{
@ruccho
ruccho / InsertPlayerLoopSample.cs
Last active January 6, 2024 08:53
PlayerLoopに任意の処理を挿入するヘルパークラスと使用サンプル
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public class InsertPlayerLoopSample
{
public struct SampleCustomUpdate{}
[RuntimeInitializeOnLoadMethod]
private static void RegisterCustomPlayerLoop()
@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>
@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
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 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;
namespace Ruccho.Utilities
{
public class LockerSubject
{
public bool IsLocked => Keys.Count > 0;
@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;