Exemple #1
0
 void Awake()
 {
     attacking         = GetComponent <PlayerAttacking>();
     playerInventory   = GetComponent <PlayerInventory>();
     playerManager     = GetComponent <PlayerManager>();
     weaponSlotManager = GetComponentInChildren <WeaponSlotManager>();
     uiManager         = FindObjectOfType <UIManager>();
 }
Exemple #2
0
    public override void AttemptToConsumeItem(AnimatorHandler playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerEffectsManager playerEffectsManager)
    {
        base.AttemptToConsumeItem(playerAnimatorManager, weaponSlotManager, playerEffectsManager);
        GameObject flask = Instantiate(itemModel, weaponSlotManager.leftHandSlot.transform); //instanciamos el modelo del item en la mano derecha

        playerEffectsManager.currentParticleFX   = recoveryFX;                               //le pasamos el fx
        playerEffectsManager.amountToBeHealed    = healthRecoverAmount;                      //le pasamos la vida que le tiene que sumar
        playerEffectsManager.instantiatedFXModel = flask;
        weaponSlotManager.leftHandSlot.UnloadWeapon();                                       //ocultamos arma en la mano para poner el item consumible
    }
Exemple #3
0
 private void Awake()
 {
     cameraHandler     = FindObjectOfType <CameraHandler>();
     animatorHandler   = GetComponent <AnimatorHandler>();
     weaponSlotManager = GetComponent <WeaponSlotManager>();
     playerManager     = GetComponentInParent <PlayerManager>();
     inputHandler      = GetComponentInParent <InputHandler>();
     playerInventory   = GetComponentInParent <PlayerInventory>();
     playerStats       = GetComponentInParent <PlayerStats>();
 }
Exemple #4
0
    private void Awake()     //se llama al cargar la isntancia del script
    {
        weaponSlotManager = GetComponentInChildren <WeaponSlotManager>();

        try{
            EquipCurrentFireWeapon();
            EquipCurrentWeapon();
        }catch (Exception ex)
        {
        }
    }
Exemple #5
0
 public virtual void AttemptToConsumeItem(AnimatorHandler playerAnimatorManager, WeaponSlotManager weaponSlotManager, PlayerEffectsManager playerEffectsManager)
 {
     if (currentItemAmount > 0 && maxItemAmount >= currentItemAmount) //si tiene items que consumir
     {
         //hacer animacion
         playerAnimatorManager.PlayTargetAnimation(consumeAnimation, isInteracting);
         currentItemAmount = currentItemAmount - 1;
     }
     else
     {
         //hacer animacion de que no tiene mas consumibles , deteniendo al player un instante
         //playerAnimatorManager.PlayTargetAnimation("Shrug", true);
     }
 }
    private void Awake()
    {
        playerAttacker  = GetComponent <PlayerAttacker>();
        playerInventory = GetComponent <PlayerInventory>();
        playerManager   = GetComponent <PlayerManager>();
        tutorial        = FindObjectOfType <tutorialHandler>();

        playerEffectsManager  = GetComponentInChildren <PlayerEffectsManager>();
        playerAnimatorManager = GetComponentInChildren <AnimatorHandler>();
        weaponSlotManager     = GetComponentInChildren <WeaponSlotManager>();

        playerLocomotion = GetComponent <PlayerLocomotion>();
        playerStats      = GetComponent <PlayerStats>();
        cameraHolder     = FindObjectOfType <CameraHolder>();
        UIManager        = FindObjectOfType <UIManager>();
        help_input       = false;
    }
Exemple #7
0
 private void Awake()
 {
     slotManager = GetComponentInChildren <WeaponSlotManager>();
 }
Exemple #8
0
 void Awake()
 {
     playerInventory   = FindObjectOfType <PlayerInventory>();
     weaponSlotManager = FindObjectOfType <WeaponSlotManager>();
     uiManager         = GetComponentInParent <UIManager>();
 }
Exemple #9
0
 private void Awake()
 {
     weaponSlotManager = GetComponent <WeaponSlotManager>();
 }
Exemple #10
0
 void Awake()
 {
     animHandler       = GetComponentInChildren <PlayerAnimatorHandler>();
     inputHandler      = GetComponent <InputHandler>();
     weaponSlotManager = GetComponentInChildren <WeaponSlotManager>();
 }
 private void Awake()
 {
     playerStats       = GetComponentInParent <PlayerStats>();
     weaponSlotManager = GetComponentInParent <WeaponSlotManager>();
     inputHandler      = GetComponentInParent <InputHandler>();
 }
Exemple #12
0
    public override void SuccessfullyCastSpell(AnimatorHandler animatorHandler, PlayerStats playerStats, CameraHandler cameraHandler, WeaponSlotManager weaponSlotManager)
    {
        base.SuccessfullyCastSpell(animatorHandler, playerStats, cameraHandler, weaponSlotManager);
        GameObject instantiatedProjectile = Instantiate(spellCastFX, weaponSlotManager.rightHandSlot.transform.position, cameraHandler.cameraPivotTransform.rotation);

        rigidbody = instantiatedProjectile.GetComponent <Rigidbody>();

        if (cameraHandler.currentLockOnTarget != null)
        {
            instantiatedProjectile.transform.LookAt(cameraHandler.currentLockOnTarget.transform);
        }
        else
        {
            instantiatedProjectile.transform.rotation = Quaternion.Euler(cameraHandler.cameraPivotTransform.eulerAngles.x, playerStats.transform.eulerAngles.y, 0);
        }

        rigidbody.AddForce(instantiatedProjectile.transform.forward * projectileForwardVelocity);
        rigidbody.AddForce(instantiatedProjectile.transform.up * projectileUpwardVelocity);
        rigidbody.useGravity = isEffectedByGravity;
        rigidbody.mass       = projectileMass;
        instantiatedProjectile.transform.parent = null;
    }
Exemple #13
0
    public override void AttemptToCastSpell(AnimatorHandler animatorHandler, PlayerStats playerStats, WeaponSlotManager weaponSlotManager)
    {
        base.AttemptToCastSpell(animatorHandler, playerStats, weaponSlotManager);
        GameObject instantiateWarmUpSpellFX = Instantiate(spellWarmUpFX, weaponSlotManager.rightHandSlot.transform);

        //instantiateWarmUpSpellFX.gameObject.transform.localScale = new Vector3(100, 100, 100);
        animatorHandler.PlayTargetAnimation(spellAnimation, true);
    }
Exemple #14
0
 public virtual void SuccessfullyCastSpell(AnimatorHandler animatorHandler, PlayerStats playerStats, CameraHandler cameraHandler, WeaponSlotManager weaponSlotManager)
 {
     Debug.Log("You cast a cast");
 }
Exemple #15
0
 public virtual void AttemptToCastSpell(AnimatorHandler animatorHandler, PlayerStats playerStats, WeaponSlotManager weaponSlotManager)
 {
     Debug.Log("you attempt to cast a spell");
 }