Example #1
0
    // Start is called before the first frame update
    void Update()
    {
        if (gameManager.currentTurnStage == TurnStage.enemyAttackTurn)
        {
            if (Physics2D.OverlapCircle(enemyAttackPoint.position, 0.2f, whatCanBeAttacked))
            {
                playerCollider = Physics2D.OverlapCircle(enemyAttackPoint.position, 0.2f, whatCanBeAttacked);


                StartCoroutine(enemyAnimations.AnimateWhenAttacking());
            }
            else
            {
                enemyManager.enemyAttackCount--;
            }
        }


        //actual movement
        transform.position = Vector3.MoveTowards(transform.position, position, Time.deltaTime * moveSpeed);
    }