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
// 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
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 ();
@ShirakawaYoshimaru
ShirakawaYoshimaru / Adapterパターン課題
Created June 10, 2016 17:38
Cubeを10個生成するCubeGeneraterクラスがある。Adapterパターンを使ってCubeを30個生成する機能を作成せよ
public class CubeGenerater
{
public void Make10 ()
{
for (int i = 0; i < 10; i++) {
var position = Vector3.right;
position.x *= i;
Generate (position);
}
}
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
public View view;
Data<int> score = new Data<int> ();
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
Decoratable cake = new CreamDecorator (new ChocoDecorator (new CakeDecorator (new Cake ("スススススス"))));