Beispiel #1
0
    /// <summary>
    ///
    /// </summary>
    protected override void OnEnable()
    {
        base.OnEnable();
        Source.clip = TakeSound;
        Source.Play();
        if (Animat)
        {
            Animat.DrawWeapon();
        }
        CanFire = true;
        CanAim  = true;
        bl_EventHandler.OnKitAmmo  += this.OnPickUpAmmo;
        bl_EventHandler.OnRoundEnd += this.OnRoundEnd;

        if (Info.Type == GunType.Grenade || Info.Type == GunType.Shotgun)
        {
            Crosshair.Change(2);
        }
        else if (Info.Type == GunType.Knife)
        {
            Crosshair.Change(1);
        }
        else
        {
            Crosshair.Change(0);
        }
        if (inReloadMode)
        {
            StartCoroutine(reload(0.2f));
        }
    }
Beispiel #2
0
 void OnEnable()
 {
     GetComponent <AudioSource>().clip = TakeSound;
     GetComponent <AudioSource>().Play();
     if (Animat)
     {
         Animat.DrawWeapon();
     }
     CanFire = true;
     CanAim  = true;
     bl_EventHandler.OnKitAmmo  += this.OnPickUpAmmo;
     bl_EventHandler.OnRoundEnd += this.OnRoundEnd;
     Cross.movementScale         = CrossHairScale;
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 void OnEnable()
 {
     audio.clip = TakeSound;
     audio.Play();
     if (Animat)
     {
         Animat.DrawWeapon();
     }
     CanFire = true;
     CanAim  = true;
     if (!isRegistered)
     {
         isRegistered = true;
         bl_EventHandler.OnKitAmmo  += this.OnPickUpAmmo;
         bl_EventHandler.OnRoundEnd += this.OnRoundEnd;
     }
     m_AmmoSlider = GameObject.Find("SliderAmmo").GetComponent <Slider>();
     if (m_AmmoSlider != null)
     {
         m_AmmoSlider.maxValue = bulletsPerClip;
     }
 }