private void Start()
    {
        input = GetComponentInParent <PlayerInput>();

        ui         = FindObjectOfType <InteractionControllerUI>();
        mainCamera = GetComponentInParent <CameraMovement>().transform;
        ui.SetCode(input.interactKey.ToString());
    }
Example #2
0
    private void Start()
    {
        input      = GetComponentInParent <PlayerInput>();
        mainCamera = GetComponentInParent <CameraMovement>().transform;

        ui = FindObjectOfType <InteractionControllerUI>();
        if (ui == null)
        {
            Debug.LogError("InteractionControllerUI not found, please add PlayerUI prefab");
        }
        if (ui)
        {
            ui.SetCode(input.interactKey.ToString());
        }
    }