Exemple #1
0
    private void Update()
    {
        if (playerInTrigger)
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                Debug.Log("Press E");

                if (Playercontroller.Instance.CurrentItem == null)
                {
                    if (linkedActor.Interact())
                    {
                        DebugCanvas.Instance.ShowHint(linkedActor.SucessText());
                    }
                    else
                    {
                        DebugCanvas.Instance.ShowHint(linkedActor.HintText());
                    }
                }
                else
                {
                    if (linkedActor.InteractWith(Playercontroller.Instance.CurrentItem))
                    {
                        DebugCanvas.Instance.ShowHint(linkedActor.SucessText());
                    }
                    else
                    {
                        DebugCanvas.Instance.ShowHint(linkedActor.HintText());
                    }
                }
            }
            if (Input.GetKeyDown(KeyCode.R))
            {
                Debug.Log("Press R");
                DebugCanvas.Instance.ShowHint(linkedActor.HintText());
            }
        }
    }