// Update is called once per frame void Update() { if (!cursedGirl.locked && cursedGirl.activation && cursedGirl.cursedGirlState == CursedGirlStates.TALKING) { if (canTalk) { cursedGirl.AimPlayer(); cursedGirl.anim.SetLayerWeight(0, 0); cursedGirl.anim.SetLayerWeight(1, 1); cursedGirl.anim.SetLayerWeight(2, 0); if (cursedGirl.enemyCanvas.activeInHierarchy) { cursedGirl.enemyCanvas.SetActive(false); } canTalk = false; SetDialogueMode(true); if (dialogueQueue.Count > 0) { currentDialogue = dialogueQueue.Dequeue(); FindObjectOfType <DialogueManager>().StartDialogue(currentDialogue); } else { print("No hay más diálogos"); } } cursedGirl.anim.SetFloat("Speed", 0); } }
// Update is called once per frame void Update() { if (!cursedGirl.locked && cursedGirl.activation && cursedGirl.cursedGirlState == CursedGirlStates.ATTACKING) { cursedGirl.AimPlayer(); if (!cursedGirl.enemyCanvas.activeInHierarchy) { GetComponent <CursedGirlTalk>().SetDialogueMode(false); } if (((!cursedGirl.canAttack && !attackInCurse) || cursedGirl.distToPlayer < cursedGirl.iniAttackDist || cursedGirl.distToPlayer > cursedGirl.endAttackDist) && GetPhase() != 3) { attackState = CursedGirlAttackStates.MOVING; } else if ((cursedGirl.canAttack || canTeleport || canCreateMonsters || GetPhase() == 4 || !FindObjectOfType <CheckBossPos>().IsInsideTheCrypt()) || attackInCurse) { attackState = CursedGirlAttackStates.ATTACKING; } if (attackState == CursedGirlAttackStates.MOVING) { cursedGirl.DetectPlayerInArea(); } else if (attackState == CursedGirlAttackStates.ATTACKING) { ManageAttackStates(); } cursedGirl.anim.SetFloat("Speed", cursedGirl.speed); } else if (cursedGirl.enemyCanvas.activeInHierarchy) { cursedGirl.enemyCanvas.SetActive(false); } }