예제 #1
0
        public Weapon(Func <int, int, double, teamEnum, bool> function, Sprite sh)
        {
            this.team = team;
            fireFunc  = new fireMode(function);
            shooter   = sh;

            String imagePath = System.IO.Directory.GetCurrentDirectory() + "/../../Images/cropped_contra_images/hero/bullet.png";

            bulletImage = (Bitmap)Image.FromFile(imagePath, true);
            bulletImage = Utilities.ScaleImage(bulletImage, 10, 10);
        }
예제 #2
0
    /// <summary>
    /// Update guns Mode in UI
    /// </summary>
    /// <param name="type"></param>
    void UpdateGunType(fireMode type)
    {
        if (gunType == fireMode.Auto)
        {
            semiModeRoot.SetActive(false);
            autoModeRoot.SetActive(true);
        }
        else if(gunType == fireMode.Semi)
        {
            autoModeRoot.SetActive(false);
            semiModeRoot.SetActive(true);
        }

    }
예제 #3
0
    IEnumerator SecondFireMode()
    {
        canSwicthMode = false;
        selected      = false;

        aSource.clip = switchModeSound;
        aSource.Play();

        //PlayAnimationName(switchAnim, 1f);

        yield return(new WaitForSeconds(0.6f));

        currentMode   = secondMode;
        fireRate      = fireRateSecondMode;
        selected      = true;
        canSwicthMode = true;
    }
예제 #4
0
    void Start()
    {
        muzzleFlash.enabled = false;
        muzzleLight.enabled = false;
        hipPosition         = transform.GetChild(0).localPosition;
        camFOV      = mainCamera.fieldOfView;
        currentMode = firstMode;
        fireRate    = fireRateFirstMode;
        aiming      = false;

        for (int i = 0; i < Bulletmarks.Length; i++)
        {
            if (!(tags.Count == Bulletmarks.Length))
            {
                tags.Add(Bulletmarks[i].Tag);
            }
        }
    }
예제 #5
0
    void Start()
    {
        inventory           = scriptManager.GetScript <Inventory>();
        playerFunctions     = scriptManager.GetScript <PlayerFunctions>();
        camFOV              = playerFunctions.NormalFOV;
        muzzleFlash.enabled = false;
        muzzleLight.enabled = false;
        hipPosition         = transform.GetChild(0).localPosition;
        currentMode         = firstMode;
        fireRate            = fireRateFirstMode;
        aiming              = false;

        for (int i = 0; i < Bulletmarks.Length; i++)
        {
            if (!(tags.Count == Bulletmarks.Length))
            {
                tags.Add(Bulletmarks[i].Tag);
            }
        }
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        stats = GameObject.Find("RoundManager").GetComponent<RoundStats>();
        weaponCamera = GameObject.FindWithTag("WeaponCamera");
        mainCamera = GameObject.FindWithTag("MainCamera");
        player = GameObject.FindWithTag("Player");

        bulletsLeft = bulletsPerMag;
        currentMode = firstMode;
        fireRate = fireRateFirstMode;
        aiming = false;

        if (ammoMode == Ammo.Bullets)
        {
            magazines = magazines * bulletsPerMag;
        }

        if (currentMode == fireMode.semi)
        {
            damage = PlayerPrefs.GetInt("GunDmg");
            bulletsLeft = PlayerPrefs.GetInt("GunAmmo");
        }

        if (currentMode == fireMode.burst)
        {
            damage = PlayerPrefs.GetInt("ShotgunDmg");
            bulletsLeft = PlayerPrefs.GetInt("ShotgunAmmo");
        }
        statUpdater.setAmmo(bulletsLeft);

           		//weaponAnim.GetComponent<Animation>().wrapMode = WrapMode.Loop;
        //weaponAnim.GetComponent<Animator>().SetBool("IsWalking", false);
        //muzzleFlash.enabled = false;
        //gunLine.enabled = false;
    }
예제 #7
0
 IEnumerator SecondFireMode()
 {
     canSwicthMode = false;
     selected = false;
     //GetComponent<AudioSource>().clip = switchModeSound;
     //GetComponent<AudioSource>().Play();
     //weaponAnim.GetComponent<Animation>().Play("SwitchAnim");
     yield return new WaitForSeconds(0.6f);
     currentMode = secondMode;
     fireRate = fireRateSecondMode;
     selected = true;
     canSwicthMode = true;
 }
 void Start()
 {
     weaponCamera = GameObject.FindWithTag("WeaponCamera");
     mainCamera = GameObject.FindWithTag("MainCamera");
     player = GameObject.FindWithTag("Player");
     muzzleFlash.enabled = false;
     muzzleLight.enabled = false;
     bulletsLeft = bulletsPerMag;
     currentMode = firstMode;
     fireRate = fireRateFirstMode;
     aiming = false;
     if (firstMode == fireMode.launcher)
     {
         rocket = GameObject.Find("RPGrocket");
     }
     if (ammoMode == Ammo.Bullets)
     {
         magazines = magazines * bulletsPerMag;
     }
 }