예제 #1
0
    private void RpcOnReload()
    {
        Animator anim = currentGraphics.GetComponent <Animator>();

        if (anim != null)
        {
            anim.SetTrigger("Reload");
        }
    }
예제 #2
0
    public void Aim()
    {
        Animator anim = currentGraphics.GetComponent <Animator>();

        if (PlayerShoot.isAiming)
        {
            anim.SetBool("Aiming", true);
        }
        else
        {
            anim.SetBool("Aiming", false);
        }
    }
예제 #3
0
    private IEnumerator Reload_Coroutine()
    {
        isReloading = true;

        CmdOnReload();

        yield return(new WaitForSeconds(currentWeapon.reloadTime));

        currentWeapon.bullets = currentWeapon.maxBullets;

        Animator anim = currentGraphics.GetComponent <Animator>();

        anim.SetBool("Reload", false);

        isReloading = false;
    }
예제 #4
0
    // need to complete

    void PickUpPrimary(GameObject _weapon)
    {
        if (weapon != null)
        {
            weapon.SetActive(false);
        }


        weapon = _weapon.transform.GetChild(0).gameObject;
        weapon.SetActive(true);

        if (weapon.tag == "L96")
        {
            CrossHair.SetActive(false);
        }
        else
        {
            CrossHair.SetActive(true);
        }

        PrimaryWeapon = weapon.GetComponent <WeaponGraphics>().weaponInfo;
        CurrentWeapon = PrimaryWeapon;

        Primary   = true;
        Secondery = false;

        currentGraphics              = weapon.GetComponent <WeaponGraphics>();
        _PlayerShoot.currentWeapon   = CurrentWeapon;
        _PlayerShoot.weaponAnimation = currentGraphics.GetComponent <WeaponAnimation>();

        _PlayerShoot.CurrentAmmo = currentGraphics.AmmoStored;

        // updateAnimator.animator = _PlayerShoot.weaponAnimation.GetComponent<Animator>();
        //////////////////////////////////////////////////
    }
예제 #5
0
    // SwitchToPrimary method
    void SwitchToPrimary(GameObject _Primary)
    {
        // Set Active (false) the current weapon
        if (weapon != null)
        {
            weapon.SetActive(false);
        }

        _PlayerShoot.CancelInvoke("Shoot");
        weapon = _Primary.transform.GetChild(0).gameObject;
        weapon.SetActive(true);
        if (weapon.tag == "L96")
        {
            CrossHair.SetActive(false);
        }
        else
        {
            CrossHair.SetActive(true);
        }

        CurrentWeapon            = PrimaryWeapon;
        _PlayerShoot.CurrentAmmo = _PlayerShoot.CurrentAmmoP;
        Primary   = true;
        Secondery = false;

        currentGraphics              = weapon.GetComponent <WeaponGraphics>();
        _PlayerShoot.currentWeapon   = CurrentWeapon;
        _PlayerShoot.weaponAnimation = currentGraphics.GetComponent <WeaponAnimation>();
    }
예제 #6
0
    void RpcOnReload()
    {
        Animator anim = currentGraphics.GetComponent <Animator>();// Getscomponent of the type animator in currentGraphics

        if (anim != null)
        {
            anim.SetTrigger("Reload");//Enables the trigger that allows the weapon reload animation
        }
    }
예제 #7
0
    void RpcOnReload()
    {
        currentSounds.PlayCockSound();
        Animator anim = currentGraphics.GetComponent <Animator>();

        if (anim != null)
        {
            anim.SetTrigger("Reload");
        }
    }
예제 #8
0
    void RpcOnAttack()
    {
        Animator anim = currentGraphics.GetComponent <Animator>();

        if (anim != null)
        {
            anim.SetTrigger("Attack");
        }
        else
        {
            Debug.Log("Animatorul nu a fost gasit");
        }
    }
예제 #9
0
    // SwitchToSecondary method
    void SwitchToSecondary(GameObject _Secondary)
    {
        if (weapon != null)
        {
            weapon.SetActive(false);
        }
        _PlayerShoot.CancelInvoke("Shoot");
        weapon = _Secondary.transform.GetChild(0).gameObject;
        weapon.SetActive(true);
        CrossHair.SetActive(true);

        CurrentWeapon            = SecondaryWeapon;
        _PlayerShoot.CurrentAmmo = _PlayerShoot.CurrentAmmoS;
        Secondery = true;
        Primary   = false;

        currentGraphics              = weapon.GetComponent <WeaponGraphics>();
        _PlayerShoot.currentWeapon   = CurrentWeapon;
        _PlayerShoot.weaponAnimation = currentGraphics.GetComponent <WeaponAnimation>();
    }
예제 #10
0
    void PickUpSecondary(GameObject _weapon)
    {
        if (weapon != null)
        {
            weapon.SetActive(false);
        }

        weapon = _weapon.transform.GetChild(0).gameObject;
        weapon.SetActive(true);
        CrossHair.SetActive(true);


        SecondaryWeapon              = weapon.GetComponent <WeaponGraphics>().weaponInfo;
        CurrentWeapon                = SecondaryWeapon;
        Secondery                    = true;
        Primary                      = false;
        currentGraphics              = weapon.GetComponent <WeaponGraphics>();
        _PlayerShoot.currentWeapon   = CurrentWeapon;
        _PlayerShoot.weaponAnimation = currentGraphics.GetComponent <WeaponAnimation>();
        _PlayerShoot.CurrentAmmo     = currentGraphics.AmmoStored;
    }