예제 #1
0
        void ShotHeavy(ShotParam param)
        {
            float   width = AtkParamHeavy.HalfWidth * 2.0f;
            Vector3 move  = ShotMove;

            int num = AtkParamHeavy.ShotNum;

            Debug.Assert(num >= 3);

            move.x -= AtkParamHeavy.HalfWidth;
            float stride = width / (num - 1);

            if (param.Step % 2 == 1)
            {// 弾を偶数個にする回
                num    -= 1;
                move.x += stride / 2.0f;
            }

            for (int i = 0; i < num; i++)
            {
                BulletManager.ShotBullet((int)ShotKind.Heavy, transform.position + transform.rotation * ShotPosition, transform.rotation, move);
                param.Num++;
                move.x += stride;
            }
            param.Step++;
            //            move.x += Random.Range(-AtkParamHeavy.HalfWidth, AtkParamHeavy.HalfWidth);
        }
예제 #2
0
        void ShotFast(ShotParam param)
        {
            float   width = AtkParamHeavy.HalfWidth * 2.0f;
            Vector3 move  = ShotMove;

            int num = AtkParamFast.ShotNum;

            Debug.Assert(num >= 3);

            float stride = width / (num - 1);

            if (param.Step % 2 == 0)
            {// 左から開始
                move.x -= AtkParamFast.HalfWidth;
                move.x += stride * param.Num;
            }
            else
            {// 右から開始
                move.x += AtkParamFast.HalfWidth;
                move.x -= stride * param.Num;
            }

            BulletManager.ShotBullet((int)ShotKind.Fast, transform.position + transform.rotation * ShotPosition, transform.rotation, move);
            param.Num++;

            if (param.Num >= AtkParamFast.ShotNum)
            {
                param.Num = 0;
                param.Step++;
            }
        }
예제 #3
0
        private void Awake()
        {
            ShotTargetPosition = transform.position;// + ShotPosition;
            HitPoint           = HitPointMax;

            ShotParams = new ShotParam[Enum.GetNames(typeof(ShotKind)).Length];
            for (int i = 0; i < ShotParams.Length; i++)
            {
                ShotParams[i] = new ShotParam();
            }
        }