Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections.Generic;
using System.Linq;
static class Util
{
static public Vector2 CrossKey(float scale = 1f, bool extraEnable = true)
{
KeyCode[][] keys = new[]{
@fuqunaga
fuqunaga / Rand
Last active December 24, 2015 09:22
[System.Serializable]
public class RandFloat : Rand<float>
{
public RandFloat(float min, float max) : base(min, max){ }
protected override float _rand(float min, float max) { return UnityEngine.Random.Range(min, max); }
}
[System.Serializable]
public class RandInt : Rand<int>
{
if ( Input.GetKeyUp(KeyCode.S))
{
var filePath = Application.dataPath + "/screenshot/" + System.DateTime.Now.ToFileTime() + ".png";
Application.CaptureScreenshot(filePath, screenShotScale);
}
using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
[InitializeOnLoad]
class MissingScriptChecker : Editor
{
Type GetPropertyType(SerializedProperty property)
{
var paths = property.propertyPath.Split('.');
var target = property.serializedObject.targetObject as object;
return paths.Aggregate(target, (t, path) => t.GetType().GetField(path).GetValue(t)).GetType();
}
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
public static class GUIUtil
{
public class Folds : Dictionary<string, Fold>
{
public void Add(string name, Action action, bool enableFirst = false)
ping localhost -n 10 > nul
start pathto/file.exe
exit
@fuqunaga
fuqunaga / load_js
Last active December 17, 2015 05:49
javascript:
(function(){
var url = 'http://jsdo.it/Fuqunaga/g_imas.js';
if(!url.match(/\?/))url+='?'+(new Date()).getTime();
var d=document;
var e=d.createElement('script');
e.charset='utf-8';
e.src=url;
d.getElementsByTagName('head')[0].appendChild(e);
})();
@fuqunaga
fuqunaga / g_imas
Last active December 17, 2015 05:39
function prog(url,html)
{
var ajax = function(next_url, func){
return next_url && func(next_url, function(data){
prog(next_url, data);
});
}
var get_func = function(next_url){ return ajax(next_url, $.get)};
var post_func = function(next_url){ return ajax(next_url, $.post)};
var link = function(btn_sel)
javascript:
function seq_func(){
$.get(location.href, function(data){
$.get($(data).find('#resque-pop-wrapper a').first().attr('href'), function(){
location.reload();
});
});
}
$.get($('#raid-menu a').first().attr('href'), seq_func);