Skip to content

Instantly share code, notes, and snippets.

View nobnak's full-sized avatar

Nakata Nobuyuki (仲田将之) nobnak

  • teamLab
  • Tokyo, Japan
View GitHub Profile
@nobnak
nobnak / ScriptableObjectUtil.cs
Created September 16, 2015 09:23
Editor Script for ScriptableObject Creation for Unity
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
namespace LayerComposer {
public static class ScriptableObjectUtil {
public static void Create<T>(string path) where T : ScriptableObject {
var data = ScriptableObject.CreateInstance<T>();
@nobnak
nobnak / Quaternion.cginc
Last active April 16, 2021 09:21
Quaternion Calculation for Unity
#ifndef __QUATERNION__
#define __QUATERNION__
#define HALF_DEG2RAD 8.72664625e-3
float4 quaternion(float3 normalizedAxis, float degree) {
float rad = degree * HALF_DEG2RAD;
return float4(normalizedAxis * sin(rad), cos(rad));
}
float4 qmul(float4 a, float4 b) {
@nobnak
nobnak / TimeZoneDatabase.cs
Last active September 15, 2015 07:34
Time zone converter for Unity (Windows)
using System.Collections.Generic;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System;
using System.Text;
namespace WorldClock {
public static class TimeZoneDatabase {
public const string KERNEL32 = "kernel32.dll";
public const string REGISTRY = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones";