ActionChain
This class is used when you want to run multiple actions in a row in Game Controling
.
Methods
appQuit
public
Quit the app.
Usage
await gamium.actions().appQuit().perform();
Arguments
exitCode
delayMs
Returns
click
public
Add the action of clicking on the screen coordinates to the Action Chain.
Usage
await gamium.actions().click({ x: 0, y: 0 }).perform();
Arguments
position
Vector2
options
Partial
<ActionsClickOptions
>
Returns
drag
public
Adds an action to ActionChain that drags from one coordinate to another coordinate.
Usage
await gamium.actions().drag({ x: 0, y: 0 }, { x: 0, y: 10 }).perform();
Arguments
fromPosition
Vector2
toPosition
Vector2
options
Partial
<ActionsDragOptions
>
Returns
move
public
Add the action of moving the mouse to a specific coordinate to the Action Chain.
Usage
await gamium.actions().move({ x: 0, y: 0 }).perform();
Arguments
position
Vector2
options
Partial
<ActionsMoveOptions
>
Returns
movePlayer
public
Adds an action to the Action Chain that moves the Player to a specific position.
Usage
await gamium
.actions()
.movePlayer(
By.path('/PlayerSpawnPoint[1]/WizardCharacter(Clone)[1]'),
By.path('/Main Camera[1]'),
{ x: 0, y: 0, z: 0 },
{ by: MovePlayerBy.Navigation },
)
.perform();
Arguments
playerLocator
Locator
cameraLocator
Locator
dest
Vector3
options
Partial
<MovePlayerOptions
>
Returns
perform
public
Request actions registered in the AccrtionChain to Gamium Engine
.
Returns
scroll
public
Adds an action to ActionChain that scrolls by delta from a specific coordinate.
Usage
await gamium.actions().scroll({ x: 0, y: 0 }, { x: 0, y: 10 }).perform();
Arguments
Returns
sendKeys
public
Adds an action to ActionChain that causes specific keystrokes to occur.
Usage
await game
.actions()
.sendKeys([KeyBy.unityKeycode('Space')])
.perform();
Arguments
byList
KeyBy
[]options
Partial
<SendKeyOptions
>
Returns
setText
public
Adds an action to ActionChain to enter text for a specific object.
Usage
await gamium
.actions()
.setText(By.path('/Canvas[1]/Panel[1]/InputField[1]/Text[1]'), 'Hello World')
.perform();
Arguments
locator
Locator
text
string
options
Partial
<SetTextOptions
>
Returns
sleep
public
Add an empty time in the middle of the ActionChain.
Usage
await gamium.actions().sleep(300).setText(text1, 'Hello World').perform();
Arguments
- millseconds
number
Returns
tryPerform
public
Returns
Promise
<TryResult
<ActionResult
[]>>