Skip to content

Instantly share code, notes, and snippets.

View whaison's full-sized avatar

whaison whaison

View GitHub Profile
@whaison
whaison / FragmentWithSurface.shader
Last active March 25, 2019 21:06 — forked from shop-0761/FragmentWithSurface.shader
Fragment と surface を一緒に使うやつ
Shader "Custom/fragmentWithSurface" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }
@whaison
whaison / ShowBoundingBox.ms
Created February 19, 2017 12:35 — forked from deathponta/ShowBoundingBox.ms
【MaxScript】BoundingBoxの取得し最小値と最大値の位置にポイント配置
bb = NodeLocalBoundingBox $
bmax = bb[2]
bmin = bb[1]
Point pos:bmax box:off cross:on
Point pos:bmin box:off cross:on
from glfwpy.glfw import (AUTO_POLL_EVENTS, OPENED, OPENGL_CORE_PROFILE,
OPENGL_FORWARD_COMPAT, OPENGL_PROFILE, OPENGL_VERSION_MAJOR,
OPENGL_VERSION_MINOR, WINDOW,
Enable, GetWindowParam, Init, OpenWindow, OpenWindowHint,
SetKeyCallback, SetWindowTitle, SwapBuffers, Terminate)
import numpy as np
from OpenGL.arrays import ArrayDatatype
from OpenGL.GL import (GL_ARRAY_BUFFER, GL_COLOR_BUFFER_BIT,
GL_COMPILE_STATUS, GL_FALSE, GL_FLOAT, GL_FRAGMENT_SHADER,
GL_LINK_STATUS, GL_RENDERER, GL_SHADING_LANGUAGE_VERSION,
@whaison
whaison / Unity-hotswapping-notes.md
Created January 26, 2017 14:13 — forked from cobbpg/Unity-hotswapping-notes.md
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping

using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// Model animation spliter.
/// by Koki Ibukuro @asus4 >Noboru Otsuka
/// </summary>
public class ModelAnimationSpliter : EditorWindow {
TextAsset csvAsset;
@whaison
whaison / ModelAnimationSpliter.cs
Last active August 29, 2015 14:23 — forked from asus4/ModelAnimationSpliter.cs
ModelAnimationSpliterAddEventHandler
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// Model animation spliter.
/// by Koki Ibukuro @asus4 >whaison.jugem.jp
/// </summary>
public class ModelAnimationSpliter : EditorWindow {
TextAsset csvAsset;