Skip to content

Instantly share code, notes, and snippets.

@hananoki
hananoki / builtin-resource.txt
Created June 11, 2020 05:51
(゚∀゚) ビルトインのアイコンパス
/// Copyright (c) 2020 hananoki
/// This code is released under NYSL Version 0.9982
/// See http://www.kmonos.net/nysl/NYSL.TXT
Unity 2019.3.10f1
/// exporting program
var bundle = typeof( EditorGUIUtility ).MethodInvoke<AssetBundle>( "GetEditorAssetBundle" );
var assetNames = bundle.GetAllAssetNames();
@JordanDelcros
JordanDelcros / combine-rgba-colors.js
Created July 31, 2015 09:55
Combine two RGBA colors with JavaScript
// Fast and easy way to combine (additive mode) two RGBA colors with JavaScript.
// [red, green, blue, alpha] based on these maximul values [255, 255, 255, 1].
var base = [69, 109, 160, 1];
var added = [61, 47, 82, 0.8];
var mix = [];
mix[3] = 1 - (1 - added[3]) * (1 - base[3]); // alpha
mix[0] = Math.round((added[0] * added[3] / mix[3]) + (base[0] * base[3] * (1 - added[3]) / mix[3])); // red
mix[1] = Math.round((added[1] * added[3] / mix[3]) + (base[1] * base[3] * (1 - added[3]) / mix[3])); // green
mix[2] = Math.round((added[2] * added[3] / mix[3]) + (base[2] * base[3] * (1 - added[3]) / mix[3])); // blue
@bzgeb
bzgeb / TriggerContainerEditor.cs
Created September 28, 2012 14:52
Example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;