예제 #1
0
    public override void Exit()
    {
        roboRam.enemyInfo.isMeleeAttacking = false;
        EnemySight sight = (roboRam.gameObject.GetComponentInChildren <EnemySight>());

        sight.GetComponent <BoxCollider2D>().size = new Vector2(sight.originalSightSize, sight.GetComponent <BoxCollider2D>().size.y);
    }
예제 #2
0
 protected override void OnTriggerEnter2D(Collider2D other)
 {
     if (!enemyInfo.isDisabled)
     {
         base.OnTriggerEnter2D(other);
         if (currentState != null)
         {
             currentState.OnTriggerEnter2D(other);
         }
         if (other.tag == playerProjectileTag)
         {
             if (target == null)
             {
                 target = other.gameObject;
                 EnemySight sight = (gameObject.GetComponentInChildren <EnemySight>());
                 sight.GetComponent <BoxCollider2D>().size = new Vector2(Vector2.Distance(EnemyTransform.position, Player.Instance.transform.position) + sight.GetComponent <BoxCollider2D>().size.x, sight.GetComponent <BoxCollider2D>().size.y);
                 LookAtTarget();
             }
         }
     }
 }