├── .github └── workflows │ └── ci.yml ├── .gitignore ├── Doc ├── blockressettings.png ├── changeui_1.png ├── changeui_2.png ├── glimpse.png ├── google_ui.png ├── settings1.png ├── settings2.png └── sratch_ui.png ├── Examples ├── Assets │ ├── UBlockly │ ├── UBlockly.meta │ ├── UBlocklyData │ └── UBlocklyData.meta ├── Packages │ ├── manifest.json │ └── packages-lock.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── SceneTemplateSettings.json │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── VersionControlSettings.asset ├── LICENSE ├── README.md ├── Source ├── Example.meta ├── Example │ ├── UGUIDemo.unity │ └── UGUIDemo.unity.meta ├── JsonBlocks.meta ├── JsonBlocks │ ├── colour.json │ ├── colour.json.meta │ ├── coroutine.json │ ├── coroutine.json.meta │ ├── lists.json │ ├── lists.json.meta │ ├── logic.json │ ├── logic.json.meta │ ├── loops.json │ ├── loops.json.meta │ ├── math.json │ ├── math.json.meta │ ├── procedures.json │ ├── procedures.json.meta │ ├── text.json │ ├── text.json.meta │ ├── variables.json │ └── variables.json.meta ├── Libs.meta ├── Libs │ ├── JsonExtension.cs │ ├── JsonExtension.cs.meta │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.dll.meta ├── Script.meta ├── Script │ ├── CodeDB.meta │ ├── CodeDB │ │ ├── CSharp.meta │ │ ├── CSharp │ │ │ ├── CSharp.cs │ │ │ ├── CSharp.cs.meta │ │ │ ├── CSharpGenerator.cs │ │ │ ├── CSharpGenerator.cs.meta │ │ │ ├── CSharpInterpreter.cs │ │ │ ├── CSharpInterpreter.cs.meta │ │ │ ├── CSharpRunner.cs │ │ │ ├── CSharpRunner.cs.meta │ │ │ ├── Generators.meta │ │ │ ├── Generators │ │ │ │ ├── Coroutine_CSharp.cs │ │ │ │ ├── Coroutine_CSharp.cs.meta │ │ │ │ ├── Logic_CSharp.cs │ │ │ │ ├── Logic_CSharp.cs.meta │ │ │ │ ├── Loop_CSharp.cs │ │ │ │ ├── Loop_CSharp.cs.meta │ │ │ │ ├── Math_CSharp.cs │ │ │ │ ├── Math_CSharp.cs.meta │ │ │ │ ├── Text_CSharp.cs │ │ │ │ ├── Text_CSharp.cs.meta │ │ │ │ ├── Variables_CSharp.cs │ │ │ │ └── Variables_CSharp.cs.meta │ │ │ ├── Interpreters.meta │ │ │ └── Interpreters │ │ │ │ ├── Coroutine_CSharp.cs │ │ │ │ ├── Coroutine_CSharp.cs.meta │ │ │ │ ├── List_CSharp.cs │ │ │ │ ├── List_CSharp.cs.meta │ │ │ │ ├── Logic_CSharp.cs │ │ │ │ ├── Logic_CSharp.cs.meta │ │ │ │ ├── Loop_CSharp.cs │ │ │ │ ├── Loop_CSharp.cs.meta │ │ │ │ ├── Math_CSharp.cs │ │ │ │ ├── Math_CSharp.cs.meta │ │ │ │ ├── Procedure_CSharp.cs │ │ │ │ ├── Procedure_CSharp.cs.meta │ │ │ │ ├── Text_CSharp.cs │ │ │ │ ├── Text_CSharp.cs.meta │ │ │ │ ├── Variables_CSharp.cs │ │ │ │ └── Variables_CSharp.cs.meta │ │ ├── Lua.meta │ │ └── Lua │ │ │ ├── Generators.meta │ │ │ ├── Generators │ │ │ ├── Colour_Lua.cs │ │ │ ├── Colour_Lua.cs.meta │ │ │ ├── List_Lua.cs │ │ │ ├── List_Lua.cs.meta │ │ │ ├── Logic_Lua.cs │ │ │ ├── Logic_Lua.cs.meta │ │ │ ├── Loop_Lua.cs │ │ │ ├── Loop_Lua.cs.meta │ │ │ ├── Math_Lua.cs │ │ │ ├── Math_Lua.cs.meta │ │ │ ├── Procedure_Lua.cs │ │ │ ├── Procedure_Lua.cs.meta │ │ │ ├── Text_Lua.cs │ │ │ ├── Text_Lua.cs.meta │ │ │ ├── Variables_Lua.cs │ │ │ └── Variables_Lua.cs.meta │ │ │ ├── Lua.cs │ │ │ ├── Lua.cs.meta │ │ │ ├── LuaGenerator.cs │ │ │ ├── LuaGenerator.cs.meta │ │ │ ├── LuaInterpreter.cs │ │ │ ├── LuaInterpreter.cs.meta │ │ │ ├── LuaRunner.cs │ │ │ └── LuaRunner.cs.meta │ ├── Core.meta │ ├── Core │ │ ├── Block.meta │ │ ├── Block │ │ │ ├── Block.cs │ │ │ ├── Block.cs.meta │ │ │ ├── BlockDefinition.cs │ │ │ ├── BlockDefinition.cs.meta │ │ │ ├── BlockFactory.cs │ │ │ └── BlockFactory.cs.meta │ │ ├── Blockly.cs │ │ ├── Blockly.cs.meta │ │ ├── Code.meta │ │ ├── Code │ │ │ ├── CmdEnumerator.cs │ │ │ ├── CmdEnumerator.cs.meta │ │ │ ├── CmdRunner.cs │ │ │ ├── CmdRunner.cs.meta │ │ │ ├── Cmdtor.cs │ │ │ ├── Cmdtor.cs.meta │ │ │ ├── CodeDefs.cs │ │ │ ├── CodeDefs.cs.meta │ │ │ ├── Datas.cs │ │ │ ├── Datas.cs.meta │ │ │ ├── Generator.cs │ │ │ ├── Generator.cs.meta │ │ │ ├── Interpreter.cs │ │ │ ├── Interpreter.cs.meta │ │ │ ├── Names.cs │ │ │ ├── Names.cs.meta │ │ │ ├── Runner.cs │ │ │ └── Runner.cs.meta │ │ ├── Connection.meta │ │ ├── Connection │ │ │ ├── Connection.cs │ │ │ ├── Connection.cs.meta │ │ │ ├── ConnectionDB.cs │ │ │ └── ConnectionDB.cs.meta │ │ ├── CustomDefine.meta │ │ ├── CustomDefine │ │ │ ├── Number.cs │ │ │ ├── Number.cs.meta │ │ │ ├── ObservePattern.cs │ │ │ ├── ObservePattern.cs.meta │ │ │ ├── Vector.cs │ │ │ └── Vector.cs.meta │ │ ├── Define.cs │ │ ├── Define.cs.meta │ │ ├── Field.meta │ │ ├── Field │ │ │ ├── Field.cs │ │ │ ├── Field.cs.meta │ │ │ ├── FieldAngle.cs │ │ │ ├── FieldAngle.cs.meta │ │ │ ├── FieldCheckbox.cs │ │ │ ├── FieldCheckbox.cs.meta │ │ │ ├── FieldColour.cs │ │ │ ├── FieldColour.cs.meta │ │ │ ├── FieldDate.cs │ │ │ ├── FieldDate.cs.meta │ │ │ ├── FieldDropdown.cs │ │ │ ├── FieldDropdown.cs.meta │ │ │ ├── FieldFactory.cs │ │ │ ├── FieldFactory.cs.meta │ │ │ ├── FieldImage.cs │ │ │ ├── FieldImage.cs.meta │ │ │ ├── FieldLabel.cs │ │ │ ├── FieldLabel.cs.meta │ │ │ ├── FieldNumber.cs │ │ │ ├── FieldNumber.cs.meta │ │ │ ├── FieldTextInput.cs │ │ │ ├── FieldTextInput.cs.meta │ │ │ ├── FieldVariable.cs │ │ │ └── FieldVariable.cs.meta │ │ ├── Input.meta │ │ ├── Input │ │ │ ├── Input.cs │ │ │ ├── Input.cs.meta │ │ │ ├── InputFactory.cs │ │ │ └── InputFactory.cs.meta │ │ ├── Mutator.meta │ │ ├── Mutator │ │ │ ├── Mutator.cs │ │ │ ├── Mutator.cs.meta │ │ │ ├── MutatorFactory.cs │ │ │ ├── MutatorFactory.cs.meta │ │ │ ├── Mutators.meta │ │ │ ├── Mutators │ │ │ │ ├── DropdownOptionsMutator.cs │ │ │ │ ├── DropdownOptionsMutator.cs.meta │ │ │ │ ├── IfElseMutator.cs │ │ │ │ ├── IfElseMutator.cs.meta │ │ │ │ ├── IndexAtMutator.cs │ │ │ │ ├── IndexAtMutator.cs.meta │ │ │ │ ├── ItemListMutator.cs │ │ │ │ ├── ItemListMutator.cs.meta │ │ │ │ ├── MathIsDivisibleByMutator.cs │ │ │ │ └── MathIsDivisibleByMutator.cs.meta │ │ │ ├── ProcedureMutators.meta │ │ │ └── ProcedureMutators │ │ │ │ ├── Procedure.cs │ │ │ │ ├── Procedure.cs.meta │ │ │ │ ├── ProcedureCallMutator.cs │ │ │ │ ├── ProcedureCallMutator.cs.meta │ │ │ │ ├── ProcedureDB.cs │ │ │ │ ├── ProcedureDB.cs.meta │ │ │ │ ├── ProcedureDefinitionMutator.cs │ │ │ │ ├── ProcedureDefinitionMutator.cs.meta │ │ │ │ ├── ProcedureMutator.cs │ │ │ │ └── ProcedureMutator.cs.meta │ │ ├── Utils.cs │ │ ├── Utils.cs.meta │ │ ├── Variable.meta │ │ ├── Variable │ │ │ ├── VariableMap.cs │ │ │ ├── VariableMap.cs.meta │ │ │ ├── VariableModel.cs │ │ │ ├── VariableModel.cs.meta │ │ │ ├── Variables.cs │ │ │ └── Variables.cs.meta │ │ ├── Workspace.cs │ │ ├── Workspace.cs.meta │ │ ├── Xml.cs │ │ └── Xml.cs.meta │ ├── I18n.meta │ ├── I18n │ │ ├── I18n.cs │ │ ├── I18n.cs.meta │ │ ├── MsgDefine.cs │ │ └── MsgDefine.cs.meta │ ├── Res.meta │ ├── Res │ │ ├── BlockResMgr.cs │ │ └── BlockResMgr.cs.meta │ ├── Test.meta │ ├── Test │ │ ├── Editor.meta │ │ └── Editor │ │ │ ├── Code.meta │ │ │ ├── Code │ │ │ ├── GeneratorTest.cs │ │ │ └── GeneratorTest.cs.meta │ │ │ ├── Connection.meta │ │ │ ├── Connection │ │ │ ├── ConnectionDBTest.cs │ │ │ ├── ConnectionDBTest.cs.meta │ │ │ ├── ConnectionTest.cs │ │ │ └── ConnectionTest.cs.meta │ │ │ ├── Field.meta │ │ │ ├── Field │ │ │ ├── FieldAngleTest.cs │ │ │ ├── FieldAngleTest.cs.meta │ │ │ ├── FieldNumberTest.cs │ │ │ ├── FieldNumberTest.cs.meta │ │ │ ├── FieldVariableTest.cs │ │ │ └── FieldVariableTest.cs.meta │ │ │ ├── InputTest.cs │ │ │ ├── InputTest.cs.meta │ │ │ ├── JsonTest.cs │ │ │ ├── JsonTest.cs.meta │ │ │ ├── TestHelper.cs │ │ │ ├── TestHelper.cs.meta │ │ │ ├── UtilsTest.cs │ │ │ ├── UtilsTest.cs.meta │ │ │ ├── VariableTest.cs │ │ │ ├── VariableTest.cs.meta │ │ │ ├── WorkspaceTest.cs │ │ │ ├── WorkspaceTest.cs.meta │ │ │ ├── XmlTest.cs │ │ │ └── XmlTest.cs.meta │ ├── UGUIView.meta │ └── UGUIView │ │ ├── BlockStatusView.cs │ │ ├── BlockStatusView.cs.meta │ │ ├── BlockViewBuilder.cs │ │ ├── BlockViewBuilder.cs.meta │ │ ├── BlockViewFactory.cs │ │ ├── BlockViewFactory.cs.meta │ │ ├── BlockViewSettings.cs │ │ ├── BlockViewSettings.cs.meta │ │ ├── BlocklyUI.cs │ │ ├── BlocklyUI.cs.meta │ │ ├── Dialogs.meta │ │ ├── Dialogs │ │ ├── BaseDialog.cs │ │ ├── BaseDialog.cs.meta │ │ ├── DialogFactory.cs │ │ ├── DialogFactory.cs.meta │ │ ├── FieldDialogs.meta │ │ ├── FieldDialogs │ │ │ ├── FieldAngleDialog.cs │ │ │ ├── FieldAngleDialog.cs.meta │ │ │ ├── FieldColorDialog.cs │ │ │ ├── FieldColorDialog.cs.meta │ │ │ ├── FieldDialog.cs │ │ │ ├── FieldDialog.cs.meta │ │ │ ├── FieldDropdownDialog.cs │ │ │ ├── FieldDropdownDialog.cs.meta │ │ │ ├── FieldNumberDialog.cs │ │ │ └── FieldNumberDialog.cs.meta │ │ ├── MsgDialog.cs │ │ ├── MsgDialog.cs.meta │ │ ├── MutatorDialogs.meta │ │ ├── MutatorDialogs │ │ │ ├── IfElseMutatorDialog.cs │ │ │ ├── IfElseMutatorDialog.cs.meta │ │ │ ├── ItemListMutatorDialog.cs │ │ │ ├── ItemListMutatorDialog.cs.meta │ │ │ ├── ProcedureDefinitionMutatorDialog.cs │ │ │ └── ProcedureDefinitionMutatorDialog.cs.meta │ │ ├── VariableNameDialog.cs │ │ └── VariableNameDialog.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── BlockViewEditor.cs │ │ └── BlockViewEditor.cs.meta │ │ ├── Extensions.meta │ │ ├── Extensions │ │ ├── CustomDropdown.cs │ │ ├── CustomDropdown.cs.meta │ │ ├── CustomMeshImage.cs │ │ ├── CustomMeshImage.cs.meta │ │ ├── CustomMeshImageDefine.cs │ │ ├── CustomMeshImageDefine.cs.meta │ │ ├── UGUIHelper.cs │ │ ├── UGUIHelper.cs.meta │ │ ├── UIEventListener.cs │ │ └── UIEventListener.cs.meta │ │ ├── PlayControlView.cs │ │ ├── PlayControlView.cs.meta │ │ ├── Toolbox.meta │ │ ├── Toolbox │ │ ├── BaseToolbox.cs │ │ ├── BaseToolbox.cs.meta │ │ ├── ClassicToolbox.cs │ │ ├── ClassicToolbox.cs.meta │ │ ├── ScratchToolbox.cs │ │ ├── ScratchToolbox.cs.meta │ │ ├── ToolboxConfig.cs │ │ └── ToolboxConfig.cs.meta │ │ ├── Views.meta │ │ ├── Views │ │ ├── BaseView.cs │ │ ├── BaseView.cs.meta │ │ ├── BlockView.cs │ │ ├── BlockView.cs.meta │ │ ├── ConnectionInputView.cs │ │ ├── ConnectionInputView.cs.meta │ │ ├── ConnectionView.cs │ │ ├── ConnectionView.cs.meta │ │ ├── FieldView.cs │ │ ├── FieldView.cs.meta │ │ ├── Fields.meta │ │ ├── Fields │ │ │ ├── FieldButtonView.cs │ │ │ ├── FieldButtonView.cs.meta │ │ │ ├── FieldCheckboxView.cs │ │ │ ├── FieldCheckboxView.cs.meta │ │ │ ├── FieldColorView.cs │ │ │ ├── FieldColorView.cs.meta │ │ │ ├── FieldDropdownView.cs │ │ │ ├── FieldDropdownView.cs.meta │ │ │ ├── FieldImageView.cs │ │ │ ├── FieldImageView.cs.meta │ │ │ ├── FieldInputView.cs │ │ │ ├── FieldInputView.cs.meta │ │ │ ├── FieldLabelView.cs │ │ │ ├── FieldLabelView.cs.meta │ │ │ ├── FieldVariableView.cs │ │ │ └── FieldVariableView.cs.meta │ │ ├── InputView.cs │ │ ├── InputView.cs.meta │ │ ├── LineGroupView.cs │ │ └── LineGroupView.cs.meta │ │ ├── WorkspaceView.cs │ │ ├── WorkspaceView.cs.meta │ │ ├── XmlView.cs │ │ └── XmlView.cs.meta ├── UGUI.meta └── UGUI │ ├── Prefabs.meta │ ├── Prefabs │ ├── BlockTemplates.meta │ ├── BlockTemplates │ │ ├── Block_root.prefab │ │ ├── Block_root.prefab.meta │ │ ├── Block_root_next.prefab │ │ ├── Block_root_next.prefab.meta │ │ ├── Block_root_output.prefab │ │ ├── Block_root_output.prefab.meta │ │ ├── Block_root_prev.prefab │ │ ├── Block_root_prev.prefab.meta │ │ ├── Block_root_prev_next.prefab │ │ ├── Block_root_prev_next.prefab.meta │ │ ├── Field_button.prefab │ │ ├── Field_button.prefab.meta │ │ ├── Field_checkbox.prefab │ │ ├── Field_checkbox.prefab.meta │ │ ├── Field_image.prefab │ │ ├── Field_image.prefab.meta │ │ ├── Field_input.prefab │ │ ├── Field_input.prefab.meta │ │ ├── Field_label.prefab │ │ ├── Field_label.prefab.meta │ │ ├── Field_variable.prefab │ │ ├── Field_variable.prefab.meta │ │ ├── Input_statement.prefab │ │ ├── Input_statement.prefab.meta │ │ ├── Input_value.prefab │ │ ├── Input_value.prefab.meta │ │ ├── Input_value_slot.prefab │ │ └── Input_value_slot.prefab.meta │ ├── BtnCreateVar.prefab │ ├── BtnCreateVar.prefab.meta │ ├── ConnectHighlight.prefab │ ├── ConnectHighlight.prefab.meta │ ├── Dialogs.meta │ ├── Dialogs │ │ ├── Dialog_message.prefab │ │ ├── Dialog_message.prefab.meta │ │ ├── Dialog_variable_name.prefab │ │ ├── Dialog_variable_name.prefab.meta │ │ ├── FieldDialogs.meta │ │ ├── FieldDialogs │ │ │ ├── Dialog_field_angle.prefab │ │ │ ├── Dialog_field_angle.prefab.meta │ │ │ ├── Dialog_field_color.prefab │ │ │ ├── Dialog_field_color.prefab.meta │ │ │ ├── Dialog_field_dropdown.prefab │ │ │ ├── Dialog_field_dropdown.prefab.meta │ │ │ ├── Dialog_field_number.prefab │ │ │ └── Dialog_field_number.prefab.meta │ │ ├── MutatorDialogs.meta │ │ └── MutatorDialogs │ │ │ ├── Dialog_mutator_ifelse.prefab │ │ │ ├── Dialog_mutator_ifelse.prefab.meta │ │ │ ├── Dialog_mutator_itemlist.prefab │ │ │ ├── Dialog_mutator_itemlist.prefab.meta │ │ │ ├── Dialog_mutator_proceduredef.prefab │ │ │ └── Dialog_mutator_proceduredef.prefab.meta │ ├── StatusLight.prefab │ ├── StatusLight.prefab.meta │ ├── Workspace.prefab │ └── Workspace.prefab.meta │ ├── Textures.meta │ └── Textures │ ├── Blocks.meta │ ├── Blocks │ ├── bg_block1.png │ ├── bg_block1.png.meta │ ├── bg_block2.png │ ├── bg_block2.png.meta │ ├── bg_common.png │ ├── bg_common.png.meta │ ├── connect_next.png │ ├── connect_next.png.meta │ ├── connect_output.png │ ├── connect_output.png.meta │ ├── field_dropdown.png │ ├── field_dropdown.png.meta │ ├── icon_mutator.png │ ├── icon_mutator.png.meta │ ├── img_checkmark.png │ ├── img_checkmark.png.meta │ ├── img_cross.png │ ├── img_cross.png.meta │ ├── img_edit.png │ ├── img_edit.png.meta │ ├── img_highlight.png │ ├── img_highlight.png.meta │ ├── img_statuslight.png │ ├── img_statuslight.png.meta │ ├── input_statement_connection.png │ ├── input_statement_connection.png.meta │ ├── input_value_connection.png │ ├── input_value_connection.png.meta │ ├── input_value_connection_slot.png │ └── input_value_connection_slot.png.meta │ ├── Panels.meta │ ├── Panels │ ├── Angle.meta │ └── Angle │ │ ├── field_angle.png │ │ ├── field_angle.png.meta │ │ ├── img_anglepanel.png │ │ └── img_anglepanel.png.meta │ ├── Workspace.meta │ └── Workspace │ ├── icon_delete_blue.png │ ├── icon_delete_blue.png.meta │ ├── icon_delete_red.png │ ├── icon_delete_red.png.meta │ ├── icon_load.png │ ├── icon_load.png.meta │ ├── icon_pause.png │ ├── icon_pause.png.meta │ ├── icon_run.png │ ├── icon_run.png.meta │ ├── icon_save.png │ ├── icon_save.png.meta │ ├── icon_step.png │ ├── icon_step.png.meta │ ├── icon_stop.png │ └── icon_stop.png.meta └── UserData ├── I18n.meta ├── I18n ├── en.json ├── en.json.meta ├── zh-hans.json └── zh-hans.json.meta ├── Resources.meta ├── Resources ├── BlockResSettings.asset ├── BlockResSettings.asset.meta ├── BlockViewSettings.asset └── BlockViewSettings.asset.meta ├── Toolboxs.meta └── Toolboxs ├── Configs.meta ├── Configs ├── toolbox_default.json └── toolbox_default.json.meta ├── Prefabs.meta └── Prefabs ├── ClassicToolbox.prefab ├── ClassicToolbox.prefab.meta ├── ScratchToolbox.prefab └── ScratchToolbox.prefab.meta /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: {} 5 | push: { branches: [master] } 6 | 7 | jobs: 8 | testAllModes: 9 | name: Test in ${{ matrix.testMode }} 10 | runs-on: ubuntu-latest 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | projectPath: 15 | - Examples 16 | testMode: 17 | - playmode 18 | - editmode 19 | steps: 20 | - uses: actions/checkout@v2 21 | with: 22 | lfs: true 23 | - uses: actions/cache@v2 24 | with: 25 | path: ${{ matrix.projectPath }}/Library 26 | key: Library-${{ matrix.projectPath }} 27 | restore-keys: | 28 | Library- 29 | - uses: game-ci/unity-test-runner@v2 30 | id: tests 31 | env: 32 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 33 | with: 34 | projectPath: ${{ matrix.projectPath }} 35 | testMode: ${{ matrix.testMode }} 36 | artifactsPath: ${{ matrix.testMode }}-artifacts 37 | githubToken: ${{ secrets.GITHUB_TOKEN }} 38 | checkName: ${{ matrix.testMode }} Test Results 39 | - uses: actions/upload-artifact@v2 40 | if: always() 41 | with: 42 | name: Test results for ${{ matrix.testMode }} 43 | path: ${{ steps.tests.outputs.artifactsPath }} 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/Temp/ 2 | **/Library/ 3 | **/obj/ 4 | **.csproj 5 | **.idea/ 6 | **.sln 7 | 8 | **/PersistentPath/ 9 | **/PersistentPath.meta 10 | **/BlockGenPrefabs/ 11 | **/BlockGenPrefabs.meta 12 | **/Xcode/ 13 | **.DS_Store 14 | **.userprefs 15 | **/JetBrains/ 16 | **/JetBrains.meta 17 | **/Logs/ 18 | **/.vs/ 19 | **/.vsconfig 20 | **/UserSettings/ 21 | -------------------------------------------------------------------------------- /Doc/blockressettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/blockressettings.png -------------------------------------------------------------------------------- /Doc/changeui_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/changeui_1.png -------------------------------------------------------------------------------- /Doc/changeui_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/changeui_2.png -------------------------------------------------------------------------------- /Doc/glimpse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/glimpse.png -------------------------------------------------------------------------------- /Doc/google_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/google_ui.png -------------------------------------------------------------------------------- /Doc/settings1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/settings1.png -------------------------------------------------------------------------------- /Doc/settings2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/settings2.png -------------------------------------------------------------------------------- /Doc/sratch_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Doc/sratch_ui.png -------------------------------------------------------------------------------- /Examples/Assets/UBlockly: -------------------------------------------------------------------------------- 1 | ../../Source -------------------------------------------------------------------------------- /Examples/Assets/UBlockly.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3db2acb353f3c4b02a4f895cd2a28328 3 | folderAsset: yes 4 | timeCreated: 1509963330 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Examples/Assets/UBlocklyData: -------------------------------------------------------------------------------- 1 | ../../UserData -------------------------------------------------------------------------------- /Examples/Assets/UBlocklyData.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd4c6a152b0c74a968260fa34ff72303 3 | folderAsset: yes 4 | timeCreated: 1510492528 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Examples/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.3.9", 4 | "com.unity.ide.rider": "2.0.7", 5 | "com.unity.ide.visualstudio": "2.0.7", 6 | "com.unity.ide.vscode": "1.2.3", 7 | "com.unity.test-framework": "1.1.24", 8 | "com.unity.ugui": "1.0.0", 9 | "com.unity.modules.imgui": "1.0.0", 10 | "com.unity.modules.jsonserialize": "1.0.0", 11 | "com.unity.modules.ui": "1.0.0", 12 | "com.unity.modules.unitywebrequest": "1.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Examples/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": { 4 | "version": "1.3.9", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "1.0.6", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "2.0.7", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.test-framework": "1.1.1" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.visualstudio": { 27 | "version": "2.0.7", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.test-framework": "1.1.9" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.ide.vscode": { 36 | "version": "1.2.3", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": {}, 40 | "url": "https://packages.unity.com" 41 | }, 42 | "com.unity.test-framework": { 43 | "version": "1.1.24", 44 | "depth": 0, 45 | "source": "registry", 46 | "dependencies": { 47 | "com.unity.ext.nunit": "1.0.6", 48 | "com.unity.modules.imgui": "1.0.0", 49 | "com.unity.modules.jsonserialize": "1.0.0" 50 | }, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.ugui": { 54 | "version": "1.0.0", 55 | "depth": 0, 56 | "source": "builtin", 57 | "dependencies": { 58 | "com.unity.modules.ui": "1.0.0", 59 | "com.unity.modules.imgui": "1.0.0" 60 | } 61 | }, 62 | "com.unity.modules.imgui": { 63 | "version": "1.0.0", 64 | "depth": 0, 65 | "source": "builtin", 66 | "dependencies": {} 67 | }, 68 | "com.unity.modules.jsonserialize": { 69 | "version": "1.0.0", 70 | "depth": 0, 71 | "source": "builtin", 72 | "dependencies": {} 73 | }, 74 | "com.unity.modules.ui": { 75 | "version": "1.0.0", 76 | "depth": 0, 77 | "source": "builtin", 78 | "dependencies": {} 79 | }, 80 | "com.unity.modules.unitywebrequest": { 81 | "version": "1.0.0", 82 | "depth": 0, 83 | "source": "builtin", 84 | "dependencies": {} 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Examples/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /Examples/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Examples/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.6f1 2 | m_EditorVersionWithRevision: 2020.3.6f1 (338bb68529b2) 3 | -------------------------------------------------------------------------------- /Examples/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Examples/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /Examples/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 0 14 | m_RuntimeVersion: 0 15 | -------------------------------------------------------------------------------- /Examples/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Source/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e1a6d0add35e4a8d8e9fdafa49597dc 3 | folderAsset: yes 4 | timeCreated: 1499395085 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Example/UGUIDemo.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/Example/UGUIDemo.unity -------------------------------------------------------------------------------- /Source/Example/UGUIDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f56260f8a8674203bf826c0311f17a9 3 | timeCreated: 1499835267 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 159ec504c47d4747ba03bc6f622e4f5d 3 | folderAsset: yes 4 | timeCreated: 1502599679 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/colour.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "colour_picker", 4 | "message0": "%1", 5 | "args0": [ 6 | { 7 | "type": "field_colour", 8 | "name": "COLOUR", 9 | "colour": "#ff0000" 10 | } 11 | ], 12 | "output": "Colour", 13 | "colour": "%{BKY_COLOUR_HUE}", 14 | "helpUrl": "%{BKY_COLOUR_PICKER_HELPURL}", 15 | "tooltip": "%{BKY_COLOUR_PICKER_TOOLTIP}", 16 | "extensions": ["parent_tooltip_when_inline"] 17 | }, 18 | 19 | { 20 | "type": "colour_random", 21 | "message0": "%{BKY_COLOUR_RANDOM_TITLE}", 22 | "output": "Colour", 23 | "colour": "%{BKY_COLOUR_HUE}", 24 | "helpUrl": "%{BKY_COLOUR_RANDOM_HELPURL}", 25 | "tooltip": "%{BKY_COLOUR_RANDOM_TOOLTIP}" 26 | }, 27 | 28 | { 29 | "type": "colour_rgb", 30 | "message0": "%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3", 31 | "args0": [ 32 | { 33 | "type": "input_value", 34 | "name": "RED", 35 | "check": "Number", 36 | "align": "RIGHT" 37 | }, 38 | { 39 | "type": "input_value", 40 | "name": "GREEN", 41 | "check": "Number", 42 | "align": "RIGHT" 43 | }, 44 | { 45 | "type": "input_value", 46 | "name": "BLUE", 47 | "check": "Number", 48 | "align": "RIGHT" 49 | } 50 | ], 51 | "output": "Colour", 52 | "colour": "%{BKY_COLOUR_HUE}", 53 | "helpUrl": "%{BKY_COLOUR_RGB_HELPURL}", 54 | "tooltip": "%{BKY_COLOUR_RGB_TOOLTIP}" 55 | }, 56 | 57 | { 58 | "type": "colour_blend", 59 | "message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3", 60 | "args0": [ 61 | { 62 | "type": "input_value", 63 | "name": "COLOUR1", 64 | "check": "Colour", 65 | "align": "RIGHT" 66 | }, 67 | { 68 | "type": "input_value", 69 | "name": "COLOUR2", 70 | "check": "Colour", 71 | "align": "RIGHT" 72 | }, 73 | { 74 | "type": "input_value", 75 | "name": "RATIO", 76 | "check": "Number", 77 | "align": "RIGHT" 78 | } 79 | ], 80 | "output": "Colour", 81 | "colour": "%{BKY_COLOUR_HUE}", 82 | "helpUrl": "%{BKY_COLOUR_BLEND_HELPURL}", 83 | "tooltip": "%{BKY_COLOUR_BLEND_TOOLTIP}" 84 | } 85 | ] 86 | -------------------------------------------------------------------------------- /Source/JsonBlocks/colour.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de2eb98efd5db484d8cd9af05397d406 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/coroutine.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "coroutine_wait_time", 4 | "message0": "%{BKY_COROUTINE_WAIT_TITLE} %1 %2", 5 | "args0": [ 6 | { 7 | "type": "input_value", 8 | "name": "TIME", 9 | "check": "Number" 10 | }, 11 | { 12 | "type": "field_dropdown", 13 | "name": "UNIT", 14 | "options": [ 15 | ["%{BKY_TIME_UNIT_MILLISECOND}", "MILLISECOND"], 16 | ["%{BKY_TIME_UNIT_SECONDS}", "SECONDS"], 17 | ["%{BKY_TIME_UNIT_MINUTES}", "MINUTES"], 18 | ["%{BKY_TIME_UNIT_TOO_HIGH}", "TOOHIGH"] 19 | ] 20 | } 21 | ], 22 | "previousStatement": null, 23 | "nextStatement": null, 24 | "colour": "%{BKY_COROUTINE_HUE}" 25 | }, 26 | { 27 | "type": "coroutine_wait_frame", 28 | "message0": "%{BKY_COROUTINE_WAIT_TITLE} %1 %{BKY_COROUTINE_FRAME}", 29 | "args0": [ 30 | { 31 | "type": "input_value", 32 | "name": "TIME", 33 | "check": "Number" 34 | } 35 | ], 36 | "previousStatement": null, 37 | "nextStatement": null, 38 | "colour": "%{BKY_COROUTINE_HUE}" 39 | } 40 | 41 | ] 42 | -------------------------------------------------------------------------------- /Source/JsonBlocks/coroutine.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14b3c4755696d4d309a9c679f2260cc9 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/lists.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bd2777606c104fe9b11adcc2909df57 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/logic.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bc51b8dd772e480d893ec34fadf6b9c 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/loops.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7bdd662f11a14d169ef05449a00fc69 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/math.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e6180f677b424798b49ead1f46d58f2 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/procedures.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "procedures_defnoreturn", 4 | "message0": "%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2", 5 | "args0": [ 6 | { 7 | "type": "field_label", 8 | "name": "NAME", 9 | "text": "%{BKY_PROCEDURES_DEFRETURN_PROCEDURE}" 10 | }, 11 | { 12 | "type": "field_label", 13 | "name": "PARAMS" 14 | } 15 | ], 16 | "mutator": "procedures_defnoreturn_mutator", 17 | "colour": "290", 18 | "tooltip": "Creates a function with no output.", 19 | "helpUrl": "https://en.wikipedia.org/wiki/Subroutine" 20 | }, 21 | { 22 | "type": "procedures_defreturn", 23 | "message0": "%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2", 24 | "args0": [ 25 | { 26 | "type": "field_label", 27 | "name": "NAME", 28 | "text": "%{BKY_PROCEDURES_DEFRETURN_PROCEDURE}" 29 | }, 30 | { 31 | "type": "field_label", 32 | "name": "PARAMS" 33 | } 34 | ], 35 | "message1": "%{BKY_PROCEDURES_DEFRETURN_RETURN} %1", 36 | "args1": [ 37 | { 38 | "type": "input_value", 39 | "name": "RETURN", 40 | "align": "RIGHT" 41 | } 42 | ], 43 | "mutator": "procedures_defreturn_mutator", 44 | "colour": "290", 45 | "tooltip": "Creates a function with an output.", 46 | "helpUrl": "https://en.wikipedia.org/wiki/Subroutine" 47 | }, 48 | { 49 | "type": "procedures_callnoreturn", 50 | "message0": "%1 %2", 51 | "args0": [ 52 | { 53 | "type": "field_label", 54 | "name": "NAME" 55 | }, 56 | { 57 | "type": "input_dummy", 58 | "name": "TOPROW" 59 | } 60 | ], 61 | "mutator": "procedures_callnoreturn_mutator", 62 | "previousStatement": null, 63 | "nextStatement": null, 64 | "colour": "290", 65 | "helpUrl": "https://en.wikipedia.org/wiki/Subroutine" 66 | }, 67 | { 68 | "type": "procedures_callreturn", 69 | "message0": "%1 %2", 70 | "args0": [ 71 | { 72 | "type": "field_label", 73 | "name": "NAME" 74 | }, 75 | { 76 | "type": "input_dummy", 77 | "name": "TOPROW" 78 | } 79 | ], 80 | "mutator": "procedures_callreturn_mutator", 81 | "output": null, 82 | "colour": "290", 83 | "helpUrl": "https://en.wikipedia.org/wiki/Subroutine" 84 | } 85 | ] -------------------------------------------------------------------------------- /Source/JsonBlocks/procedures.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ebb0af9c438947cc9330560c52ebbc4 3 | timeCreated: 1503485194 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/text.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7881ae29bb5c648b5abcb1f131ba8c8f 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/JsonBlocks/variables.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "variables_get", 4 | "message0": "%1", 5 | "args0": [ 6 | { 7 | "type": "field_variable", 8 | "name": "VAR" 9 | } 10 | ], 11 | "output": null, 12 | "colour": "%{BKY_VARIABLES_HUE}", 13 | "helpUrl": "%{BKY_VARIABLES_GET_HELPURL}", 14 | "tooltip": "%{BKY_VARIABLES_GET_TOOLTIP}", 15 | "extensions": ["contextMenu_variableSetterGetter"] 16 | }, 17 | 18 | { 19 | "type": "variables_set", 20 | "message0": "%{BKY_VARIABLES_SET}", 21 | "args0": [ 22 | { 23 | "type": "field_variable", 24 | "name": "VAR" 25 | }, 26 | { 27 | "type": "input_value", 28 | "name": "VALUE" 29 | } 30 | ], 31 | "previousStatement": null, 32 | "nextStatement": null, 33 | "colour": "%{BKY_VARIABLES_HUE}", 34 | "tooltip": "%{BKY_VARIABLES_SET_TOOLTIP}", 35 | "helpUrl": "%{BKY_VARIABLES_SET_HELPURL}", 36 | "extensions": ["contextMenu_variableSetterGetter"] 37 | }, 38 | 39 | { 40 | "type": "variables_change", 41 | "message0": "%{BKY_VARIABLES_CHANGE_TITLE}", 42 | "args0": [ 43 | { 44 | "type": "field_variable", 45 | "name": "VAR", 46 | "variable": "%{BKY_VARIABLES_CHANGE_TITLE_ITEM}" 47 | }, 48 | { 49 | "type": "input_value", 50 | "name": "DELTA", 51 | "check": "Number" 52 | } 53 | ], 54 | "previousStatement": null, 55 | "nextStatement": null, 56 | "colour": "%{BKY_VARIABLES_HUE}", 57 | "helpUrl": "%{BKY_VARIABLES_CHANGE_HELPURL}", 58 | } 59 | ] -------------------------------------------------------------------------------- /Source/JsonBlocks/variables.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0e6cc79a30de40e6ab2a13928a03d85 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2e702f470afa4bc789a2f7e53c20c21 3 | folderAsset: yes 4 | timeCreated: 1510021213 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Libs/JsonExtension.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | 3 | public static class JsonExtension 4 | { 5 | /// 6 | /// Check if json data contains key specified 7 | /// 8 | public static bool JsonDataContainsKey(this JToken self, string key) 9 | { 10 | if (self == null) return false; 11 | if (!self.IsObject()) return false; 12 | return self[key] != null; 13 | } 14 | 15 | public static bool IsNullOrUndefined(this JToken self) 16 | { 17 | return self == null || self.Type == JTokenType.Null || self.Type == JTokenType.Undefined || self.Type == JTokenType.None; 18 | } 19 | 20 | public static bool IsBool(this JToken self) 21 | { 22 | return self != null && self.Type == JTokenType.Boolean; 23 | } 24 | 25 | public static bool IsInt(this JToken self) 26 | { 27 | return self != null && self.Type == JTokenType.Integer; 28 | } 29 | 30 | public static bool IsString(this JToken self) 31 | { 32 | return self != null && self.Type == JTokenType.String; 33 | } 34 | 35 | public static bool IsObject(this JToken self) 36 | { 37 | return self != null && self.Type == JTokenType.Object; 38 | } 39 | 40 | public static bool IsArray(this JToken self) 41 | { 42 | return self != null && self.Type == JTokenType.Array; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/Libs/JsonExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 159b3f2b637ea4419838bae404ed59a3 3 | timeCreated: 1509982922 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Libs/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/Libs/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Source/Libs/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d54f38b839e54690aba4dd36de18b91 3 | timeCreated: 1509980732 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Source/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8df82b6aa9c94a228dc72b25c4ec2b4 3 | folderAsset: yes 4 | timeCreated: 1499395031 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/CodeDB.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d696352dd44f4ce790d5ab4c95e260d9 3 | folderAsset: yes 4 | timeCreated: 1503319004 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc8aba8d92f44f23b0337c82ec9accc7 3 | timeCreated: 1503319020 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03c1ba27475c4391ba3e47ac02778f8c 3 | timeCreated: 1500893320 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/CSharpGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f684091fa5c4b848f5ca689549e2562 3 | timeCreated: 1503319435 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/CSharpInterpreter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4ea42114d4a4ba9970fd3548899cc75 3 | timeCreated: 1501058140 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/CSharpRunner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac207c08426d4192aec1bd8b76c8acc0 3 | timeCreated: 1623317425 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22559fccb46d4a37a74532c73346e5c1 3 | timeCreated: 1503319367 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Coroutine_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for generating c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | namespace UBlockly 22 | { 23 | public partial class CSharpGenerator 24 | { 25 | [CodeGenerator(BlockType = "coroutine_wait_time")] 26 | private string Time_Wait(Block block) 27 | { 28 | string time = CSharp.Generator.ValueToCode(block, "TIME", CSharp.ORDER_NONE, "0"); 29 | Number timeNumber = new Number(time); 30 | string op = block.GetFieldValue("UNIT"); 31 | switch (op) 32 | { 33 | case "MILLISECOND": 34 | time = (timeNumber.Value * 0.001f).ToString(); 35 | break; 36 | case "SECONDS": 37 | break; 38 | case "MINUTES": 39 | time = (timeNumber.Value * 60f).ToString(); 40 | break; 41 | case "TOOHIGH": 42 | time = null; 43 | break; 44 | } 45 | if (string.IsNullOrEmpty(time)) return null; 46 | return string.Format("yield return new WaitForSeconds({0});\n", time); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Coroutine_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d787e81cba84e239ed36ef5e69c09aa 3 | timeCreated: 1503395853 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Logic_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e3d912294094311a771d03cac323da2 3 | timeCreated: 1503239486 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Loop_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 395b5354e14c45eeb6eff98a01b2737a 3 | timeCreated: 1503239498 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Math_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for generating c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | using System.Collections.Generic; 22 | 23 | namespace UBlockly 24 | { 25 | public partial class CSharpGenerator 26 | { 27 | [CodeGenerator(BlockType = "math_number")] 28 | private CodeStruct Math_Number(Block block) 29 | { 30 | string code = block.GetFieldValue("NUM"); 31 | float num = float.Parse(code); 32 | int order = num < 0 ? CSharp.ORDER_UNARY : CSharp.ORDER_ATOMIC; 33 | return new CodeStruct(code, order); 34 | } 35 | 36 | [CodeGenerator(BlockType = "math_arithmetic")] 37 | private CodeStruct Math_Arithmetic(Block block) 38 | { 39 | Dictionary> operators = new Dictionary> 40 | { 41 | {"ADD", new KeyValuePair(" + ", CSharp.ORDER_ADDITIVE)}, 42 | {"MINUS", new KeyValuePair(" - ", CSharp.ORDER_ADDITIVE)}, 43 | {"MULTIPLY", new KeyValuePair(" * ", CSharp.ORDER_MULTIPLICATIVE)}, 44 | {"DIVIDE", new KeyValuePair(" / ", CSharp.ORDER_MULTIPLICATIVE)}, 45 | {"POWER", new KeyValuePair(null, CSharp.ORDER_COMMA)}, 46 | }; 47 | 48 | var pair = operators[block.GetFieldValue("OP")]; 49 | string op = pair.Key; 50 | int order = pair.Value; 51 | string arg0 = CSharp.Generator.ValueToCode(block, "A", order, "0"); 52 | string arg1 = CSharp.Generator.ValueToCode(block, "B", order, "0"); 53 | string code; 54 | if (op == null) 55 | { 56 | //Power in c# requires a special case since it has no operator. 57 | code = string.Format("System.Math.Pow({0}, {1})", arg0, arg1); 58 | return new CodeStruct(code, CSharp.ORDER_EXPRESSION); 59 | } 60 | code = arg0 + op + arg1; 61 | return new CodeStruct(code, order); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Math_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1abfd5b17d4242ba84e8ef388ae6586a 3 | timeCreated: 1503234631 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Text_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for generating c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | namespace UBlockly 22 | { 23 | public partial class CSharpGenerator 24 | { 25 | [CodeGenerator(BlockType = "text")] 26 | private CodeStruct Text(Block block) 27 | { 28 | string code = CSharp.Generator.Quote(block.GetFieldValue("TEXT")); 29 | return new CodeStruct(code, CSharp.ORDER_ATOMIC); 30 | } 31 | 32 | [CodeGenerator(BlockType = "text_print")] 33 | private string Text_Print(Block block) 34 | { 35 | string text = CSharp.Generator.ValueToCode(block, "TEXT", CSharp.ORDER_NONE, "\'\'"); 36 | return string.Format("UnityEngine.Debug.Log({0});\n", text); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Text_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8bcb79ef5d849e6a76df41e2c3add1e 3 | timeCreated: 1503230200 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Variables_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for generating c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | namespace UBlockly 22 | { 23 | public partial class CSharpGenerator 24 | { 25 | [CodeGenerator(BlockType = "variables_get")] 26 | private CodeStruct Variables_Get(Block block) 27 | { 28 | string code = CSharp.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 29 | return new CodeStruct(code, CSharp.ORDER_ATOMIC); 30 | } 31 | 32 | [CodeGenerator(BlockType = "variables_set")] 33 | private string Variables_Set(Block block) 34 | { 35 | string varName = CSharp.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 36 | string arg = CSharp.Generator.ValueToCode(block, "VALUE", CSharp.ORDER_NONE, "0"); 37 | return varName + " = " + arg + ";\n"; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Generators/Variables_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63021a8a106340f98c6622d3ef835e47 3 | timeCreated: 1500893501 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bf766492ad24b6ab45847a47549e5da 3 | timeCreated: 1503319403 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Coroutine_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for interpreting c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | 22 | using System.Collections; 23 | using UnityEngine; 24 | 25 | namespace UBlockly 26 | { 27 | [CodeInterpreter(BlockType = "coroutine_wait_time")] 28 | public class Coroutine_WaitTime_Cmdtor : EnumeratorCmdtor 29 | { 30 | protected override IEnumerator Execute(Block block) 31 | { 32 | Debug.Log(">>>>>> block wait_time start: " + Time.time); 33 | 34 | CmdEnumerator ctor = CSharp.Interpreter.ValueReturn(block, "TIME", new DataStruct(0)); 35 | yield return ctor; 36 | DataStruct time = ctor.Data; 37 | 38 | string unit = block.GetFieldValue("UNIT"); 39 | switch (unit) 40 | { 41 | case "MILLISECOND": 42 | yield return new WaitForSeconds(time.NumberValue.Value * 0.001f); 43 | break; 44 | case "SECONDS": 45 | yield return new WaitForSeconds(time.NumberValue.Value); 46 | break; 47 | case "MINUTES": 48 | yield return new WaitForSeconds(time.NumberValue.Value * 60f); 49 | break; 50 | case "TOOHIGH": 51 | Debug.Log("wait time too long"); 52 | break; 53 | } 54 | Debug.Log(">>>>>> block wait_time end: " + Time.time); 55 | } 56 | } 57 | 58 | [CodeInterpreter(BlockType = "coroutine_wait_frame")] 59 | public class Coroutine_WaitFrame_Cmdtor : EnumeratorCmdtor 60 | { 61 | protected override IEnumerator Execute(Block block) 62 | { 63 | Debug.Log(">>>>>> block wait_frame start: " + Time.time); 64 | 65 | CmdEnumerator ctor = CSharp.Interpreter.ValueReturn(block, "TIME", new DataStruct(0)); 66 | yield return ctor; 67 | DataStruct time = ctor.Data; 68 | 69 | for (int i = 0; i < time.NumberValue.Value; i++) 70 | { 71 | yield return null; 72 | } 73 | 74 | Debug.Log(">>>>>> block wait_frame end: " + Time.time); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Coroutine_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33f54ed805584e698811aa132b14b000 3 | timeCreated: 1503463061 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/List_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f3e8921dbf444d4b050fd86d1e1396f 3 | timeCreated: 1503239546 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Logic_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d55d0723d7144d1b40e499ab44e2d17 3 | timeCreated: 1503239564 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Loop_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50542d6f2f20429388882b786114ef6c 3 | timeCreated: 1503239575 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Math_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7393278a57b45698b8d80e28007c388 3 | timeCreated: 1503239398 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Procedure_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for interpreting c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | 22 | using System.Collections; 23 | 24 | namespace UBlockly 25 | { 26 | [CodeInterpreter(BlockType = "procedures_callreturn")] 27 | public class Procedure_CallReturn_Cmdtor : EnumeratorCmdtor 28 | { 29 | protected override IEnumerator Execute(Block block) 30 | { 31 | string procedureName = block.GetFieldValue("NAME"); 32 | Block defBlock = block.Workspace.ProcedureDB.GetDefinitionBlock(procedureName); 33 | yield return CSharp.Interpreter.StatementRun(defBlock, "STACK"); 34 | 35 | CmdEnumerator ctor = CSharp.Interpreter.ValueReturn(defBlock, "RETURN"); 36 | yield return ctor; 37 | ReturnData(ctor.Data); 38 | } 39 | } 40 | 41 | [CodeInterpreter(BlockType = "procedures_callnoreturn")] 42 | public class Procedure_CallNoReturn_Cmdtor : EnumeratorCmdtor 43 | { 44 | protected override IEnumerator Execute(Block block) 45 | { 46 | string procedureName = block.GetFieldValue("NAME"); 47 | Block defBlock = block.Workspace.ProcedureDB.GetDefinitionBlock(procedureName); 48 | yield return CSharp.Interpreter.StatementRun(defBlock, "STACK"); 49 | } 50 | } 51 | 52 | [CodeInterpreter(BlockType = "procedures_ifreturn")] 53 | public class Proceudre_IfReturn_Cmdtor : EnumeratorCmdtor 54 | { 55 | protected override IEnumerator Execute(Block block) 56 | { 57 | yield return 0; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Procedure_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d1b42e3fee4e0e8996d32f0c86cf66 3 | timeCreated: 1508296076 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Text_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f715cff0d9da4eaea13bb59e2501c4ee 3 | timeCreated: 1503234092 -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Variables_CSharp.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for interpreting c# code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | 22 | using System.Collections; 23 | 24 | namespace UBlockly 25 | { 26 | [CodeInterpreter(BlockType = "variables_get")] 27 | public class Variables_Get_Cmdtor : ValueCmdtor 28 | { 29 | protected override DataStruct Execute(Block block) 30 | { 31 | string varName = CSharp.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 32 | return CSharp.VariableDatas.GetData(varName); 33 | } 34 | } 35 | 36 | [CodeInterpreter(BlockType = "variables_set")] 37 | public class Variables_Set_Cmdtor : EnumeratorCmdtor 38 | { 39 | protected override IEnumerator Execute(Block block) 40 | { 41 | string varName = CSharp.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 42 | CmdEnumerator ctor = CSharp.Interpreter.ValueReturn(block, "VALUE"); 43 | yield return ctor; 44 | CSharp.VariableDatas.SetData(varName, ctor.Data); 45 | } 46 | } 47 | 48 | [CodeInterpreter(BlockType = "variables_change")] 49 | public class Math_Change_Cmdtor : EnumeratorCmdtor 50 | { 51 | protected override IEnumerator Execute(Block block) 52 | { 53 | string tmp = block.GetFieldValue("VAR"); 54 | 55 | CmdEnumerator ctor = CSharp.Interpreter.ValueReturn(block, "DELTA", new DataStruct(0)); 56 | yield return ctor; 57 | DataStruct arg1 = ctor.Data; 58 | 59 | Number result = CSharp.VariableDatas.GetData(tmp).NumberValue + arg1.NumberValue; 60 | CSharp.VariableDatas.SetData(tmp, new DataStruct(result)); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/CSharp/Interpreters/Variables_CSharp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2982fd5c1c141ea98e4388f6338eedd 3 | timeCreated: 1501059331 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3203af6520840b19553868d9ea552bc 3 | timeCreated: 1503319029 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0144e496f3304c5fba994434f6fea99a 3 | timeCreated: 1503319051 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Colour_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b28edbe72464c5786913251e375557f 3 | timeCreated: 1503039126 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/List_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ac3b8bb383f4a46b83ca2cb02f0bac4 3 | timeCreated: 1503027097 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Logic_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae237a1d1c4d4366be7c3b04f1f9a51d 3 | timeCreated: 1502683329 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Loop_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b21eef1f7574120bed22688f48156d6 3 | timeCreated: 1502954268 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Math_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 147559e9a8a7421e9b8cbb4263011ed0 3 | timeCreated: 1502942443 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Procedure_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e0aa44ba0bc4f5f8b01c2d0ecd5b8ae 3 | timeCreated: 1503485792 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Text_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b897a383b7f45318d6322cb9f1205ba 3 | timeCreated: 1502695105 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Variables_Lua.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Functions for generating lua code for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | using System; 22 | 23 | namespace UBlockly 24 | { 25 | public partial class LuaGenerator 26 | { 27 | [CodeGenerator(BlockType = "variables_get")] 28 | private CodeStruct Variables_Get(Block block) 29 | { 30 | string code = Lua.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 31 | return new CodeStruct(code, Lua.ORDER_ATOMIC); 32 | } 33 | 34 | [CodeGenerator(BlockType = "variables_set")] 35 | private string Variables_Set(Block block) 36 | { 37 | var arg = Lua.Generator.ValueToCode(block, "VALUE", Lua.ORDER_NONE, "0"); 38 | var varName = Lua.VariableNames.GetName(block.GetFieldValue("VAR"), Define.VARIABLE_CATEGORY_NAME); 39 | return varName + " = " + arg + "\n"; 40 | } 41 | 42 | [CodeGenerator(BlockType = "variables_change")] 43 | private string Math_Change(Block block) 44 | { 45 | string varName = Lua.VariableNames.GetName(block.GetFieldValue("VAR"), Variables.NAME_TYPE); 46 | string arg = Lua.Generator.ValueToCode(block, "DELTA", Lua.ORDER_ADDITIVE, "0"); 47 | return string.Format("{0} = {0} + {1}\n", varName, arg); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Generators/Variables_Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89f761904b6e43bea272bf7f4fcd50e5 3 | timeCreated: 1500893597 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/Lua.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e4bc0e0083445f99fe5b4052d8ceeb1 3 | timeCreated: 1499913905 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaGenerator.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Helper functions for generating lua for blocks. 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | 22 | using System.Text; 23 | 24 | namespace UBlockly 25 | { 26 | public partial class LuaGenerator : Generator 27 | { 28 | public override CodeName Name 29 | { 30 | get { return CodeName.Lua; } 31 | } 32 | 33 | public LuaGenerator(Names variableNames) : base(variableNames) 34 | { 35 | } 36 | 37 | protected override void Init(Workspace workspace) 38 | { 39 | mFuncMap.Clear(); 40 | mVariableNames.Reset(); 41 | } 42 | 43 | protected override string Finish(string code) 44 | { 45 | StringBuilder sb = new StringBuilder(); 46 | foreach (var pair in mFuncMap.Values) 47 | sb.Append(pair.Value + "\n\n"); 48 | 49 | // Clean up temporary data. 50 | mFuncMap.Clear(); 51 | mVariableNames.Reset(); 52 | 53 | return sb + code; 54 | } 55 | 56 | protected override string Scrub(Block block, string code) 57 | { 58 | //todo: add comment 59 | return base.Scrub(block, code); 60 | } 61 | 62 | protected override string ScrubNakedValue(string code) 63 | { 64 | return "local _ = " + code + "\n"; 65 | } 66 | 67 | /// 68 | /// Encode a string as a properly escaped Lua string, complete with quotes. 69 | /// 70 | public string Quote(string text) 71 | { 72 | if (string.IsNullOrEmpty(text)) 73 | return "\'\'"; 74 | 75 | string newtext = text.Replace("\\", "\\\\").Replace("\n", "\\\n").Replace("'", "\\\'"); 76 | return "\'" + newtext + "\'"; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc6d6518c2f249d6a18bfc6defdf2ee7 3 | timeCreated: 1503319123 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaInterpreter.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright 2016 sophieml1989@gmail.com 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | ****************************************************************************/ 17 | 18 | #if ULUA_SUPPORT 19 | using LuaInterface; 20 | #endif 21 | 22 | namespace UBlockly 23 | { 24 | public partial class LuaInterpreter : Interpreter 25 | { 26 | public override CodeName Name 27 | { 28 | get { return CodeName.Lua; } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaInterpreter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 331e14a552574dac9e84656a90d59edf 3 | timeCreated: 1501057129 -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaRunner.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright 2021 sophieml1989@gmail.com 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | ****************************************************************************/ 17 | 18 | namespace UBlockly 19 | { 20 | public class LuaRunner : Runner 21 | { 22 | public override void Run(Workspace workspace) 23 | { 24 | string code = Lua.Generator.WorkspaceToCode(workspace); 25 | 26 | #if ULUA_SUPPORT 27 | LuaState lua = new LuaState(); 28 | lua.Start(); 29 | lua.DoString(code); 30 | lua = null; 31 | #endif 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Source/Script/CodeDB/Lua/LuaRunner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ed099b55f3545e4aead2bbeb982ccba 3 | timeCreated: 1623317814 -------------------------------------------------------------------------------- /Source/Script/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b91ce0df37b84f51aba760dd7466755c 3 | timeCreated: 1499856287 -------------------------------------------------------------------------------- /Source/Script/Core/Block.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04fbcbc18ee34aa3be5ed8bbff139e84 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Block/Block.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f03d0bb3f81546b1bb2ab71b55c306db 3 | timeCreated: 1499856901 -------------------------------------------------------------------------------- /Source/Script/Core/Block/BlockDefinition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0b82b319de040eda147bef9c988f58a 3 | timeCreated: 1502790630 -------------------------------------------------------------------------------- /Source/Script/Core/Block/BlockFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21cc3500561643c3974f6f4aae06a276 3 | timeCreated: 1502850431 -------------------------------------------------------------------------------- /Source/Script/Core/Blockly.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.Collections; 21 | using System.Collections.Generic; 22 | using Newtonsoft.Json.Linq; 23 | using UnityEngine; 24 | 25 | namespace UBlockly 26 | { 27 | public class Blockly 28 | { 29 | /// 30 | /// Initialize blockly model. Called very first when start blockly 31 | /// 32 | public static void Init() 33 | { 34 | BlockResMgr.Get().LoadI18n(); 35 | BlockResMgr.Get().LoadJsonDefinitions(); 36 | } 37 | 38 | /// 39 | /// clear all blocks loaded 40 | /// 41 | public static void Dispose() 42 | { 43 | BlockFactory.Instance.Clear(); 44 | I18n.Dispose(); 45 | } 46 | 47 | /// 48 | /// Define blocks from an array of JSON block definitions, as might be generated 49 | /// by the Blockly Developer Tools. 50 | /// 51 | /// 52 | [Obsolete("Only used for test case. Use BlockFactory.Instance.AddJsonDefinitions instead.")] 53 | public static void DefineBlocksWithJsonArray(JArray jsonArray) 54 | { 55 | BlockFactory.Instance.AddJsonDefinitions(jsonArray.ToString()); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Source/Script/Core/Blockly.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84c1a8b4acd33422a84278c24b4fbd3d 3 | timeCreated: 1499843516 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Script/Core/Code.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9141a526ccb047dfbf99a3b9d8a53382 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Code/CmdEnumerator.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System.Collections; 20 | 21 | namespace UBlockly 22 | { 23 | /// 24 | /// IEnumerator wrapper for running Cmdtor, block code 25 | /// 26 | public class CmdEnumerator : IEnumerator 27 | { 28 | private readonly Block mBlock; 29 | private readonly Cmdtor mCmdtor; 30 | private IEnumerator mItor; 31 | 32 | public Block Block 33 | { 34 | get { return mBlock; } 35 | } 36 | 37 | public Cmdtor Cmdtor 38 | { 39 | get { return mCmdtor; } 40 | } 41 | 42 | public DataStruct Data 43 | { 44 | get { return mCmdtor.Data; } 45 | } 46 | 47 | public CmdEnumerator(Block block) 48 | { 49 | mBlock = block; 50 | mCmdtor = CSharp.Interpreter.GetBlockInterpreter(block); 51 | mItor = mCmdtor.Run(block); 52 | } 53 | 54 | public bool MoveNext() 55 | { 56 | return mItor.MoveNext(); 57 | } 58 | 59 | public void Reset() 60 | { 61 | mItor = null; 62 | } 63 | 64 | public object Current 65 | { 66 | get { return mItor.Current; } 67 | } 68 | 69 | /// 70 | /// get the next block's running code, connected with previous - next connection 71 | /// 72 | public CmdEnumerator GetNextCmd() 73 | { 74 | var nextblock = mBlock.NextBlock; 75 | if (nextblock == null || nextblock.Disabled) 76 | return null; 77 | 78 | //parent loop was break or continue, move out. 79 | if (LoopCmdtor.SkipRunByControlFlow(nextblock)) 80 | return null; 81 | 82 | return new CmdEnumerator(nextblock); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Source/Script/Core/Code/CmdEnumerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f287faba07b41a291764940af3db8a5 3 | timeCreated: 1623208411 -------------------------------------------------------------------------------- /Source/Script/Core/Code/CmdRunner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8cd13be43e9414185dcd5a1dab9025d 3 | timeCreated: 1623160475 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Cmdtor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cc13d4d0bac4d5884cbc0881b50ec4a 3 | timeCreated: 1509443217 -------------------------------------------------------------------------------- /Source/Script/Core/Code/CodeDefs.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Collections for some definitions for code generations and interpreting 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | using System; 22 | using System.ComponentModel; 23 | 24 | namespace UBlockly 25 | { 26 | public enum CodeName 27 | { 28 | CSharp, 29 | Lua, 30 | } 31 | 32 | public enum ControlFlowType 33 | { 34 | None, 35 | Break, 36 | Continue, 37 | } 38 | 39 | [AttributeUsage(AttributeTargets.Method, Inherited = false)] 40 | public sealed class CodeGeneratorAttribute : Attribute 41 | { 42 | [Description("method for generating block code string")] 43 | public CodeGeneratorAttribute() {} 44 | public string BlockType { get; set; } 45 | } 46 | 47 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 48 | public sealed class CodeInterpreterAttribute : Attribute 49 | { 50 | [Description("method for interpreting to implement block code")] 51 | public CodeInterpreterAttribute() {} 52 | public string BlockType { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Source/Script/Core/Code/CodeDefs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3063580b013047029517cd5ca9d7a2e3 3 | timeCreated: 1501056007 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Datas.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad7e5d9c1b3747a1b091153d1f7b21e1 3 | timeCreated: 1503306429 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Generator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 806758f7db514f699790e02e653ab0de 3 | timeCreated: 1499856297 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Interpreter.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Utility functions for interpreting Blockly code to implementations 4 | 5 | Copyright 2016 sophieml1989@gmail.com 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | ****************************************************************************/ 20 | 21 | using System; 22 | using System.Collections.Generic; 23 | using System.Reflection; 24 | 25 | namespace UBlockly 26 | { 27 | public abstract class Interpreter 28 | { 29 | public abstract CodeName Name { get; } 30 | 31 | /// 32 | /// instances for interpreting code 33 | /// 34 | protected Dictionary mCmdMap; 35 | 36 | protected Interpreter() 37 | { 38 | InitCodeDB(); 39 | } 40 | 41 | /// 42 | /// collect all code generation/interpretion methods 43 | /// 44 | protected void InitCodeDB() 45 | { 46 | mCmdMap = new Dictionary(); 47 | Assembly assem = Assembly.GetAssembly(this.GetType()); 48 | foreach (Type type in assem.GetTypes()) 49 | { 50 | if (type.IsSubclassOf(typeof(Cmdtor))) 51 | { 52 | var attrs = type.GetCustomAttributes(typeof(CodeInterpreterAttribute), false); 53 | if (attrs.Length > 0) 54 | { 55 | mCmdMap[((CodeInterpreterAttribute) attrs[0]).BlockType] = Activator.CreateInstance(type) as Cmdtor; 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Source/Script/Core/Code/Interpreter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09ca3f53b93546cd9a01d9a89f486c11 3 | timeCreated: 1501056174 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Names.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e37b6db876b44387a98d7c69f5d50198 3 | timeCreated: 1499914268 -------------------------------------------------------------------------------- /Source/Script/Core/Code/Runner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b26d51eeeae948978a51e5c2a7bd0ab0 3 | timeCreated: 1623317046 -------------------------------------------------------------------------------- /Source/Script/Core/Connection.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3219e017e19c42c6b898daa90e962faf 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Connection/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f49c22831a64e4b9324bf35fd4cf143 3 | timeCreated: 1499923953 -------------------------------------------------------------------------------- /Source/Script/Core/Connection/ConnectionDB.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65e74311394d475387907698b63d9c0e 3 | timeCreated: 1500633328 -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d870a56415547579d73109e911ba81e 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine/Number.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df7956ad627b4eba8c12637cf4913c83 3 | timeCreated: 1502029789 -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine/ObservePattern.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System.Collections.Generic; 20 | 21 | namespace UBlockly 22 | { 23 | /// 24 | /// Customed Observable/Observer pattern 25 | /// 26 | public interface IObserver 27 | { 28 | void OnUpdated(object subject, TArgs args); 29 | } 30 | 31 | /// 32 | /// Customed Observable/Observer pattern 33 | /// 34 | public abstract class Observable 35 | { 36 | private readonly List> mObservers = new List>(); 37 | 38 | public void AddObserver(IObserver observer) 39 | { 40 | if (!mObservers.Contains(observer)) 41 | mObservers.Add(observer); 42 | } 43 | 44 | public void RemoveObserver(IObserver observer) 45 | { 46 | mObservers.Remove(observer); 47 | } 48 | 49 | public void FireUpdate(TArgs args) 50 | { 51 | for (int i = mObservers.Count - 1; i >= 0; i--) 52 | { 53 | mObservers[i].OnUpdated(this, args); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine/ObservePattern.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6062d1aeb798483a8883c9dfff8cab79 3 | timeCreated: 1505116233 -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine/Vector.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | namespace UBlockly 20 | { 21 | public struct Vector2 22 | { 23 | public T x; 24 | public T y; 25 | 26 | public Vector2(T x, T y) 27 | { 28 | this.x = x; 29 | this.y = y; 30 | } 31 | } 32 | 33 | public struct Vector3 34 | { 35 | public T x; 36 | public T y; 37 | public T z; 38 | 39 | public Vector3(T x, T y, T z) 40 | { 41 | this.x = x; 42 | this.y = y; 43 | this.z = z; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Script/Core/CustomDefine/Vector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 129a205267794fcab14274f46c955282 3 | timeCreated: 1502355534 -------------------------------------------------------------------------------- /Source/Script/Core/Define.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bb0a709d4c64965bc9efbcda0775860 3 | timeCreated: 1499923959 -------------------------------------------------------------------------------- /Source/Script/Core/Field.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d56f8bd05bb496e9079e9ad7f3f6725 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/Field.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 041abba516954937b9af6e04d52adbbb 3 | timeCreated: 1499924003 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldAngle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9f4296a9cd1473c8563257af403d948 3 | timeCreated: 1499924015 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldCheckbox.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using Newtonsoft.Json.Linq; 20 | 21 | namespace UBlockly 22 | { 23 | public sealed class FieldCheckbox : Field 24 | { 25 | [FieldCreator(FieldType = "field_checkbox")] 26 | private static FieldCheckbox CreateFromJson(JObject json) 27 | { 28 | string fieldName = json["name"].IsString() ? json["name"].ToString() : "FIELDNAME_DEFAULT"; 29 | return new FieldCheckbox(fieldName, json["checked"] != null && json["checked"].ToString().ToUpper() == "TRUE" ? "TRUE" : "FALSE"); 30 | } 31 | 32 | /// 33 | /// Class for a checkbox field. 34 | /// 35 | /// The unique name of the field, usually defined in json block. 36 | /// The initial state of the field ('TRUE' or 'FALSE'). 37 | public FieldCheckbox(string fieldName, string state) : base(fieldName) 38 | { 39 | this.SetValue(state); 40 | } 41 | 42 | public override void SetValue(string newValue) 43 | { 44 | newValue = newValue.ToUpper(); 45 | if (newValue != "TRUE" && newValue != "FALSE") 46 | return; 47 | 48 | base.SetValue(newValue); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldCheckbox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e50fa24d24cc4e74920b9b6e84bfceb0 3 | timeCreated: 1499924031 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldColour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0754b3aba8a44f07906d53a693c5df94 3 | timeCreated: 1499924044 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldDate.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.Globalization; 21 | using Newtonsoft.Json.Linq; 22 | 23 | namespace UBlockly 24 | { 25 | public sealed class FieldDate : Field 26 | { 27 | [FieldCreator(FieldType = "field_date")] 28 | private static FieldDate CreateFromJson(JObject json) 29 | { 30 | string fieldName = json["name"].IsString() ? json["name"].ToString() : "FIELDNAME_DEFAULT"; 31 | string dateStr = json.JsonDataContainsKey("date") ? json["date"].ToString() : null; 32 | return new FieldDate(fieldName, dateStr); 33 | } 34 | 35 | private const string DATE_FORMAT = "yyyy-MM-dd"; 36 | 37 | private DateTime mDate; 38 | public DateTime Date { get { return mDate; } } 39 | 40 | public FieldDate(string fieldName, string dateStr) : base(fieldName) 41 | { 42 | if (!DateTime.TryParseExact(dateStr, DATE_FORMAT, null, DateTimeStyles.None, out mDate)) 43 | throw new Exception( 44 | String.Format("FieldDate: can\'t parse date string {0} to DateTime. Correct format is {1}.", dateStr, DATE_FORMAT)); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldDate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a32eff7f6314cbf92bc32a5840495bc 3 | timeCreated: 1511925613 4 | MonoImporter: 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldDropdown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 803d8a9b4d33411a8bcbfda2b1ad57ec 3 | timeCreated: 1499924061 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c89e513d2b04299940521a237bcdda2 3 | timeCreated: 1503559246 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldImage.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using Newtonsoft.Json.Linq; 20 | 21 | namespace UBlockly 22 | { 23 | public sealed class FieldImage : Field 24 | { 25 | [FieldCreator(FieldType = "field_image")] 26 | private static FieldImage CreateFromJson(JObject json) 27 | { 28 | string fieldName = json["name"].IsString() ? json["name"].ToString() : "FIELDNAME_DEFAULT"; 29 | string imageSrc = json.JsonDataContainsKey("src") ? json["src"].ToString() : null; 30 | Number width = json.JsonDataContainsKey("width") ? new Number(json["width"].ToString()) : Number.NaN; 31 | Number height = json.JsonDataContainsKey("height") ? new Number(json["height"].ToString()) : Number.NaN; 32 | string alt = json.JsonDataContainsKey("alt") ? json["alt"].ToString() : null; 33 | return new FieldImage(fieldName, imageSrc, new Vector2((int) width.Value, (int) height.Value), alt); 34 | } 35 | 36 | private Vector2 mSize; 37 | public Vector2 Size { get { return mSize; } } 38 | 39 | public FieldImage(string fieldName, string imageSrc, Vector2 imageSize, string optAlt = null) : base(fieldName) 40 | { 41 | this.mText = !string.IsNullOrEmpty(optAlt) ? optAlt : ""; 42 | if (string.IsNullOrEmpty(imageSrc)) 43 | imageSrc = "fieldimage_default"; 44 | this.SetValue(imageSrc); 45 | 46 | mSize = imageSize; 47 | if (mSize.x <= 0) mSize.x = Define.FIELD_IMAGE_WIDTH_DEFAULT; 48 | if (mSize.y <= 0) mSize.y = Define.FIELD_IMAGE_HEIGHT_DEFAULT; 49 | 50 | IsImage = true; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49027fc67bad4b2ca94870202de3f507 3 | timeCreated: 1511923035 4 | MonoImporter: 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldLabel.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using Newtonsoft.Json.Linq; 20 | using UnityEngine; 21 | 22 | namespace UBlockly 23 | { 24 | public sealed class FieldLabel : Field 25 | { 26 | [FieldCreator(FieldType = "field_label")] 27 | private static FieldLabel CreateFromJson(JObject json) 28 | { 29 | string fieldName = json["name"].IsString() ? json["name"].ToString() : "FIELDNAME_DEFAULT"; 30 | var text = json["text"].IsString() ? Utils.ReplaceMessageReferences(json["text"].ToString()) : ""; 31 | return new FieldLabel(fieldName, text); 32 | } 33 | 34 | /// 35 | /// Class for a non-editable field. 36 | /// 37 | /// The unique name of the field, usually defined in json block. 38 | /// The initial content of the field 39 | public FieldLabel(string fieldName, string text) : base(fieldName) 40 | { 41 | this.SetValue(text); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldLabel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7542fa51fa5043babf58a643de3c44d0 3 | timeCreated: 1499924076 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldNumber.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a629f4c499f64f0eb1048faec56311bd 3 | timeCreated: 1499924091 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldTextInput.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using Newtonsoft.Json.Linq; 20 | 21 | namespace UBlockly 22 | { 23 | public class FieldTextInput : Field 24 | { 25 | [FieldCreator(FieldType = "field_input")] 26 | private static FieldTextInput CreateFromJson(JObject json) 27 | { 28 | string fieldName = json["name"].IsString() ? json["name"].ToString() : "FIELDNAME_DEFAULT"; 29 | var text = json["text"].IsString() ? Utils.ReplaceMessageReferences(json["text"].ToString()) : ""; 30 | return new FieldTextInput(fieldName, text); 31 | } 32 | 33 | /// 34 | /// Empty constructor for inheritance use 35 | /// 36 | protected FieldTextInput(string fieldName) : base(fieldName) {} 37 | 38 | /// 39 | /// Class for an editable text field. 40 | /// 41 | /// The unique name of the field, usually defined in json block. 42 | /// The default text in the field 43 | public FieldTextInput(string fieldName, string text) : base(fieldName) 44 | { 45 | this.SetValue(text); 46 | } 47 | 48 | public override void SetValue(string newValue) 49 | { 50 | if (string.IsNullOrEmpty(newValue)) 51 | return; 52 | 53 | if (SourceBlock != null) 54 | { 55 | string validated = CallValidator(newValue); 56 | if (validated != null) 57 | newValue = validated; 58 | } 59 | 60 | base.SetValue(newValue); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldTextInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52b442e2e02440229e4af26c839ab781 3 | timeCreated: 1499924103 -------------------------------------------------------------------------------- /Source/Script/Core/Field/FieldVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b35ab14b6e6467fbaa405b4f6b0c630 3 | timeCreated: 1499924129 -------------------------------------------------------------------------------- /Source/Script/Core/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe053127496a4b73bbdc0a82d5584d20 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Input/Input.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1c3879770ff40a59a6921cae899f12a 3 | timeCreated: 1499924249 -------------------------------------------------------------------------------- /Source/Script/Core/Input/InputFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97d0c87247b5456a9dd66d53c5c2b99b 3 | timeCreated: 1503559082 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b99116a4f7a1468aba711fcc0aa3fe25 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1f50c07deeb4e7b8a8b1772977b23b2 3 | timeCreated: 1499924259 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/MutatorFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f388c86c59494dbc8571dc97f50e5f7f 3 | timeCreated: 1503544715 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bed00657f2343d98b8c0af4dcab4500 3 | timeCreated: 1504495987 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators/DropdownOptionsMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 527d8e4446844f6fbd2c80ca8b16184a 3 | timeCreated: 1510125280 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators/IfElseMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b95aa7964b92419db99804bf64a169f9 3 | timeCreated: 1503546905 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators/IndexAtMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3edaea9da46e4036b029be7d000494c4 3 | timeCreated: 1504664944 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators/ItemListMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4b7eb50e9ad4ce89b94f8e8a2dfa4e8 3 | timeCreated: 1504495787 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/Mutators/MathIsDivisibleByMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fd2315c25874cdc98a292b42b93ba89 3 | timeCreated: 1504523683 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9f016ce1cfa4ed0925460d78136e1d9 3 | timeCreated: 1504496006 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators/Procedure.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e1e6177db0f4ee09baaedc07ea8b5fc 3 | timeCreated: 1499924281 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators/ProcedureCallMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6cd533a8be24ea681253e6e697931c6 3 | timeCreated: 1503650571 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators/ProcedureDB.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98a65929e85c4f2e9f349bb8b85e53de 3 | timeCreated: 1503633736 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators/ProcedureDefinitionMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4018b531e824acaba1938893575478d 3 | timeCreated: 1503650595 -------------------------------------------------------------------------------- /Source/Script/Core/Mutator/ProcedureMutators/ProcedureMutator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46b2dd44fdb74889bc82c45652dc56fe 3 | timeCreated: 1503631451 -------------------------------------------------------------------------------- /Source/Script/Core/Utils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba4243cc6ad2483bb323a0bd6628fed9 3 | timeCreated: 1499924326 -------------------------------------------------------------------------------- /Source/Script/Core/Variable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d17198b9941c4b3d9ef3c1d966e906bf 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Core/Variable/VariableMap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2affedc43e64471a954d76e1972e42f6 3 | timeCreated: 1499924331 -------------------------------------------------------------------------------- /Source/Script/Core/Variable/VariableModel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f70825d314734254afcafb7ab2a2af57 3 | timeCreated: 1499924336 -------------------------------------------------------------------------------- /Source/Script/Core/Variable/Variables.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00b7d5a747f34ecc9726bbeca60a981b 3 | timeCreated: 1501594341 -------------------------------------------------------------------------------- /Source/Script/Core/Workspace.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d3e31bd0f954630a5b65bb0c43f3dca 3 | timeCreated: 1499857161 -------------------------------------------------------------------------------- /Source/Script/Core/Xml.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a861bdf177e9410996f2ad3c01a9210a 3 | timeCreated: 1499924411 -------------------------------------------------------------------------------- /Source/Script/I18n.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c6914a1cbca49fba15368f86eb2e989 3 | timeCreated: 1501048772 -------------------------------------------------------------------------------- /Source/Script/I18n/I18n.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using Newtonsoft.Json.Linq; 22 | 23 | namespace UBlockly 24 | { 25 | public class I18n 26 | { 27 | public const string EN = "en"; 28 | public const string CN = "cn"; 29 | 30 | private static Dictionary mMsg = null; 31 | 32 | public static string Get(string key) 33 | { 34 | if (mMsg == null) 35 | BlockResMgr.Get().LoadI18n(); 36 | 37 | string value; 38 | if (mMsg.TryGetValue(key, out value)) 39 | return value; 40 | 41 | throw new Exception("I18n file doesn't contain translation for key: " + key); 42 | } 43 | 44 | public static void Add(string key, string value) 45 | { 46 | if (mMsg == null) 47 | BlockResMgr.Get().LoadI18n(); 48 | 49 | mMsg[key] = value; 50 | } 51 | 52 | public static bool Contains(string key) 53 | { 54 | if (mMsg == null) 55 | BlockResMgr.Get().LoadI18n(); 56 | 57 | return mMsg.ContainsKey(key); 58 | } 59 | 60 | public static void AddI18nFile(string text) 61 | { 62 | if (mMsg == null) 63 | mMsg = new Dictionary(); 64 | 65 | JObject jobj = JObject.Parse(text); 66 | foreach (KeyValuePair pair in jobj) 67 | { 68 | mMsg[pair.Key] = pair.Value.ToString(); 69 | } 70 | } 71 | 72 | public static void Dispose() 73 | { 74 | if (mMsg != null) 75 | mMsg.Clear(); 76 | mMsg = null; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Source/Script/I18n/I18n.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9143e9205b24a988bba31743ca9ed06 3 | timeCreated: 1501048781 -------------------------------------------------------------------------------- /Source/Script/I18n/MsgDefine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d9aa43074f24be0843fd3338869ec5d 3 | timeCreated: 1501398830 -------------------------------------------------------------------------------- /Source/Script/Res.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dee3a0f0e8c94890a7925bbf180e2fa9 3 | timeCreated: 1510045591 -------------------------------------------------------------------------------- /Source/Script/Res/BlockResMgr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d25e0c2162fdf4072833530d6c74a579 3 | timeCreated: 1505203538 4 | -------------------------------------------------------------------------------- /Source/Script/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9cb213982974461085bf4e95f3ed141 3 | folderAsset: yes 4 | timeCreated: 1500642855 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0211a1e882414c7198f7680f33cecc3 3 | folderAsset: yes 4 | timeCreated: 1500642806 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Code.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 738a132ab13641318088e1d157e5b5fc 3 | timeCreated: 1501144464 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Code/GeneratorTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace UBlockly.Test 4 | { 5 | public class GeneratorTest 6 | { 7 | [Test] 8 | public void TestPrefix() 9 | { 10 | var generator = new CSharpGenerator(null); 11 | Assert.AreEqual("", generator.PrefixLines("", ""), "Prefix nothing."); 12 | Assert.AreEqual("@Hello", generator.PrefixLines("Hello", "@"), "Prefix a word"); 13 | Assert.AreEqual("12Hello\n", generator.PrefixLines("Hello\n", "12"), "Prefix one line"); 14 | Assert.AreEqual("***Hello\n***World\n", generator.PrefixLines("Hello\nWorld\n", "***"), "Prefix two lines"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Code/GeneratorTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 497561a26a9c4ca6b6afb891e9672239 3 | timeCreated: 1502551665 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Connection.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9698da7c0ec345f7874831fdebd9be54 3 | timeCreated: 1502361345 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Connection/ConnectionDBTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed2ff05e3b4d4c4484091521058defe6 3 | timeCreated: 1502423338 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Connection/ConnectionTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1f4b1360f7d441f9a05c41355c041f8 3 | timeCreated: 1502361353 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5867606fb37c49ecb0d20ef72d5c1ed8 3 | timeCreated: 1502012708 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field/FieldAngleTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace UBlockly.Test 4 | { 5 | public class FieldAngleTest 6 | { 7 | [Test] 8 | public void TestFieldAngleConstructor() 9 | { 10 | Assert.AreEqual(new FieldAngle(null).GetValue(), "0"); 11 | Assert.AreEqual(new FieldAngle(null, "").GetValue(), "0"); 12 | Assert.AreEqual(new FieldAngle(null, new Number(1)).GetValue(), "1"); 13 | Assert.AreEqual(new FieldAngle(null, new Number(1.5f)).GetValue(), "1.5"); 14 | Assert.AreEqual(new FieldAngle(null, "2").GetValue(), "2"); 15 | Assert.AreEqual(new FieldAngle(null, "2.5").GetValue(), "2.5"); 16 | Assert.AreEqual(new FieldAngle(null, "bad").GetValue(), "0"); 17 | Assert.AreEqual(new FieldAngle(null, new Number()).GetValue(), "0"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field/FieldAngleTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa4cf0ec787f43b9996cbdec5e03aaa8 3 | timeCreated: 1502179697 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field/FieldNumberTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace UBlockly.Test 4 | { 5 | public class FieldNumberTest 6 | { 7 | [Test] 8 | public void TestFieldNumberConstructor() 9 | { 10 | var field = new FieldNumber(null); 11 | Assert.AreEqual("0", field.GetValue()); 12 | 13 | //numeric values 14 | field = new FieldNumber(null, new Number(1), Number.NaN, Number.NaN); 15 | Assert.AreEqual(field.GetValue(), "1"); 16 | field = new FieldNumber(null, new Number(1.5f), Number.NaN, Number.NaN); 17 | Assert.AreEqual(field.GetValue(), "1.5"); 18 | 19 | //string values 20 | field = new FieldNumber(null, "2"); 21 | Assert.AreEqual(field.GetValue(), "2"); 22 | field = new FieldNumber(null, "2.5"); 23 | Assert.AreEqual(field.GetValue(), "2.5"); 24 | 25 | field = new FieldNumber(null, new Number(0), new Number(-128), new Number(127)); 26 | Assert.AreEqual(field.GetValue(), "0"); 27 | Assert.AreEqual(field.Min.Value, -128); 28 | Assert.AreEqual(field.Max.Value, 127); 29 | 30 | field = new FieldNumber(null, "bad"); 31 | Assert.AreEqual(field.GetValue(), "0"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field/FieldNumberTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa1148b0070d40499239099471b137c1 3 | timeCreated: 1502032935 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/Field/FieldVariableTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cec6e0281e7444279d117bad61b6d88a 3 | timeCreated: 1502012727 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/InputTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9798e115e2bd4620ab675393fe388f20 3 | timeCreated: 1501588752 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/JsonTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afe11f846e6f545d2be3d5fcb69b06e8 3 | timeCreated: 1501038439 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/TestHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using NUnit.Framework; 5 | 6 | namespace UBlockly.Test 7 | { 8 | /// 9 | /// TODO:rename 2 BlocklyTestHelper 10 | /// 11 | public static class TestHelper 12 | { 13 | /// 14 | /// Check that two arrays have the same content. 15 | /// 16 | public static void IsEqualArrays(T[] array1, T[] array2) 17 | { 18 | Assert.AreEqual(array1.Length, array2.Length); 19 | for (int i = 0; i < array1.Length; i++) 20 | { 21 | Assert.AreEqual(array1[i], array2[i]); 22 | } 23 | } 24 | 25 | /// 26 | /// Check that two list have the same content. 27 | /// 28 | public static void IsEqualList(List list1, List list2) 29 | { 30 | Assert.AreEqual(list1.Count, list2.Count); 31 | for (int i = 0; i < list1.Count; i++) 32 | { 33 | Assert.AreEqual(list1[i], list2[i]); 34 | } 35 | } 36 | 37 | /// 38 | /// Check if a variable with the given values exists. 39 | /// 40 | /// {Blockly.Workspace|Blockly.VariableMap} 41 | public static void CheckVariableValues(object container, string name, string type, string id) 42 | { 43 | VariableMap variableMap = container as VariableMap; 44 | if (variableMap == null) 45 | { 46 | Workspace workspace = container as Workspace; 47 | if (workspace != null) 48 | variableMap = workspace.VariableMap; 49 | } 50 | 51 | if (variableMap == null) 52 | throw new Exception("calls TestHelper.CheckVariableValues, argument container must be Worspace or VariableMap"); 53 | 54 | VariableModel variable = variableMap.GetVariableById(id); 55 | Assert.NotNull(variable); 56 | Assert.AreEqual(name, variable.Name); 57 | Assert.AreEqual(type, variable.Type); 58 | Assert.AreEqual(id, variable.ID); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/TestHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a7a46d700fd44e29d4c0ecc3a25969b 3 | timeCreated: 1501558731 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/UtilsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec8cb51297df945ed9483f3a2b66bd02 3 | timeCreated: 1501037654 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/VariableTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00b01cfa9286403aa5a48d19ac3e6667 3 | timeCreated: 1501498653 -------------------------------------------------------------------------------- /Source/Script/Test/Editor/WorkspaceTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 835b2402d89c24890ab5fc57381d6166 3 | timeCreated: 1500642808 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Script/Test/Editor/XmlTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23742c129ede478fae4e59c64944a087 3 | timeCreated: 1502003607 -------------------------------------------------------------------------------- /Source/Script/UGUIView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b091d273c144acdbe4dbae04d94ec82 3 | timeCreated: 1504686614 -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlockStatusView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89e09c7ba04c4325ae86f921f3762654 3 | timeCreated: 1509604168 -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlockViewBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4127921e217f4b7db8228972fae71286 3 | timeCreated: 1504854350 -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlockViewFactory.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using UnityEngine; 23 | 24 | namespace UBlockly.UGUI 25 | { 26 | /// 27 | /// factory to create block view 28 | /// developers can change this to static class and customnly load prefabs from Assetbundles or Resources. 29 | /// 30 | public static class BlockViewFactory 31 | { 32 | public static BlockView CreateView(Block block) 33 | { 34 | BlockView blockView; 35 | 36 | GameObject blockPrefab = BlockResMgr.Get().LoadBlockViewPrefab(block.Type); 37 | if (blockPrefab != null) 38 | { 39 | // has been builded beforehand 40 | GameObject blockObj = GameObject.Instantiate(blockPrefab); 41 | blockObj.name = blockPrefab.name; 42 | 43 | blockView = blockObj.GetComponent(); 44 | blockView.BindModel(block); 45 | 46 | // rebuild inputs for mutation blocks 47 | if (block.Mutator != null) 48 | BlockViewBuilder.BuildInputViews(block, blockView); 49 | 50 | blockView.BuildLayout(); 51 | } 52 | else 53 | { 54 | blockPrefab = BlockViewBuilder.BuildBlockView(block); 55 | 56 | blockView = blockPrefab.GetComponent(); 57 | blockView.BindModel(block); 58 | 59 | // BlockViewBuilder.BuildBlockView will do both "BuildInputViews" and "BuildLayout" 60 | } 61 | 62 | blockView.ChangeBgColor(BlocklyUI.WorkspaceView.Toolbox.GetColorOfBlockView(blockView)); 63 | 64 | return blockView; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlockViewFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0e0001f50884aa9a337584488120ac0 3 | timeCreated: 1505203538 -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlockViewSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8f9cfbe84d04eb5961fba167ecbbb02 3 | timeCreated: 1504860252 -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlocklyUI.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using System; 21 | using UnityEngine; 22 | using Object = UnityEngine.Object; 23 | 24 | namespace UBlockly.UGUI 25 | { 26 | public static class BlocklyUI 27 | { 28 | public static WorkspaceView WorkspaceView; 29 | public static Canvas UICanvas; 30 | 31 | public static void NewWorkspace() 32 | { 33 | if (WorkspaceView != null) 34 | throw new Exception("BlocklyUI.NewWorkspace- there is already a workspace"); 35 | 36 | Workspace workspace = new Workspace(new Workspace.WorkspaceOptions()); 37 | WorkspaceView = Object.FindObjectOfType(); 38 | WorkspaceView.BindModel(workspace); 39 | 40 | UICanvas = WorkspaceView.GetComponentInParent(); 41 | } 42 | 43 | public static void DestroyWorkspace() 44 | { 45 | if (WorkspaceView == null) 46 | return; 47 | 48 | WorkspaceView.Dispose(); 49 | if (WorkspaceView.gameObject != null) 50 | GameObject.Destroy(WorkspaceView.gameObject); 51 | WorkspaceView = null; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/BlocklyUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b88ee262a4c4e1ab60fbdd8784d95bd 3 | timeCreated: 1505283405 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fdabd37340c41dca21b31e508c83cdf 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/BaseDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using UnityEngine; 21 | using UnityEngine.EventSystems; 22 | using UnityEngine.UI; 23 | 24 | namespace UBlockly.UGUI 25 | { 26 | public abstract class BaseDialog : MonoBehaviour, IPointerClickHandler 27 | { 28 | [SerializeField] private Button m_ButtonOK; 29 | 30 | protected Block mBlock; 31 | public Block Block { get { return mBlock; } } 32 | 33 | private event Action mOnCloseEvent; 34 | 35 | /// 36 | /// Intialization called after gameobject created 37 | /// 38 | public void Init() 39 | { 40 | OnInit(); 41 | 42 | m_ButtonOK.onClick.AddListener(() => 43 | { 44 | if (mOnCloseEvent != null) 45 | { 46 | mOnCloseEvent.Invoke(); 47 | mOnCloseEvent = null; 48 | } 49 | 50 | GameObject.Destroy(this.gameObject); 51 | }); 52 | 53 | } 54 | 55 | /// 56 | /// Intialization called after gameobject created 57 | /// 58 | public void Init(Block block) 59 | { 60 | mBlock = block; 61 | Init(); 62 | } 63 | 64 | /// 65 | /// Add listeners for destroying the dialog 66 | /// 67 | public void AddCloseEvent(Action onClose) 68 | { 69 | mOnCloseEvent += onClose; 70 | } 71 | 72 | public void OnPointerClick(PointerEventData eventData) 73 | { 74 | if (eventData.rawPointerPress == gameObject) 75 | GameObject.Destroy(this.gameObject); 76 | } 77 | 78 | protected virtual void OnInit(){} 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/BaseDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fcb7a6902af4a93825a75b2a06f300c 3 | timeCreated: 1508138059 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/DialogFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be98f89b956e4e7c9f46a78d81af1358 3 | timeCreated: 1508648362 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d50229f9eb8644c5ab7dabe424c43b15 3 | timeCreated: 1510798965 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldAngleDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c986323a75a04bc4995ee8e1b9c994f4 3 | timeCreated: 1510799033 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldColorDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityEngine.UI; 23 | 24 | namespace UBlockly.UGUI 25 | { 26 | public class FieldColorDialog : FieldDialog 27 | { 28 | [SerializeField] private GameObject m_ColorPrefab; 29 | 30 | private FieldColour mFieldColor 31 | { 32 | get { return mField as FieldColour; } 33 | } 34 | 35 | protected List mToggleColors; 36 | 37 | protected override void OnInit() 38 | { 39 | m_ColorPrefab.GetComponent().group.allowSwitchOff = true; 40 | 41 | mToggleColors = new List(); 42 | string[] colorOptions = mFieldColor.GetOptions(); 43 | for (int i = 0; i < colorOptions.Length; i++) 44 | { 45 | Color color; 46 | if (!ColorUtility.TryParseHtmlString(colorOptions[i], out color)) 47 | throw new Exception("TryParseHtmlString failed. Please make sure the right color hex string is given."); 48 | 49 | GameObject colorObj = GameObject.Instantiate(m_ColorPrefab, m_ColorPrefab.transform.parent, false); 50 | colorObj.SetActive(true); 51 | Toggle colorToggle = colorObj.GetComponent(); 52 | colorToggle.targetGraphic.color = color; 53 | colorToggle.isOn = colorOptions[i].ToLower().Equals(mFieldColor.GetValue().ToLower()); 54 | 55 | mToggleColors.Add(colorToggle); 56 | } 57 | 58 | AddCloseEvent(() => 59 | { 60 | for (int i = 0; i < mToggleColors.Count; i++) 61 | { 62 | if (mToggleColors[i].isOn) 63 | { 64 | string colorHex = ColorUtility.ToHtmlStringRGB(mToggleColors[i].targetGraphic.color); 65 | mFieldColor.SetValue("#" + colorHex); 66 | break; 67 | } 68 | } 69 | }); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldColorDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfdd18a75ae64127abf85c6e83ff7f08 3 | timeCreated: 1510799044 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | namespace UBlockly.UGUI 20 | { 21 | public abstract class FieldDialog : BaseDialog 22 | { 23 | protected Field mField; 24 | public Field Field { get { return mField; } } 25 | 26 | public void Init(Field field) 27 | { 28 | mField = field; 29 | mBlock = field.SourceBlock; 30 | Init(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe1c69755574adc8947c36f455ad29f 3 | timeCreated: 1510801101 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldDropdownDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System.Collections.Generic; 20 | using UnityEngine; 21 | using UnityEngine.UI; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | public class FieldDropdownDialog : FieldDialog 26 | { 27 | [SerializeField] private GameObject m_ItemPrefab; 28 | 29 | protected FieldDropdownMenu[] mOptions; 30 | protected List mToggleItems; 31 | 32 | private FieldDropdown mFieldDropdown 33 | { 34 | get { return mField as FieldDropdown; } 35 | } 36 | 37 | protected override void OnInit() 38 | { 39 | m_ItemPrefab.GetComponent().group.allowSwitchOff = true; 40 | 41 | mOptions = mFieldDropdown.GetOptions(); 42 | mToggleItems = new List(); 43 | for (int i = 0; i < mOptions.Length; i++) 44 | { 45 | FieldDropdownMenu option = mOptions[i]; 46 | GameObject itemObj = GameObject.Instantiate(m_ItemPrefab, m_ItemPrefab.transform.parent, false); 47 | itemObj.SetActive(true); 48 | 49 | itemObj.GetComponentInChildren().text = option.Text; 50 | Toggle toggle = itemObj.GetComponent(); 51 | if (!string.IsNullOrEmpty(mFieldDropdown.GetText())) 52 | toggle.isOn = mFieldDropdown.GetText().Equals(option.Text); 53 | else toggle.isOn = false; 54 | 55 | mToggleItems.Add(toggle); 56 | } 57 | 58 | AddCloseEvent(() => 59 | { 60 | for (int i = 0; i < mToggleItems.Count; i++) 61 | { 62 | if (mToggleItems[i].isOn) 63 | { 64 | mFieldDropdown.OnItemSelected(i); 65 | break; 66 | } 67 | } 68 | }); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldDropdownDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c9632316180408082650a5783c94576 3 | timeCreated: 1510799001 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/FieldDialogs/FieldNumberDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dd68bb91781475ba88dd597849ca11b 3 | timeCreated: 1510799022 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MsgDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | using UnityEngine.UI; 21 | 22 | namespace UBlockly.UGUI 23 | { 24 | public class MsgDialog : BaseDialog 25 | { 26 | [SerializeField] private Text m_MsgText; 27 | 28 | public void SetMsg(string msg) 29 | { 30 | m_MsgText.text = msg; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MsgDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bd58087a13a4a68958b829bd08e79bb 3 | timeCreated: 1615794637 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d905f2e531e04a96885978173c95847e 3 | timeCreated: 1508142485 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs/IfElseMutatorDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using UnityEngine; 21 | using UnityEngine.UI; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | public class IfElseMutatorDialog : BaseDialog 26 | { 27 | [SerializeField] private Slider m_ElseIfCountSlider; 28 | [SerializeField] private Text m_ElseIfCountText; 29 | [SerializeField] private Text m_ElseIfCountTitle; 30 | [SerializeField] private Toggle m_HasElseToggle; 31 | [SerializeField] private Text m_HasElseTitle; 32 | 33 | private IfElseMutator mIfElseMutator 34 | { 35 | get { return mBlock.Mutator as IfElseMutator; } 36 | } 37 | 38 | protected override void OnInit() 39 | { 40 | m_ElseIfCountSlider.value = mIfElseMutator.ElseIfCount; 41 | m_ElseIfCountText.text = mIfElseMutator.ElseIfCount.ToString(); 42 | m_HasElseToggle.isOn = mIfElseMutator.HasElse; 43 | 44 | m_ElseIfCountTitle.text = I18n.Get(MsgDefine.CONTROLS_IF_MSG_ELSEIF); 45 | m_HasElseTitle.text = I18n.Get(MsgDefine.CONTROLS_IF_MSG_ELSE); 46 | 47 | AddCloseEvent(() => 48 | { 49 | mIfElseMutator.Mutate((int) m_ElseIfCountSlider.value, m_HasElseToggle.isOn); 50 | }); 51 | 52 | m_ElseIfCountSlider.onValueChanged.AddListener((value) => 53 | { 54 | m_ElseIfCountText.text = ((int) value).ToString(); 55 | }); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs/IfElseMutatorDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df1813bf93054fa081f54d9f4242905d 3 | timeCreated: 1508142524 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs/ItemListMutatorDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | using UnityEngine.UI; 21 | 22 | namespace UBlockly.UGUI 23 | { 24 | public class ItemListMutatorDialog : BaseDialog 25 | { 26 | [SerializeField] private Slider m_ItemCountSlider; 27 | [SerializeField] private Text m_ItemCountText; 28 | [SerializeField] private Text m_ItemCountTitle; 29 | 30 | private ItemListMutator mItemListMutator 31 | { 32 | get { return mBlock.Mutator as ItemListMutator; } 33 | } 34 | 35 | protected override void OnInit() 36 | { 37 | m_ItemCountSlider.value = mItemListMutator.ItemCount; 38 | m_ItemCountText.text = mItemListMutator.ItemCount.ToString(); 39 | 40 | m_ItemCountTitle.text = I18n.Get(MsgDefine.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM); 41 | 42 | AddCloseEvent(() => 43 | { 44 | mItemListMutator.Mutate((int) m_ItemCountSlider.value); 45 | }); 46 | 47 | m_ItemCountSlider.onValueChanged.AddListener((value) => 48 | { 49 | m_ItemCountText.text = ((int) value).ToString(); 50 | }); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs/ItemListMutatorDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 434ea6240330466c875c058871c14a6e 3 | timeCreated: 1508234475 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/MutatorDialogs/ProcedureDefinitionMutatorDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f229f48c184948cea2ad64997af6c66f 3 | timeCreated: 1508297496 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/VariableNameDialog.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | using UnityEngine.UI; 21 | 22 | namespace UBlockly.UGUI 23 | { 24 | public class VariableNameDialog : BaseDialog 25 | { 26 | [SerializeField] private Text m_InputLabel; 27 | [SerializeField] private InputField m_Input; 28 | 29 | private bool mIsRename = false; 30 | 31 | private string mOldVarName; 32 | public void Rename(string varName) 33 | { 34 | mOldVarName = varName; 35 | mIsRename = true; 36 | m_InputLabel.text = I18n.Get(MsgDefine.RENAME_VARIABLE); 37 | } 38 | 39 | protected override void OnInit() 40 | { 41 | m_InputLabel.text = I18n.Get(MsgDefine.NEW_VARIABLE); 42 | 43 | AddCloseEvent(() => 44 | { 45 | if (mIsRename) 46 | BlocklyUI.WorkspaceView.Workspace.RenameVariable(mOldVarName, m_Input.text); 47 | else 48 | BlocklyUI.WorkspaceView.Workspace.CreateVariable(m_Input.text); 49 | }); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Dialogs/VariableNameDialog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7419838625174b31b7aa2339d8dc3a15 3 | timeCreated: 1508649459 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e2c018b32294340b49a4f7e0fe8d543 3 | folderAsset: yes 4 | timeCreated: 1504855550 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Editor/BlockViewEditor.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.IO; 21 | using System.Linq; 22 | using UBlockly; 23 | using UnityEditor; 24 | using UnityEngine; 25 | 26 | namespace UBlockly.UGUI 27 | { 28 | public class BlockViewEditor 29 | { 30 | [MenuItem("UBlockly/Build Block Prefabs")] 31 | static void BuildBlockPrefabs() 32 | { 33 | Blockly.Dispose(); 34 | Blockly.Init(); 35 | Workspace workspace = new Workspace(); 36 | 37 | var blocks = BlockFactory.Instance.GetAllBlockDefinitions().Keys; 38 | // var blocks = BlockFactory.Instance.GetAllBlockDefinitions().Keys.Where(s => s.Equals("lists_create_with")); 39 | 40 | if (!Directory.Exists(BlockResMgr.Get().BlockViewPrefabPath)) 41 | Directory.CreateDirectory(BlockResMgr.Get().BlockViewPrefabPath); 42 | 43 | BlockResMgr.Get().ClearBlockViewPrefabs(); 44 | 45 | try 46 | { 47 | int index = 0; 48 | int count = blocks.Count(); 49 | foreach (string name in blocks) 50 | { 51 | EditorUtility.DisplayProgressBar(null, "Building block prefab: " + name, index / (float) count); 52 | 53 | Block block = workspace.NewBlock(name); 54 | GameObject obj = BlockViewBuilder.BuildBlockView(block); 55 | 56 | string path = BlockResMgr.Get().BlockViewPrefabPath + obj.name + ".prefab"; 57 | GameObject prefab = PrefabUtility.CreatePrefab(path, obj, ReplacePrefabOptions.Default); 58 | BlockResMgr.Get().AddBlockViewPrefab(prefab); 59 | 60 | GameObject.DestroyImmediate(obj); 61 | 62 | index++; 63 | } 64 | } 65 | finally 66 | { 67 | AssetDatabase.SaveAssets(); 68 | Resources.UnloadUnusedAssets(); 69 | 70 | EditorUtility.ClearProgressBar(); 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Editor/BlockViewEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99cfdf0ca45f4722865c9d05559911cb 3 | timeCreated: 1504855536 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2371963aebff48f88383662fec31518e 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/CustomDropdown.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using UnityEngine.Events; 21 | using UnityEngine.EventSystems; 22 | using UnityEngine.UI; 23 | 24 | namespace UBlockly.UGUI 25 | { 26 | public class CustomDropdown : Dropdown 27 | { 28 | private UnityEvent mShowOptionsEvent = null; 29 | 30 | public void AddShowOptionsListener(UnityAction listener) 31 | { 32 | if (mShowOptionsEvent == null) 33 | mShowOptionsEvent = new Button.ButtonClickedEvent(); 34 | mShowOptionsEvent.AddListener(listener); 35 | } 36 | 37 | public void RemoveShowOptionsListener(UnityAction listener) 38 | { 39 | if (mShowOptionsEvent != null) 40 | mShowOptionsEvent.RemoveListener(listener); 41 | } 42 | 43 | public override void OnPointerClick(PointerEventData eventData) 44 | { 45 | base.OnPointerClick(eventData); 46 | if (mShowOptionsEvent != null) 47 | mShowOptionsEvent.Invoke(); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/CustomDropdown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a8498cd29a14f7faeef8432230a7cd6 3 | timeCreated: 1510127163 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/CustomMeshImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51af42e528234be281fc650f6b2427ed 3 | timeCreated: 1505817750 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/CustomMeshImageDefine.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | 21 | namespace UBlockly.UGUI 22 | { 23 | [RequireComponent(typeof(CustomMeshImage))] 24 | public class CustomMeshImageDefine : MonoBehaviour 25 | { 26 | [SerializeField] private Vector4[] m_DrawDimensions; 27 | 28 | private void Awake() 29 | { 30 | GetComponent().SetDrawDimensions(m_DrawDimensions); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/CustomMeshImageDefine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbf6d38b92b647b99d23c2736fe42d9a 3 | timeCreated: 1511768195 4 | MonoImporter: 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/UGUIHelper.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | using UnityEngine.UI; 21 | 22 | namespace UBlockly.UGUI 23 | { 24 | public static class UGUIHelper 25 | { 26 | /// 27 | /// Calculate the width of UI text 28 | /// 29 | /// the UI.Text component where the text is put into 30 | /// The text for calculation 31 | public static int CalculateTextWidth(this Text textComponent, string text) 32 | { 33 | int width = 0; 34 | Font font = textComponent.font; 35 | int fontSize = textComponent.fontSize; 36 | font.RequestCharactersInTexture(text, fontSize, textComponent.fontStyle); 37 | CharacterInfo characterInfo; 38 | for (int i = 0; i < text.Length; i++) 39 | { 40 | font.GetCharacterInfo(text[i], out characterInfo, fontSize); 41 | width += characterInfo.advance; 42 | } 43 | return width; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/UGUIHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79eaf492e5934992b3053c0c89618ff7 3 | timeCreated: 1505100495 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Extensions/UIEventListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1e59bb2987e140cbbe795aa30bcd726 3 | timeCreated: 1510888805 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/PlayControlView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e6c5aa62a820495ca8487f816e228cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f8c74fdd05435bae5bed7ff000a167 3 | folderAsset: yes 4 | timeCreated: 1511958551 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox/BaseToolbox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abde0255432e4d35b3b594e140d4625d 3 | timeCreated: 1511959007 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox/ClassicToolbox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84d2b744c7f44acf8e1e88edcb8ecb6d 3 | timeCreated: 1511960913 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox/ScratchToolbox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f209f1c2996435587ce2a4bd7215c4e 3 | timeCreated: 1512031124 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox/ToolboxConfig.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | [Serializable] 26 | public class ToolboxConfig 27 | { 28 | public string Style; 29 | public List BlockCategoryList; 30 | 31 | public ToolboxBlockCategory GetBlockCategory(string categoryName) 32 | { 33 | var category = BlockCategoryList.Find(c => c.CategoryName.Equals(categoryName)); 34 | if (category == null) 35 | throw new Exception(string.Format("Can\'t find category configuration for \"{0}\" in Toolbox json configuration.", categoryName)); 36 | return category; 37 | } 38 | 39 | public static ToolboxConfig Load() 40 | { 41 | ToolboxConfig config = BlockResMgr.Get().LoadToolboxConfig(); 42 | foreach (var category in config.BlockCategoryList) 43 | { 44 | category.Init(); 45 | } 46 | return config; 47 | } 48 | } 49 | 50 | [Serializable] 51 | public class ToolboxBlockCategory 52 | { 53 | public string CategoryName; 54 | public string ColorHex; 55 | public string BlockTypePrefix; 56 | public List BlockList; 57 | 58 | [NonSerialized] private bool mInited = false; 59 | 60 | public Color Color { get; private set; } 61 | 62 | public void Init() 63 | { 64 | if (mInited) return; 65 | 66 | if (!string.IsNullOrEmpty(BlockTypePrefix)) 67 | { 68 | BlockList.AddRange(BlockFactory.Instance.GetBlockTypesOfPrefix(BlockTypePrefix)); 69 | } 70 | 71 | Color color; 72 | ColorUtility.TryParseHtmlString(ColorHex, out color); 73 | Color = color; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /Source/Script/UGUIView/Toolbox/ToolboxConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a812f951cdbe41c4994344562c31eb29 3 | timeCreated: 1511958613 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4b33be8a0ae44dd9a1f750da8761e22 3 | folderAsset: yes 4 | timeCreated: 1510672886 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/BaseView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f03d5f2fc69147d5b18f3ccb75b5af1f 3 | timeCreated: 1504971168 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/BlockView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8be41bf85e284605a61946f423faaca6 3 | timeCreated: 1504686646 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/ConnectionInputView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c491d59b11404c52a1753c814e46ed3f 3 | timeCreated: 1505018023 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/ConnectionView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d13612075c89422ea57276bc1edfab5b 3 | timeCreated: 1504835122 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/FieldView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c44882f11251416ea28dbd302e044373 3 | timeCreated: 1504838133 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9df7429526c44d399ec9dd756de57bc7 3 | timeCreated: 1504868695 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldButtonView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8336b4e64474f428a079fc4c5d03cb5 3 | timeCreated: 1510816497 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldCheckboxView.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | using UnityEngine; 20 | using UnityEngine.UI; 21 | 22 | namespace UBlockly.UGUI 23 | { 24 | public class FieldCheckboxView : FieldView 25 | { 26 | [SerializeField] protected Toggle m_Toggle; 27 | private float uiWidth; 28 | 29 | protected override void SetComponents() 30 | { 31 | if (m_Toggle == null) 32 | { 33 | m_Toggle = GetComponentInChildren(true); 34 | uiWidth = GetComponent().rect.width; 35 | } 36 | } 37 | 38 | protected override void OnBindModel() 39 | { 40 | m_Toggle.isOn = mField.GetValue() == "TRUE"; 41 | } 42 | 43 | protected override void OnUnBindModel() 44 | { 45 | } 46 | 47 | protected override void RegisterTouchEvent() 48 | { 49 | m_Toggle.onValueChanged.AddListener(isOn => 50 | { 51 | mField.SetValue(isOn ? "TRUE" : "FALSE"); 52 | }); 53 | } 54 | 55 | protected override void OnValueChanged(string newValue) 56 | { 57 | bool isOn = newValue == "TRUE"; 58 | if (m_Toggle.isOn != isOn) 59 | m_Toggle.isOn = isOn; 60 | } 61 | 62 | protected override Vector2 CalculateSize() 63 | { 64 | return new Vector2(uiWidth, BlockViewSettings.Get().ContentHeight); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldCheckboxView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dd91ee7ec4642abaaa931f0c2ef4c96 3 | timeCreated: 1599405361 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldColorView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 741b065847a04a18b2368204f38c06e7 3 | timeCreated: 1510819308 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldDropdownView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cd8d867565247d587f2fa3686795f3c 3 | timeCreated: 1504943672 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldImageView.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using UnityEngine; 21 | using UnityEngine.UI; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | public class FieldImageView : FieldView 26 | { 27 | [SerializeField] protected RawImage m_Image; 28 | 29 | private FieldImage mFieldImage 30 | { 31 | get { return mField as FieldImage; } 32 | } 33 | 34 | protected override void SetComponents() 35 | { 36 | if (m_Image == null) 37 | m_Image = GetComponentInChildren(); 38 | } 39 | 40 | protected override void OnBindModel() 41 | { 42 | m_Image.texture = BlockResMgr.Get().LoadTexture(mField.GetValue()); 43 | m_Image.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, mFieldImage.Size.x); 44 | m_Image.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, mFieldImage.Size.y); 45 | } 46 | 47 | protected override void OnUnBindModel() 48 | { 49 | BlockResMgr.Get().UnloadTexture(mField.GetValue()); 50 | } 51 | 52 | protected override void RegisterTouchEvent() 53 | { 54 | } 55 | 56 | protected override void OnValueChanged(string newValue) 57 | { 58 | } 59 | 60 | protected override Vector2 CalculateSize() 61 | { 62 | int width = mFieldImage.Size.x; 63 | //Debug.LogFormat(">>>>> CalculateSize-Image: width: {0}", width); 64 | return new Vector2(width, BlockViewSettings.Get().ContentHeight); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldImageView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cfba7b6f26b42c289f9b1b4f8db2a15 3 | timeCreated: 1511937550 4 | MonoImporter: 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldInputView.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using UnityEngine; 21 | using UnityEngine.UI; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | public class FieldInputView : FieldView 26 | { 27 | [SerializeField] protected InputField m_InputField; 28 | 29 | private FieldTextInput mFieldInput 30 | { 31 | get { return mField as FieldTextInput; } 32 | } 33 | 34 | private float mHorizontalMargin; 35 | 36 | protected override void SetComponents() 37 | { 38 | if (m_InputField == null) 39 | m_InputField = GetComponentInChildren(); 40 | 41 | mHorizontalMargin = m_InputField.textComponent.rectTransform.offsetMin.x - m_InputField.textComponent.rectTransform.offsetMax.x; 42 | } 43 | 44 | protected override void OnBindModel() 45 | { 46 | m_InputField.text = mField.GetValue(); 47 | } 48 | 49 | protected override void OnUnBindModel() 50 | { 51 | } 52 | 53 | protected override void RegisterTouchEvent() 54 | { 55 | m_InputField.onValueChanged.AddListener(newText => 56 | { 57 | mField.SetValue(newText); 58 | }); 59 | } 60 | 61 | protected override void OnValueChanged(string newValue) 62 | { 63 | if (!string.Equals(m_InputField.text, newValue)) 64 | m_InputField.text = newValue; 65 | UpdateLayout(XY); 66 | } 67 | 68 | protected override Vector2 CalculateSize() 69 | { 70 | float width = m_InputField.textComponent.CalculateTextWidth(m_InputField.text); 71 | width += mHorizontalMargin; 72 | 73 | //Debug.LogFormat(">>>>> CalculateSize-TextInput: text: {0}, width: {1}", m_InputField.text, width); 74 | return new Vector2(width, BlockViewSettings.Get().ContentHeight); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldInputView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 985ead8058e042daa9c8ffc76d561ee4 3 | timeCreated: 1504943643 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldLabelView.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright 2016 sophieml1989@gmail.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | ****************************************************************************/ 18 | 19 | 20 | using UnityEngine; 21 | using UnityEngine.UI; 22 | 23 | namespace UBlockly.UGUI 24 | { 25 | public class FieldLabelView : FieldView 26 | { 27 | [SerializeField] protected Text m_TextUI; 28 | 29 | protected override void SetComponents() 30 | { 31 | if (m_TextUI == null) 32 | m_TextUI = GetComponentInChildren(); 33 | } 34 | 35 | protected override void OnBindModel() 36 | { 37 | m_TextUI.text = mField.GetValue(); 38 | } 39 | 40 | protected override void OnUnBindModel() 41 | { 42 | } 43 | 44 | protected override void RegisterTouchEvent() 45 | { 46 | // no touch event on labels 47 | } 48 | 49 | protected override void OnValueChanged(string newValue) 50 | { 51 | if (!string.Equals(m_TextUI.text, newValue)) 52 | m_TextUI.text = newValue; 53 | UpdateLayout(XY); 54 | } 55 | 56 | protected override Vector2 CalculateSize() 57 | { 58 | int width = m_TextUI.CalculateTextWidth(m_TextUI.text); 59 | //Debug.LogFormat(">>>>> CalculateSize-Label: text: {0}, width: {1}", m_TextUI.text, width); 60 | return new Vector2(width, BlockViewSettings.Get().ContentHeight); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldLabelView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 787c777a040c443185f558baba2877c6 3 | timeCreated: 1504868707 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/Fields/FieldVariableView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f58df164710047a89453dd184a3468b4 3 | timeCreated: 1504953779 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/InputView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0432e058018498fabd6825fdeee8a36 3 | timeCreated: 1504768962 -------------------------------------------------------------------------------- /Source/Script/UGUIView/Views/LineGroupView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 132e649bd46f4628bc60eb5096ffa997 3 | timeCreated: 1505020297 -------------------------------------------------------------------------------- /Source/Script/UGUIView/WorkspaceView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40cbf6e3cafe4edb8d110cce9329b05b 3 | timeCreated: 1504691185 -------------------------------------------------------------------------------- /Source/Script/UGUIView/XmlView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9228f6dcc72b4494918a412ca63bf45a 3 | timeCreated: 1509004107 -------------------------------------------------------------------------------- /Source/UGUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dff42a5388bcb4a7aa29aa053cfc32d2 3 | folderAsset: yes 4 | timeCreated: 1504699799 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc1cfb388150e42d5bee1dada004167e 3 | folderAsset: yes 4 | timeCreated: 1504699946 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ec7b6f8c8a4b4de9810f1e01d472619 3 | folderAsset: yes 4 | timeCreated: 1504883256 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Block_root.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1adb66dc990b4a1dbd299062b2a0ec9 3 | timeCreated: 1508315449 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_next.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Block_root_next.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_next.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25fe0121888404310a147f0ceba6870e 3 | timeCreated: 1504882387 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_output.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Block_root_output.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_output.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 566cbf92ddc3f4c749c5a18a1b825d17 3 | timeCreated: 1504881458 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_prev.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Block_root_prev.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_prev.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b4c65dcecc2948a8bac3dc380741aec 3 | timeCreated: 1504882387 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_prev_next.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Block_root_prev_next.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Block_root_prev_next.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d18515e97282947c5bb1a575bc1d6c4b 3 | timeCreated: 1504882387 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_button.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_button.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_button.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4f98c4342c754b71b1d362026344a6c 3 | timeCreated: 1510816820 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_checkbox.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_checkbox.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_checkbox.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfca79776c81248ca98cbf64bccb16a8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_image.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_image.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_image.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2afd0454a388a4a11a897e5ac4d04cee 3 | timeCreated: 1511945345 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_input.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_input.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_input.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebce9f28eb312402f904656ea3c97104 3 | timeCreated: 1504888806 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_label.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_label.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_label.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f478b5a7e87f4481eb813d5d9be702b0 3 | timeCreated: 1504885951 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_variable.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Field_variable.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Field_variable.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddc51a3ac1c8f41ada1e5a5a4e835618 3 | timeCreated: 1510816709 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_statement.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Input_statement.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_statement.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8903eee196199498a93f94df2b375754 3 | timeCreated: 1505635440 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_value.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Input_value.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_value.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4bddd5386383f4174b9515861e0d9795 3 | timeCreated: 1504947950 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_value_slot.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BlockTemplates/Input_value_slot.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BlockTemplates/Input_value_slot.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54a08c68d4ce242939aefba6cdab0746 3 | timeCreated: 1504947950 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BtnCreateVar.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/BtnCreateVar.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/BtnCreateVar.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed0194cfa5aed47369bf2a9fc37038c6 3 | timeCreated: 1505548126 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/ConnectHighlight.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/ConnectHighlight.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/ConnectHighlight.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5033722b9d884932b0305692eb71801 3 | timeCreated: 1505568580 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1df78bf2165df459d92967b6186819dc 3 | folderAsset: yes 4 | timeCreated: 1508647695 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/Dialog_message.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/Dialog_message.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/Dialog_message.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5da45033f06ed41499ebc70ed69b4d41 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/Dialog_variable_name.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/Dialog_variable_name.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/Dialog_variable_name.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fee558f14cd3140b09a337b98d7d4bc3 3 | timeCreated: 1508648239 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90436ff4b517548cd9904a76a3ba9ede 3 | folderAsset: yes 4 | timeCreated: 1510797676 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_angle.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_angle.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_angle.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68d5f6bc04264406d8b99ef763b753d6 3 | timeCreated: 1508145448 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_color.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_color.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_color.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 112bb05fca88b4e6fbec63097a5b3d91 3 | timeCreated: 1508145448 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_dropdown.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_dropdown.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_dropdown.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70c883d37b9bb4399b7f2f55ba8de5a4 3 | timeCreated: 1508145448 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_number.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_number.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/FieldDialogs/Dialog_field_number.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06f0152adcb664067b8a4751865ed8e2 3 | timeCreated: 1508145448 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46c340d7ba70d4bb090f5dbfd33faec4 3 | folderAsset: yes 4 | timeCreated: 1508143059 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_ifelse.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_ifelse.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_ifelse.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d800445c59bfd49ae8d3ee24c36f26c3 3 | timeCreated: 1508145448 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_itemlist.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_itemlist.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_itemlist.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbe6a830a9c15491eb42457c49f16a18 3 | timeCreated: 1508234739 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_proceduredef.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_proceduredef.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Dialogs/MutatorDialogs/Dialog_mutator_proceduredef.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4d3a523aa9ab495a994965fc2e2c13f 3 | timeCreated: 1508234739 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/StatusLight.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/StatusLight.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/StatusLight.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5748e524f1f544e8a9ab7d8cfa71974d 3 | timeCreated: 1509600141 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Workspace.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Prefabs/Workspace.prefab -------------------------------------------------------------------------------- /Source/UGUI/Prefabs/Workspace.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30bdd5fddc725438796726c39f29cd83 3 | timeCreated: 1505200375 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Source/UGUI/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e3daa2177441490ca6b62fd7f3149c1 3 | folderAsset: yes 4 | timeCreated: 1504699936 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b46a5c3625941490c9e05d659b94cf12 3 | folderAsset: yes 4 | timeCreated: 1508982117 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/bg_block1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/bg_block1.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/bg_block2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/bg_block2.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/bg_common.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/bg_common.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/connect_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/connect_next.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/connect_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/connect_output.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/field_dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/field_dropdown.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/icon_mutator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/icon_mutator.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/img_checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/img_checkmark.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/img_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/img_cross.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/img_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/img_edit.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/img_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/img_highlight.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/img_statuslight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/img_statuslight.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/input_statement_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/input_statement_connection.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/input_value_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/input_value_connection.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Blocks/input_value_connection_slot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Blocks/input_value_connection_slot.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Panels.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d208b2cb36584a0d89ab05720ef49f3 3 | folderAsset: yes 4 | timeCreated: 1510907969 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Textures/Panels/Angle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9baff8129b0204340b33c16329419584 3 | folderAsset: yes 4 | timeCreated: 1510908019 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Textures/Panels/Angle/field_angle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Panels/Angle/field_angle.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Panels/Angle/img_anglepanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Panels/Angle/img_anglepanel.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ff8b98ebc553477f83adea4e5273954 3 | folderAsset: yes 4 | timeCreated: 1508982148 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_delete_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_delete_blue.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_delete_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_delete_red.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_load.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_pause.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_run.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_save.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_step.png -------------------------------------------------------------------------------- /Source/UGUI/Textures/Workspace/icon_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/Source/UGUI/Textures/Workspace/icon_stop.png -------------------------------------------------------------------------------- /UserData/I18n.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 592b9b73473924d5db7d7f3fbcddbe3f 3 | folderAsset: yes 4 | timeCreated: 1510492528 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UserData/I18n/en.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb2b240724f9d41aabcf2ca6e37be0b1 3 | timeCreated: 1510486494 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UserData/I18n/zh-hans.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd486eb2060838b439c5f2aa03af8a5d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UserData/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94b51bd1f7ff643ecbd9cc29445a7d2e 3 | folderAsset: yes 4 | timeCreated: 1510492528 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UserData/Resources/BlockResSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/UserData/Resources/BlockResSettings.asset -------------------------------------------------------------------------------- /UserData/Resources/BlockResSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 373f9d60aef394ec3bb4fcd63aee2665 3 | timeCreated: 1510052958 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UserData/Resources/BlockViewSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/UserData/Resources/BlockViewSettings.asset -------------------------------------------------------------------------------- /UserData/Resources/BlockViewSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 566c6a2b25a0d4084bac3c2aa0549998 3 | timeCreated: 1504860643 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UserData/Toolboxs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de8dbf3dbb33642b5aa138c9bde11d62 3 | folderAsset: yes 4 | timeCreated: 1512010281 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Configs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de41ec565e6f445c58f9d54d93805a27 3 | folderAsset: yes 4 | timeCreated: 1512030153 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Configs/toolbox_default.json: -------------------------------------------------------------------------------- 1 | { 2 | "Style": "classic", 3 | "BlockCategoryList": [ 4 | { 5 | "CategoryName": "VARIABLE", 6 | "ColorHex": "#8a9fc6", 7 | "BlockTypePrefix": "variables" 8 | }, 9 | { 10 | "CategoryName": "PROCEDURE", 11 | "ColorHex": "#a64c79", 12 | "BlockTypePrefix": "procedures" 13 | }, 14 | { 15 | "CategoryName": "LOGIC", 16 | "ColorHex": "#47574d", 17 | "BlockTypePrefix": "logic" 18 | }, 19 | { 20 | "CategoryName": "CONTROL", 21 | "ColorHex": "#669966", 22 | "BlockTypePrefix": "controls" 23 | }, 24 | { 25 | "CategoryName": "COROUTINE", 26 | "ColorHex": "#00a4e3", 27 | "BlockTypePrefix": "coroutine" 28 | }, 29 | { 30 | "CategoryName": "MATH", 31 | "ColorHex": "#4668a5", 32 | "BlockTypePrefix": "math" 33 | }, 34 | { 35 | "CategoryName": "TEXT", 36 | "ColorHex": "#f6546a", 37 | "BlockTypePrefix": "text" 38 | }, 39 | { 40 | "CategoryName": "LIST", 41 | "ColorHex": "#ff8b42", 42 | "BlockTypePrefix": "lists" 43 | }, 44 | { 45 | "CategoryName": "COLOR", 46 | "ColorHex": "#b42695", 47 | "BlockTypePrefix": "colour" 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Configs/toolbox_default.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c0bdd5df6d904a27af2a1b56125a6e0 3 | timeCreated: 1502599981 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d2d255a00175431a98b674aeab048d6 3 | folderAsset: yes 4 | timeCreated: 1512030121 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Prefabs/ClassicToolbox.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/UserData/Toolboxs/Prefabs/ClassicToolbox.prefab -------------------------------------------------------------------------------- /UserData/Toolboxs/Prefabs/ClassicToolbox.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: caa28148096aa4a09a6a57c243b46301 3 | timeCreated: 1512029717 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UserData/Toolboxs/Prefabs/ScratchToolbox.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imagicbell/ublockly/5f3b2c550ca79011567b081a5b8e98e06e7f9fdd/UserData/Toolboxs/Prefabs/ScratchToolbox.prefab -------------------------------------------------------------------------------- /UserData/Toolboxs/Prefabs/ScratchToolbox.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0162fa30706104ef6bb520f45d8ebbe4 3 | timeCreated: 1512030037 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | --------------------------------------------------------------------------------