Fix interactions IGrabable + Ajout interface IUsable

This commit is contained in:
Antoine H 2020-12-10 10:49:36 +01:00
parent eacf4f2711
commit 5b787c7da6
6 changed files with 33 additions and 6 deletions

View file

@ -4,7 +4,7 @@ using UnityEngine;
//Define the behavior of a client
[RequireComponent(typeof(Collider2D))]
public class Client_controller : MonoBehaviour
public class Client_controller : MonoBehaviour, IUsable
{
public float consumeTime = 3.0f; //Time to consume currentMug
public float waitingTime = 10.0f; //Patience after ordering
@ -18,7 +18,8 @@ public class Client_controller : MonoBehaviour
{
if(currentMug is null) //No mug in hand
{
if(object_used != null && object_used.tag=="Mug")
//TODO : Gérer Grabale qui ne sont pas des Mugs ?
if(object_used != null && object_used.tag=="Grabable")
{
Mug mug = object_used.GetComponent<Mug>();
if (mug!= null && mug.content != null)