示例#1
0
    private void Suck(EnemyStateController controller)
    {
        bool playerLooking = controller.IsSeen();

        if (playerLooking)
        {
            Vector3 newPos = controller.HeroTransform.position;
            Vector3 dir    = controller.transform.position - newPos;

            controller.Hero.GetComponent <Rigidbody2D>().AddForce(dir.normalized * 375f, ForceMode2D.Force);
        }
    }
示例#2
0
 private bool isSeen(EnemyStateController controller)
 {
     return(controller.IsSeen());
 }