예제 #1
0
 private void Update()
 {
     if (!onPlayer)
     {
         if (pDetect.detected && efd.OnGround && !jump)
         {
             if (player != null)
             {
                 if (player.GetX() > transform.position.x && !efd.FacingRight)
                 {
                     efd.Flip();
                 }
                 if (player.GetX() < transform.position.x && efd.FacingRight)
                 {
                     efd.Flip();
                 }
             }
             jump = true;
             if (jumpAgain)
             {
                 anim.SetTrigger("Jump");
             }
         }
     }
     else
     {
         transform.position = playerC.transform.position;
         if (playerC.leftLook)
         {
             transform.eulerAngles = new Vector3(0, 180, 0);
         }
         else
         {
             transform.eulerAngles = new Vector3(0, 0, 0);
         }
     }
 }