Beispiel #1
0
    public void CmdPlayerLeftClick(GameObject obj) //Cant have overloaded commands, so need to use optional arguments instead
    {
        InteractableObjectController controller = obj.GetComponent <InteractableObjectController>();

        if (controller == null)
        {
            return;
        }
        controller.OnClick(); //Needs to run on server as players do not have authority over interactable objects
    }
Beispiel #2
0
    public void HandleOnHoverExitAction(GameObject obj, ref RaycastResult result)
    {
        InteractableObjectController controller = obj.GetComponent <InteractableObjectController>();

        if (controller == null)
        {
            return;
        }
        ExecuteEvents.Execute <IHelpTextDisplay>(
            thisGameObject,
            null,
            (x, y) =>
        {
            x.Hide();
        });
        controller.OnHoverExit();
    }
Beispiel #3
0
    public void HandleOnHoverEnterAction(GameObject obj, ref RaycastResult result)
    {
        InteractableObjectController controller = obj.GetComponent <InteractableObjectController>();

        if (controller == null)
        {
            return;
        }
        string helpText = controller.HelpText ?? "";

        ExecuteEvents.Execute <IHelpTextDisplay>(
            thisGameObject,
            null,
            (x, y) =>
        {
            x.Show(helpText);
        });
        controller.OnHoverEnter();
    }