Esempio n. 1
0
    private void Awake()
    {
        camera        = Camera.main;
        weaponManager = FindObjectOfType <WeaponManager>();

        player      = GetComponent <Player>();
        playerInput = GetComponent <PlayerInput>();

        player.onRespawn += Reset;

        playerInput.AddKeybind(KeyCode.R, () => {
            var bulletWeapon = Weapon as BulletWeapon;
            if (bulletWeapon)
            {
                bulletWeapon.Reload();
            }
        });

        SetGadget(weaponManager.GetRandomGadgetIndex());
    }