Skip to content

Instantly share code, notes, and snippets.

@jake1256
jake1256 / MeshCombiner.cs
Last active June 5, 2016 06:39
複数のMeshを一つに結合するスクリプト。Unity5.4で動くようにちょろっと修正。 元ネタ https://gist.github.com/tsubaki/03ef8e6131e30bc91d49
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
@jake1256
jake1256 / SpineShader.shader
Created July 21, 2015 13:53
【Unity】SpineオブジェクトをMaskする ref: http://qiita.com/kuuki_yomenaio/items/00d74762e930d037ad27
Stencil {
Ref 1
Comp Equal
}
@jake1256
jake1256 / MapCreater.cs
Created June 28, 2015 12:23
【Unity】簡単なMapエディタをEditor拡張で作る ref: http://qiita.com/kuuki_yomenaio/items/26f886db286865f08123
// ファイルで出力
private void OutputFile(){
string path = parent.OutputFilePath();
FileInfo fileInfo = new FileInfo(path);
StreamWriter sw = fileInfo.AppendText();
sw.WriteLine(GetMapStrFormat());
sw.Flush();
sw.Close();
@jake1256
jake1256 / CaptureCreater.cs
Created June 16, 2015 15:14
【Unity】3Dオブジェクトのサムネイル画像を一括で作るEditor拡張 ref: http://qiita.com/kuuki_yomenaio/items/16577f32792da9eac17b
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public class CaptureCreater : EditorWindow
{
@jake1256
jake1256 / Sample.cs
Created June 15, 2015 14:51
【Unity】Animator has not been initialized についてメモ ref: http://qiita.com/kuuki_yomenaio/items/57d0de163f2e0eb62134
Animator anim = obj.GetComponent<Animator>();
anim.Rebind();
// 処理
@jake1256
jake1256 / SpineAnimHook.cs
Last active August 29, 2015 14:21
UnityでSpineを扱う際に覚えておきたいTIPS ref: http://qiita.com/kuuki_yomenaio/items/13432e5d912b6b62abdf
SkeletonAnimation skeletonAnimation = obj.GetComponent<SkeletonAnimation>();
// アニメ終了イベントをセット
skeletonAnimation.state.Complete += OnCompleteSpineAnim;
// アニメ終了イベント
private void OnCompleteSpineAnim(Spine.AnimationState state , int trackIndex , int loopCount){
Debug.Log(string.Format("state : {0} , trackIndex : {1} , loopCount : {2}" , state , trackIndex , loopCount));
}
@jake1256
jake1256 / GameImgHolder.cs
Created May 17, 2015 11:11
【Unity】特定dir以下のファイルを一括で紐付けるレシピ【Editor拡張】 ref: http://qiita.com/kuuki_yomenaio/items/776d965c9b712f2b44a9
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using System.Linq;
#endif
public class GameImgHolder : MonoBehaviour {
@jake1256
jake1256 / CharacterMove.cs
Created March 15, 2015 08:18
【Unity】桜を咲かせてみた【初心者向け】 ref: http://qiita.com/kuuki_yomenaio/items/ea77a12834296645bc92
using UnityEngine;
using System.Collections;
public class CharacterMove : MonoBehaviour {
float forwardSpeed = 3.0f;
float backwardSpeed = 1.0f;
float rotateSpeed = 10.0f;
CharacterController characterController;
void Start () {
@jake1256
jake1256 / BeamShot.cs
Last active August 29, 2015 14:15
【Unity】ParticleとLineRendererで◯めはめ波を作ろう! ref: http://qiita.com/kuuki_yomenaio/items/85f0233822ccc5272d1e
int layerMask = LayerMask.GetMask("Enemy");
if(Physics.Raycast(shotRay , out shotHit , range , layerMask)){
// enemyに当たった時だけここにくる
}
@jake1256
jake1256 / CCNode.cpp
Last active August 29, 2015 14:13
【cocos2d-x】v2.0.4からv2.2.6に一気に上げた際にやったことをメモ【iOS 64bit対応】 ref: http://qiita.com/kuuki_yomenaio/items/a8628ae8cdad2f644e9d
//~
void * CCNode::getUserData()
{
return m_pUserData;
}
void CCNode::setUserData(void *var)
{
m_pUserData = var;
}