public void OnInteractableExit(InteractBehaviour interactable)
 {
     if (currentInteractable == interactable)
     {
         currentInteractable = null;
     }
 }
Example #2
0
    void OnTriggerEnter(Collider other)
    {
        InteractBehaviour i = gameObject.GetComponent <InteractBehaviour> ();

        i.Interaction();
        Destroy(gameObject);
    }
 public void OnInteractableEnter(InteractBehaviour interactable)
 {
     if (currentInteractable == null)
     {
         currentInteractable = interactable;
         Debug.Log(interactable);
     }
 }
Example #4
0
    void Start()
    {
        // Set up the state of the pot.
        cooking = false;
        empty   = true;

        // Initialise contents variable.
        contents = new Dictionary <string, int>();

        // Grab the interaction behaviour from the player.
        controller = Camera.main.GetComponent <InteractBehaviour>();
        // Grab the image componenets from the image objects.
        baseImageComponent    = baseImage.GetComponent <Image>();
        cookingImageComponent = cookingImage.GetComponent <Image>();
        // Create a recipe book.
        recipeBook = new RecipeBook();
    }