Skip to content

Instantly share code, notes, and snippets.

View shinriyo's full-sized avatar

shinriyo shinriyo

View GitHub Profile
@shinriyo
shinriyo / gist:2bad8d8428bcd03a06218a0f1d5b75e9
Created June 6, 2016 01:46 — forked from j5ik2o/gist:1520836
Scalaで使えそうなWeb系フレームワーク&ライブラリ
@shinriyo
shinriyo / ForcelyBreakPrefab.cs
Created January 29, 2016 10:05 — forked from anonymous/ForcelyBreakPrefab.cs
おかしいプレハブを強制的にブレークする
[MenuItem("GameObject/Forcely Break Prefab", false, 1)]
static void BreakPrefabObject()
{
GameObject disconnectingObj = Selection.activeGameObject;
Selection.activeGameObject = null;
PrefabUtility.DisconnectPrefabInstance(disconnectingObj);
UnityEngine.Object prefab = PrefabUtility.CreateEmptyPrefab("Assets/dummy.prefab");
PrefabUtility.ReplacePrefab(disconnectingObj, prefab, ReplacePrefabOptions.ConnectToPrefab);
PrefabUtility.DisconnectPrefabInstance(disconnectingObj);
AssetDatabase.DeleteAsset("Assets/dummy.prefab");
@shinriyo
shinriyo / ShortCutEditor.cs
Created January 25, 2016 01:29
UIWidgetのdepth値をいじるときのショートカット。 1増やす・・・Control + Shift + k 1減らす・・・Control + Shift + j
namespace EditorUtil
{
/// <summary>
/// 便利メソッド.
/// </summary>
public class CustomMethods
{
/// <summary>
/// Widgetのdepthを1増やす1減らす.
/// ショートカット: Control + Shift + k.
@shinriyo
shinriyo / PlayerPrefsX2.cs
Last active January 9, 2016 07:30
PlayerPrefsXが必須で、オブジェクトを保存できる(完璧ではないが) URL: http://wiki.unity3d.com/index.php/PlayerPrefsX2
/*
PlayerPrefsX2
Author: shinriyo
Date: 1/9/2015
*/
using UnityEngine;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
@shinriyo
shinriyo / popeye.swift
Created December 19, 2015 07:41
Swiftで演算子のオーバーロードでポパイの算数
infix operator ++ { associativity left precedence 160 }
func ++ (left: Int, right: Int) -> Int {
// 8=2
// 9=1
// 6=1
// 0=1
let cal = { (origin: Int) -> Int in
var final = 0
let strOrigin = String(origin)
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
/// <summary>
/// Draw component icon in hierarchy.
/// </summary>
public class DrawComponentIconInHierarchy
{
@shinriyo
shinriyo / ScriptableObjectToAsset.cs
Created September 12, 2015 02:48 — forked from tsubaki/ScriptableObjectToAsset.cs
ScriptableObjectをAssetsファイルとして出力する汎用スクリプト
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/// <summary>
// ScriptableObjectをプレハブとして出力する汎用スクリプト
/// </summary>
// <remarks>
// 指定したScriptableObjectをプレハブに変換する。
@shinriyo
shinriyo / css_resources.md
Last active August 29, 2015 14:16 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@shinriyo
shinriyo / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
using UnityEngine;
using System.Collections;
// angleのスピードで、とあるオブジェクトの周りを回転するスクリプト
public class TargetRotation : MonoBehaviour
{
// 変数
// 一秒当たりの回転角度
public float angle = 30f;