Install LogicBlock 2
Install LogicBlock 2 after Visual Script is ready.
- Install and set up Visual Script 1.0.4 or newer.
- Open Window > Package Manager and install LogicBlock 2.
- Wait for Unity to finish compiling. LogicBlock 2 then generates its parameter types.
Requirements and installation
| Requirement | Version |
|---|---|
| Unity | 6000.5 or newer |
| Visual Script | 1.0.4 or newer (works.catsoft.visualscript) |
| Package | no.fullscreen.logicblock2 |
| Namespace | Fullscreen.LogicBlock2.Runtime (and .Editor, .Generated) |
LogicBlock 2 is a package. After installing it, it appears in Window > Package Manager as LogicBlock 2, next to Visual Script.
Importing the examples
- Open Window > Package Manager.
- Select LogicBlock 2.
- Open the Samples tab and click Import next to Examples.
The example scenes and Blocks are copied to Assets/Samples/LogicBlock 2/<version>/Examples. See Examples.
What LogicBlock 2 adds to your project
LogicBlock 2 writes one folder into your project: Assets/Plugins/LogicBlock2/Generated Parameters. It holds the parameter types, which are generated automatically (see Parameter types). Don't edit these files.
Quick start
This makes a reusable "Pop" effect and runs it from several objects.
- In the Project window, right-click and choose Create > Visual Script > LogicBlock > Instruction Block. Name it
Pop. - Select it. Under Instructions, click Add Instruction... and add Transform > Local Scale > Set Transform Local Scale. Set Transform to Source and Value to
(1.3, 1.3, 1.3), with a short duration (for example 0.1 seconds). - Add a second Set Transform Local Scale back to
(1, 1, 1). - Add an Event component to a cube with a collider. Add the trigger Input > Cursor > On Mouse Click.
- In the Event's instructions, click Add Instruction... and choose LogicBlock > Run Block. Pick
Popin the Block field. - Do the same on as many cubes as you like and press Play. Clicking any cube runs the same Block on that cube.
Inside a Block, Source and Target are whatever the call passes in. Run Block passes its own Event's Source and Target by default, so Source in Pop is the clicked cube.