Beispiel #1
0
    private bool placed = false; // Records whether the object has been placed or not

    public override void OnTriggerWasPressed(InteractionController controller)
    {
        if (!placed)
        {
            base.OnTriggerWasPressed(controller);
        }
        else
        {
            controller.GetComponent <ControllerUI>().ToggleCanvas();
            if (controller.GetComponentInChildren <Canvas>())
            {
                controller.GetComponentInChildren <Text>().text = description;
            }
        }
    }