Knowledge Base - Extending the Library

From its inception, iCanScript was designed to be extendable with the addition of user defined nodes. Once installed, the user defined nodes are accessible from the [Library Tree].

Extending the iCanScript library is realized by:

  1. [Tagging your Source Code];
  2. [Importing Public Members];
  3. [Adding Message Handlers].

The following picture illustrates how the iCanScript library gets populated and used. You are given three access points (purple) to include your own packages and nodes inside the iCanScript library. The iCanScript library gets repopulated for every recompile of the Unity scripts.

Figure 1. iCanScript library information flow.
Figure 1. iCanScript library information flow.

Tagged Source Code: You can add to the iCanScript library by tagging your source code with specialized .NET attributes. This provides for fine control of which elements in your source code are published to the iCanScript user.

Importing Public Members: You can add to the iCanScript library by batch importing all public members of specified programatic types. This method is specially useful for importing libraries for which you do not have the source code.

Message Installation: The .NET reflection technology allows for dynamic messaging; a technic used to dynamically invoke a functionality only if it is defined for a software object. A script responds to dynamic messages if it includes the appropriate message handlers. You can populate the iCanScript library with the signature of message handlers for given programatic types. Afterward, the signature can be used by the iCanScript user to build the message handler nodes.

The iCanScript editors extracts from the library node and port information when building the visual script. The visual script manifest and layout information is saved along with the game object that includes the iCS_VisualScript component.

iCanScript also generates the iCS_Behaviour code that is needed by Unity to execute the the Visual Script. The behaviour code includes:

  1. the message handlers;
  2. the control logic that determine the execution order of nodes, and;
  3. the nodes converted into .NET code.

When the Unity engine is ran, the iCS_Behaviour code instantiates the variables, invokes the .NET code of the nodes, and responds to the message handlers. The iCanScript core executive (iCanScriptEngine.dll) assures the execution order and resolves data contention.

Details

Created : 2015-03-16 20:10:22, Last Modified : 2015-03-16 20:10:22

User Comments

Add a Comment

Search Articles

Member Login