Categories > Logic > rex_fncallpkg

Introduction

Serialize function call to a JSON string, or deserialize it to invoke the function call.

Links


Categories > Logic > rex_fncallpkgIntroductionLinksDependenceUsageSingle function callSerializeDeserializeAssign function objectMultiple function callsSerializeDeserializeRetrieve function queueMore samples

Dependence

Usage

Single function call

Deserialize SerializeAction:Call function, orExpression:CallFunction object:On function_nameExpression:FnCallPkg( function_name, parameter0, parameter1, ..)JSON string:[function_name,parameter0,parameter1, ...]

Serialize

Serialize a function call by Expression:FnCallPkg( function_name, parameter0, parameter1, ..). It returns a JSON string in this format

 
x
[function_name,parameter0,parameter1, ...]

The interface of parameters is the same as `Expression:Call of official function object,

Deserialize

Action:Call function , or Expression:Call to deserialize JSON to invoke function call.

Assign function object

This plugin invokes function by one of these function object

  1. rex_function2
  2. official function

Or assign function object by Action:Setup callback.


Multiple function calls

Deserialize SerializeAction:Call function, orExpression:CallFunction object:On function_nameAction:CleanAction:PushAction:Push...Function calls queueAction:LoadExpression:FnQueuePkgJSON string:[[function_name,parameter0,parameter1, ...],[function_name,parameter0,parameter1, ...], ... ]

Serialize

Multiple function calls are stored in a queue.

  1. Push function calls into queue

    • Action:Clean, clean queue
    • Action:Push , push function call into queue.
  2. Expression:FnQueuePkg, serialize function queue. It returns a JSON string in this format

 
xxxxxxxxxx
[[function_name,parameter0,parameter1, ...],[function_name,parameter0,parameter1, ...],...]

Action:Load, to load serialize result Expression:FnQueuePkg, or Expression:FnCallPkg.

Deserialize

Action:Call function , or Expression:Call to deserialize JSON to invoke function call.

Retrieve function queue

For each call+Condition:Foreach packageExpression:CurName,Expression:CurParam( index )-Action:Overwrite parameter, or-Action:Add to parameterFunction calls queue
  1. Condition:For each package to retrieve parameters o function call in queue in order.

    1. Expression:CurName, Expression:CurParam

    2. Modify parameter

      • Action:Overwrite parameter,
      • Action:Add to parameter

More samples

Prefab