/// ******************************************************* /// <summary>当たり判定準備</summary> /// ******************************************************* protected virtual void EntryHitCheck() { if (BarrageCollider == null) { BarrageCollider = new BarrageCollider(); } BarrageCollider.ColliderScale = ColliderScale; BarrageCollider.ColliderPosition = ColliderPosition; BarrageCollider.UpdatePosition(transform); if (CollisionManager.Instance == null) { return; } CollisionManager.Instance.EntryHitCheck(this); }
/// ******************************************************* /// <summary>当たり判定テスト</summary> /// <param name="target">判定対象</param> /// <returns>true:当たった/false:当たってない</returns> /// ******************************************************* public bool HitTest(BarrageCollider target) { float dist = Vector2.Distance(target.ColliderCenter, ColliderCenter); return(dist < (target.ColliderRadius + ColliderRadius)); }
/// ******************************************************* /// <summary>当たり判定初期処理</summary> /// ******************************************************* protected virtual void InitHitCheck() { BarrageCollider = new BarrageCollider(); HitTarget = new List <CharacterControll>(); }