コード例 #1
0
    void Start()
    {
        //get the interactable component and add interactions to it
        interactableComponent = GetComponent <InteractableBase>();
        interactableComponent.AddInteractionToList("On Place In Container", OnPlaceInContainer);

        //get the image component and set the sprite
        imageComponent = GetComponent <Image>();

        cookableObject = GetComponent <CookableObject>();
        cookableObject.OnCookOveride = OnCookOveride;

        ChangeSpaghettiState(SpaghettiState.Boxed);
    }
コード例 #2
0
    //author: John Vance, Ben Stern
    /// <summary>
    /// Gets the Frying Pan to be used elsewhere
    /// </summary>
    /// <param name="pan">The container that the utensil is being used on</param>
    public void HoldItem(InteractableBase pan)
    {
        currentContainer = pan;

        //move the item into the container
        transform.position = currentContainer.transform.position + PlacePositionRelative;
        //transform.SetParent(itemHolding.transform);

        if (currentContainer.transform.childCount > 0)
        {
            //move item inside container to new container
            InteractableBase child = currentContainer.transform.GetChild(0).gameObject.GetComponent <InteractableBase>();
            Debug.Log("3: " + child);

            child.transform.position = transform.position;
            child.transform.SetParent(transform);

            //objects in containers should not be selectable until taken out of the container
            currentContainer.GetComponent <SelectableObject>().enabled = false;

            //add the empty into to interaction to the list
            interactableComponent.AddInteractionToList("Empty into", EmptyInto);
        }
    }
コード例 #3
0
 void Start()
 {
     //get the interactable component and add interactions to it
     interactableComponent = GetComponent <InteractableBase>();
     interactableComponent.AddInteractionToList("Fill With Water", FillWithWater);
 }
コード例 #4
0
 private void Start()
 {
     //initialize all of the interactions and triggers
     interactableComponent = GetComponent <InteractableBase>();
     interactableComponent.AddInteractionToList("Place Spatula", HoldItem);
 }
コード例 #5
0
 void Start()
 {
     //get the interactable component and add interactions to it
     interactableComponent = GetComponent <InteractableBase>();
     interactableComponent.AddInteractionToList("Place On Burner", PlacedOnBurner);
 }