Exemplo n.º 1
0
    private void UpdatePromtButton(bool showText, IInteractableObject iObject, ButtonPrompt promtObject)
    {
        if (IsInteracting)
        {
            showText = false;
        }

        string textToOutput = iObject.IsSelected ? iObject.ActionsToDisplay : iObject.TextToDisplay;

        promtObject.SetText(showText ? textToOutput : "");
        promtObject.setInteractableUI(iObject.IsSelected && !IsInteracting);
    }
Exemplo n.º 2
0
    private void OnInteractionEnter(IInteractableObject interactionObject)
    {
        if (interactionObjects.ContainsKey(interactionObject))
        {
            return;
        }

        GameObject   promtPrefab  = UIManager.Instance.m_buttonPromtPrefab;
        GameObject   promtGO      = Instantiate(promtPrefab) as GameObject;
        ButtonPrompt buttonPrompt = promtGO.GetComponent <ButtonPrompt>();

        buttonPrompt.SetText("");
        buttonPrompt.SetConnectedTransform(interactionObject.transform);

        // setting the object under Canvas
        //promtGO.transform.SetParent(UIManager.s_canvas.transform);
        //promtGO.transform.localScale = Vector3.one;


        interactionObjects.Add(interactionObject, buttonPrompt);
        interactionObject.onInteractionDestroyed += OnInteractionDestroyed;
        interactionObject.onInteractionDisabled  += OnInteractionDisabled;
    }
Exemplo n.º 3
0
    private void UpdatePromtButton(bool showText, IInteractableObject iObject, ButtonPrompt promtObject)
    {
        if(IsInteracting)
            showText = false;

        string textToOutput = iObject.IsSelected ? iObject.ActionsToDisplay : iObject.TextToDisplay;       
        promtObject.SetText (showText ? textToOutput : "");
        promtObject.setInteractableUI(iObject.IsSelected && !IsInteracting);
    }