Example #1
0
        /// <summary>
        /// 波動砲発射イベント受信時
        /// </summary>
        public void OnShootLaserBeam(object value)
        {
            var dto = new BulletDto();

            dto.SetBinary((byte[])value);

            //弾丸生成
            var bulletPrefab = this.fvaBulletAsset.handle.asset as BulletBase;
            var bulletBase   = this.turretBase.CreateBullet(bulletPrefab, BattleGlobal.instance.bulletArea);

            bulletBase.transform.localPosition = this.cachedTransform.localRotation * dto.bulletLocalPosition;
            bulletBase.transform.rotation      = this.cachedTransform.localRotation * Quaternion.Euler(dto.bulletLocalEulerAngles);
            bulletBase.SetParticleLayer(BattleGlobal.instance.bulletCanvas);

            //砲身回転
            this.StartBarrelRotation(dto.barrelLocalEulerAngles);

            //制御開始
            var controller = new FvAttackLaserBeam.Controller();

            this.fvaControllers.Add(controller);
            controller.Start(true, this, bulletBase, null);
        }