Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("Car Kill");
        Vector3 position = this.transform.position;

        Collider2D[] colliders = Physics2D.OverlapAreaAll(new Vector2(position.x - 0.5f, position.y + 0.5f), new Vector2(position.x + 0.5f, position.y - 0.5f), FrogMask);

        if (colliders.Length > 0)
        {
            GameObject frogy = colliders[0].gameObject;
            Destroy(frogy);
            GameObject newFrog = Instantiate(frog);
        }
    }
Exemplo n.º 2
0
    Collider2D[] checkWorldObject()
    {
        var cols = new Collider2D[0];

        if (checkRect)
        {
            cols = Physics2D.OverlapAreaAll(transform.position - size, transform.position + size, Game.instance.worldObjectLayer);
        }
        else
        {
            cols = Physics2D.OverlapCircleAll(transform.position, size.y, Game.instance.worldObjectLayer);
        }
        return(cols);
    }
Exemplo n.º 3
0
    protected MonsterCharacter DefaultGetNewTarget()
    {
        //use this to only allow target acquisition when monster is near screen

        /*Vector2 distance = transform.position - Camera.main.transform.position;
         * if (Mathf.Max(distance.x) > Options.AlertDistance.x || Mathf.Max(distance.y) > Options.AlertDistance.y)
         *  return null;*/

        Vector2 size = Options.AlertDistance;

        Collider2D[] hits = Physics2D.OverlapAreaAll(
            (Vector2)transform.position + size,
            (Vector2)transform.position - size,
            LayerMask.Walkers);

        float            closest = float.MaxValue;
        MonsterCharacter m       = null;

        foreach (Collider2D hit in hits)
        {
            MonsterCharacter monster = hit.GetComponent <MonsterCharacter>();

            if (monster == null)
            {
                continue;
            }

            if (monster == character)
            {
                continue;
            }

            if (character.Faction != Factions.AgainstAll)
            {
                if (character.Faction == monster.Faction)
                {
                    continue;
                }
            }

            float d = (monster.transform.position - transform.position).sqrMagnitude;
            if (d < closest)
            {
                m       = monster;
                closest = d;
            }
        }

        return(m);
    }
Exemplo n.º 4
0
    private void FindNeighbours()
    {
        Vector2 size = rend.sprite.bounds.extents;

        foreach (var item in Physics2D.OverlapAreaAll((Vector2)transform.position - size - new Vector2(0.01f, 0.01f), (Vector2)transform.position + size - new Vector2(0.01f, 0.01f), groundMask))
        {
            var obj = item.GetComponent <WalkingArea>();
            if (obj == this)
            {
                continue;
            }
            neighbours.Add(obj);
        }
    }
Exemplo n.º 5
0
    void explode()
    {
        List <Collider2D> hits = new List <Collider2D>();

        Vector2 stick_corner_a = new Vector2(gameObject.transform.position.x, gameObject.transform.position.y + -direction);
        Vector2 stick_corner_b = new Vector2(gameObject.transform.position.x + 3, gameObject.transform.position.y + 3 * -direction);

        hits.AddRange(Physics2D.OverlapAreaAll(stick_corner_a, stick_corner_b, Physics2D.DefaultRaycastLayers, 0, 0));

        Transform      anim_pop = gameObject.transform.Find("anim_pop");
        SpriteRenderer pop_anim = (SpriteRenderer)anim_pop.GetComponent(typeof(SpriteRenderer));

        Texture2D explosion = pop_anim.sprite.texture;

        float left = anim_pop.position.x - (explosion.width / 2);
        float top  = anim_pop.position.y - (explosion.height / 2);

        for (int i = 0; i < explosion.height; i++)
        {
            for (int u = 0; u < explosion.width; u++)
            {
                Vector2 origin = new Vector2(left + u + 0.5f, top + i + 0.5f);

                if (explosion.GetPixel(u, i).a == 1)
                {
                    Collider2D hit = Physics2D.OverlapCircle(origin, 0.2f, Physics2D.DefaultRaycastLayers, 0, 0);

                    if (hit != null)
                    {
                        hits.Add(hit);
                    }
                }
            }
        }

        foreach (Collider2D hit in hits)
        {
            Transform barrier_hit = hit.transform;

            if (barrier_hit.CompareTag("UnbreakableBarrier"))
            {
                ((SpriteRenderer)barrier_hit.GetChild(0).GetComponent(typeof(SpriteRenderer))).enabled = false;
            }
            else if (barrier_hit.CompareTag("Barrier"))
            {
                GameObject.Destroy(hit.gameObject);
            }
        }
    }
