├── .gitattributes ├── .gitignore ├── LICENSE ├── README.assets ├── screenshot-1.png ├── screenshot-2.png └── screenshot.png ├── README.md ├── 工程 ├── TsProject │ ├── .editorconfig │ ├── .eslintrc.json │ ├── .gitignore │ ├── .prettierignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ │ ├── core │ │ │ ├── event.ts │ │ │ └── object.ts │ │ ├── game │ │ │ ├── base │ │ │ │ └── game-module.ts │ │ │ ├── config.ts │ │ │ ├── game-loop.ts │ │ │ ├── game.ts │ │ │ ├── modules │ │ │ │ ├── Inventory.ts │ │ │ │ ├── action-manager.ts │ │ │ │ ├── audio-manager.ts │ │ │ │ ├── profile-manager.ts │ │ │ │ ├── story-manager.ts │ │ │ │ ├── task-manager.ts │ │ │ │ ├── time-manager.ts │ │ │ │ ├── timer │ │ │ │ │ ├── delay-queue.ts │ │ │ │ │ ├── timer-task-list.ts │ │ │ │ │ └── timing-wheel.ts │ │ │ │ └── ui-manage.ts │ │ │ ├── plugins │ │ │ │ ├── action.ts │ │ │ │ ├── attack.ts │ │ │ │ ├── attr.ts │ │ │ │ ├── buff.ts │ │ │ │ ├── unit-view.ts │ │ │ │ └── unit.ts │ │ │ ├── scenes │ │ │ │ └── fight-scene.ts │ │ │ └── ui │ │ │ │ ├── UIMain.ts │ │ │ │ ├── UIPageGame.ts │ │ │ │ ├── UIPageHome.ts │ │ │ │ └── dialogs │ │ │ │ ├── UIDialog.ts │ │ │ │ ├── UIDialogConfirm.ts │ │ │ │ ├── UIDialogSetting.ts │ │ │ │ ├── UIDialogStoryBox.ts │ │ │ │ ├── UIDialogStoryChoices.ts │ │ │ │ └── UIDialogToast.ts │ │ ├── gen │ │ │ ├── .gitkeep │ │ │ └── ui │ │ │ │ └── main │ │ │ │ ├── UIRaw_Button.ts │ │ │ │ ├── UIRaw_DialogConfirm.ts │ │ │ │ ├── UIRaw_DialogSetting.ts │ │ │ │ ├── UIRaw_DialogStoryBox.ts │ │ │ │ ├── UIRaw_DialogStoryChoices.ts │ │ │ │ ├── UIRaw_DialogToast.ts │ │ │ │ ├── UIRaw_IconButton.ts │ │ │ │ ├── UIRaw_IconLabel.ts │ │ │ │ ├── UIRaw_Main.ts │ │ │ │ ├── UIRaw_PageGame.ts │ │ │ │ ├── UIRaw_PageHome.ts │ │ │ │ ├── UIRaw_StoryChoicesItem.ts │ │ │ │ ├── UIRaw_Toast.ts │ │ │ │ ├── UIRaw__Frame.ts │ │ │ │ ├── fairygui.ts │ │ │ │ └── mainBinder.ts │ │ ├── index.ts │ │ ├── types │ │ │ └── example.d.ts │ │ └── utils │ │ │ ├── array.ts │ │ │ └── puerts-source-map-support.ts │ ├── tools │ │ ├── _debounce.js │ │ ├── build-config.js │ │ ├── build.js │ │ └── watch.js │ ├── tsconfig.json │ └── tsconfig.module.json ├── UIProject │ ├── .gitignore │ ├── assets │ │ └── main │ │ │ ├── Main.xml │ │ │ ├── components │ │ │ ├── Button.xml │ │ │ ├── IconButton.xml │ │ │ ├── IconLabel.xml │ │ │ ├── StoryChoicesItem.xml │ │ │ ├── Toast.xml │ │ │ └── TransparentButton.xml │ │ │ ├── dialogs │ │ │ ├── DialogConfirm.xml │ │ │ ├── DialogSetting.xml │ │ │ ├── DialogStoryBox.xml │ │ │ ├── DialogStoryChoices.xml │ │ │ ├── DialogToast.xml │ │ │ └── _Frame.xml │ │ │ ├── package.xml │ │ │ ├── pages │ │ │ ├── PageGame.xml │ │ │ └── PageHome.xml │ │ │ └── res │ │ │ └── common │ │ │ ├── btn_bg.png │ │ │ ├── btn_close.png │ │ │ ├── btn_fun.png │ │ │ ├── dialog_bg01.png │ │ │ ├── icon_cash.png │ │ │ ├── icon_repute.png │ │ │ ├── icon_setting.png │ │ │ └── img_bg.png │ ├── plugins │ │ └── fairygui-puerts-unity │ │ │ ├── CodeWriter.d.ts │ │ │ ├── GenCode_TS.js │ │ │ ├── GenCode_TS.ts │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── editor.d.ts │ │ │ ├── main.js │ │ │ ├── main.ts │ │ │ ├── package.json │ │ │ ├── puerts.d.ts │ │ │ └── tsconfig.json │ ├── settings │ │ ├── Adaptation.json │ │ ├── Common.json │ │ ├── CustomProperties.json │ │ ├── Publish.json │ │ └── i18n.json │ └── uiproject.fairy ├── UnityProject │ ├── .gitignore │ ├── Assets │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── PuertsConfig.cs │ │ │ └── PuertsConfig.cs.meta │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── .gitignore │ │ │ ├── puerts.bundle.meta │ │ │ ├── puerts.bundle │ │ │ │ ├── Contents.meta │ │ │ │ └── Contents │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── Info.plist.meta │ │ │ ├── x86.meta │ │ │ └── x86_64.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ └── FairyGUI-dist.meta │ │ ├── Scenes.meta │ │ ├── Scenes │ │ │ ├── Main.unity │ │ │ └── Main.unity.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── Anchor.cs │ │ │ ├── Anchor.cs.meta │ │ │ ├── CSharpUtils.cs │ │ │ ├── CSharpUtils.cs.meta │ │ │ ├── Main.cs │ │ │ └── Main.cs.meta │ │ ├── Vendors.meta │ │ └── Vendors │ │ │ ├── FairyGUI.meta │ │ │ ├── FairyGUI │ │ │ ├── Extensions.meta │ │ │ ├── Extensions │ │ │ │ ├── DragonBones.meta │ │ │ │ ├── DragonBones │ │ │ │ │ ├── DragonBonesLoader.cs │ │ │ │ │ └── DragonBonesLoader.cs.meta │ │ │ │ ├── Spine.meta │ │ │ │ ├── Spine │ │ │ │ │ ├── SpineLoader.cs │ │ │ │ │ └── SpineLoader.cs.meta │ │ │ │ ├── TextMeshPro.meta │ │ │ │ └── TextMeshPro │ │ │ │ │ ├── Shaders.meta │ │ │ │ │ ├── Shaders │ │ │ │ │ ├── FairyGUI-TMP.shader │ │ │ │ │ └── FairyGUI-TMP.shader.meta │ │ │ │ │ ├── TMPFont.cs │ │ │ │ │ ├── TMPFont.cs.meta │ │ │ │ │ ├── TMPTextFormat.cs │ │ │ │ │ └── TMPTextFormat.cs.meta │ │ │ ├── LICENSE │ │ │ ├── LICENSE.meta │ │ │ ├── README_zh-CN.md │ │ │ ├── README_zh-CN.md.meta │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── Shaders.meta │ │ │ │ └── Shaders │ │ │ │ │ ├── AddOn.meta │ │ │ │ │ ├── AddOn │ │ │ │ │ ├── FairyGUI-BlurFilter.shader │ │ │ │ │ └── FairyGUI-BlurFilter.shader.meta │ │ │ │ │ ├── FairyGUI-BMFont.shader │ │ │ │ │ ├── FairyGUI-BMFont.shader.meta │ │ │ │ │ ├── FairyGUI-Image.shader │ │ │ │ │ ├── FairyGUI-Image.shader.meta │ │ │ │ │ ├── FairyGUI-Text.shader │ │ │ │ │ └── FairyGUI-Text.shader.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── Core.meta │ │ │ │ ├── Core │ │ │ │ │ ├── BlendMode.cs │ │ │ │ │ ├── BlendMode.cs.meta │ │ │ │ │ ├── CaptureCamera.cs │ │ │ │ │ ├── CaptureCamera.cs.meta │ │ │ │ │ ├── Container.cs │ │ │ │ │ ├── Container.cs.meta │ │ │ │ │ ├── DisplayObject.cs │ │ │ │ │ ├── DisplayObject.cs.meta │ │ │ │ │ ├── GoWrapper.cs │ │ │ │ │ ├── GoWrapper.cs.meta │ │ │ │ │ ├── HitTest.meta │ │ │ │ │ ├── HitTest │ │ │ │ │ │ ├── ColliderHitTest.cs │ │ │ │ │ │ ├── ColliderHitTest.cs.meta │ │ │ │ │ │ ├── HitTestContext.cs │ │ │ │ │ │ ├── HitTestContext.cs.meta │ │ │ │ │ │ ├── IHitTest.cs │ │ │ │ │ │ ├── IHitTest.cs.meta │ │ │ │ │ │ ├── MeshColliderHitTest.cs │ │ │ │ │ │ ├── MeshColliderHitTest.cs.meta │ │ │ │ │ │ ├── PixelHitTest.cs │ │ │ │ │ │ ├── PixelHitTest.cs.meta │ │ │ │ │ │ ├── RectHitTest.cs │ │ │ │ │ │ ├── RectHitTest.cs.meta │ │ │ │ │ │ ├── ShapeHitTest.cs │ │ │ │ │ │ └── ShapeHitTest.cs.meta │ │ │ │ │ ├── Image.cs │ │ │ │ │ ├── Image.cs.meta │ │ │ │ │ ├── MaterialManager.cs │ │ │ │ │ ├── MaterialManager.cs.meta │ │ │ │ │ ├── Mesh.meta │ │ │ │ │ ├── Mesh │ │ │ │ │ │ ├── CompositeMesh.cs │ │ │ │ │ │ ├── CompositeMesh.cs.meta │ │ │ │ │ │ ├── EllipseMesh.cs │ │ │ │ │ │ ├── EllipseMesh.cs.meta │ │ │ │ │ │ ├── FillMesh.cs │ │ │ │ │ │ ├── FillMesh.cs.meta │ │ │ │ │ │ ├── LineMesh.cs │ │ │ │ │ │ ├── LineMesh.cs.meta │ │ │ │ │ │ ├── MeshFactory.cs │ │ │ │ │ │ ├── MeshFactory.cs.meta │ │ │ │ │ │ ├── PlaneMesh.cs │ │ │ │ │ │ ├── PlaneMesh.cs.meta │ │ │ │ │ │ ├── PolygonMesh.cs │ │ │ │ │ │ ├── PolygonMesh.cs.meta │ │ │ │ │ │ ├── RectMesh.cs │ │ │ │ │ │ ├── RectMesh.cs.meta │ │ │ │ │ │ ├── RegularPolygonMesh.cs │ │ │ │ │ │ ├── RegularPolygonMesh.cs.meta │ │ │ │ │ │ ├── RoundedRectMesh.cs │ │ │ │ │ │ ├── RoundedRectMesh.cs.meta │ │ │ │ │ │ ├── StraightLineMesh.cs │ │ │ │ │ │ ├── StraightLineMesh.cs.meta │ │ │ │ │ │ ├── VertexBuffer.cs │ │ │ │ │ │ └── VertexBuffer.cs.meta │ │ │ │ │ ├── MovieClip.cs │ │ │ │ │ ├── MovieClip.cs.meta │ │ │ │ │ ├── NAudioClip.cs │ │ │ │ │ ├── NAudioClip.cs.meta │ │ │ │ │ ├── NGraphics.cs │ │ │ │ │ ├── NGraphics.cs.meta │ │ │ │ │ ├── NTexture.cs │ │ │ │ │ ├── NTexture.cs.meta │ │ │ │ │ ├── ShaderConfig.cs │ │ │ │ │ ├── ShaderConfig.cs.meta │ │ │ │ │ ├── Shape.cs │ │ │ │ │ ├── Shape.cs.meta │ │ │ │ │ ├── Stage.cs │ │ │ │ │ ├── Stage.cs.meta │ │ │ │ │ ├── StageCamera.cs │ │ │ │ │ ├── StageCamera.cs.meta │ │ │ │ │ ├── StageEngine.cs │ │ │ │ │ ├── StageEngine.cs.meta │ │ │ │ │ ├── Stats.cs │ │ │ │ │ ├── Stats.cs.meta │ │ │ │ │ ├── Text.meta │ │ │ │ │ ├── Text │ │ │ │ │ │ ├── BaseFont.cs │ │ │ │ │ │ ├── BaseFont.cs.meta │ │ │ │ │ │ ├── BitmapFont.cs │ │ │ │ │ │ ├── BitmapFont.cs.meta │ │ │ │ │ │ ├── DynamicFont.cs │ │ │ │ │ │ ├── DynamicFont.cs.meta │ │ │ │ │ │ ├── Emoji.cs │ │ │ │ │ │ ├── Emoji.cs.meta │ │ │ │ │ │ ├── FontManager.cs │ │ │ │ │ │ ├── FontManager.cs.meta │ │ │ │ │ │ ├── IKeyboard.cs │ │ │ │ │ │ ├── IKeyboard.cs.meta │ │ │ │ │ │ ├── InputTextField.cs │ │ │ │ │ │ ├── InputTextField.cs.meta │ │ │ │ │ │ ├── RTLSupport.cs │ │ │ │ │ │ ├── RTLSupport.cs.meta │ │ │ │ │ │ ├── RichTextField.cs │ │ │ │ │ │ ├── RichTextField.cs.meta │ │ │ │ │ │ ├── SelectionShape.cs │ │ │ │ │ │ ├── SelectionShape.cs.meta │ │ │ │ │ │ ├── TextField.cs │ │ │ │ │ │ ├── TextField.cs.meta │ │ │ │ │ │ ├── TextFormat.cs │ │ │ │ │ │ ├── TextFormat.cs.meta │ │ │ │ │ │ ├── TouchScreenKeyboard.cs │ │ │ │ │ │ ├── TouchScreenKeyboard.cs.meta │ │ │ │ │ │ ├── TypingEffect.cs │ │ │ │ │ │ └── TypingEffect.cs.meta │ │ │ │ │ ├── UpdateContext.cs │ │ │ │ │ └── UpdateContext.cs.meta │ │ │ │ ├── Editor.meta │ │ │ │ ├── Editor │ │ │ │ │ ├── DisplayObjectEditor.cs │ │ │ │ │ ├── DisplayObjectEditor.cs.meta │ │ │ │ │ ├── EditorToolSet.cs │ │ │ │ │ ├── EditorToolSet.cs.meta │ │ │ │ │ ├── PackagesWindow.cs │ │ │ │ │ ├── PackagesWindow.cs.meta │ │ │ │ │ ├── StageCameraEditor.cs │ │ │ │ │ ├── StageCameraEditor.cs.meta │ │ │ │ │ ├── UIConfigEditor.cs │ │ │ │ │ ├── UIConfigEditor.cs.meta │ │ │ │ │ ├── UIContentScalerEditor.cs │ │ │ │ │ ├── UIContentScalerEditor.cs.meta │ │ │ │ │ ├── UIPainterEditor.cs │ │ │ │ │ ├── UIPainterEditor.cs.meta │ │ │ │ │ ├── UIPanelEditor.cs │ │ │ │ │ └── UIPanelEditor.cs.meta │ │ │ │ ├── Event.meta │ │ │ │ ├── Event │ │ │ │ │ ├── EventBridge.cs │ │ │ │ │ ├── EventBridge.cs.meta │ │ │ │ │ ├── EventContext.cs │ │ │ │ │ ├── EventContext.cs.meta │ │ │ │ │ ├── EventDispatcher.cs │ │ │ │ │ ├── EventDispatcher.cs.meta │ │ │ │ │ ├── EventListener.cs │ │ │ │ │ ├── EventListener.cs.meta │ │ │ │ │ ├── IEventDispatcher.cs │ │ │ │ │ ├── IEventDispatcher.cs.meta │ │ │ │ │ ├── InputEvent.cs │ │ │ │ │ └── InputEvent.cs.meta │ │ │ │ ├── Filter.meta │ │ │ │ ├── Filter │ │ │ │ │ ├── BlurFilter.cs │ │ │ │ │ ├── BlurFilter.cs.meta │ │ │ │ │ ├── ColorFilter.cs │ │ │ │ │ ├── ColorFilter.cs.meta │ │ │ │ │ ├── IFilter.cs │ │ │ │ │ └── IFilter.cs.meta │ │ │ │ ├── Gesture.meta │ │ │ │ ├── Gesture │ │ │ │ │ ├── LongPressGesture.cs │ │ │ │ │ ├── LongPressGesture.cs.meta │ │ │ │ │ ├── PinchGesture.cs │ │ │ │ │ ├── PinchGesture.cs.meta │ │ │ │ │ ├── RotationGesture.cs │ │ │ │ │ ├── RotationGesture.cs.meta │ │ │ │ │ ├── SwipeGesture.cs │ │ │ │ │ └── SwipeGesture.cs.meta │ │ │ │ ├── Tween.meta │ │ │ │ ├── Tween │ │ │ │ │ ├── EaseManager.cs │ │ │ │ │ ├── EaseManager.cs.meta │ │ │ │ │ ├── EaseType.cs │ │ │ │ │ ├── EaseType.cs.meta │ │ │ │ │ ├── GPath.cs │ │ │ │ │ ├── GPath.cs.meta │ │ │ │ │ ├── GTween.cs │ │ │ │ │ ├── GTween.cs.meta │ │ │ │ │ ├── GTweener.cs │ │ │ │ │ ├── GTweener.cs.meta │ │ │ │ │ ├── TweenManager.cs │ │ │ │ │ ├── TweenManager.cs.meta │ │ │ │ │ ├── TweenPropType.cs │ │ │ │ │ ├── TweenPropType.cs.meta │ │ │ │ │ ├── TweenValue.cs │ │ │ │ │ └── TweenValue.cs.meta │ │ │ │ ├── UI.meta │ │ │ │ ├── UI │ │ │ │ │ ├── Action.meta │ │ │ │ │ ├── Action │ │ │ │ │ │ ├── ChangePageAction.cs │ │ │ │ │ │ ├── ChangePageAction.cs.meta │ │ │ │ │ │ ├── ControllerAction.cs │ │ │ │ │ │ ├── ControllerAction.cs.meta │ │ │ │ │ │ ├── PlayTransitionAction.cs │ │ │ │ │ │ └── PlayTransitionAction.cs.meta │ │ │ │ │ ├── AsyncCreationHelper.cs │ │ │ │ │ ├── AsyncCreationHelper.cs.meta │ │ │ │ │ ├── Controller.cs │ │ │ │ │ ├── Controller.cs.meta │ │ │ │ │ ├── DragDropManager.cs │ │ │ │ │ ├── DragDropManager.cs.meta │ │ │ │ │ ├── EMRenderSupport.cs │ │ │ │ │ ├── EMRenderSupport.cs.meta │ │ │ │ │ ├── FieldTypes.cs │ │ │ │ │ ├── FieldTypes.cs.meta │ │ │ │ │ ├── GButton.cs │ │ │ │ │ ├── GButton.cs.meta │ │ │ │ │ ├── GComboBox.cs │ │ │ │ │ ├── GComboBox.cs.meta │ │ │ │ │ ├── GComponent.cs │ │ │ │ │ ├── GComponent.cs.meta │ │ │ │ │ ├── GGraph.cs │ │ │ │ │ ├── GGraph.cs.meta │ │ │ │ │ ├── GGroup.cs │ │ │ │ │ ├── GGroup.cs.meta │ │ │ │ │ ├── GImage.cs │ │ │ │ │ ├── GImage.cs.meta │ │ │ │ │ ├── GLabel.cs │ │ │ │ │ ├── GLabel.cs.meta │ │ │ │ │ ├── GList.cs │ │ │ │ │ ├── GList.cs.meta │ │ │ │ │ ├── GLoader.cs │ │ │ │ │ ├── GLoader.cs.meta │ │ │ │ │ ├── GLoader3D.cs │ │ │ │ │ ├── GLoader3D.cs.meta │ │ │ │ │ ├── GMovieClip.cs │ │ │ │ │ ├── GMovieClip.cs.meta │ │ │ │ │ ├── GObject.cs │ │ │ │ │ ├── GObject.cs.meta │ │ │ │ │ ├── GObjectPool.cs │ │ │ │ │ ├── GObjectPool.cs.meta │ │ │ │ │ ├── GProgressBar.cs │ │ │ │ │ ├── GProgressBar.cs.meta │ │ │ │ │ ├── GRichTextField.cs │ │ │ │ │ ├── GRichTextField.cs.meta │ │ │ │ │ ├── GRoot.cs │ │ │ │ │ ├── GRoot.cs.meta │ │ │ │ │ ├── GScrollBar.cs │ │ │ │ │ ├── GScrollBar.cs.meta │ │ │ │ │ ├── GSlider.cs │ │ │ │ │ ├── GSlider.cs.meta │ │ │ │ │ ├── GTextField.cs │ │ │ │ │ ├── GTextField.cs.meta │ │ │ │ │ ├── GTextInput.cs │ │ │ │ │ ├── GTextInput.cs.meta │ │ │ │ │ ├── GTree.cs │ │ │ │ │ ├── GTree.cs.meta │ │ │ │ │ ├── GTreeNode.cs │ │ │ │ │ ├── GTreeNode.cs.meta │ │ │ │ │ ├── Gears.meta │ │ │ │ │ ├── Gears │ │ │ │ │ │ ├── GearAnimation.cs │ │ │ │ │ │ ├── GearAnimation.cs.meta │ │ │ │ │ │ ├── GearBase.cs │ │ │ │ │ │ ├── GearBase.cs.meta │ │ │ │ │ │ ├── GearColor.cs │ │ │ │ │ │ ├── GearColor.cs.meta │ │ │ │ │ │ ├── GearDisplay.cs │ │ │ │ │ │ ├── GearDisplay.cs.meta │ │ │ │ │ │ ├── GearDisplay2.cs │ │ │ │ │ │ ├── GearDisplay2.cs.meta │ │ │ │ │ │ ├── GearFontSize.cs │ │ │ │ │ │ ├── GearFontSize.cs.meta │ │ │ │ │ │ ├── GearIcon.cs │ │ │ │ │ │ ├── GearIcon.cs.meta │ │ │ │ │ │ ├── GearLook.cs │ │ │ │ │ │ ├── GearLook.cs.meta │ │ │ │ │ │ ├── GearSize.cs │ │ │ │ │ │ ├── GearSize.cs.meta │ │ │ │ │ │ ├── GearText.cs │ │ │ │ │ │ ├── GearText.cs.meta │ │ │ │ │ │ ├── GearXY.cs │ │ │ │ │ │ ├── GearXY.cs.meta │ │ │ │ │ │ ├── IAnimationGear.cs │ │ │ │ │ │ ├── IAnimationGear.cs.meta │ │ │ │ │ │ ├── IColorGear.cs │ │ │ │ │ │ └── IColorGear.cs.meta │ │ │ │ │ ├── IUISource.cs │ │ │ │ │ ├── IUISource.cs.meta │ │ │ │ │ ├── Margin.cs │ │ │ │ │ ├── Margin.cs.meta │ │ │ │ │ ├── PackageItem.cs │ │ │ │ │ ├── PackageItem.cs.meta │ │ │ │ │ ├── PopupMenu.cs │ │ │ │ │ ├── PopupMenu.cs.meta │ │ │ │ │ ├── RelationItem.cs │ │ │ │ │ ├── RelationItem.cs.meta │ │ │ │ │ ├── Relations.cs │ │ │ │ │ ├── Relations.cs.meta │ │ │ │ │ ├── ScrollPane.cs │ │ │ │ │ ├── ScrollPane.cs.meta │ │ │ │ │ ├── Transition.cs │ │ │ │ │ ├── Transition.cs.meta │ │ │ │ │ ├── TranslationHelper.cs │ │ │ │ │ ├── TranslationHelper.cs.meta │ │ │ │ │ ├── Tree.meta │ │ │ │ │ ├── Tree │ │ │ │ │ │ ├── TreeNode.cs │ │ │ │ │ │ ├── TreeNode.cs.meta │ │ │ │ │ │ ├── TreeView.cs │ │ │ │ │ │ └── TreeView.cs.meta │ │ │ │ │ ├── UIConfig.cs │ │ │ │ │ ├── UIConfig.cs.meta │ │ │ │ │ ├── UIContentScaler.cs │ │ │ │ │ ├── UIContentScaler.cs.meta │ │ │ │ │ ├── UIObjectFactory.cs │ │ │ │ │ ├── UIObjectFactory.cs.meta │ │ │ │ │ ├── UIPackage.cs │ │ │ │ │ ├── UIPackage.cs.meta │ │ │ │ │ ├── UIPainter.cs │ │ │ │ │ ├── UIPainter.cs.meta │ │ │ │ │ ├── UIPanel.cs │ │ │ │ │ ├── UIPanel.cs.meta │ │ │ │ │ ├── Window.cs │ │ │ │ │ └── Window.cs.meta │ │ │ │ ├── Utils.meta │ │ │ │ └── Utils │ │ │ │ │ ├── ByteBuffer.cs │ │ │ │ │ ├── ByteBuffer.cs.meta │ │ │ │ │ ├── Html.meta │ │ │ │ │ ├── Html │ │ │ │ │ ├── HtmlButton.cs │ │ │ │ │ ├── HtmlButton.cs.meta │ │ │ │ │ ├── HtmlElement.cs │ │ │ │ │ ├── HtmlElement.cs.meta │ │ │ │ │ ├── HtmlImage.cs │ │ │ │ │ ├── HtmlImage.cs.meta │ │ │ │ │ ├── HtmlInput.cs │ │ │ │ │ ├── HtmlInput.cs.meta │ │ │ │ │ ├── HtmlLink.cs │ │ │ │ │ ├── HtmlLink.cs.meta │ │ │ │ │ ├── HtmlPageContext.cs │ │ │ │ │ ├── HtmlPageContext.cs.meta │ │ │ │ │ ├── HtmlParseOptions.cs │ │ │ │ │ ├── HtmlParseOptions.cs.meta │ │ │ │ │ ├── HtmlParser.cs │ │ │ │ │ ├── HtmlParser.cs.meta │ │ │ │ │ ├── HtmlSelect.cs │ │ │ │ │ ├── HtmlSelect.cs.meta │ │ │ │ │ ├── IHtmlObject.cs │ │ │ │ │ ├── IHtmlObject.cs.meta │ │ │ │ │ ├── IHtmlPageContext.cs │ │ │ │ │ └── IHtmlPageContext.cs.meta │ │ │ │ │ ├── Timers.cs │ │ │ │ │ ├── Timers.cs.meta │ │ │ │ │ ├── ToolSet.cs │ │ │ │ │ ├── ToolSet.cs.meta │ │ │ │ │ ├── UBBParser.cs │ │ │ │ │ ├── UBBParser.cs.meta │ │ │ │ │ ├── XML.cs │ │ │ │ │ ├── XML.cs.meta │ │ │ │ │ ├── XMLIterator.cs │ │ │ │ │ ├── XMLIterator.cs.meta │ │ │ │ │ ├── XMLList.cs │ │ │ │ │ ├── XMLList.cs.meta │ │ │ │ │ ├── XMLUtils.cs │ │ │ │ │ ├── XMLUtils.cs.meta │ │ │ │ │ ├── ZipReader.cs │ │ │ │ │ └── ZipReader.cs.meta │ │ │ ├── VERSION-4-2-0 │ │ │ └── VERSION-4-2-0.meta │ │ │ ├── Puerts.meta │ │ │ └── Puerts │ │ │ ├── Src.meta │ │ │ ├── Src │ │ │ ├── ArgumentHelper.cs │ │ │ ├── ArgumentHelper.cs.meta │ │ │ ├── DataTranslate.cs │ │ │ ├── DataTranslate.cs.meta │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── CJSImporter.cs │ │ │ │ ├── CJSImporter.cs.meta │ │ │ │ ├── Configure.cs │ │ │ │ ├── Configure.cs.meta │ │ │ │ ├── DocResolver.cs │ │ │ │ ├── DocResolver.cs.meta │ │ │ │ ├── Generator.cs │ │ │ │ ├── Generator.cs.meta │ │ │ │ ├── Resources.meta │ │ │ │ ├── Resources │ │ │ │ │ ├── puerts.meta │ │ │ │ │ └── puerts │ │ │ │ │ │ ├── gencode.meta │ │ │ │ │ │ ├── gencode │ │ │ │ │ │ ├── doT.js.txt │ │ │ │ │ │ ├── doT.js.txt.meta │ │ │ │ │ │ ├── main.js.txt │ │ │ │ │ │ └── main.js.txt.meta │ │ │ │ │ │ ├── templates.meta │ │ │ │ │ │ └── templates │ │ │ │ │ │ ├── autoreg.tpl.txt │ │ │ │ │ │ ├── autoreg.tpl.txt.meta │ │ │ │ │ │ ├── type.tpl.txt │ │ │ │ │ │ ├── type.tpl.txt.meta │ │ │ │ │ │ ├── typing.tpl.txt │ │ │ │ │ │ └── typing.tpl.txt.meta │ │ │ │ ├── U2018Compatible.cs │ │ │ │ └── U2018Compatible.cs.meta │ │ │ ├── GenericDelegate.cs │ │ │ ├── GenericDelegate.cs.meta │ │ │ ├── JsEnv.cs │ │ │ ├── JsEnv.cs.meta │ │ │ ├── Loader.cs │ │ │ ├── Loader.cs.meta │ │ │ ├── MethodReflection.cs │ │ │ ├── MethodReflection.cs.meta │ │ │ ├── NativeValueApiGeneric.cs │ │ │ ├── NativeValueApiGeneric.cs.meta │ │ │ ├── ObjectPool.cs │ │ │ ├── ObjectPool.cs.meta │ │ │ ├── PuertsDLL.cs │ │ │ ├── PuertsDLL.cs.meta │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── puerts.meta │ │ │ │ └── puerts │ │ │ │ │ ├── cjsload.js.txt │ │ │ │ │ ├── cjsload.js.txt.meta │ │ │ │ │ ├── csharp.js.txt │ │ │ │ │ ├── csharp.js.txt.meta │ │ │ │ │ ├── events.js.txt │ │ │ │ │ ├── events.js.txt.meta │ │ │ │ │ ├── init.js.txt │ │ │ │ │ ├── init.js.txt.meta │ │ │ │ │ ├── log.js.txt │ │ │ │ │ ├── log.js.txt.meta │ │ │ │ │ ├── modular.js.txt │ │ │ │ │ ├── modular.js.txt.meta │ │ │ │ │ ├── polyfill.js.txt │ │ │ │ │ ├── polyfill.js.txt.meta │ │ │ │ │ ├── promises.js.txt │ │ │ │ │ ├── promises.js.txt.meta │ │ │ │ │ ├── timer.js.txt │ │ │ │ │ └── timer.js.txt.meta │ │ │ ├── StaticCallbacks.cs │ │ │ ├── StaticCallbacks.cs.meta │ │ │ ├── StaticTranslate.cs │ │ │ ├── StaticTranslate.cs.meta │ │ │ ├── StaticWrapRegister.cs │ │ │ ├── StaticWrapRegister.cs.meta │ │ │ ├── TypeExtensions.cs │ │ │ ├── TypeExtensions.cs.meta │ │ │ ├── TypeRegister.cs │ │ │ ├── TypeRegister.cs.meta │ │ │ ├── TypedValue.cs │ │ │ ├── TypedValue.cs.meta │ │ │ ├── Utils.cs │ │ │ └── Utils.cs.meta │ │ │ ├── Typing.meta │ │ │ └── Typing │ │ │ ├── puerts.meta │ │ │ └── puerts │ │ │ ├── index.d.ts │ │ │ └── index.d.ts.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 │ │ ├── TimelineSettings.asset │ │ ├── UnityConnectSettings.asset │ │ ├── VFXManager.asset │ │ ├── VersionControlSettings.asset │ │ └── XRSettings.asset └── urp-mod │ └── UnityProject │ ├── Assets │ ├── Materials │ │ ├── Skybox_Mat.mat │ │ └── Skybox_Mat.mat.meta │ ├── Presets │ │ ├── AudioCompressedInMemory.preset │ │ ├── AudioCompressedInMemory.preset.meta │ │ ├── AudioStreaming.preset │ │ ├── AudioStreaming.preset.meta │ │ ├── Defaults.meta │ │ ├── Defaults │ │ │ ├── AlbedoTexture_Default.preset │ │ │ ├── AlbedoTexture_Default.preset.meta │ │ │ ├── AudioDecompressOnLoad.preset │ │ │ ├── AudioDecompressOnLoad.preset.meta │ │ │ ├── DirectionalLight_Default.preset │ │ │ └── DirectionalLight_Default.preset.meta │ │ ├── NormalTexture.preset │ │ ├── NormalTexture.preset.meta │ │ ├── UtilityTexture.preset │ │ └── UtilityTexture.preset.meta │ ├── Scenes │ │ ├── MainURP.unity │ │ ├── MainURP.unity.meta │ │ ├── SampleSceneLightingSettings.lighting │ │ └── SampleSceneLightingSettings.lighting.meta │ └── Settings │ │ ├── ForwardRenderer.asset │ │ ├── ForwardRenderer.asset.meta │ │ ├── SampleSceneProfile.asset │ │ ├── SampleSceneProfile.asset.meta │ │ ├── UniversalRP-HighQuality.asset │ │ ├── UniversalRP-HighQuality.asset.meta │ │ ├── UniversalRP-LowQuality.asset │ │ ├── UniversalRP-LowQuality.asset.meta │ │ ├── UniversalRP-MediumQuality.asset │ │ └── UniversalRP-MediumQuality.asset.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 │ ├── TimelineSettings.asset │ ├── URPProjectSettings.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset └── 资源 ├── UI资源 └── .gitkeep ├── 创意 └── .gitkeep ├── 故事文案 └── .gitkeep ├── 策划文档 └── .gitkeep ├── 美术资源 └── .gitkeep └── 音乐音效 └── .gitkeep /.gitattributes: -------------------------------------------------------------------------------- 1 | 资源 filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 资源/ 2 | -------------------------------------------------------------------------------- /README.assets/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fy0/unity-tskit/7baeee296c3f5aa39b8c6247af6efb647f9d0bd9/README.assets/screenshot-1.png -------------------------------------------------------------------------------- /README.assets/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fy0/unity-tskit/7baeee296c3f5aa39b8c6247af6efb647f9d0bd9/README.assets/screenshot-2.png -------------------------------------------------------------------------------- /README.assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fy0/unity-tskit/7baeee296c3f5aa39b8c6247af6efb647f9d0bd9/README.assets/screenshot.png -------------------------------------------------------------------------------- /工程/TsProject/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /工程/TsProject/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | .nyc_output 3 | build 4 | node_modules 5 | test 6 | src/**.js 7 | coverage 8 | *.log 9 | yarn.lock 10 | *.zip 11 | *.xlsx 12 | package-lock.json 13 | -------------------------------------------------------------------------------- /工程/TsProject/.prettierignore: -------------------------------------------------------------------------------- 1 | # package.json is formatted by package managers, so we ignore it here 2 | package.json -------------------------------------------------------------------------------- /工程/TsProject/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### 1.0.1 (2020-12-28) 6 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/base/game-module.ts: -------------------------------------------------------------------------------- 1 | import { SCoreObject } from '../../core/object'; 2 | import { Game } from '../game'; 3 | 4 | /** 游戏主要模块 */ 5 | export class GameModule extends SCoreObject { 6 | constructor(game: Game) { 7 | super(); 8 | this.game = game; 9 | } 10 | 11 | init() {} 12 | } 13 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/config.ts: -------------------------------------------------------------------------------- 1 | export class Config { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/game.ts: -------------------------------------------------------------------------------- 1 | import { GameLoop } from './game-loop'; 2 | 3 | export class Game extends GameLoop { 4 | start() { 5 | // 绑定到游戏引擎 6 | this.bindToEngine() 7 | // 初始化game modules等 8 | this.init(); 9 | } 10 | 11 | // singleton 12 | protected static _inst: Game; 13 | 14 | static get inst() { 15 | if (!Game._inst) Game._inst = new Game(); 16 | return Game._inst; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/modules/action-manager.ts: -------------------------------------------------------------------------------- 1 | import { GameModule } from '../base/game-module'; 2 | import { Action } from '../plugins/action'; 3 | 4 | export class ActionManager extends GameModule { 5 | // coreList: L.List; 6 | 7 | addAction(action: Action) { 8 | // L.insert() 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/modules/audio-manager.ts: -------------------------------------------------------------------------------- 1 | import { GameModule } from '../base/game-module'; 2 | 3 | export class AudioManager extends GameModule {} 4 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/modules/profile-manager.ts: -------------------------------------------------------------------------------- 1 | import { makeObservable } from 'mobx'; 2 | import { Game } from '../game'; 3 | import { SObject } from '../../core/object'; 4 | import { GameModule } from '../base/game-module'; 5 | 6 | export class Profile extends SObject { 7 | /** 当前队伍 */ 8 | /** 道具 */ 9 | items: any[] = []; 10 | /** 好感度 */ 11 | favorable: { [id: number]: number } = {}; 12 | /** 时间 */ 13 | time: number; 14 | /** 天数 */ 15 | day: number = 1; 16 | 17 | constructor(game: Game) { 18 | super() 19 | 20 | // makeObservable(this); 21 | } 22 | } 23 | 24 | export class ProfileManager extends GameModule { 25 | cur: Profile; 26 | profiles: Profile[] = []; 27 | 28 | init () { 29 | const game = this.game; 30 | // TODO: 示例存档 31 | const p = new Profile(game); 32 | this.profiles.push(p); 33 | this.cur = p; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/modules/time-manager.ts: -------------------------------------------------------------------------------- 1 | import { GameModule } from '../base/game-module'; 2 | 3 | export class TimeManager extends GameModule { 4 | /** 游戏逻辑时间,暂停时不计入 */ 5 | logicTime = 0; 6 | 7 | /** 游戏运行时间 */ 8 | startTime = 0; 9 | 10 | /** 现实时间 */ 11 | realityTime = 0; 12 | 13 | updateFixed(dt: number) { 14 | let dtMs = dt * 1000; 15 | this.startTime += dtMs; 16 | this.realityTime += dtMs; 17 | } 18 | 19 | /** 注:TimerManager的update会被强制调用,这和其他Object不同 */ 20 | update(dt) { 21 | let dtMs = dt * 1000; 22 | this.logicTime += dtMs; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/plugins/unit-view.ts: -------------------------------------------------------------------------------- 1 | import { game, UnityEngine } from "csharp"; 2 | import { autorun, makeObservable, observable, when } from "mobx"; 3 | import { $typeof } from "puerts"; 4 | import { SObject } from "../../core/object"; 5 | import { Unit } from "./unit"; 6 | 7 | export class UnitView extends SObject { 8 | @observable 9 | unit: Unit; 10 | 11 | // view: game.UnitView; 12 | 13 | constructor() { 14 | super(); 15 | 16 | autorun(() => { 17 | if (this.unit) { 18 | this.createView(); 19 | } 20 | }) 21 | 22 | makeObservable(this); 23 | } 24 | 25 | createView() { 26 | // const prefab = UnityEngine.Resources.Load('units/testUnit'); 27 | // const a = UnityEngine.GameObject.Instantiate(prefab, new UnityEngine.Vector3(0,0,0), UnityEngine.Quaternion.Euler(0,0,0)) as UnityEngine.GameObject; 28 | // a.SetActive(true); 29 | // this.view = a.GetComponent($typeof(game.UnitView)) as game.UnitView; 30 | // a.transform.parent = anchor.transform; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/scenes/fight-scene.ts: -------------------------------------------------------------------------------- 1 | import { UnityEngine } from "csharp"; 2 | import { SObject } from "../../core/object"; 3 | 4 | export class FightScene extends SObject { 5 | // battleField: BattleField; 6 | // battleFieldView: BattleFieldView; 7 | 8 | init () { 9 | UnityEngine.SceneManagement.SceneManager.LoadScene('Fight'); 10 | 11 | UnityEngine.SceneManagement.SceneManager.add_sceneLoaded((scene, mode) => { 12 | // this.battleField = new BattleField(); 13 | // this.battleFieldView = new BattleFieldView(this.battleField); 14 | 15 | // this.battleField.attach(this.game); 16 | // this.battleFieldView.attach(this.game); 17 | 18 | // this.battleField.loadMap1(); 19 | 20 | // a.transform.localPosition = UnityEngine.Vector3.zero; 21 | // console.log(111, tileGrass, a); 22 | }); 23 | } 24 | } -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/UIMain.ts: -------------------------------------------------------------------------------- 1 | import { autorun } from "mobx"; 2 | import UIRaw_Main from "../../gen/ui/main/UIRaw_Main"; 3 | import { Game } from "../game"; 4 | import { DialogSetting } from "./dialogs/UIDialogSetting"; 5 | 6 | export class UIMain extends UIRaw_Main { 7 | onConstruct () { 8 | super.onConstruct(); 9 | 10 | const game = Game.inst; 11 | 12 | // 示例:每秒钟增加一块钱,UI会同步进行自动更新 13 | game.task.interval(1000, () => { 14 | game.inventory.earn({'cash': 1}); 15 | }); 16 | 17 | autorun(() => { 18 | // 数据 -> UI 自动同步:持有金钱 19 | this.m_lbCoin.text = `${game.inventory.get('cash')}`; 20 | }); 21 | 22 | this.m_btnSetting.onClick.Set(() => { 23 | // 弹出设置窗口 24 | DialogSetting.show(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/UIPageHome.ts: -------------------------------------------------------------------------------- 1 | import UIRaw_PageHome from "../../gen/ui/main/UIRaw_PageHome"; 2 | import { Game } from "../game"; 3 | 4 | export class UIPageHome extends UIRaw_PageHome { 5 | onConstruct () { 6 | super.onConstruct(); 7 | const game = Game.inst; 8 | 9 | this.m_btnStart.onClick.Set(() => { 10 | // 开始游戏 11 | game.story.toast('请点击右下角第一个按钮试试'); 12 | game.ui.openPageGame(); 13 | }); 14 | 15 | this.m_btnExit.onClick.Set(() => { 16 | // 退出游戏 17 | game.quit(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/dialogs/UIDialogConfirm.ts: -------------------------------------------------------------------------------- 1 | import UIRaw_DialogConfirm from "../../../gen/ui/main/UIRaw_DialogConfirm"; 2 | import { UIDialog } from "./UIDialog"; 3 | 4 | export class DialogConfirm extends UIDialog { 5 | constructor() { 6 | super(UIRaw_DialogConfirm); 7 | } 8 | 9 | protected onInit() { 10 | this.view.m_btnYes.onClick.Set(() => { 11 | console.log('click yes'); 12 | this.hide(); 13 | }); 14 | 15 | this.view.m_btnNo.onClick.Set(() => { 16 | console.log('click no'); 17 | this.hide(); 18 | }); 19 | } 20 | 21 | protected onShown () { 22 | // 同步设置 23 | this.view.m_text.text = (this.extra && this.extra.text) || '是否确定?'; // 将 extra.text 设定为询问文本 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/dialogs/UIDialogSetting.ts: -------------------------------------------------------------------------------- 1 | import UIRaw_DialogSetting from "../../../gen/ui/main/UIRaw_DialogSetting"; 2 | import { UIDialog } from "./UIDialog"; 3 | 4 | export class DialogSetting extends UIDialog { 5 | constructor() { 6 | super(UIRaw_DialogSetting); 7 | } 8 | 9 | protected onInit() { 10 | this.view.m_btnYes.onClick.Set(() => { 11 | console.log('click yes'); 12 | this.hide(); 13 | }); 14 | 15 | this.view.m_btnNo.onClick.Set(() => { 16 | console.log('click no'); 17 | this.hide(); 18 | }); 19 | } 20 | 21 | protected onShown () { 22 | // 同步设置 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/dialogs/UIDialogStoryBox.ts: -------------------------------------------------------------------------------- 1 | import UIRaw_DialogStoryBox from "../../../gen/ui/main/UIRaw_DialogStoryBox"; 2 | import { UIDialog } from "./UIDialog"; 3 | 4 | export class DialogStoryBox extends UIDialog { 5 | constructor() { 6 | super(UIRaw_DialogStoryBox); 7 | } 8 | 9 | protected onInit() { 10 | } 11 | 12 | protected onShown () { 13 | // 同步设置 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /工程/TsProject/src/game/ui/dialogs/UIDialogToast.ts: -------------------------------------------------------------------------------- 1 | import UIRaw_DialogToast from "../../../gen/ui/main/UIRaw_DialogToast"; 2 | import { UIDialog } from "./UIDialog"; 3 | 4 | export class DialogToast extends UIDialog { 5 | constructor() { 6 | super(UIRaw_DialogToast); 7 | } 8 | 9 | protected onInit() { 10 | } 11 | 12 | protected onShown () { 13 | // 同步设置 14 | this.view.m_toast.m_txt.text = this.extra.text; 15 | this.view.m_pos_state.selectedIndex = this.extra.pos; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /工程/TsProject/src/gen/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fy0/unity-tskit/7baeee296c3f5aa39b8c6247af6efb647f9d0bd9/工程/TsProject/src/gen/.gitkeep -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_Button.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_Button extends FairyGUI.GButton { 8 | 9 | public m_color_state: FairyGUI.Controller; 10 | public static URL: string = "ui://j8b2cwkbaemq6"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "Button")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_color_state = this.GetControllerAt(1); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_DialogConfirm.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw__Frame from "./UIRaw__Frame"; 6 | import UIRaw_Button from "./UIRaw_Button"; 7 | 8 | import { FairyGUI } from "csharp"; 9 | 10 | export default class UIRaw_DialogConfirm extends FairyGUI.GComponent { 11 | 12 | public m_frame: UIRaw__Frame; 13 | public m_btnYes: UIRaw_Button; 14 | public m_btnNo: UIRaw_Button; 15 | public m_text: FairyGUI.GTextField; 16 | public static URL: string = "ui://j8b2cwkb7oxo5"; 17 | 18 | public static createInstance(): T { 19 | const obj = (FairyGUI.UIPackage.CreateObject("main", "DialogConfirm")); 20 | return obj as T; 21 | } 22 | 23 | protected onConstruct () { 24 | this.m_frame = (this.GetChildAt(0)); 25 | this.m_btnYes = (this.GetChildAt(1)); 26 | this.m_btnNo = (this.GetChildAt(2)); 27 | this.m_text = (this.GetChildAt(3)); 28 | } 29 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_DialogSetting.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw__Frame from "./UIRaw__Frame"; 6 | import UIRaw_Button from "./UIRaw_Button"; 7 | 8 | import { FairyGUI } from "csharp"; 9 | 10 | export default class UIRaw_DialogSetting extends FairyGUI.GLabel { 11 | 12 | public m_frame: UIRaw__Frame; 13 | public m_text: FairyGUI.GTextField; 14 | public m_btnYes: UIRaw_Button; 15 | public m_btnNo: UIRaw_Button; 16 | public static URL: string = "ui://j8b2cwkbcx8uf"; 17 | 18 | public static createInstance(): T { 19 | const obj = (FairyGUI.UIPackage.CreateObject("main", "DialogSetting")); 20 | return obj as T; 21 | } 22 | 23 | protected onConstruct () { 24 | this.m_frame = (this.GetChildAt(0)); 25 | this.m_text = (this.GetChildAt(1)); 26 | this.m_btnYes = (this.GetChildAt(2)); 27 | this.m_btnNo = (this.GetChildAt(3)); 28 | } 29 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_DialogStoryBox.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_DialogStoryBox extends FairyGUI.GComponent { 8 | 9 | public m_content: FairyGUI.GTextField; 10 | public m_btnClose: FairyGUI.GButton; 11 | public m_fx_flash: FairyGUI.Transition; 12 | public static URL: string = "ui://j8b2cwkbv44rs"; 13 | 14 | public static createInstance(): T { 15 | const obj = (FairyGUI.UIPackage.CreateObject("main", "DialogStoryBox")); 16 | return obj as T; 17 | } 18 | 19 | protected onConstruct () { 20 | this.m_content = (this.GetChildAt(1)); 21 | this.m_btnClose = (this.GetChildAt(4)); 22 | this.m_fx_flash = this.GetTransitionAt(0); 23 | } 24 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_DialogStoryChoices.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_DialogStoryChoices extends FairyGUI.GComponent { 8 | 9 | public m_list: FairyGUI.GList; 10 | public static URL: string = "ui://j8b2cwkbv44ro"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "DialogStoryChoices")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_list = (this.GetChildAt(0)); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_DialogToast.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw_Toast from "./UIRaw_Toast"; 6 | 7 | import { FairyGUI } from "csharp"; 8 | 9 | export default class UIRaw_DialogToast extends FairyGUI.GComponent { 10 | 11 | public m_pos_state: FairyGUI.Controller; 12 | public m_toast: UIRaw_Toast; 13 | public m_fx_flash: FairyGUI.Transition; 14 | public static URL: string = "ui://j8b2cwkbv44rn"; 15 | 16 | public static createInstance(): T { 17 | const obj = (FairyGUI.UIPackage.CreateObject("main", "DialogToast")); 18 | return obj as T; 19 | } 20 | 21 | protected onConstruct () { 22 | this.m_pos_state = this.GetControllerAt(0); 23 | this.m_toast = (this.GetChildAt(0)); 24 | this.m_fx_flash = this.GetTransitionAt(0); 25 | } 26 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_IconButton.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_IconButton extends FairyGUI.GButton { 8 | 9 | public m_bg_state: FairyGUI.Controller; 10 | public static URL: string = "ui://j8b2cwkb7n7qe"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "IconButton")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_bg_state = this.GetControllerAt(1); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_IconLabel.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_IconLabel extends FairyGUI.GLabel { 8 | 9 | public m_type_state: FairyGUI.Controller; 10 | public static URL: string = "ui://j8b2cwkbi7x2j"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "IconLabel")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_type_state = this.GetControllerAt(0); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_PageGame.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw_Button from "./UIRaw_Button"; 6 | 7 | import { FairyGUI } from "csharp"; 8 | 9 | export default class UIRaw_PageGame extends FairyGUI.GComponent { 10 | 11 | public m_btnStory: UIRaw_Button; 12 | public m_btnBack: UIRaw_Button; 13 | public static URL: string = "ui://j8b2cwkbcx8ug"; 14 | 15 | public static createInstance(): T { 16 | const obj = (FairyGUI.UIPackage.CreateObject("main", "PageGame")); 17 | return obj as T; 18 | } 19 | 20 | protected onConstruct () { 21 | this.m_btnStory = (this.GetChildAt(0)); 22 | this.m_btnBack = (this.GetChildAt(1)); 23 | } 24 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_PageHome.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw_Button from "./UIRaw_Button"; 6 | 7 | import { FairyGUI } from "csharp"; 8 | 9 | export default class UIRaw_PageHome extends FairyGUI.GComponent { 10 | 11 | public m_btnStart: UIRaw_Button; 12 | public m_btnExit: UIRaw_Button; 13 | public static URL: string = "ui://j8b2cwkbtjnt0"; 14 | 15 | public static createInstance(): T { 16 | const obj = (FairyGUI.UIPackage.CreateObject("main", "PageHome")); 17 | return obj as T; 18 | } 19 | 20 | protected onConstruct () { 21 | this.m_btnStart = (this.GetChildAt(0)); 22 | this.m_btnExit = (this.GetChildAt(1)); 23 | } 24 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_StoryChoicesItem.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_StoryChoicesItem extends FairyGUI.GButton { 8 | 9 | public m_bg: FairyGUI.GGraph; 10 | public static URL: string = "ui://j8b2cwkbv44rp"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "StoryChoicesItem")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_bg = (this.GetChildAt(0)); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw_Toast.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import { FairyGUI } from "csharp"; 6 | 7 | export default class UIRaw_Toast extends FairyGUI.GComponent { 8 | 9 | public m_txt: FairyGUI.GTextField; 10 | public static URL: string = "ui://j8b2cwkbv44rr"; 11 | 12 | public static createInstance(): T { 13 | const obj = (FairyGUI.UIPackage.CreateObject("main", "Toast")); 14 | return obj as T; 15 | } 16 | 17 | protected onConstruct () { 18 | this.m_txt = (this.GetChildAt(1)); 19 | } 20 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/UIRaw__Frame.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | /* eslint-disable */ 4 | 5 | import UIRaw_IconButton from "./UIRaw_IconButton"; 6 | 7 | import { FairyGUI } from "csharp"; 8 | 9 | export default class UIRaw__Frame extends FairyGUI.GButton { 10 | 11 | public m_dragArea: FairyGUI.GGraph; 12 | public m_closeButton: UIRaw_IconButton; 13 | public m_contentArea: FairyGUI.GGraph; 14 | public static URL: string = "ui://j8b2cwkbcx8ui"; 15 | 16 | public static createInstance(): T { 17 | const obj = (FairyGUI.UIPackage.CreateObject("main", "_Frame")); 18 | return obj as T; 19 | } 20 | 21 | protected onConstruct () { 22 | this.m_dragArea = (this.GetChildAt(1)); 23 | this.m_closeButton = (this.GetChildAt(2)); 24 | this.m_contentArea = (this.GetChildAt(4)); 25 | } 26 | } -------------------------------------------------------------------------------- /工程/TsProject/src/gen/ui/main/fairygui.ts: -------------------------------------------------------------------------------- 1 | /** This is an automatically generated class by FairyGUI. Please do not modify it. **/ 2 | 3 | import { FairyGUI, System } from "csharp"; 4 | 5 | export function bind(cls: new () => FairyGUI.GComponent) { 6 | FairyGUI.UIObjectFactory.SetPackageItemExtension((cls as any).URL, () => { 7 | const obj = new cls(); 8 | 9 | const tryBind = (actionName: string, funcName: string) => { 10 | // 存在则进行绑定 11 | if (funcName in obj && typeof obj[funcName] === 'function') { 12 | obj[actionName] = new System.Action(obj[funcName].bind(obj)); 13 | } 14 | } 15 | 16 | tryBind('__onConstruct', 'onConstruct'); 17 | tryBind('__onDispose', 'onDispose'); 18 | 19 | tryBind('__onInit', 'onInit'); 20 | tryBind('__onShown', 'onShown'); 21 | tryBind('__onHide', 'onHide'); 22 | tryBind('__doShowAnimation', 'doShowAnimation'); 23 | tryBind('__doHideAnimation', 'doHideAnimation'); 24 | 25 | return obj; 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /工程/TsProject/src/index.ts: -------------------------------------------------------------------------------- 1 | import './utils/puerts-source-map-support' 2 | import { Game } from './game/game'; 3 | 4 | 5 | Game.inst.start(); 6 | -------------------------------------------------------------------------------- /工程/TsProject/src/types/example.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * If you import a dependency which does not include its own type definitions, 3 | * TypeScript will try to find a definition for it by following the `typeRoots` 4 | * compiler option in tsconfig.json. For this project, we've configured it to 5 | * fall back to this folder if nothing is found in node_modules/@types. 6 | * 7 | * Often, you can install the DefinitelyTyped 8 | * (https://github.com/DefinitelyTyped/DefinitelyTyped) type definition for the 9 | * dependency in question. However, if no one has yet contributed definitions 10 | * for the package, you may want to declare your own. (If you're using the 11 | * `noImplicitAny` compiler options, you'll be required to declare it.) 12 | * 13 | * This is an example type definition which allows import from `module-name`, 14 | * e.g.: 15 | * ```ts 16 | * import something from 'module-name'; 17 | * something(); 18 | * ``` 19 | */ 20 | declare module 'module-name' { 21 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 22 | const whatever: any; 23 | export = whatever; 24 | } 25 | -------------------------------------------------------------------------------- /工程/TsProject/src/utils/array.ts: -------------------------------------------------------------------------------- 1 | import { chunk, fill } from "lodash-es"; 2 | 3 | export function arrayWidth(arr) { 4 | return arr.length; 5 | } 6 | 7 | export function arrayHeight(arr) { 8 | if (arr.length == 0) return 0; 9 | return arr[0].length; 10 | } 11 | 12 | export function arraySetSize(arr, x: number, y: number) { 13 | if (arr.length == 0) { 14 | arr = chunk(fill(Array(x * y), 0), y); 15 | } else { 16 | const srcWidth = arrayWidth(arr); 17 | const srcHeight = arrayWidth(arr); 18 | 19 | // 对齐 x 行 20 | if (x < srcWidth) { 21 | arr.length = x; 22 | } else { 23 | const xRest = x - arr.length; 24 | const lst = chunk(fill(Array(xRest * y), 0), y); 25 | arr.push(...lst) 26 | } 27 | 28 | // 对齐y行 29 | if (y < srcHeight) { 30 | for (let i of arr) { 31 | i.length = y; 32 | } 33 | } else { 34 | for (let i of arr) { 35 | const yRest = (y - i.length); 36 | i.push(...fill(Array(yRest), 0)); 37 | } 38 | } 39 | } 40 | return arr; 41 | } 42 | -------------------------------------------------------------------------------- /工程/TsProject/tools/build-config.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | // Bundles JavaScript. 4 | bundle: true, 5 | // Defines env variables for bundled JavaScript; here `process.env.NODE_ENV` 6 | // is propagated with a fallback. 7 | // define: { "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development") }, 8 | // Bundles JavaScript from (see `outfile`). 9 | entryPoints: ["src/index.ts"], 10 | // Uses incremental compilation (see `chokidar.on`). 11 | incremental: true, 12 | // Removes whitespace, etc. depending on `NODE_ENV=...`. 13 | minify: process.env.NODE_ENV === "production", 14 | // Bundles JavaScript to (see `entryPoints`). 15 | outfile: "../UnityProject/Assets/Resources/tsbuild/bundle.js.txt", 16 | // Others 17 | platform: "node", 18 | tsconfig: "./tsconfig.json", 19 | color: true, 20 | sourcemap: process.env.NODE_ENV === "production" ? false : true, 21 | external: ['csharp', 'puerts'], 22 | target: 'es2020', 23 | treeShaking: true, 24 | logLevel: 'error' 25 | } 26 | -------------------------------------------------------------------------------- /工程/TsProject/tools/build.js: -------------------------------------------------------------------------------- 1 | const { build } = require("esbuild"); 2 | const path = require("path"); 3 | const fs = require("fs"); 4 | const config = require('./build-config'); 5 | 6 | 7 | (async () => { 8 | try { 9 | const timerStart = Date.now(); 10 | fs.rmSync(path.dirname(config.outfile), { recursive: true, force: true }); 11 | 12 | await build(config) 13 | const timerEnd = Date.now(); 14 | console.log(`🔨 Built in ${timerEnd - timerStart}ms.`) 15 | process.exit(0); 16 | } catch (e) { 17 | } 18 | })() 19 | -------------------------------------------------------------------------------- /工程/TsProject/tools/watch.js: -------------------------------------------------------------------------------- 1 | const { build } = require("esbuild"); 2 | const chokidar = require("chokidar"); 3 | const debounce = require('./_debounce.js'); 4 | const config = require('./build-config'); 5 | 6 | 7 | (async () => { 8 | // `chokidar` watcher source changes. 9 | chokidar 10 | // Watches TypeScript and React TypeScript. 11 | .watch("src/**/*.{ts,tsx}", { 12 | interval: 0, // No delay 13 | }) 14 | // Rebuilds esbuild (incrementally -- see `build.incremental`). 15 | .on("all", debounce(async (e, path) => { 16 | const timerStart = Date.now(); 17 | try { 18 | await build(config) 19 | } catch (e) { 20 | } 21 | const timerEnd = Date.now(); 22 | console.log(`🔨 Built in ${timerEnd - timerStart}ms.`) 23 | }, 500)) 24 | 25 | // `liveServer` local server for hot reload. 26 | // liveServer.start({ 27 | // // Opens the local server on start. 28 | // open: true, 29 | // // Uses `PORT=...` or 8080 as a fallback. 30 | // port: +process.env.PORT || 8080, 31 | // // Uses `public` as the local server folder. 32 | // root: "public", 33 | // }) 34 | })() 35 | -------------------------------------------------------------------------------- /工程/TsProject/tsconfig.module.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "target": "esnext", 5 | "outDir": "build/module", 6 | "module": "esnext" 7 | }, 8 | "exclude": [ 9 | "node_modules/**" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /工程/UIProject/.gitignore: -------------------------------------------------------------------------------- 1 | .objs 2 | -------------------------------------------------------------------------------- /工程/UIProject/assets/main/Main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |