Skip to content

Instantly share code, notes, and snippets.

@jake1256
jake1256 / LoadText.cs
Created December 1, 2014 10:04
【Unity】簡単明快なdrawcall削減の例 ref: http://qiita.com/kuuki_yomenaio/items/eaea133479bb8be96870
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public class LoadText {
// Resources/text/から指定のテキストファイルを改行区切りで読む
public List<string> loadTextFile(string textFileName){
TextAsset textAsset = Resources.Load<TextAsset>("text/" + textFileName);
string[] strs = textAsset.text.Split ("\n" [0]);
@jake1256
jake1256 / AndroidBridge.cpp
Created November 18, 2014 07:41
【Android】Android 5.0 Lolipop に対応するには【cocos2d-x】 ref: http://qiita.com/kuuki_yomenaio/items/64f89b68709c3f7090cb
JNIEnv *pEnv;
jclass classId;
jmethodID methodId;
//~~~
jboolean flg = (jboolean)pEnv->CallStaticBooleanMethod(classId , methodId);
//~~~
@jake1256
jake1256 / NativeUtil.cpp
Created October 26, 2014 10:37
【iOS】Xcodeでビルドした時にNSObjCRuntimeでエラー?【cocos2d-x】 ref: http://qiita.com/kuuki_yomenaio/items/6edc7cb16a81d2bc9ef5
// NativeUtil.cpp
#include "NativeUtil.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
@jake1256
jake1256 / CutSceneEvent.cs
Created July 27, 2014 10:54
【Unity】カットシーンを作成するAssetの使い方【Animator Timeline Editor】 ref: http://qiita.com/kuuki_yomenaio/items/698a33ce6115fb27166a
// 指定したカットシーンを再生
AnimatorTimeline.Play("Take名");
// 指定したカットシーンをループ再生
AnimatorTimeline.Play("Take名", true);
// 再生中のカットシーンを止める
AnimatorTimeline.Stop();
@jake1256
jake1256 / HelloWorldScene.cpp
Created June 23, 2014 06:09
cocos2d-xでsocket.io(第五回cocos2d-x勉強会) ref: http://qiita.com/kuuki_yomenaio/items/c25477c9394c1709019b
_client->emit("event" , "aaaaa");
@jake1256
jake1256 / HelloWorld.cpp
Created June 3, 2014 16:11
【cocos2d-x v3.1】cocos2dxでzipファイルを扱う場合のまとめ。load timeの計測もあるよ。 ref: http://qiita.com/kuuki_yomenaio/items/b93b236ed5563adf9c39
unsigned char* buf = FileUtils::getInstance()->getFileDataFromZip(
path.c_str() ,
zipFile.c_str(),
(ssize_t*)&size);
@jake1256
jake1256 / CharacterController_Bio.js
Created April 17, 2014 14:07
【Unity】バイオハザード風の動きをするscriptとカメラについて ref: http://qiita.com/kuuki_yomenaio/items/1eac012d5e40ce47b4e2
#pragma strict
public var speed : float = 3;
private var direction : Vector3 = Vector3.zero;
private var playerController : CharacterController;
private var animator : Animator;
function Start() {
playerController = GetComponent( CharacterController );
animator = GetComponentInChildren( Animator );
@jake1256
jake1256 / BallSetup.cs
Created April 1, 2014 12:40
【Unity】MMDモデルを使ってボールを蹴って物体を壊すゲームを作ろう!その6【基礎】【完結】 ref: http://qiita.com/kuuki_yomenaio/items/03ed5212de0a93f0de13
using UnityEngine;
using System.Collections;
public class BallSetup : MonoBehaviour {
// Use this for initialization
void Start () {
}
@jake1256
jake1256 / CreateStage.cs
Created March 31, 2014 08:53
【Unity】MMDモデルを使ってボールを蹴って物体を壊すゲームを作ろう!その5【基礎】 ref: http://qiita.com/kuuki_yomenaio/items/95f54a7404d71c80cbaf
using UnityEngine;
using System.Collections;
public class CreateStage : MonoBehaviour {
public GameObject gameObject;
// Use this for initialization
void Start () {
int countW = 5;
int countH = 5;
@jake1256
jake1256 / CharacterSetup.cs
Created March 28, 2014 14:12
【Unity】MMDモデルを使ってボールを蹴って物体を壊すゲームを作ろう!その4【基礎】 ref: http://qiita.com/kuuki_yomenaio/items/33cc2d234f3394bd0eab
animator.SetFloat("speed" , varticalMove);