Exemplo n.º 6
0
    //Keyboard Controls
    void Control()
    {
        if (Input.GetKeyDown("right"))
        {
            if (_lane != 1)
            {
                gameObject.GetComponent <AudioSource>().PlayOneShot(LaneChange);
                gameObject.transform.Translate(1.5f, 0, 0);
                _lane += 1;
            }
        }

        if (Input.GetKeyDown("left"))
        {
            if (_lane != -1)
            {
                gameObject.GetComponent <AudioSource>().PlayOneShot(LaneChange);
                gameObject.transform.Translate(-1.5f, 0, 0);
                _lane -= 1;
            }
        }

        if (Input.GetKeyDown("up"))
        {
            _animator = gameObject.GetComponent <Animator>();
            //_animator.ResetTrigger("backwalk");
            _animator.SetTrigger("Attack");
            Collider2D[] CollidersInFront = Physics2D.OverlapAreaAll(new Vector2(transform.position.x - 0.5f, transform.position.y), new Vector2(transform.position.x + 0.5f, transform.position.y + 1.5f));
            foreach (Collider2D collided in CollidersInFront)
            {
                if (collided.gameObject.tag == "Enemy")
                {
                    gameObject.GetComponent <AudioSource>().PlayOneShot(SwordHit);
                    //ParticleSystem blood = Instantiate(bloodEffect) as ParticleSystem;
                    ParticleSystem blood = ParticlePooler.current.GetPooledParticle();
                    blood.transform.position = collided.transform.position;
                    blood.Play();
                    Invoke("ParticlePooler.current.DestroyParticle(blood)", 2f);
                    Destroy(collided.gameObject);
                    _killedEnemies += 1;
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
Exemplo n.º 7
0
    void dropTile()
    {
        //figure out a way to make it so you can't drop tiles outside of the grid space, probably something to do with only allowing drops on Base layer
        foreach (Transform child in transform)
        {
            //may need more complex implementation later involving layers
            foreach (Collider2D foundColl in Physics2D.OverlapPointAll(child.position, LayerMask.GetMask("Wall")))
            {
                if (foundColl.transform != child)
                {
                    return;
                }
            }

            foreach (Collider2D foundColl in Physics2D.OverlapAreaAll((Vector2)child.position - (Vector2.one * 0.5f), (Vector2)child.position + (Vector2.one * 0.5f), LayerMask.GetMask("Enemy")))
            {
                return;
            }


            bool foundBase = false;
            foreach (Collider2D foundColl in Physics2D.OverlapPointAll(child.position, LayerMask.GetMask("Base")))
            {
                if (foundColl.transform != child)
                {
                    foundBase = true;
                }
            }

            if (!foundBase)
            {
                return;
            }
        }

        isHeld           = false;
        gameObject.layer = LayerMask.NameToLayer("Wall");
        foreach (Transform child in transform)
        {
            child.gameObject.layer = LayerMask.NameToLayer("Wall");
        }

        _currentBlock = Instantiate(_tileBag[0], transform.position, Quaternion.identity);
        _tileBag.RemoveAt(0);
        if (_tileBag.Count == 0)
        {
            fillBag();
        }
    }
Exemplo n.º 8
0
        private void DoOverlap()
        {
            var go = Fsm.GetOwnerDefaultTarget(position);

            if (go)
            {
                pos = go.transform.position;
            }

            switch (shape)
            {
            case ShapeType.Circle:
                collidedObjects = Physics2D.OverlapCircleAll(pos + offset.Value, radius.Value, layerMask.Value, minDepth.Value, maxDepth.Value);
                break;

            case ShapeType.Box:
                collidedObjects = Physics2D.OverlapBoxAll(pos + offset.Value, boxSize.Value, 0, layerMask.Value, minDepth.Value, maxDepth.Value);
                break;

            case ShapeType.Area:
                collidedObjects = Physics2D.OverlapAreaAll(pos + pointA.Value, pos + pointB.Value, layerMask.Value, minDepth.Value, maxDepth.Value);
                break;

            case ShapeType.Capsule:
                collidedObjects = Physics2D.OverlapCapsuleAll(pos + offset.Value, size.Value, direction, 0, layerMask.Value, minDepth.Value, maxDepth.Value);
                break;

            case ShapeType.Point:
                collidedObjects = Physics2D.OverlapPointAll(pos + point.Value, layerMask.Value, minDepth.Value, maxDepth.Value);
                break;

            default:
                break;
            }

            if (collidedObjects.Length > 0)
            {
                storeDidHit.Value       = true;
                storeGameObjects.Values = new GameObject[collidedObjects.Length];
                for (int i = 0; i < storeGameObjects.Values.Length; i++)
                {
                    storeGameObjects.Values[i] = collidedObjects[i].gameObject;
                }
            }
            else
            {
                storeDidHit.Value = false;
            }
        }
Exemplo n.º 9
0
    public bool CanBrickStay(Vector2 position)
    {
        Vector2 pointA = new Vector2(position.x - BRICK_HALF_SIZE, position.y + BRICK_HALF_SIZE);
        Vector2 pointB = new Vector2(position.x + BRICK_HALF_SIZE, position.y - BRICK_HALF_SIZE);

        Collider2D[] hits = Physics2D.OverlapAreaAll(pointA, pointB);
        foreach (Collider2D hit in hits)
        {
            if (PLAYER_TAG != hit.tag)
            {
                return(false);
            }
        }
        return(true);
    }
Exemplo n.º 10
0
 /// <summary>
 /// If there are other modules on the blocks this module is going to be putted on other modules just move to panel (or delete if the panel was updated)
 /// </summary>
 public void MoveCollidedModules()
 {
     Collider2D[] otherModules = Physics2D.OverlapAreaAll(
         new Vector2(transform.position.x - halfColliderWidth, transform.position.y - halfColliderHeight)
         , new Vector2(transform.position.x + halfColliderWidth, transform.position.y + halfColliderHeight)
         , LayerMask.GetMask("Equipment")
         );
     foreach (var moduleCol in otherModules)
     {
         if (moduleCol.gameObject != transform.gameObject)
         {
             moduleCol.GetComponent <ModulePositioner>().ReturnModuleToPool();
         }
     }
 }
Exemplo n.º 11
0
    private Tile GetTileFromWorldPosition(Vector3 position)
    {
        var tilesAtPosition = Physics2D.OverlapAreaAll(position, position, LayerMask.GetMask("Floor"));

        foreach (var tileCollider in tilesAtPosition)
        {
            var tile = tileCollider.gameObject.GetComponent <Tile>();
            if (tile != null)
            {
                return(tile);
            }
        }

        return(null);
    }
Exemplo n.º 12
0
    private bool CanJump()
    {
        Collider2D[] overlaps    = Physics2D.OverlapAreaAll(jumpCheckLeft.position, jumpCheckRight.position);
        int          nonTriggers = 0;

        foreach (Collider2D col in overlaps)
        {
            if (!col.isTrigger)
            {
                nonTriggers++;
            }
        }

        return(nonTriggers > 1);
    }
Exemplo n.º 13
0
 private void seleccionarUnidades()
 {
     Collider2D[] colliders = Physics2D.OverlapAreaAll(startPosition, position());
     foreach (Collider2D collider2D in colliders)
     {
         //      Debug.Log(collider2D.name);
         UnitRTS unitRts = collider2D.GetComponent <UnitRTS>();
         if (unitRts != null)
         {
             unitRts.SetSeletedVisible(true);
             unitsList.Add(unitRts);
         }
     }
     //  Debug.Log(unitsList.Count);
 }
Exemplo n.º 14
0
    private static void SelectAllSameSelectableInScreen(Selectable currentSelectable)
    {
        DeselectSelected();
        Collider2D[] allVisibleColliders = Physics2D.OverlapAreaAll(Camera.main.ScreenToWorldPoint(new Vector2(0, 0)), Camera.main.ScreenToWorldPoint(new Vector2(Camera.main.pixelWidth, Camera.main.pixelHeight)));

        foreach (Collider2D collider in allVisibleColliders)
        {
            Selectable colliderSelectable = collider.GetComponent <Selectable>();
            if (colliderSelectable != null && colliderSelectable.selectableName.Equals(currentSelectable.selectableName) && !selected.Contains(colliderSelectable))
            {
                selected.Add(colliderSelectable);
                colliderSelectable.FlipSelected();
            }
        }
    }
Exemplo n.º 15
0
    private List <ZombieController> GetSelectedZombies(Vector2 corner1, Vector2 corner2)
    {
        var list = new List <ZombieController>();

        Collider2D[] objectsAtPosition = Physics2D.OverlapAreaAll(corner1, corner2, 1 << Layers.Zombies);
        foreach (var possibleZombie in objectsAtPosition)
        {
            var zombie = possibleZombie.GetComponentInParent <ZombieController>();
            if (zombie != null && zombie.isActiveAndEnabled)
            {
                list.Add(zombie);
            }
        }
        return(list);
    }
Exemplo n.º 16
0
    public void destroyBottomWave() //The Danger Zone
    {
        Collider2D[] boxes = Physics2D.OverlapAreaAll(corner3.position, corner2.position, whatIsBox);

        if (clearUses > 0 && boxes.Length > 0)
        {
            for (int i = 0; i < boxes.Length; i++)
            {
                Destroy(boxes[i].gameObject);
                Debug.Log(boxes[i]);
            }
            clearUses--;
            PlayerPrefs.SetInt("Clears", clearUses);
        }
    }
Exemplo n.º 17
0
    private void CheckGround()
    {
        isLadder = GetComponent <CharacterAnimation>().isLadder;

        Collider2D[] colliders  = Physics2D.OverlapAreaAll(transform.position + new Vector3(-0.45f, -0.2f, 0), transform.position + new Vector3(0.45f, 0.2f, 0), layerMaskGrounded);
        Collider2D[] colliders1 = Physics2D.OverlapAreaAll(transform.position + new Vector3(-0.45f, -0.2f, 0), transform.position + new Vector3(0.45f, 0.2f, 0), layerMaskRoll);

        bool isGrounded1 = colliders1.Length > 0;

        if (isGrounded != isGrounded1 && isGrounded == false && isRoll == false && isWater == false)
        {
            audioSource.PlayOneShot(landingAudio);
        }
        isGrounded = colliders.Length > 0;
    }
Exemplo n.º 18
0
    // Update is called once per frame
    void FixedUpdate()
    {
        Collider2D[] colliders = Physics2D.OverlapAreaAll(new Vector2(-40f, 80f), new Vector2(170f, -20f));

        foreach (Collider2D collider in colliders)
        {
            string tag = collider.gameObject.tag;

            if (tag == "Bullet" || tag == "Hbomb")
            {
                print("됏어");
                collider.gameObject.GetComponent <Rigidbody2D> ().AddForce(Vector2.right * WindFos);
            }
        }
    }
 private void GroundCheck()
 {
     if (m_GroundCheck != null)
     {
         Collider2D[] colliders = Physics2D.OverlapAreaAll(m_GroundCheck.bounds.max, m_GroundCheck.bounds.min, GroundLayers);
         if (colliders.Length > 0)
         {
             m_Grounded     = true;
             jump_duration  = JumpDuration;
             jumpCount      = 0;
             jumping        = false;
             accumJumpForce = 0f;
         }
     }
 }
Exemplo n.º 20
0
    public override void hitBehavior(int weapon)
    {
        Collider2D[] colliders = Physics2D.OverlapAreaAll(transform.position, new Vector2(transform.position.x, transform.position.y));
        foreach (Collider2D c in colliders)
        {
            if (c.gameObject.tag == "Enemy")
            {
                if (PlayerNum == 1)
                {
                    StatusEffect bound = new StatusEffect(3);
                    bound.m_type = StatusType.Bound;
                    c.gameObject.GetComponent <Enemy> ().myStatus.AddEffect(bound);
                    c.gameObject.GetComponent <Enemy> ().takeDamage(damageCalc(damageTier, hitNum));
                    returnShot        = true;
                    markedForDeletion = true;
                }
            }
            else if (c.gameObject.tag == "Obstacle")
            {
                c.GetComponent <Obstacle> ().takeDamage(damageCalc(damageTier, hitNum));
                returnShot        = true;
                markedForDeletion = true;
            }
            else if (c.gameObject.tag == "Player" && PlayerNum == 2)
            {
                StatusEffect bound = new StatusEffect(10);
                bound.m_type = StatusType.Bound;
                c.gameObject.GetComponent <Player> ().myStatus.AddEffect(bound);
                c.gameObject.GetComponent <Player> ().takeDamage(damageCalc(damageTier, hitNum));
                returnShot        = true;
                markedForDeletion = true;
            }
            else if (c.gameObject.tag == "Player2" && PlayerNum == 1)
            {
                StatusEffect bound = new StatusEffect(10);
                bound.m_type = StatusType.Bound;
                c.gameObject.GetComponent <Player> ().myStatus.AddEffect(bound);
                c.gameObject.GetComponent <Player> ().takeDamage(damageCalc(damageTier, hitNum));
                returnShot        = true;
                markedForDeletion = true;
            }

            if (c.gameObject.tag == "playerZone" || c.gameObject.tag == "enemyZone")
            {
                showPanels(c);
            }
        }
    }
Exemplo n.º 21
0
    public override void Update()
    {
        base.Update();
        if (isActive >= 1)
        {
            isActive--;
        }
        string updateText;

        if (isExpanded)
        {
            updateText = "AvoiderCollision\n";
        }
        else
        {
            updateText = "AvoiderCollision\n\nTag";
        }
        Transform real_avoider_model = AvoiderTr.GetChild(0);

        Collider2D[] colls;// = new Collider2D[10];
        //int colliderCount = AvoiderTr.GetComponentInChildren<Collider2D>().OverlapCollider(new ContactFilter2D(), colls);
        colls = Physics2D.OverlapAreaAll(real_avoider_model.position - real_avoider_model.lossyScale, real_avoider_model.position + real_avoider_model.lossyScale);
        for (int i = 0, count = 0; i < colls.Length; ++i)
        {
            Collider2D coll = colls[i];
            if (!(coll.transform.IsChildOf(AvoiderTr) || coll.transform == AvoiderTr))
            {
                //상수,변수,ArrowInput의 재활성화와 재전송가능하게 변경
                if (count != 0)
                {
                    NodeManager.instance.ProcessNodeToReoutput();
                }

                count++;
                string_output.Input(coll.tag);
                active_output.Active();
                Active();
                if (isExpanded)
                {
                    updateText += (coll.tag + "\n");
                }
            }
        }
        if (textMesh != null)
        {
            textMesh.text = updateText;
        }
    }
Exemplo n.º 22
0
 public override void hitBehavior(int weapon)
 {
     Collider2D[] colliders = Physics2D.OverlapAreaAll(transform.position, new Vector2(transform.position.x, transform.position.y));
     foreach (Collider2D c in colliders)
     {
         if (c.gameObject.tag == "Enemy")
         {
             if (PlayerNum == 1)
             {
                 c.gameObject.GetComponent <Enemy> ().takeDamage(damageCalc(damageTier, hitNum));
                 returnShot = true;
             }
         }
         else if (c.gameObject.tag == "Obstacle")
         {
             c.GetComponent <Obstacle> ().takeDamage(damageCalc(damageTier, hitNum));
             returnShot = true;
         }
         else if (c.gameObject.tag == "Player" && PlayerNum == 2)
         {
             c.gameObject.GetComponent <Player> ().takeDamage(damageCalc(damageTier, hitNum));
             returnShot = true;
         }
         else if (c.gameObject.tag == "Player2" && PlayerNum == 1)
         {
             c.gameObject.GetComponent <Player> ().takeDamage(damageCalc(damageTier, hitNum));
             returnShot = true;
         }
         else if (c.gameObject.tag == "Player2" && PlayerNum == 2)
         {
             if (returnShot)
             {
                 c.gameObject.GetComponent <Player> ().Chamber.Add(Resources.Load("Boomerang"));
                 returnShot        = false;
                 markedForDeletion = true;
             }
         }
         else if (c.gameObject.tag == "Player" && PlayerNum == 1)
         {
             if (returnShot)
             {
                 c.gameObject.GetComponent <Player> ().Chamber.Add(Resources.Load("Boomerang"));
                 returnShot        = false;
                 markedForDeletion = true;
             }
         }
     }
 }
Exemplo n.º 23
0
    void TestEnable()
    {
        bool enable = true;

        foreach (Collider2D col in Physics2D.OverlapAreaAll(transform.position + new Vector3(.25f, .25f), transform.position - new Vector3(.25f, .25f)))
        {
            if (col.tag == "Player")
            {
                enable = false;
            }
        }
        if (enable)
        {
            GetComponent <BoxCollider2D>().enabled = !Powered;
        }
    }
Exemplo n.º 24
0
    public IInteractionTriggerController GetInteractionTrigger()
    {
        var res = Physics2D
                  .OverlapAreaAll(_interactionAreaP1.position, _interactionAreaP2.position);

        var interactionTriggerCollider =
            Physics2D
            .OverlapAreaAll(_interactionAreaP1.position, _interactionAreaP2.position)
            .FirstOrDefault(c => c.GetComponent <IInteractionTriggerController>() != null);

        if (interactionTriggerCollider == null)
        {
            return(null);
        }
        return(interactionTriggerCollider.GetComponent <IInteractionTriggerController>());
    }
Exemplo n.º 25
0
    /// <summary>
    /// new collisioncheck using box collider bounds
    /// </summary>
    /// <returns></returns>
    public bool CharacterCollidesBarrier(Vector2 center)
    {
        float width  = characterColliderWidth / 2;
        float height = characterColliderHeight / 2;
        float offset = 0.1f;

        Vector2 botRight = new Vector2(center.x + width + offset, center.y - height - offset);
        Vector2 topLeft  = new Vector2(center.x - width - offset, center.y + height + offset);

        Collider2D[] collisions = Physics2D.OverlapAreaAll(topLeft, botRight, aiBase.barrierMask);
        if (collisions.Length != 0)
        {
            return(true);
        }
        return(false);
    }
Exemplo n.º 26
0
    void CheckItemsIn()
    {
        inv.items.Clear();
        colls = Physics2D.OverlapAreaAll(
            new Vector2(transform.position.x - 0.5f, transform.position.y - 0.6f),
            new Vector2(transform.position.x + 0.5f, transform.position.y + 1.1f), whatIsItems);
        foreach (Collider2D coll in colls)
        {
            if (coll.gameObject.name != gameObject.name)
            {
                inv.items.Add(coll.gameObject);
            }
        }

        inv.items = inv.items.Distinct().ToList();
    }
Exemplo n.º 27
0
 // Update is called once per frame
 public void spellUpdate()
 {
     this.movement(weaponUsed);
     Collider2D[] colliders = Physics2D.OverlapAreaAll(transform.position, new Vector2(transform.position.x, transform.position.y));
     foreach (Collider2D c in colliders)
     {
         if (c.gameObject.tag == "Player" || c.gameObject.tag == "Enemy" || c.gameObject.tag == "Obstacle" || c.gameObject.tag == "Player2")
         {
             hitBehavior(weaponUsed);
         }
         if (c.gameObject.tag == "playerZone" || c.gameObject.tag == "enemyZone")
         {
             showPanels(c);
         }
     }
 }
Exemplo n.º 28
0
    void ExplosiveSideEffects()
    {
        Bounds bounds = new Bounds(this.transform.position, Vector2.one * 2f);
        var    hits   = Physics2D.OverlapAreaAll(bounds.min, bounds.max);

        foreach (var hit in hits)
        {
            var material = hit.GetComponentInChildren <ChemMaterial>();
            if (material != null)
            {
                material.React(this);
            }
        }

        barreira();
    }
Exemplo n.º 29
0
    public List <SelectableComponent> GetSelectableInArea(Vector2 start, Vector2 end)
    {
        Collider2D[] colliders = Physics2D.OverlapAreaAll(start, end);
        List <SelectableComponent> selectable = new List <SelectableComponent>();

        foreach (Collider2D collider in colliders)
        {
            SelectableComponent sc = collider.gameObject.GetComponent <SelectableComponent>();
            if (sc is null || !_settings.selectionMask.Contains(sc.selectable.GetType()))
            {
                continue;
            }
            selectable.Add(sc);
        }
        return(selectable);
    }
Exemplo n.º 30
0
    public void SearchAI()
    {
        anim.SetBool("IsSkill2Attack", false);

        //왼쪽 공격
        Collider2D[] collider2Ds = Physics2D.OverlapAreaAll(Pos.position, gameObject.transform.position);
        foreach (Collider2D collider in collider2Ds)
        {
            if (collider.tag == "Player")
            {
                anim.SetTrigger("Enemy_Attack");
                //anim.ResetTrigger("Enemy_Idle");
            }
        }
        StartCoroutine(AttackCoolTime());
    }