Esempio n. 1
0
        /// <summary>
        /// 弾丸発射時
        /// </summary>
        public override void OnShoot(Bullet bullet)
        {
            bullet.SetTimeStamp(BattleGlobal.GetTimeStamp());
            bullet.SetOnDestroyCallback(this.OnDestroyBullet);

            //発射した弾丸の速度や角度の情報
            var data = new BulletDto();

            data.bulletBase             = bullet.bulletBase;
            data.isNormalBullet         = bullet is NormalBullet;
            data.id                     = this.shootCount;
            data.timeStamp              = bullet.bulletBase.movement.timeStamp;
            data.speed                  = bullet.bulletBase.movement.speed;
            data.bulletLocalPosition    = bullet.transform.localPosition;
            data.bulletLocalEulerAngles = bullet.transform.localEulerAngles;
            data.barrelLocalEulerAngles = this.turretBase.rotationParts.localEulerAngles;
            this.bulletList.Add(data);

            //プロパティ更新
            PhotonNetwork.LocalPlayer.SetCustomProperties(new PhotonHashtable {
                { PlayerPropertyKey.BulletList, this.bulletList.ToBinary() }
            });

            this.shootCount++;
        }
Esempio n. 2
0
    /// <summary>
    /// Update
    /// </summary>
    private void Update()
    {
        if (this.lifeTime <= 0f)
        {
            //寿命が尽きたので終了
            Destroy(this.gameObject);
            return;
        }

        float deltaTime = BattleGlobal.GetDeltaTime(ref this.timeStamp);
        this.lifeTime -= deltaTime;
    }
Esempio n. 3
0
    /// <summary>
    /// Update
    /// </summary>
    private void Update()
    {
        float deltaTime = BattleGlobal.GetDeltaTime(ref timeStamp);
        int loopCount = (int)(deltaTime / SharkDefine.DELTATIME);

        for (int i = 0; i < loopCount + 1; i++)
        {
            float _deltaTime = Mathf.Min(deltaTime, SharkDefine.DELTATIME);
            deltaTime -= _deltaTime;

            this.controller?.Update(_deltaTime);
        }
    }
Esempio n. 4
0
    /// <summary>
    /// Update
    /// </summary>
    private void Update()
    {
        //Stayイベントは1フレームだけしか聞かない
        this.bulletBase.bulletCollider.stayEventReceiver = null;

        float deltaTime = BattleGlobal.GetDeltaTime(ref timeStamp);
        int loopCount = (int)(deltaTime / SharkDefine.DELTATIME);

        for (int i = 0; i < loopCount + 1; i++)
        {
            float _deltaTime = Mathf.Min(deltaTime, SharkDefine.DELTATIME);
            deltaTime -= _deltaTime;

            this.controller?.Update(_deltaTime);
        }
    }
Esempio n. 5
0
    /// <summary>
    /// セットアップ
    /// </summary>
    public void Setup(
        bool isFvAttack,
        uint power,
        uint fvRate,
        Master.BulletData bulletData,
        SkillGroupManager skill,
        Turret turret)
    {
        base.Setup(isFvAttack, power, fvRate, bulletData, skill);

        //タイムスタンプ取得
        this.timeStamp = BattleGlobal.GetTimeStamp();

        //制御開始
        this.controller.Start(turret, this.bulletBase, this.OnHit, this.OnFinished);
    }
Esempio n. 6
0
    /// <summary>
    /// セットアップ
    /// </summary>
    public void Setup(
        bool isFvAttack,
        uint power,
        uint fvRate,
        Master.BulletData bulletData,
        SkillGroupManager skill,
        Turret turret,
        Vector2 dropPosition)
    {
        base.Setup(isFvAttack, power, fvRate, bulletData, skill);

        this.timeStamp = BattleGlobal.GetTimeStamp();
        this.dropPosition = dropPosition;

        //制御開始
        this.controller.Start(turret, this.bulletBase, dropPosition, this, this.OnFinished);
    }
Esempio n. 7
0
    /// <summary>
    /// ダメージ食らう
    /// </summary>
    public void OnDamaged(Bullet bullet)
    {
        if (this.isDead)
        {
            return;
        }

        //ダメージ
        int damage = BattleGlobal.GetDamage(this, bullet);

        //ダメージ食らう
        this.hp -= damage;
#if DEBUG
        if (BattleDebug.isOneKill)
        {
            this.hp = 0;
        }
#endif

        //被ダメ中状態になる
        this.conditionManager.Add(new FishConditionDamaged());

        //被ダメ時スキル効果発動
        bullet.skill.OnFishDamaged(this);

        //捕獲成功したかチェック
        if (SceneChanger.currentScene is BattleSceneBase && (SceneChanger.currentScene as BattleSceneBase).FishCatchingCalculation(this))
        {
            //死亡フラグON
            this.conditionManager.Add(new FishConditionDead());

            //捕獲通知
            (SceneChanger.currentScene as BattleSceneBase)?.OnFishCatched(this, bullet);
        }

        //被ダメ通知
        (SceneChanger.currentScene as MultiBattleScene)?.OnFishDamaged(this, damage);

        //状態変化通知
        (SceneChanger.currentScene as MultiBattleScene)?.OnChangeFishCondition(this);
    }
Esempio n. 8
0
        /// <summary>
        /// 波動砲発射時
        /// </summary>
        public override void OnShoot(LaserBeamBullet bullet)
        {
            //自分しかいないのでイベント送信の必要なし
            if (PhotonNetwork.CurrentRoom.PlayerCount == 1)
            {
                return;
            }

            var dto = new BulletDto();

            dto.timeStamp              = BattleGlobal.GetTimeStamp();
            dto.bulletLocalPosition    = bullet.transform.localPosition;
            dto.bulletLocalEulerAngles = bullet.transform.localEulerAngles;
            dto.barrelLocalEulerAngles = this.turretBase.rotationParts.localEulerAngles;

            //イベント送信
            PhotonNetwork.RaiseEvent(
                (byte)MultiEventCode.ShootLaserBeam,
                dto.GetBinary(),
                RaiseEventOptions.Default,
                SendOptions.SendReliable
                );
        }