Add Workshop (+tag)

This commit is contained in:
Antoine H 2020-12-05 13:38:13 +01:00
parent 16248cdf16
commit 538f05aa15
6 changed files with 114 additions and 15 deletions

View file

@ -80,6 +80,7 @@ public class Tavernkeeper_controller : MonoBehaviour
}
//Handle action with hands
//TODO : Factoriser actions des IGrabable et actions des Clients/Workshop
void handAction(string hand)
{
// Test collision of ray from tavernkeeper center (A verifier) at action_dist unit distance on Interactions layer
@ -119,6 +120,20 @@ public class Tavernkeeper_controller : MonoBehaviour
}
}
}
else if(hit_object.tag == "Workshop")
{
// Debug.Log("Give "+ hand_container[hand].name+" to "+hit_object.name);
Workshop workshop = hit_object.GetComponent<Workshop>();
if(workshop!=null)
{
if(workshop.use(hand_container[hand])) //Interactions w/ object in hands
{
//Object taken by workshop
// Destroy(hand_container[hand]);
hand_container[hand]=null;
}
}
}
}
}
//Full hand : drop