Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if ((player.transform.position - transform.position).magnitude < grabDist &&
         (dumpPos.transform.position - transform.position).magnitude > grabDist)
     {
         if (player.isGrabbed == false)
         {
             player.isGrabbed        = true;
             player.transform.parent = transform;
             enemySight.CoolDown(15);
             isGrabbing = true;
         }
     }
     else if ((dumpPos.transform.position - transform.position).magnitude < grabDist)
     {
         if (isGrabbing == true)
         {
             player.isGrabbed        = false;
             player.transform.parent = null;
             enemySight.CoolDown(10);
         }
         isGrabbing = false;
     }
     else
     {
         isGrabbing = false;
     }
 }