Skip to content

Instantly share code, notes, and snippets.

View ShirakawaYoshimaru's full-sized avatar

SLEKFjawefkjw ShirakawaYoshimaru

  • 東京あたり
View GitHub Profile
@ShirakawaYoshimaru
ShirakawaYoshimaru / .gitignore
Last active January 26, 2016 18:07
gitignore for unity5
# =============== #
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
Library/
LocalCache/
BuildForiOS/
[core]
excludesfile = /Users/shirakawayoshimaru1/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[user]
name = ShirakawaYoshimaru
@ShirakawaYoshimaru
ShirakawaYoshimaru / git-lesson.md
Created March 16, 2016 13:09 — forked from yatemmma/git-lesson.md
git初心者への道 - お仕事で困らないレベルまでググっとします。

git初心者への道

まずやってみよう - コミットする、ログを見る、差分を見る

初登場するコマンド: init, add, commit, log, config, status, diff

// Shader created with Shader Forge v1.26
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
// Note: Manually altering this data may prevent you from opening it in Shader Forge
/*SF_DATA;ver:1.26;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:32992,y:32600,varname:node_3138,prsc:2|normal-2595-OUT,emission-991-OUT;n:type:ShaderForge.SFN_Color,id:7241,x:32469,y:32613,ptovrint:False,ptlb:C
@ShirakawaYoshimaru
ShirakawaYoshimaru / PathMaker.cs
Last active February 6, 2018 04:42
選択したオブジェクトのPathをログに表示する Unity プチEditor拡張
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
/// <summary>
/// 選択している複数のObjectのパスをLogに表示させます。
/// SceneとProject両方に対応しています。
/// </summary>
public class PathMaker
{
using UnityEngine;
using System;
public class TestScript : MonoBehaviour
{
void Start ()
{
var bookShelf = new Iterator1.BookShelf ();
bookShelf.Add (new Book ("111"));
bookShelf.Add (new Book ("222"));
using System.Collections.Generic;
namespace Iterator3
{
public class BookShelf : Shelf<Book>
{
public Book GetRandom ()
{
int index = new System.Random ().Next (GetCount ());
return GetAt (index);
public class HogeSingleton
{
private static HogeSingleton singleton = new HogeSingleton ();
private HogeSingleton ()
{
//初期化処理
}
public static HogeSingleton Instance ()
@ShirakawaYoshimaru
ShirakawaYoshimaru / Singleton実装練習用
Created June 10, 2016 16:51
このクラスをSingletonにする。Awake時に外部からGetData()されても正常に動作するようにしよう
public class DataManager {
int dummyData;
void LoadData(){
dummyData = 10;
}
public int GetData(){
return dummyData;
}
}
using UnityEngine;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
var a = new GoodHellow1 ("いーちゃん", 20, "。戯言だけどね!");
a.VeryGoodHellow ();