Add Client_controller and mug interaction

This commit is contained in:
Antoine H 2020-12-04 13:12:01 +01:00
parent 70024c7b6a
commit 80704e1ba3
6 changed files with 205 additions and 24 deletions

View file

@ -2,15 +2,18 @@
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
public class Mug : MonoBehaviour, IGrabable
{
public int size = 1; //Size (1 or 2 hands) of the object
bool dirty = false;
int content = 1;
public void use()
{
//Do nothing
}
public void take()
public void take() //Object taken
{
gameObject.SetActive(false);
}
@ -20,10 +23,20 @@ public class Mug : MonoBehaviour, IGrabable
gameObject.transform.position = position;
}
public void fill(int new_content)
{
content = new_content;
}
public void consume()
{
content=0;
}
// Start is called before the first frame update
void Start()
{
//Needs to be on Interactions layer and have the Mug tag to work properly
gameObject.tag = "Mug"; //Force gameobject tag
}
// Update is called once per frame