Parrots in captivity seem to enjoy video-chatting with their friends on Messenger
UnityのAssetBundleの実装をまとめました。 ハック用のコードもつけたいけど書くと長いので割愛。 最初に、AssetBundleとは? Unityで作成したアプリにコンテンツの追加を行う機能です。 利用目的 iTunesStoreではWiFi以外からのダウンロードに50Mのサイズ制限があるのと、待ち時間のあるアプリ審査をせずにコンテンツの追加を行うのにAssetBundleを利用しています。 起動時にCaching.readyとCaching.enabledがONになるまで待つ アプリ -> サーバーから最新のバージョン番号のみをJSONで取得 アプリ内のAssetBundleバージョンより新しいバージョンの場合、サーバーからAssetBundleのファイル名、version、CRC32をJSON+tsvで取得※1 最新バージョンが有るAssetBundleをLoadFromC
ダウンロードしたリソース(csvファイル)をローカルに保存する&保存したリソースを読み込むサンプル ダウンロード&永続化 using UnityEngine; using System.Collections; using System.IO; public class WWWLoader : MonoBehaviour { IEnumerator Start () { WWW www = new WWW("http://127.0.0.1:8000/static/sample.csv"); while (!www.isDone) { // ダウンロードの進捗を表示 print(Mathf.CeilToInt(www.progress*100)); yield return null; } if (!string.IsNullOrEmpty(www.error)) { // ダウンロードで
目次 目次 n秒後に何かする コルーチンの停止 コルーチンの一時停止 コルーチンの完了を待ち合わせる コルーチンの結果を受け取る 進行状況が表現可能な 待機 その他Tips 参考 n秒後に何かする コルーチンは、時間を絡めた処理を実装するのに便利です。例えば以下のように記述すると、以下の様なフローが記述出来ます。 オブジェクトをクリックした際、色を「赤」へ変更 0.5秒待つ 対象のオブジェクトの色を「緑」に戻す gist.github.com yield return null;を使用すると次のフレームまで、yield return new WaitForSeconds(秒数);を使用すると指定秒停止します。 コルーチンとして実行できる処理は、戻り値がIEnumeratorのメソッドのみです。 ちなみにStartCoroutine_Autoなるメソッドが有りますが、これはStartCoro
Map a sub-asset from an imported asset (such as an FBX file) to an external Asset of the same type.
Controller filters are a common sight in Ruby on Rails controllers. The before_filter specifically can be used to halt the request cycle. This is useful to prevent unauthorized access to controller actions, but it’s also very often used to load database records. Take a look at this controller: class TreesController before_action :authenticate_user! before_action :find_forest before_action :find_tr
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く