Skip to content

Instantly share code, notes, and snippets.

@LotteMakesStuff
LotteMakesStuff / EditorCoroutineRunner.cs
Last active August 28, 2024 19:09
Run stuff in the editor with all the convenience of co-routines! Add a status UI super easily to see readouts what your long running code is actually doing! nice~ There is a short API demo at the top of the class. This is a prefect companion for my inspector buttons https://gist.github.com/LotteMakesStuff/dd785ff49b2a5048bb60333a6a125187
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public class EditorCoroutineRunner
{
[MenuItem("Window/Lotte's Coroutine Runner: Demo")]
@ryesalvador
ryesalvador / tamagotchi.py
Last active May 10, 2025 08:26
Tamagotchi Emulator in PyGame
# Tamagotchi - A port of the Tamagotchi Emulator by aerospark: https://goo.gl/gaZ1fA
# Copyright (C) 2017 Ryan Salvador
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
local Class = require 'modules.middleclass.middleclass'
local Timer = require 'modules.hump.timer'
local Vector = require 'modules.hump.vector'
local Const = require 'src.const'
local Util = require 'src.util'
local Camera = Class('Camera')
function Camera:initialize(settings)
settings = settings or {}
@tsubaki
tsubaki / Bind.cs
Last active September 3, 2018 12:44
Timeline (Unity 2017b5) Fade sample
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using UnityEngine.Playables;
// bind canvas group on runtime.
public class Bind : MonoBehaviour
{
@terrynoya
terrynoya / pmx21.md
Created June 14, 2017 13:36 — forked from felixjones/pmx21.md
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.

Todo

@mob-sakai
mob-sakai / CacheableDownloadHandler.cs
Created July 28, 2017 10:04
Etag-cacheable DownloadHandler for Unity.
using UnityEngine.Networking;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using UnityEngine;
using System;
namespace Mobcast.Coffee.AssetSystem
{
@tsubaki
tsubaki / SomeAnimations.cs
Last active April 12, 2022 08:54
AnimationClipPlayableを使いまわす
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
using UnityEngine.Profiling;
public class LoopSomeAnimations : MonoBehaviour
{
[SerializeField] AnimationClip[] clips = null;
@tsubaki
tsubaki / Warikomi.cs
Created July 29, 2017 17:59
AnimationControllerのアニメーションに割り込み
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
public class Warikomi : MonoBehaviour {
PlayableGraph graph;
AnimatorControllerPlayable controllerPlayable;

Generating Procedural Game Worlds with Wave Function Collapse

Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.

sprites

The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti

@ousttrue
ousttrue / AlphaClip.cs
Last active May 2, 2018 11:57
A custom timeline track for Unity2017.3. File name must be same as class name at clip and track.
using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
public class AlphaBehaviour : PlayableBehaviour
{
public float Alpha;
}