Exemplo n.º 1
0
 protected override void Start()
 {
     base.Start();
     startYScale   = transform.transform.localScale.y;
     _recoilScript = GetComponent <RecoilScript>();
     _audioSource  = GetComponent <AudioSource>();
 }
Exemplo n.º 2
0
 private void Awake()
 {
     if (_cameraFunctions == null)
     {
         _cameraFunctions = this;
         _zStart          = transform.position.z;
         _recoil          = GetComponent <RecoilScript>();
     }
     else if (_cameraFunctions != this)
     {
         Destroy(this);
     }
 }
    private void Start()
    {
        _canFire      = true;
        _weaponDelay  = 60f / _weaponRPM;
        _currentDelay = 0f;

        _recoilScript = GetComponent <RecoilScript>();

        if (_cameraRecoil == null)
        {
            _cameraRecoil = Camera.main.GetComponent <RecoilScript>();
            _cameraRecoil.ChangeRecoilValues(_recoilScript._recoilAcceleration * 2, _recoilScript._weaponRecoilStartSpeed * 2, _recoilScript._maximumOffsetDistance * 2);
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        fireDelay = RPM / 60.0f;
        allowFire = true;

        startVector     = transform.localPosition;
        startQuaternion = transform.localRotation;
    }
Exemplo n.º 5
0
    protected override void Start()
    {
        base.Start();

        // start with some ammo
        _pickup = true;

        _recoil = GetComponent<RecoilScript>();

        // set up weapon ammo
        if (_weaponAmmo == null)
        {
            _weaponAmmo = new Dictionary<WeaponType, int>
            {
                { WeaponType.LIGHT, 86 },
                { WeaponType.SPECIAL, 12 },
                { WeaponType.HEAVY, 8 }
            };
        }

        OnAmmoChangeEvent();
    }