Adventure Creator Wikia
Advertisement

Unofficial Integrations Page

Note: this page contains unofficial integrations created by AC users. These can be anything from regular scripts, used by attaching said script to an object during runtime, to AC Actions usable directly through AC's Visual scripting.

-

Rewired Integration (Alverik)

Notes: Attach the script to any active object in the hierarchy, which you know is always going to exist on every scenes, or which doesn't get destroyed on loading (You may also put it on the AC persistent engine or game engine prefabs). Also, make sure your actions are correctly setup In Rewired, they need to have the exact same names as the AC inputs listed under the AC's Settings Manager. Make sure you don't have Unity inputs which may clash with your actions, too, or they will fight for control. So once the Rewired actions are setup you can delete your unity inputs (in unity's input manager). For the rest follow Rewired's documentation.

using UnityEngine;

public class ACInputRewired : MonoBehaviour {

public int playerId = 0;

private Rewired.Player player;

void Start() {

AC.KickStarter.playerInput.InputGetButtonDownDelegate = CustomGetButtonDown;

AC.KickStarter.playerInput.InputGetButtonUpDelegate = CustomGetButtonUp; AC.KickStarter.playerInput.InputGetButtonDelegate = CustomGetButton; AC.KickStarter.playerInput.InputGetAxisDelegate = CustomGetAxis; player = Rewired.ReInput.players.GetPlayer(playerId);

}


private bool CustomGetButtonDown(string buttonName)

{

return player.GetButtonDown(buttonName);

}

private float CustomGetAxis(string AxisName)

{ return player.GetAxis(AxisName);

}

private bool CustomGetButton(string buttonName)

{

return player.GetButton(buttonName);

}

private bool CustomGetButtonUp(string buttonName)

{

return player.GetButtonUp(buttonName);

}

CNControls Integration (Virtual Joystick) (Alverik)

Notes: Same as rewired's Integration, attach the script to any active object in the hierarchy, which you know is always going to exist on every scenes, or which doesn't get destroyed on loading (You may also put it on the AC persistent engine or game engine prefabs). Also, make sure CN Controls' Virtual Joystick is using "Vertical" and "Horizontal" as the input names.

using UnityEngine;

using CnControls;

public class ACInputCNControls : MonoBehaviour

{

void Start()

{

//Call AC delegate for the joystick Axis

AC.KickStarter.playerInput.InputGetAxisDelegate = CustomGetAxis;

}


private float CustomGetAxis(string AxisName)

{

//get the axis from CNControls' joystick 

return CnInputManager.GetAxis(AxisName);

}

}

Advertisement