예제 #1
0
파일: Rockjaw.cs 프로젝트: wuw94/pon
 // ------------------------------------------------- Shotgun -------------------------------------------------
 public override void PrimaryAttack()
 {
     if (!primary.is_reloading)
     {
         ShakeCamera(0.05f, 0.09f, Quaternion.Euler(0, 0, GetMouseDirection(attacking_offset.position)));
         primary.Fire(GetMouseDirection(attacking_offset.position));
     }
     else
     {
         ability_primary.Reset();
     }
 }
    private void Shoot()
    {
        if (!isloaded || !shootReleased)
        {
            return;
        }

        if (DamageUPActive)
        {
            shotty.Fire(this.gameObject.transform.position);
            cd       = 0.15f;
            isloaded = false;
        }
        else
        {
            shotty.Fire(this.gameObject.transform.position);
            PeterCD     = 0.400f;
            cd          = 0.700f;
            isloaded    = false;
            PeterCDDone = false;
        }

        anim.SetTrigger("Shoot");
    }
예제 #3
0
    void FireByIndex()
    {
        switch (enemyType)
        {
        case 0:
            br.Fire();
            break;

        case 1:
            ps.Fire();
            break;

        case 2:
            sg.Fire();
            break;
        }
    }
예제 #4
0
        static void Main(string[] args)
        {
            Firearm firearm = new Firearm();

            firearm.Fire("I'm a generic firearm and I shoot things.");

            Shotgun shotgun = new Shotgun();

            shotgun.Fire("I'm a 12 guage shotgun and I got boom!");

            Pistol pistol = new Pistol();

            pistol.Fire("I'm a 9mm pistol and I got pop!");

            Rifle rifle = new Rifle();

            rifle.Fire("I'm a 30-06 rifle and I go crack!");
        }
예제 #5
0
    public void CmdFireActiveWeapon(bool mouseHeld, Vector3 localForward, Vector3 localUp)
    {
        switch (currentWeapon)
        {
        case 0:
            pistolPrefab.Fire(mouseHeld, localForward, localUp);
            break;

        case 1:
            laserPrefab.Fire(mouseHeld, localForward, localUp);
            break;

        case 2:
            assaultRifle.Fire(mouseHeld, localForward, localUp);
            break;

        case 3:
            shotgun.Fire(mouseHeld, localForward, localUp);
            break;
        }
    }