今日やったこと
ワーキングメモリートレーニング
瞑想
鬼計算、鬼耳算、鬼ネズミ、計算20、計算100.
Lv.11 120問程度
ゲーム開発
爆風との当たり判定
Bombが出す爆風とプレイヤーとの当たり判定を管理するクラスを作成しました。
using UnityEngine; using Zenject; using Manager; namespace Attacker { public class BlastHitter : MonoBehaviour { [Inject] private PlayerStateManager playerStateManager; private void OnParticleCollision(GameObject other) { if (playerStateManager.PlayerState == Manager.PlayerState.Collapse) return; if(other.tag == "Player") { playerStateManager.SetPlayerState(Manager.PlayerState.Collapse); Debug.Log("Blast Hit"); } } } }
BombDestroyerとExploderの作成
昨日作成したBombクラスは、2つの処理を担当してしまっているような気がしたので、2つのクラスに分割することにしました。
using UnityEngine; namespace Attacker { public class BombDestroyer : MonoBehaviour { // Start is called before the first frame update void Start() { Destroy(this.gameObject, 1.1f); } } }
using UnityEngine; using UniRx; using System; namespace Attacker { public class Exploder : MonoBehaviour { [SerializeField] private GameObject explosionObject; // Start is called before the first frame update void Start() { Explode(); } private void Explode() { Observable .Timer(TimeSpan.FromSeconds(1)) .Subscribe(_ => Instantiate(explosionObject,this.transform.localPosition,Quaternion.identity)); } } }
今日のパフォーマンス
JINS MEME ESという最新の学術研究の成果を元に人間の心理状態を測定できるウェアラブルデバイスを使って本日の僕の集中状態を測定した結果は以下のようになりました。
作業時間 8h49m
集中時間 2h55m
集中率 33 %
反省
今日は途中で気を失ってしまい(ただの居眠り)、またよく分からんエラーに躓いてしまい、作業があまり進みませんでした。