PlayMakerだけでオブジェクトプールさせるための備忘録
概要
Unityのアセット「Playmaker」を使ってバレットをObject Poolをするための備忘録です。
バレット生成用の空オブジェクトと、バレット保存用の空オブジェクトを使っています。
この記事はabout game makingさんの動画を参考にしています。
弾の事前生成処理

【Create Object】
生成させたGame Objectを「tempBulletsObj」に格納させる。
【Set Parent】
「tempBulletsObj」を「tempGroupObj」とペアレントさせる。
【Int Add】
カウントを足す
【Activate Game Object】
関連付けした「tempBulletsObj」を非表示にする。
弾の発射処理

【Get Next Child】
「tempGroupObj」にペアレントされているGame Objectを「tempBulletsObj」に格納する。
【Game Object is Visible】
「tempBulletsObj」にオブジェクトが格納できているかチェック。
出来ている場合は生成へ。
出来ていない場合は戻る。
弾が生成できた場合

【Get Position】【Set Position】
発射位置を取得して、
生成させるGame Objectの位置を指定する。
【Get Rotation】【Set Rotation】
発射角度を取得して、
生成させるGame Objectの角度を指定する。
コメント
コメント一覧 (2件)
Hello there, just became aware of your blog through Google, and
found that it is really informative. I’m gonna watch
out for brussels. I’ll be grateful if you continue this in future.
Many people will be benefited from your writing.
Cheers! Escape room
Although the update frequency is low, I will still post useful content. Thank you for your continued support!