示例#1
0
        /// *******************************************************
        /// <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);
        }
示例#2
0
        /// *******************************************************
        /// <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));
        }
示例#3
0
 /// *******************************************************
 /// <summary>当たり判定初期処理</summary>
 /// *******************************************************
 protected virtual void InitHitCheck()
 {
     BarrageCollider = new BarrageCollider();
     HitTarget       = new List <CharacterControll>();
 }