Exemplo n.º 1
0
        private IEnumerator StartSwordAttack()
        {
            Sword _sword = currentWeaponRef.GetComponent <Sword>();

            isAttacking = true;
            currentWeaponRef.refObj.SetActive(true);
            foreach (Transform child in currentWeaponRef.refObj.transform)
            {
                child.gameObject.SetActive(true);
            }
            weaponHolder.anim.SetTrigger("Attack" + Random.Range(1, 3).ToString());
            yield return(new WaitForSeconds(.2f));

            PlayerReferencer.singleton.camMovement.ShakeCamera(cameraShakeProperties);
            yield return(new WaitForSeconds(.4f));

            _sword.ClearColliders();
            currentWeaponRef.refObj.SetActive(false);
            foreach (Transform child in currentWeaponRef.refObj.transform)
            {
                child.gameObject.SetActive(false);
            }
            isAttacking = false;
        }