Adventure Creator Wikia
Advertisement

When the Interaction method is set to Choose Hotspot Then Interaction, available interactions are presented in a Menu upon clicking a Hotspot.  Choosing an interaction is then a case of clicking the intended icon.

This script reduces this to a single-click: holding the mouse down brings up the Interaction menu, and releasing the mouse runs the Interaction that the mouse is over (and closes the Menu otherwise).

To use it:

  1. Set your Settings Manager's Close interactions with field to Via Script Only.
  2. Copy/paste the code below into a C# script named ClickUpInteractions.
  3. Attach the new Click Up Interactions component to a GameObject in the scene.

ClickUpInteractions.cs:

using UnityEngine;
using AC;

public class ClickUpInteractions : MonoBehaviour
{

	void Update ()
	{
		if (Input.GetMouseButtonUp (0) && KickStarter.playerMenus.IsInteractionMenuOn ())
		{
			MenuElement mouseOverElement = KickStarter.playerMenus.MouseOverMenuElement;
			if (mouseOverElement && mouseOverElement is MenuInteraction)
			{
				MenuInteraction menuInteraction = (MenuInteraction) mouseOverElement;
				menuInteraction.ParentMenu.TargetHotspot.RunUseInteraction (menuInteraction.iconID);
			}
			KickStarter.playerMenus.CloseInteractionMenus ();
		}
	}

}
Advertisement