See the follows for details:
- http://imagicbell.github.io/unity/2017/10/11/blockly-one.html
- http://imagicbell.github.io/unity/2017/10/14/blockly-two.html
- http://imagicbell.github.io/unity/2017/10/22/blockly-three.html
- http://imagicbell.github.io/unity/2017/10/31/blockly-four.html
Have fun with 2 game demo.
- open Examples in Unity.
- Hit menu UBlockly/Build Block Prefabs and wait to finish prefabs building.
- open scene UGUIDemo.
- Hit play and have fun.
There offered two UI themes: google blockly style and scratch style. Default is scratch(I prefer~).
To change themes:
-
Drag the prefab UBlocklyData/Toolboxs/Prefabs/ClassicToolbox under the scene object Canvas/Workspace (Make sure the scene UGUIDemo is opened).
-
Delete or hide the other theme prefab ScratchToolbox.
-
Attach the ClassicToolbox to the component WorkspaceView on scene object Workspace.
-
Hit play and have a look.
-
Add json definition for the block. Please follow the format of the built-in blocks under
ublockly/Source/JsonBlocks/
.-
If you want to add a block in the existing category, just add the json definition in the existing json files.
-
The
type
of the block must follow the format:[category]_nameOfBlock
.e.g.
coroutine_wait_time
,coroutine
is the name of the category, which is also the name of the json file;wait_time
is the name of the block. -
If you want to add a new category.
- Create a new json file anywhere you want. Then add its reference to the
BlockJsonFiles
inBlockResSettings
. Of course you can remove a category from it. - If you want the toolbox to show the newly added category, you should add the new category to the toolbox config file named
toolbox_default
. Of course, you can customized the toolbox config by adding your own config file. - Add a translation for the new category name in
en.json
. Or you can create your own i18n file for a new language.
- Create a new json file anywhere you want. Then add its reference to the
-
-
Interprete the execute code for the newly added block in C#. Please follow the built-in blocks under
ublockly/Source/Script/CodeDB/CSharp
.
Greatly appreciate the help by: