コード例 #1
0
    private void FireObjtive()
    {
        // Instantiate bullet
        GunBulletResponse currentBullet = GameController.Instance.GetHeliGunBulletInactive();
        // Commpute bullet direction
        Vector3 bulletDirection = (m_Target.transform.position - m_EnemyTransform.position).normalized;

        // Init bullet
        currentBullet.OnInit(m_EnemyBlackboard.m_Damage, m_BulletSpeed, bulletDirection, m_BulletEmitter.transform.position);
    }
コード例 #2
0
    void FirePlayer()
    {
        DesactivateAnimations();
        SetAttackAnimation(true);
        m_ElapsedTime = 0.0f;
        GunBulletResponse currentBullet   = GameController.Instance.GetHeliGunBulletInactive();
        Vector3           bulletDirection = m_EnemyTransform.forward - new Vector3(0, +0.1f, 0);

        currentBullet.OnInit(m_EnemyBlackboard.m_Damage, m_BulletSpeed, bulletDirection, m_BulletEmitter.transform.position);
        // Set audio
        SoundController.Instance.PlayOneShootAudio("event:/Helicopter/Shot", m_EnemyTransform);
    }
コード例 #3
0
    private void FireNerfAnitguo()
    {
        SoundController.Instance.PlayOneShootAudio("event:/Nerf/Shot", m_PlayerBlackboard.m_PlayerTransform);
        // Set elapsed time to 0
        m_ElapsedTimeFire = 0;
        //Substract Ammo
        m_PlayerBlackboard.SubstractAmmo(1);
        // Instantiate bullet
        GunBulletResponse l_CurrentBullet = GameController.Instance.GetGunBulletInactive();
        // Get damage depending if player have buff activated
        int l_Damage = m_PlayerBlackboard.BuffActive() ?
                       l_Damage = m_PlayerBlackboard.m_NerfSO.m_WeaponLevel[m_PlayerBlackboard.m_NerfCurrentLevel].m_Damage * m_PlayerBlackboard.m_DamageMultiplayer   :
                                  m_PlayerBlackboard.m_NerfSO.m_WeaponLevel[m_PlayerBlackboard.m_NerfCurrentLevel].m_Damage;

        // Init bullet with his damage, direction and cadence
        l_CurrentBullet.OnInit(l_Damage,
                               m_PlayerBlackboard.m_NerfSO.m_WeaponLevel[m_PlayerBlackboard.m_NerfCurrentLevel].m_BulletForce,
                               m_PlayerBlackboard.m_PlayerCamera.transform.forward, m_BulletEmitter.transform.position);
        // Play PS
        m_NerfShootParticleSystem.Play();
    }