技術
Unity StreamingAssetsからファイルを読み出す
Streaming Assets で iOSとAndroidの違いにハマったのでメモ。 string FilePath; #if UNITY_IPHONE FilePath = Application.dataPath + "/Raw/" + filename; #else string fullPath = "jar:file://" + Application.dataPath + "/!/assets/" + filename; WWW www = new WWW (fullPath); while (!www.isDone) { } FilePath = Application.persistentDataPath + filename; File.WriteAllBytes (toPath,www.bytes); #endif iOS
Unity メッシュの中心とサイズ
メッシュの情報をとる方法に少しハマったので備忘録 Get correct Mesh.Bounds ローカル座標ではmeshfilter.mesh.boundsではなくてrenderer
Unity Export Packageは実機でtagの情報を引き継がない
別のプロジェクトで作ったものを、いったん.unitypackageでエキスポートしたのですが、インポートすると、エディタでは問題なく動くのに
ffmpegで動画解像度変更
むちゃくちゃ簡単 ffmpeg -i movie.mp4 -s 1136x640 movie.mp4
Unity の lookAt を おきかえる
UnityのlookAtは便利ですが、回転をさらに細かく制御しようと思うと難しいので置き換えます。 Rot.transform.LookAt (Vector3.zero); こうするところを、 Vector3 relative = gameObject.transform.InverseTransformPoint(Vector3.zero);<br /> float angle = Mathf.Atan2(relative.x, relative.z)
Google API OAuth 2.0 の認証でハマった
<script type="text/javascript"> var client_id = "クライアントID"; var scopes = 'https://www.googleapis.com/auth/drive'; function checkAuth() { gapi.auth.authorize( { 'client_id':client_id, 'scope':scopes, 'immediate':true }, function(authResult){ console.log(arguments); }); } </script> <script type="text/javascript" src="https://apis.google.com/js/client.js?onload=checkAuth"</script> こんな感じで認証部分を記述しても何度やってもこ
Blenderでスムースシェーディングをつける
Auto SmoothをON
BlenderでUV展開
3DViewでモデルを選択し、Object ModeからEdit Modeに変更。 左側のメニュー内のShading/UVsを選択。 Shading/UVs > UVs > UV Mapping >
VRシューティングゲーム「GCLOPS」をOculus Store for GearVR のギャラリーアプリで公開しました
先週の「RingNinja」に続いて、GearVR向けのVRシューティングゲーム「GCLOPS」がOculus Storeのギャラリーアプリで