Esempio n. 1
0
    public virtual IEnumerator attakAnimation()
    {
        useable  = false;
        attaking = true;
        movementController.attaking = attaking;
        effectContainer.SetActive(true);

        weaponInterface.setValues(weapon.attakTime, weapon.cooldown, weapon.quantity, attaking, weapon.rotation, weapon.tooltip, weapon.damage);
        weaponInterface.WeaponUse();
        animator.SetBool("attack", true);

        yield return(new WaitForSeconds(weapon.attakTime));

        attaking = false;
        animator.SetBool("attack", false);
        movementController.attaking = attaking;
        StartCoroutine(EffectDisable());

        yield return(new WaitForSeconds(weapon.cooldown - weapon.attakTime));;

        weaponInterface.setValues(weapon.attakTime, weapon.cooldown, weapon.quantity, attaking, weapon.rotation, weapon.tooltip, weapon.damage);
        useable = true;
    }
Esempio n. 2
0
    // Set the Correct Animation Controller for the current weapon
    public void Start()
    {
        attaking           = false;
        player             = GameObject.FindGameObjectWithTag("Player");
        movementController = player.GetComponent <MovementController>();

        animator        = GetComponent <Animator>();
        effectContainer = transform.GetChild(0).gameObject;
        //Set weappon Interface values
        weaponInterface = this.GetComponent <WeaponInterface>();
        weaponInterface.defaultSprite = this.GetComponent <SpriteRenderer>().sprite;
        weaponInterface.setValues(weapon.attakTime, weapon.cooldown, weapon.quantity, attaking, weapon.rotation, weapon.tooltip, weapon.damage);
        weaponInterface.setWeaponManager(player.GetComponent <WeaponManager>());



        //Weapon Specific Initialazation
        Initialize();
    }