Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@Flafla2
Flafla2 / Perlin_Tiled.cs
Last active February 19, 2024 16:29
A slightly modified implementation of Ken Perlin's improved noise that allows for tiling the noise arbitrarily.
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
@katsuhide
katsuhide / FileManagerTest.m
Created June 16, 2013 07:11
FileManager(ファイル操作)周り
// ファイルマネージャを作成
NSFileManager *fileManager = [NSFileManager defaultManager];
// ファイルが存在するか?
if ([fileManager fileExistsAtPath:filePath]) { // yes
NSLog(@"%@は既に存在しています", filePath);
} else {
NSLog(@"%@は存在していません", filePath);
}
@neuneu9
neuneu9 / MecanimCheckPanel.cs
Created November 5, 2020 15:11
【Unity】Animatorのステートを自動取得してモーションを確認できるUIパネル(Editor only)
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor.Animations;
#endif
/// <summary>
/// Mecanimモーション確認用のUIパネル
/// </summary>
@kasari
kasari / Undersea_volumetric_for_twigl_geekerMRT.frag
Last active August 8, 2020 02:06
純粋なVolumetricが重すぎて敗北したのでポスプロで実装したバージョン(Twigl の geeker(MRT)で動作します)
// https://www.shadertoy.com/view/4sfGzS
float hash(vec3 p) // replace this by something better
{
p = fract( p*0.3183099+.1 );
p *= 17.0;
return fract( p.x*p.y*p.z*(p.x+p.y+p.z) );
}
float noise( in vec3 x )
{
// 送信側
radio.setGroup(1)
input.onButtonPressed(Button.A, () => {
radio.sendString("A")
})
input.onButtonPressed(Button.B, () => {
radio.sendString("B")
})
input.onButtonPressed(Button.AB, () => {
radio.sendString("AB")