From 9cd469b811956d061092294fe41af4c56f5193c5 Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Tue, 15 Oct 2024 20:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4FairyGUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JNFrame2/Assembly-CSharp-firstpass.csproj | 9 + JNFrame2/Assembly-CSharp.csproj | 8 + JNFrame2/Assets/HotMain/HotMain.unity | 52 + JNFrame2/Assets/Plugins/FairyGUI.meta | 8 + JNFrame2/Assets/Plugins/FairyGUI/Editor.meta | 8 + .../FairyGUI/Editor/DisplayObjectEditor.cs | 126 + .../Editor/DisplayObjectEditor.cs.meta | 13 + .../Plugins/FairyGUI/Editor/EditorToolSet.cs | 135 + .../FairyGUI/Editor/EditorToolSet.cs.meta | 13 + .../FairyGUI/Editor/FairyGUI.Editor.asmdef | 18 + .../Editor/FairyGUI.Editor.asmdef.meta | 7 + .../Plugins/FairyGUI/Editor/PackagesWindow.cs | 201 ++ .../FairyGUI/Editor/PackagesWindow.cs.meta | 13 + .../FairyGUI/Editor/StageCameraEditor.cs | 29 + .../FairyGUI/Editor/StageCameraEditor.cs.meta | 13 + .../Plugins/FairyGUI/Editor/UIConfigEditor.cs | 226 ++ .../FairyGUI/Editor/UIConfigEditor.cs.meta | 13 + .../FairyGUI/Editor/UIContentScalerEditor.cs | 64 + .../Editor/UIContentScalerEditor.cs.meta | 13 + .../FairyGUI/Editor/UIPainterEditor.cs | 96 + .../FairyGUI/Editor/UIPainterEditor.cs.meta | 13 + .../Plugins/FairyGUI/Editor/UIPanelEditor.cs | 163 + .../FairyGUI/Editor/UIPanelEditor.cs.meta | 13 + .../Plugins/FairyGUI/ReadMe - 4.3.0.txt | 150 + .../Plugins/FairyGUI/ReadMe - 4.3.0.txt.meta | 7 + JNFrame2/Assets/Plugins/FairyGUI/Runtime.meta | 8 + .../Plugins/FairyGUI/Runtime/Extensions.meta | 8 + .../Runtime/Extensions/DragonBones.meta | 8 + .../DragonBones/DragonBonesLoader.cs | 109 + .../DragonBones/DragonBonesLoader.cs.meta | 11 + .../FairyGUI/Runtime/Extensions/Spine.meta | 8 + .../Runtime/Extensions/Spine/SpineLoader.cs | 160 + .../Extensions/Spine/SpineLoader.cs.meta | 11 + .../Runtime/Extensions/TextMeshPro.meta | 8 + .../Extensions/TextMeshPro/Shaders.meta | 8 + .../TextMeshPro/Shaders/FairyGUI-TMP.shader | 338 ++ .../Shaders/FairyGUI-TMP.shader.meta | 9 + .../Runtime/Extensions/TextMeshPro/TMPFont.cs | 542 +++ .../Extensions/TextMeshPro/TMPFont.cs.meta | 11 + .../Extensions/TextMeshPro/TMPTextFormat.cs | 16 + .../TextMeshPro/TMPTextFormat.cs.meta | 11 + .../FairyGUI/Runtime/FairyGUI.Runtime.asmdef | 14 + .../Runtime/FairyGUI.Runtime.asmdef.meta | 7 + .../Plugins/FairyGUI/Runtime/Resources.meta | 8 + .../FairyGUI/Runtime/Resources/Shaders.meta | 9 + .../Runtime/Resources/Shaders/AddOn.meta | 9 + .../Shaders/AddOn/FairyGUI-BlurFilter.shader | 58 + .../AddOn/FairyGUI-BlurFilter.shader.meta | 9 + .../Resources/Shaders/FairyGUI-BMFont.shader | 154 + .../Shaders/FairyGUI-BMFont.shader.meta | 9 + .../Resources/Shaders/FairyGUI-Image.shader | 182 + .../Shaders/FairyGUI-Image.shader.meta | 9 + .../Resources/Shaders/FairyGUI-Text.shader | 150 + .../Shaders/FairyGUI-Text.shader.meta | 9 + .../Plugins/FairyGUI/Runtime/Scripts.meta | 8 + .../FairyGUI/Runtime/Scripts/Core.meta | 9 + .../Runtime/Scripts/Core/BlendMode.cs | 110 + .../Runtime/Scripts/Core/BlendMode.cs.meta | 13 + .../Runtime/Scripts/Core/CaptureCamera.cs | 202 ++ .../Scripts/Core/CaptureCamera.cs.meta | 13 + .../Runtime/Scripts/Core/Container.cs | 1124 ++++++ .../Runtime/Scripts/Core/Container.cs.meta | 13 + .../Runtime/Scripts/Core/DisplayObject.cs | 1878 ++++++++++ .../Scripts/Core/DisplayObject.cs.meta | 13 + .../Runtime/Scripts/Core/GoWrapper.cs | 393 +++ .../Runtime/Scripts/Core/GoWrapper.cs.meta | 13 + .../Runtime/Scripts/Core/HitTest.meta | 9 + .../Scripts/Core/HitTest/ColliderHitTest.cs | 33 + .../Core/HitTest/ColliderHitTest.cs.meta | 13 + .../Scripts/Core/HitTest/HitTestContext.cs | 79 + .../Core/HitTest/HitTestContext.cs.meta | 13 + .../Runtime/Scripts/Core/HitTest/IHitTest.cs | 27 + .../Scripts/Core/HitTest/IHitTest.cs.meta | 13 + .../Core/HitTest/MeshColliderHitTest.cs | 43 + .../Core/HitTest/MeshColliderHitTest.cs.meta | 13 + .../Scripts/Core/HitTest/PixelHitTest.cs | 82 + .../Scripts/Core/HitTest/PixelHitTest.cs.meta | 13 + .../Scripts/Core/HitTest/RectHitTest.cs | 26 + .../Scripts/Core/HitTest/RectHitTest.cs.meta | 13 + .../Scripts/Core/HitTest/ShapeHitTest.cs | 44 + .../Scripts/Core/HitTest/ShapeHitTest.cs.meta | 11 + .../FairyGUI/Runtime/Scripts/Core/Image.cs | 436 +++ .../Runtime/Scripts/Core/Image.cs.meta | 13 + .../Runtime/Scripts/Core/MaterialManager.cs | 243 ++ .../Scripts/Core/MaterialManager.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Core/Mesh.meta | 10 + .../Scripts/Core/Mesh/CompositeMesh.cs | 75 + .../Scripts/Core/Mesh/CompositeMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/EllipseMesh.cs | 200 ++ .../Scripts/Core/Mesh/EllipseMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/FillMesh.cs | 400 +++ .../Scripts/Core/Mesh/FillMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/LineMesh.cs | 179 + .../Scripts/Core/Mesh/LineMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/MeshFactory.cs | 15 + .../Scripts/Core/Mesh/MeshFactory.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/PlaneMesh.cs | 51 + .../Scripts/Core/Mesh/PlaneMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/PolygonMesh.cs | 291 ++ .../Scripts/Core/Mesh/PolygonMesh.cs.meta | 13 + .../Runtime/Scripts/Core/Mesh/RectMesh.cs | 85 + .../Scripts/Core/Mesh/RectMesh.cs.meta | 13 + .../Scripts/Core/Mesh/RegularPolygonMesh.cs | 128 + .../Core/Mesh/RegularPolygonMesh.cs.meta | 13 + .../Scripts/Core/Mesh/RoundedRectMesh.cs | 177 + .../Scripts/Core/Mesh/RoundedRectMesh.cs.meta | 13 + .../Scripts/Core/Mesh/StraightLineMesh.cs | 90 + .../Core/Mesh/StraightLineMesh.cs.meta | 11 + .../Runtime/Scripts/Core/Mesh/VertexBuffer.cs | 441 +++ .../Scripts/Core/Mesh/VertexBuffer.cs.meta | 13 + .../Runtime/Scripts/Core/MovieClip.cs | 414 +++ .../Runtime/Scripts/Core/MovieClip.cs.meta | 13 + .../Runtime/Scripts/Core/NAudioClip.cs | 67 + .../Runtime/Scripts/Core/NAudioClip.cs.meta | 13 + .../Runtime/Scripts/Core/NGraphics.cs | 842 +++++ .../Runtime/Scripts/Core/NGraphics.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Core/NTexture.cs | 515 +++ .../Runtime/Scripts/Core/NTexture.cs.meta | 13 + .../Runtime/Scripts/Core/ShaderConfig.cs | 95 + .../Runtime/Scripts/Core/ShaderConfig.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Core/Shape.cs | 250 ++ .../Runtime/Scripts/Core/Shape.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Core/Stage.cs | 1768 ++++++++++ .../Runtime/Scripts/Core/Stage.cs.meta | 13 + .../Runtime/Scripts/Core/StageCamera.cs | 196 ++ .../Runtime/Scripts/Core/StageCamera.cs.meta | 13 + .../Runtime/Scripts/Core/StageEngine.cs | 49 + .../Runtime/Scripts/Core/StageEngine.cs.meta | 11 + .../FairyGUI/Runtime/Scripts/Core/Stats.cs | 29 + .../Runtime/Scripts/Core/Stats.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Core/Text.meta | 9 + .../Runtime/Scripts/Core/Text/BaseFont.cs | 108 + .../Scripts/Core/Text/BaseFont.cs.meta | 13 + .../Runtime/Scripts/Core/Text/BitmapFont.cs | 177 + .../Scripts/Core/Text/BitmapFont.cs.meta | 13 + .../Runtime/Scripts/Core/Text/DynamicFont.cs | 385 +++ .../Scripts/Core/Text/DynamicFont.cs.meta | 13 + .../Runtime/Scripts/Core/Text/Emoji.cs | 48 + .../Runtime/Scripts/Core/Text/Emoji.cs.meta | 13 + .../Runtime/Scripts/Core/Text/FontManager.cs | 146 + .../Scripts/Core/Text/FontManager.cs.meta | 13 + .../Runtime/Scripts/Core/Text/IKeyboard.cs | 42 + .../Scripts/Core/Text/IKeyboard.cs.meta | 13 + .../Scripts/Core/Text/InputTextField.cs | 1569 +++++++++ .../Scripts/Core/Text/InputTextField.cs.meta | 13 + .../Runtime/Scripts/Core/Text/RTLSupport.cs | 701 ++++ .../Scripts/Core/Text/RTLSupport.cs.meta | 13 + .../Scripts/Core/Text/RichTextField.cs | 216 ++ .../Scripts/Core/Text/RichTextField.cs.meta | 13 + .../Scripts/Core/Text/SelectionShape.cs | 94 + .../Scripts/Core/Text/SelectionShape.cs.meta | 13 + .../Runtime/Scripts/Core/Text/TextField.cs | 1701 +++++++++ .../Scripts/Core/Text/TextField.cs.meta | 13 + .../Runtime/Scripts/Core/Text/TextFormat.cs | 175 + .../Scripts/Core/Text/TextFormat.cs.meta | 13 + .../Scripts/Core/Text/TouchScreenKeyboard.cs | 65 + .../Core/Text/TouchScreenKeyboard.cs.meta | 13 + .../Runtime/Scripts/Core/Text/TypingEffect.cs | 248 ++ .../Scripts/Core/Text/TypingEffect.cs.meta | 13 + .../Runtime/Scripts/Core/UpdateContext.cs | 310 ++ .../Scripts/Core/UpdateContext.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Event.meta | 9 + .../Runtime/Scripts/Event/EventBridge.cs | 198 ++ .../Runtime/Scripts/Event/EventBridge.cs.meta | 13 + .../Runtime/Scripts/Event/EventContext.cs | 94 + .../Scripts/Event/EventContext.cs.meta | 13 + .../Runtime/Scripts/Event/EventDispatcher.cs | 515 +++ .../Scripts/Event/EventDispatcher.cs.meta | 13 + .../Runtime/Scripts/Event/EventListener.cs | 284 ++ .../Scripts/Event/EventListener.cs.meta | 13 + .../Runtime/Scripts/Event/IEventDispatcher.cs | 20 + .../Scripts/Event/IEventDispatcher.cs.meta | 13 + .../Runtime/Scripts/Event/InputEvent.cs | 149 + .../Runtime/Scripts/Event/InputEvent.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Filter.meta | 9 + .../Runtime/Scripts/Filter/BlurFilter.cs | 103 + .../Runtime/Scripts/Filter/BlurFilter.cs.meta | 13 + .../Runtime/Scripts/Filter/ColorFilter.cs | 238 ++ .../Scripts/Filter/ColorFilter.cs.meta | 13 + .../Runtime/Scripts/Filter/IFilter.cs | 24 + .../Runtime/Scripts/Filter/IFilter.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Gesture.meta | 9 + .../Scripts/Gesture/LongPressGesture.cs | 155 + .../Scripts/Gesture/LongPressGesture.cs.meta | 13 + .../Runtime/Scripts/Gesture/PinchGesture.cs | 156 + .../Scripts/Gesture/PinchGesture.cs.meta | 13 + .../Scripts/Gesture/RotationGesture.cs | 169 + .../Scripts/Gesture/RotationGesture.cs.meta | 13 + .../Runtime/Scripts/Gesture/SwipeGesture.cs | 228 ++ .../Scripts/Gesture/SwipeGesture.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Tween.meta | 10 + .../Runtime/Scripts/Tween/EaseManager.cs | 248 ++ .../Runtime/Scripts/Tween/EaseManager.cs.meta | 13 + .../Runtime/Scripts/Tween/EaseType.cs | 141 + .../Runtime/Scripts/Tween/EaseType.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Tween/GPath.cs | 475 +++ .../Runtime/Scripts/Tween/GPath.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Tween/GTween.cs | 189 + .../Runtime/Scripts/Tween/GTween.cs.meta | 13 + .../Runtime/Scripts/Tween/GTweener.cs | 859 +++++ .../Runtime/Scripts/Tween/GTweener.cs.meta | 13 + .../Runtime/Scripts/Tween/TweenManager.cs | 180 + .../Scripts/Tween/TweenManager.cs.meta | 13 + .../Runtime/Scripts/Tween/TweenPropType.cs | 103 + .../Scripts/Tween/TweenPropType.cs.meta | 13 + .../Runtime/Scripts/Tween/TweenValue.cs | 151 + .../Runtime/Scripts/Tween/TweenValue.cs.meta | 13 + .../Plugins/FairyGUI/Runtime/Scripts/UI.meta | 9 + .../FairyGUI/Runtime/Scripts/UI/Action.meta | 9 + .../Scripts/UI/Action/ChangePageAction.cs | 52 + .../UI/Action/ChangePageAction.cs.meta | 13 + .../Scripts/UI/Action/ControllerAction.cs | 68 + .../UI/Action/ControllerAction.cs.meta | 13 + .../Scripts/UI/Action/PlayTransitionAction.cs | 52 + .../UI/Action/PlayTransitionAction.cs.meta | 13 + .../Runtime/Scripts/UI/AsyncCreationHelper.cs | 189 + .../Scripts/UI/AsyncCreationHelper.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Controller.cs | 434 +++ .../Runtime/Scripts/UI/Controller.cs.meta | 13 + .../Runtime/Scripts/UI/DragDropManager.cs | 122 + .../Scripts/UI/DragDropManager.cs.meta | 13 + .../Runtime/Scripts/UI/EMRenderSupport.cs | 129 + .../Scripts/UI/EMRenderSupport.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/FieldTypes.cs | 304 ++ .../Runtime/Scripts/UI/FieldTypes.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GButton.cs | 657 ++++ .../Runtime/Scripts/UI/GButton.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GComboBox.cs | 629 ++++ .../Runtime/Scripts/UI/GComboBox.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GComponent.cs | 1726 +++++++++ .../Runtime/Scripts/UI/GComponent.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GGraph.cs | 274 ++ .../Runtime/Scripts/UI/GGraph.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GGroup.cs | 538 +++ .../Runtime/Scripts/UI/GGroup.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GImage.cs | 172 + .../Runtime/Scripts/UI/GImage.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GLabel.cs | 235 ++ .../Runtime/Scripts/UI/GLabel.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GList.cs | 3071 +++++++++++++++++ .../FairyGUI/Runtime/Scripts/UI/GList.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GLoader.cs | 701 ++++ .../Runtime/Scripts/UI/GLoader.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GLoader3D.cs | 566 +++ .../Runtime/Scripts/UI/GLoader3D.cs.meta | 11 + .../FairyGUI/Runtime/Scripts/UI/GMovieClip.cs | 190 + .../Runtime/Scripts/UI/GMovieClip.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GObject.cs | 2179 ++++++++++++ .../Runtime/Scripts/UI/GObject.cs.meta | 13 + .../Runtime/Scripts/UI/GObjectPool.cs | 106 + .../Runtime/Scripts/UI/GObjectPool.cs.meta | 13 + .../Runtime/Scripts/UI/GProgressBar.cs | 311 ++ .../Runtime/Scripts/UI/GProgressBar.cs.meta | 13 + .../Runtime/Scripts/UI/GRichTextField.cs | 53 + .../Runtime/Scripts/UI/GRichTextField.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GRoot.cs | 847 +++++ .../FairyGUI/Runtime/Scripts/UI/GRoot.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GScrollBar.cs | 226 ++ .../Runtime/Scripts/UI/GScrollBar.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GSlider.cs | 405 +++ .../Runtime/Scripts/UI/GSlider.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GTextField.cs | 438 +++ .../Runtime/Scripts/UI/GTextField.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GTextInput.cs | 243 ++ .../Runtime/Scripts/UI/GTextInput.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/GTree.cs | 557 +++ .../FairyGUI/Runtime/Scripts/UI/GTree.cs.meta | 11 + .../FairyGUI/Runtime/Scripts/UI/GTreeNode.cs | 406 +++ .../Runtime/Scripts/UI/GTreeNode.cs.meta | 11 + .../FairyGUI/Runtime/Scripts/UI/Gears.meta | 9 + .../Runtime/Scripts/UI/Gears/GearAnimation.cs | 109 + .../Scripts/UI/Gears/GearAnimation.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearBase.cs | 203 ++ .../Runtime/Scripts/UI/Gears/GearBase.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearColor.cs | 142 + .../Scripts/UI/Gears/GearColor.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearDisplay.cs | 68 + .../Scripts/UI/Gears/GearDisplay.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearDisplay2.cs | 55 + .../Scripts/UI/Gears/GearDisplay2.cs.meta | 11 + .../Runtime/Scripts/UI/Gears/GearFontSize.cs | 53 + .../Scripts/UI/Gears/GearFontSize.cs.meta | 11 + .../Runtime/Scripts/UI/Gears/GearIcon.cs | 51 + .../Runtime/Scripts/UI/Gears/GearIcon.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearLook.cs | 152 + .../Runtime/Scripts/UI/Gears/GearLook.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearSize.cs | 163 + .../Runtime/Scripts/UI/Gears/GearSize.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearText.cs | 51 + .../Runtime/Scripts/UI/Gears/GearText.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/GearXY.cs | 177 + .../Runtime/Scripts/UI/Gears/GearXY.cs.meta | 13 + .../Scripts/UI/Gears/IAnimationGear.cs | 35 + .../Scripts/UI/Gears/IAnimationGear.cs.meta | 13 + .../Runtime/Scripts/UI/Gears/IColorGear.cs | 26 + .../Scripts/UI/Gears/IColorGear.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/IUISource.cs | 36 + .../Runtime/Scripts/UI/IUISource.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Margin.cs | 29 + .../Runtime/Scripts/UI/Margin.cs.meta | 13 + .../Runtime/Scripts/UI/PackageItem.cs | 85 + .../Runtime/Scripts/UI/PackageItem.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/PopupMenu.cs | 565 +++ .../Runtime/Scripts/UI/PopupMenu.cs.meta | 13 + .../Runtime/Scripts/UI/RelationItem.cs | 672 ++++ .../Runtime/Scripts/UI/RelationItem.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Relations.cs | 220 ++ .../Runtime/Scripts/UI/Relations.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/ScrollPane.cs | 2301 ++++++++++++ .../Runtime/Scripts/UI/ScrollPane.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Transition.cs | 1771 ++++++++++ .../Runtime/Scripts/UI/Transition.cs.meta | 13 + .../Runtime/Scripts/UI/TranslationHelper.cs | 253 ++ .../Scripts/UI/TranslationHelper.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Tree.meta | 9 + .../Runtime/Scripts/UI/Tree/TreeNode.cs | 348 ++ .../Runtime/Scripts/UI/Tree/TreeNode.cs.meta | 13 + .../Runtime/Scripts/UI/Tree/TreeView.cs | 490 +++ .../Runtime/Scripts/UI/Tree/TreeView.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/UIConfig.cs | 462 +++ .../Runtime/Scripts/UI/UIConfig.cs.meta | 13 + .../Runtime/Scripts/UI/UIContentScaler.cs | 217 ++ .../Scripts/UI/UIContentScaler.cs.meta | 13 + .../Runtime/Scripts/UI/UIObjectFactory.cs | 202 ++ .../Scripts/UI/UIObjectFactory.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/UIPackage.cs | 1666 +++++++++ .../Runtime/Scripts/UI/UIPackage.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/UIPainter.cs | 335 ++ .../Runtime/Scripts/UI/UIPainter.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/UIPanel.cs | 622 ++++ .../Runtime/Scripts/UI/UIPanel.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/UI/Window.cs | 555 +++ .../Runtime/Scripts/UI/Window.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils.meta | 9 + .../Runtime/Scripts/Utils/ByteBuffer.cs | 455 +++ .../Runtime/Scripts/Utils/ByteBuffer.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils/Html.meta | 9 + .../Runtime/Scripts/Utils/Html/HtmlButton.cs | 104 + .../Scripts/Utils/Html/HtmlButton.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlElement.cs | 207 ++ .../Scripts/Utils/Html/HtmlElement.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlImage.cs | 126 + .../Scripts/Utils/Html/HtmlImage.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlInput.cs | 117 + .../Scripts/Utils/Html/HtmlInput.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlLink.cs | 113 + .../Scripts/Utils/Html/HtmlLink.cs.meta | 13 + .../Scripts/Utils/Html/HtmlPageContext.cs | 150 + .../Utils/Html/HtmlPageContext.cs.meta | 13 + .../Scripts/Utils/Html/HtmlParseOptions.cs | 65 + .../Utils/Html/HtmlParseOptions.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlParser.cs | 387 +++ .../Scripts/Utils/Html/HtmlParser.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/HtmlSelect.cs | 107 + .../Scripts/Utils/Html/HtmlSelect.cs.meta | 13 + .../Runtime/Scripts/Utils/Html/IHtmlObject.cs | 24 + .../Scripts/Utils/Html/IHtmlObject.cs.meta | 13 + .../Scripts/Utils/Html/IHtmlPageContext.cs | 15 + .../Utils/Html/IHtmlPageContext.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils/Timers.cs | 274 ++ .../Runtime/Scripts/Utils/Timers.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils/ToolSet.cs | 136 + .../Runtime/Scripts/Utils/ToolSet.cs.meta | 13 + .../Runtime/Scripts/Utils/UBBParser.cs | 226 ++ .../Runtime/Scripts/Utils/UBBParser.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils/XML.cs | 427 +++ .../Runtime/Scripts/Utils/XML.cs.meta | 13 + .../Runtime/Scripts/Utils/XMLIterator.cs | 485 +++ .../Runtime/Scripts/Utils/XMLIterator.cs.meta | 13 + .../FairyGUI/Runtime/Scripts/Utils/XMLList.cs | 144 + .../Runtime/Scripts/Utils/XMLList.cs.meta | 13 + .../Runtime/Scripts/Utils/XMLUtils.cs | 133 + .../Runtime/Scripts/Utils/XMLUtils.cs.meta | 13 + .../Runtime/Scripts/Utils/ZipReader.cs | 114 + .../Runtime/Scripts/Utils/ZipReader.cs.meta | 13 + .../SHFrame/Runtime/Modules/SHFrameModule.cs | 6 + .../SHFrame/Runtime/Modules/UIModule.meta | 3 + .../Modules/UIModule/FairyGUILoader.cs | 139 + .../Modules/UIModule/FairyGUILoader.cs.meta | 3 + .../Runtime/Modules/UIModule/UIBase.cs | 56 + .../Runtime/Modules/UIModule/UIBase.cs.meta | 3 + .../Runtime/Modules/UIModule/UIModule.cs | 192 ++ .../Runtime/Modules/UIModule/UIModule.cs.meta | 3 + .../SHFrame/Runtime/SHFrame.Runtime.asmdef | 3 +- JNFrame2/FairyGUI.Editor.csproj | 866 +++++ JNFrame2/FairyGUI.Runtime.csproj | 1004 ++++++ JNFrame2/JNFrame2.sln | 8 + JNFrame2/Logs/AssetImportWorker0-prev.log | 2308 +++++++++++++ JNFrame2/Logs/AssetImportWorker0.log | 2274 ++---------- JNFrame2/Logs/AssetImportWorker1-prev.log | 2188 ++++++++++++ JNFrame2/Logs/AssetImportWorker1.log | 2184 +----------- .../shadercompiler-AssetImportWorker0.log | 1 + ...hadercompiler-UnityShaderCompiler.exe0.log | 21 + ...hadercompiler-UnityShaderCompiler.exe1.log | 6 + ...hadercompiler-UnityShaderCompiler.exe2.log | 6 + ...hadercompiler-UnityShaderCompiler.exe3.log | 6 + ...hadercompiler-UnityShaderCompiler.exe4.log | 6 + ...hadercompiler-UnityShaderCompiler.exe5.log | 6 + ...hadercompiler-UnityShaderCompiler.exe6.log | 6 + ...hadercompiler-UnityShaderCompiler.exe7.log | 6 + ...hadercompiler-UnityShaderCompiler.exe8.log | 6 + JNFrame2/Modules/FairyGUI/.gitignore | 2 + JNFrame2/Modules/FairyGUI/FairyGUI.fairy | 2 + .../FairyGUI/assets/Package1/Component1.xml | 8 + .../FairyGUI/assets/Package1/ProgressBar1.xml | 10 + .../FairyGUI/assets/Package1/package.xml | 8 + JNFrame2/SHFrame.csproj | 7 + ...yGUI.Editor.csproj.AssemblyReference.cache | Bin 0 -> 125503 bytes ...GUI.Runtime.csproj.AssemblyReference.cache | Bin 0 -> 123831 bytes 409 files changed, 66228 insertions(+), 4076 deletions(-) create mode 100644 JNFrame2/Assets/Plugins/FairyGUI.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs.meta create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs create mode 100644 JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs.meta create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule.meta create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs.meta create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs.meta create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs create mode 100644 JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs.meta create mode 100644 JNFrame2/FairyGUI.Editor.csproj create mode 100644 JNFrame2/FairyGUI.Runtime.csproj create mode 100644 JNFrame2/Logs/AssetImportWorker0-prev.log create mode 100644 JNFrame2/Logs/AssetImportWorker1-prev.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe1.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe2.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe3.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe4.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe5.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe6.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe7.log create mode 100644 JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe8.log create mode 100644 JNFrame2/Modules/FairyGUI/.gitignore create mode 100644 JNFrame2/Modules/FairyGUI/FairyGUI.fairy create mode 100644 JNFrame2/Modules/FairyGUI/assets/Package1/Component1.xml create mode 100644 JNFrame2/Modules/FairyGUI/assets/Package1/ProgressBar1.xml create mode 100644 JNFrame2/Modules/FairyGUI/assets/Package1/package.xml create mode 100644 JNFrame2/obj/Debug/FairyGUI.Editor.csproj.AssemblyReference.cache create mode 100644 JNFrame2/obj/Debug/FairyGUI.Runtime.csproj.AssemblyReference.cache diff --git a/JNFrame2/Assembly-CSharp-firstpass.csproj b/JNFrame2/Assembly-CSharp-firstpass.csproj index 4001ee3d..3e7b9a81 100644 --- a/JNFrame2/Assembly-CSharp-firstpass.csproj +++ b/JNFrame2/Assembly-CSharp-firstpass.csproj @@ -83,6 +83,7 @@ + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll @@ -899,6 +900,10 @@ {168b694c-7d58-d228-f9a3-02235c192fc5} UniTask.Linq + + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c} + FairyGUI.Runtime + {17b58f54-5d7b-7430-a784-74a4540f4c68} JNGame.Editor @@ -943,6 +948,10 @@ {56fe4698-9e38-f97f-0948-b4a412ec01fc} SHFrame + + {44b47b38-a33f-7d44-f2e0-a6c5f272d235} + FairyGUI.Editor + {694241c5-b793-03a0-1887-6d1b1abd5716} UniTask.DOTween diff --git a/JNFrame2/Assembly-CSharp.csproj b/JNFrame2/Assembly-CSharp.csproj index aa6cb655..7d61dd77 100644 --- a/JNFrame2/Assembly-CSharp.csproj +++ b/JNFrame2/Assembly-CSharp.csproj @@ -1015,6 +1015,10 @@ {168b694c-7d58-d228-f9a3-02235c192fc5} UniTask.Linq + + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c} + FairyGUI.Runtime + {17b58f54-5d7b-7430-a784-74a4540f4c68} JNGame.Editor @@ -1059,6 +1063,10 @@ {56fe4698-9e38-f97f-0948-b4a412ec01fc} SHFrame + + {44b47b38-a33f-7d44-f2e0-a6c5f272d235} + FairyGUI.Editor + {694241c5-b793-03a0-1887-6d1b1abd5716} UniTask.DOTween diff --git a/JNFrame2/Assets/HotMain/HotMain.unity b/JNFrame2/Assets/HotMain/HotMain.unity index 5bc67f29..58d28f0e 100644 --- a/JNFrame2/Assets/HotMain/HotMain.unity +++ b/JNFrame2/Assets/HotMain/HotMain.unity @@ -406,3 +406,55 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1994723394 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1994723396} + - component: {fileID: 1994723395} + m_Layer: 0 + m_Name: UIContentScaler + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1994723395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1994723394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a723f7fd716aac049aa24e9186f18685, type: 3} + m_Name: + m_EditorClassIdentifier: + scaleMode: 1 + screenMatchMode: 0 + designResolutionX: 1600 + designResolutionY: 720 + fallbackScreenDPI: 96 + defaultSpriteDPI: 96 + constantScaleFactor: 1 + ignoreOrientation: 0 +--- !u!4 &1994723396 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1994723394} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/JNFrame2/Assets/Plugins/FairyGUI.meta b/JNFrame2/Assets/Plugins/FairyGUI.meta new file mode 100644 index 00000000..dd4094a4 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53bdd28b74e5cb144ac7165c06a5f286 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor.meta new file mode 100644 index 00000000..54b45634 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3fca1864980d947bfb1fd073c07362e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs new file mode 100644 index 00000000..a307e67d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs @@ -0,0 +1,126 @@ +using UnityEngine; +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(DisplayObjectInfo))] + public class DisplayObjectEditor : Editor + { + void OnEnable() + { + } + + public override void OnInspectorGUI() + { + DisplayObject obj = (target as DisplayObjectInfo).displayObject; + if (obj == null) + return; + + EditorGUILayout.LabelField(obj.GetType().Name + ": " + obj.id, (GUIStyle)"OL Title"); + EditorGUILayout.Separator(); + EditorGUI.BeginChangeCheck(); + string name = EditorGUILayout.TextField("Name", obj.name); + if (EditorGUI.EndChangeCheck()) + obj.name = name; + if (obj is Container) + { + EditorGUI.BeginChangeCheck(); + bool fairyBatching = EditorGUILayout.Toggle("FairyBatching", ((Container)obj).fairyBatching); + if (EditorGUI.EndChangeCheck()) + ((Container)obj).fairyBatching = fairyBatching; + } + + GObject gObj = obj.gOwner; + if (gObj != null) + { + EditorGUILayout.Separator(); + EditorGUILayout.LabelField(gObj.GetType().Name + ": " + gObj.id, (GUIStyle)"OL Title"); + EditorGUILayout.Separator(); + + if (!string.IsNullOrEmpty(gObj.resourceURL)) + { + PackageItem pi = UIPackage.GetItemByURL(gObj.resourceURL); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Resource"); + EditorGUILayout.LabelField(pi.name + "@" + pi.owner.name); + EditorGUILayout.EndHorizontal(); + } + + EditorGUI.BeginChangeCheck(); + name = EditorGUILayout.TextField("Name", gObj.name); + if (EditorGUI.EndChangeCheck()) + gObj.name = name; + + if (gObj.parent != null) + { + string[] options = new string[gObj.parent.numChildren]; + int[] values = new int[options.Length]; + for (int i = 0; i < options.Length; i++) + { + options[i] = i.ToString(); + values[i] = i; + } + EditorGUI.BeginChangeCheck(); + int childIndex = EditorGUILayout.IntPopup("Child Index", gObj.parent.GetChildIndex(gObj), options, values); + if (EditorGUI.EndChangeCheck()) + gObj.parent.SetChildIndex(gObj, childIndex); + } + else + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Child Index"); + EditorGUILayout.LabelField("No Parent"); + EditorGUILayout.EndHorizontal(); + } + + EditorGUI.BeginChangeCheck(); + Vector3 position = EditorGUILayout.Vector3Field("Position", gObj.position); + if (EditorGUI.EndChangeCheck()) + gObj.position = position; + + EditorGUI.BeginChangeCheck(); + Vector3 rotation = EditorGUILayout.Vector3Field("Rotation", new Vector3(gObj.rotationX, gObj.rotationY, gObj.rotation)); + if (EditorGUI.EndChangeCheck()) + { + gObj.rotationX = rotation.x; + gObj.rotationY = rotation.y; + gObj.rotation = rotation.z; + } + + EditorGUI.BeginChangeCheck(); + Vector2 scale = EditorGUILayout.Vector2Field("Scale", gObj.scale); + if (EditorGUI.EndChangeCheck()) + gObj.scale = scale; + + EditorGUI.BeginChangeCheck(); + Vector2 skew = EditorGUILayout.Vector2Field("Skew", gObj.skew); + if (EditorGUI.EndChangeCheck()) + gObj.skew = skew; + + EditorGUI.BeginChangeCheck(); + Vector2 size = EditorGUILayout.Vector2Field("Size", gObj.size); + if (EditorGUI.EndChangeCheck()) + gObj.size = size; + + EditorGUI.BeginChangeCheck(); + Vector2 pivot = EditorGUILayout.Vector2Field("Pivot", gObj.pivot); + if (EditorGUI.EndChangeCheck()) + gObj.pivot = pivot; + + EditorGUI.BeginChangeCheck(); + string text = EditorGUILayout.TextField("Text", gObj.text); + if (EditorGUI.EndChangeCheck()) + gObj.text = text; + + EditorGUI.BeginChangeCheck(); + string icon = EditorGUILayout.TextField("Icon", gObj.icon); + if (EditorGUI.EndChangeCheck()) + gObj.icon = icon; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs.meta new file mode 100644 index 00000000..5ed8600d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/DisplayObjectEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a2f78faa29e5e1547837f976bf4b39f2 +timeCreated: 1541149029 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs new file mode 100644 index 00000000..b736ef6e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs @@ -0,0 +1,135 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + public class EditorToolSet + { + public static GUIContent[] packagesPopupContents; + + static bool _loaded; + + [InitializeOnLoadMethod] + static void Startup() + { + EditorApplication.update += EditorApplication_Update; + } + + [MenuItem("GameObject/FairyGUI/UI Panel", false, 0)] + static void CreatePanel() + { + EditorApplication.update -= EditorApplication_Update; + EditorApplication.update += EditorApplication_Update; + + StageCamera.CheckMainCamera(); + + GameObject panelObject = new GameObject("UIPanel"); + if (Selection.activeGameObject != null) + { + panelObject.transform.parent = Selection.activeGameObject.transform; + panelObject.layer = Selection.activeGameObject.layer; + } + else + { + int layer = LayerMask.NameToLayer(StageCamera.LayerName); + panelObject.layer = layer; + } + panelObject.AddComponent(); + Selection.objects = new Object[] { panelObject }; + } + + [MenuItem("GameObject/FairyGUI/UI Camera", false, 0)] + static void CreateCamera() + { + StageCamera.CheckMainCamera(); + Selection.objects = new Object[] { StageCamera.main.gameObject }; + } + + [MenuItem("Window/FairyGUI - Refresh Packages And Panels")] + static void RefreshPanels() + { + ReloadPackages(); + } + + static void EditorApplication_Update() + { + if (Application.isPlaying) + return; + + if (_loaded || !EMRenderSupport.hasTarget) + return; + + LoadPackages(); + } + + public static void ReloadPackages() + { + if (!Application.isPlaying) + { + _loaded = false; + LoadPackages(); + Debug.Log("FairyGUI - Refresh Packages And Panels complete."); + } + else + EditorUtility.DisplayDialog("FairyGUI", "Cannot run in play mode.", "OK"); + } + + public static void LoadPackages() + { + if (Application.isPlaying || _loaded) + return; + + EditorApplication.update -= EditorApplication_Update; + EditorApplication.update += EditorApplication_Update; + + _loaded = true; + + UIPackage.RemoveAllPackages(); + FontManager.Clear(); + NTexture.DisposeEmpty(); + UIObjectFactory.Clear(); + + string[] ids = AssetDatabase.FindAssets("_fui t:textAsset"); + int cnt = ids.Length; + for (int i = 0; i < cnt; i++) + { + string assetPath = AssetDatabase.GUIDToAssetPath(ids[i]); + int pos = assetPath.LastIndexOf("_fui"); + if (pos == -1) + continue; + + assetPath = assetPath.Substring(0, pos); + if (AssetDatabase.AssetPathToGUID(assetPath) != null) + UIPackage.AddPackage(assetPath, + (string name, string extension, System.Type type, out DestroyMethod destroyMethod) => + { + destroyMethod = DestroyMethod.Unload; + return AssetDatabase.LoadAssetAtPath(name + extension, type); + } + ); + } + + List pkgs = UIPackage.GetPackages(); + pkgs.Sort(CompareUIPackage); + + cnt = pkgs.Count; + packagesPopupContents = new GUIContent[cnt + 1]; + for (int i = 0; i < cnt; i++) + packagesPopupContents[i] = new GUIContent(pkgs[i].name); + packagesPopupContents[cnt] = new GUIContent("Please Select"); + + EMRenderSupport.Reload(); + } + + static int CompareUIPackage(UIPackage u1, UIPackage u2) + { + return u1.name.CompareTo(u2.name); + } + } + +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs.meta new file mode 100644 index 00000000..65541278 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/EditorToolSet.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 35dcb233f95ffd54c94f09d731db89ae +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef b/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef new file mode 100644 index 00000000..51abd615 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "FairyGUI.Editor", + "rootNamespace": "", + "references": [ + "GUID:f4270d81837019d47b93f11421168dae" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef.meta new file mode 100644 index 00000000..0847954a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 19cba46ac204fdd48a96c9d9f1471d9c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs new file mode 100644 index 00000000..0fb36663 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs @@ -0,0 +1,201 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +#if UNITY_5_3_OR_NEWER +using UnityEditor.SceneManagement; +#endif +#if UNITY_2018_3_OR_NEWER +using UnityEditor.Experimental.SceneManagement; +#endif +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + public class PackagesWindow : EditorWindow + { + Vector2 scrollPos1; + Vector2 scrollPos2; + GUIStyle itemStyle; + + int selectedPackage; + string selectedPackageName; + string selectedComponentName; + + public PackagesWindow() + { + this.maxSize = new Vector2(550, 400); + this.minSize = new Vector2(550, 400); + } + + public void SetSelection(string packageName, string componentName) + { + selectedPackageName = packageName; + selectedComponentName = componentName; + } + + void OnGUI() + { + if (itemStyle == null) + itemStyle = new GUIStyle(GUI.skin.GetStyle("Tag MenuItem")); + + EditorGUILayout.BeginHorizontal(); + + //package list start------ + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(5); + + EditorGUILayout.BeginVertical(); + GUILayout.Space(10); + + EditorGUILayout.LabelField("Packages", (GUIStyle)"OL Title", GUILayout.Width(300)); + GUILayout.Space(5); + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(4); + + scrollPos1 = EditorGUILayout.BeginScrollView(scrollPos1, (GUIStyle)"CN Box", GUILayout.Height(300), GUILayout.Width(300)); + EditorToolSet.LoadPackages(); + List pkgs = UIPackage.GetPackages(); + int cnt = pkgs.Count; + if (cnt == 0) + { + selectedPackage = -1; + selectedPackageName = null; + } + else + { + for (int i = 0; i < cnt; i++) + { + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Toggle(selectedPackageName == pkgs[i].name, pkgs[i].name, itemStyle, GUILayout.ExpandWidth(true))) + { + selectedPackage = i; + selectedPackageName = pkgs[i].name; + } + EditorGUILayout.EndHorizontal(); + } + } + EditorGUILayout.EndScrollView(); + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.EndHorizontal(); + + //package list end------ + + //component list start------ + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(5); + + EditorGUILayout.BeginVertical(); + GUILayout.Space(10); + + EditorGUILayout.LabelField("Components", (GUIStyle)"OL Title", GUILayout.Width(220)); + GUILayout.Space(5); + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(4); + + scrollPos2 = EditorGUILayout.BeginScrollView(scrollPos2, (GUIStyle)"CN Box", GUILayout.Height(300), GUILayout.Width(220)); + if (selectedPackage >= 0) + { + List items = pkgs[selectedPackage].GetItems(); + int i = 0; + foreach (PackageItem pi in items) + { + if (pi.type == PackageItemType.Component && pi.exported) + { + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Toggle(selectedComponentName == pi.name, pi.name, itemStyle, GUILayout.ExpandWidth(true))) + selectedComponentName = pi.name; + i++; + EditorGUILayout.EndHorizontal(); + } + } + } + EditorGUILayout.EndScrollView(); + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.EndHorizontal(); + + //component list end------ + + GUILayout.Space(10); + + EditorGUILayout.EndHorizontal(); + + GUILayout.Space(20); + + //buttons start--- + EditorGUILayout.BeginHorizontal(); + + GUILayout.Space(180); + + if (GUILayout.Button("Refresh", GUILayout.Width(100))) + EditorToolSet.ReloadPackages(); + + GUILayout.Space(20); + if (GUILayout.Button("OK", GUILayout.Width(100)) && selectedPackage >= 0) + { + UIPackage selectedPkg = pkgs[selectedPackage]; + string tmp = selectedPkg.assetPath.ToLower(); + string packagePath; + int pos = tmp.LastIndexOf("/resources/"); + if (pos != -1) + packagePath = selectedPkg.assetPath.Substring(pos + 11); + else + { + pos = tmp.IndexOf("resources/"); + if (pos == 0) + packagePath = selectedPkg.assetPath.Substring(pos + 10); + else + packagePath = selectedPkg.assetPath; + } + if (Selection.activeGameObject != null) + { +#if UNITY_2018_3_OR_NEWER + bool isPrefab = PrefabUtility.GetPrefabAssetType(Selection.activeGameObject) != PrefabAssetType.NotAPrefab; +#else + bool isPrefab = PrefabUtility.GetPrefabType(Selection.activeGameObject) == PrefabType.Prefab; +#endif + Selection.activeGameObject.SendMessage("OnUpdateSource", + new object[] { selectedPkg.name, packagePath, selectedComponentName, !isPrefab }, + SendMessageOptions.DontRequireReceiver); + } + +#if UNITY_2018_3_OR_NEWER + PrefabStage prefabStage = PrefabStageUtility.GetCurrentPrefabStage(); + if (prefabStage != null) + EditorSceneManager.MarkSceneDirty(prefabStage.scene); + else + ApplyChange(); +#else + ApplyChange(); +#endif + this.Close(); + } + + EditorGUILayout.EndHorizontal(); + } + + void ApplyChange() + { +#if UNITY_5_3_OR_NEWER + EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); +#elif UNITY_5 + EditorApplication.MarkSceneDirty(); +#else + EditorUtility.SetDirty(Selection.activeGameObject); +#endif + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs.meta new file mode 100644 index 00000000..471d1b3d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/PackagesWindow.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 83ed477a96af9c94f9f2ccc24b5a24c0 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs new file mode 100644 index 00000000..0e7bba90 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs @@ -0,0 +1,29 @@ +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(StageCamera))] + public class StageCameraEditor : Editor + { + string[] propertyToExclude; + + void OnEnable() + { + propertyToExclude = new string[] { "m_Script" }; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + DrawPropertiesExcluding(serializedObject, propertyToExclude); + + if (serializedObject.ApplyModifiedProperties()) + (target as StageCamera).ApplyModifiedProperties(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs.meta new file mode 100644 index 00000000..517cdbaf --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/StageCameraEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2b99582678b83dc46986b02984c665a3 +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs new file mode 100644 index 00000000..dc6a828e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs @@ -0,0 +1,226 @@ +using UnityEngine; +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(UIConfig))] + public class UIConfigEditor : Editor + { + string[] propertyToExclude; + bool itemsFoldout; + bool packagesFoldOut; + int errorState; + + private const float kButtonWidth = 18f; + + void OnEnable() + { + propertyToExclude = new string[] { "m_Script", "Items", "PreloadPackages" }; + + itemsFoldout = EditorPrefs.GetBool("itemsFoldOut"); + packagesFoldOut = EditorPrefs.GetBool("packagesFoldOut"); + errorState = 0; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + DrawPropertiesExcluding(serializedObject, propertyToExclude); + + UIConfig config = (UIConfig)target; + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + itemsFoldout = EditorGUILayout.Foldout(itemsFoldout, "Config Items"); + if (EditorGUI.EndChangeCheck()) + EditorPrefs.SetBool("itemsFoldOut", itemsFoldout); + EditorGUILayout.EndHorizontal(); + + bool modified = false; + + if (itemsFoldout) + { + Undo.RecordObject(config, "Items"); + + int len = config.Items.Count; + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Add"); + UIConfig.ConfigKey selectedKey = (UIConfig.ConfigKey)EditorGUILayout.EnumPopup((System.Enum)UIConfig.ConfigKey.PleaseSelect); + + if (selectedKey != UIConfig.ConfigKey.PleaseSelect) + { + int index = (int)selectedKey; + + if (index > len - 1) + { + for (int i = len; i < index; i++) + config.Items.Add(new UIConfig.ConfigValue()); + + UIConfig.ConfigValue value = new UIConfig.ConfigValue(); + value.valid = true; + UIConfig.SetDefaultValue(selectedKey, value); + config.Items.Add(value); + } + else + { + UIConfig.ConfigValue value = config.Items[index]; + if (value == null) + { + value = new UIConfig.ConfigValue(); + value.valid = true; + UIConfig.SetDefaultValue(selectedKey, value); + config.Items[index] = value; + } + else if (!value.valid) + { + value.valid = true; + UIConfig.SetDefaultValue(selectedKey, value); + } + } + } + EditorGUILayout.EndHorizontal(); + + for (int i = 0; i < len; i++) + { + UIConfig.ConfigValue value = config.Items[i]; + if (value == null || !value.valid) + continue; + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(((UIConfig.ConfigKey)i).ToString()); + switch ((UIConfig.ConfigKey)i) + { + case UIConfig.ConfigKey.ClickDragSensitivity: + case UIConfig.ConfigKey.DefaultComboBoxVisibleItemCount: + case UIConfig.ConfigKey.DefaultScrollStep: + case UIConfig.ConfigKey.TouchDragSensitivity: + case UIConfig.ConfigKey.TouchScrollSensitivity: + case UIConfig.ConfigKey.InputCaretSize: + value.i = EditorGUILayout.IntField(value.i); + break; + + case UIConfig.ConfigKey.ButtonSound: + case UIConfig.ConfigKey.GlobalModalWaiting: + case UIConfig.ConfigKey.HorizontalScrollBar: + case UIConfig.ConfigKey.LoaderErrorSign: + case UIConfig.ConfigKey.PopupMenu: + case UIConfig.ConfigKey.PopupMenu_seperator: + case UIConfig.ConfigKey.TooltipsWin: + case UIConfig.ConfigKey.VerticalScrollBar: + case UIConfig.ConfigKey.WindowModalWaiting: + case UIConfig.ConfigKey.DefaultFont: + value.s = EditorGUILayout.TextField(value.s); + break; + + case UIConfig.ConfigKey.DefaultScrollBounceEffect: + case UIConfig.ConfigKey.DefaultScrollTouchEffect: + case UIConfig.ConfigKey.RenderingTextBrighterOnDesktop: + case UIConfig.ConfigKey.AllowSoftnessOnTopOrLeftSide: + case UIConfig.ConfigKey.DepthSupportForPaintingMode: + value.b = EditorGUILayout.Toggle(value.b); + break; + + case UIConfig.ConfigKey.ButtonSoundVolumeScale: + value.f = EditorGUILayout.Slider(value.f, 0, 1); + break; + + case UIConfig.ConfigKey.ModalLayerColor: + case UIConfig.ConfigKey.InputHighlightColor: + value.c = EditorGUILayout.ColorField(value.c); + break; + + case UIConfig.ConfigKey.Branch: + EditorGUI.BeginChangeCheck(); + value.s = EditorGUILayout.TextField(value.s); + if (EditorGUI.EndChangeCheck()) + modified = true; + break; + } + + if (GUILayout.Button(new GUIContent("X", "Delete Item"), EditorStyles.miniButtonRight, GUILayout.Width(30))) + { + config.Items[i].Reset(); + UIConfig.SetDefaultValue((UIConfig.ConfigKey)i, config.Items[i]); + modified = true; + } + EditorGUILayout.EndHorizontal(); + } + } + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + packagesFoldOut = EditorGUILayout.Foldout(packagesFoldOut, "Preload Packages"); + if (EditorGUI.EndChangeCheck()) + EditorPrefs.SetBool("packagesFoldOut", packagesFoldOut); + EditorGUILayout.EndHorizontal(); + + if (packagesFoldOut) + { + Undo.RecordObject(config, "PreloadPackages"); + + EditorToolSet.LoadPackages(); + + if (EditorToolSet.packagesPopupContents != null) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Add"); + int selected = EditorGUILayout.Popup(EditorToolSet.packagesPopupContents.Length - 1, EditorToolSet.packagesPopupContents); + EditorGUILayout.EndHorizontal(); + + if (selected != EditorToolSet.packagesPopupContents.Length - 1) + { + UIPackage pkg = UIPackage.GetPackages()[selected]; + string tmp = pkg.assetPath.ToLower(); + int pos = tmp.LastIndexOf("resources/"); + if (pos != -1) + { + string packagePath = pkg.assetPath.Substring(pos + 10); + if (config.PreloadPackages.IndexOf(packagePath) == -1) + config.PreloadPackages.Add(packagePath); + + errorState = 0; + } + else + { + errorState = 10; + } + } + } + + if (errorState > 0) + { + errorState--; + EditorGUILayout.HelpBox("Package is not in resources folder.", MessageType.Warning); + } + + int cnt = config.PreloadPackages.Count; + int pi = 0; + while (pi < cnt) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("" + pi + "."); + config.PreloadPackages[pi] = EditorGUILayout.TextField(config.PreloadPackages[pi]); + if (GUILayout.Button(new GUIContent("X", "Delete Item"), EditorStyles.miniButtonRight, GUILayout.Width(30))) + { + config.PreloadPackages.RemoveAt(pi); + cnt--; + } + else + pi++; + EditorGUILayout.EndHorizontal(); + } + } + else + errorState = 0; + + if (serializedObject.ApplyModifiedProperties() || modified) + (target as UIConfig).ApplyModifiedProperties(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs.meta new file mode 100644 index 00000000..e40b052d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIConfigEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 74df68b10ee56a54a8105d88312571ce +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs new file mode 100644 index 00000000..f874c985 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs @@ -0,0 +1,64 @@ +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(UIContentScaler))] + public class UIContentScalerEditor : Editor + { + SerializedProperty scaleMode; + SerializedProperty screenMatchMode; + SerializedProperty designResolutionX; + SerializedProperty designResolutionY; + SerializedProperty fallbackScreenDPI; + SerializedProperty defaultSpriteDPI; + SerializedProperty constantScaleFactor; + SerializedProperty ignoreOrientation; + + string[] propertyToExclude; + + void OnEnable() + { + scaleMode = serializedObject.FindProperty("scaleMode"); + screenMatchMode = serializedObject.FindProperty("screenMatchMode"); + designResolutionX = serializedObject.FindProperty("designResolutionX"); + designResolutionY = serializedObject.FindProperty("designResolutionY"); + fallbackScreenDPI = serializedObject.FindProperty("fallbackScreenDPI"); + defaultSpriteDPI = serializedObject.FindProperty("defaultSpriteDPI"); + constantScaleFactor = serializedObject.FindProperty("constantScaleFactor"); + ignoreOrientation = serializedObject.FindProperty("ignoreOrientation"); + + propertyToExclude = new string[] { "m_Script", "scaleMode", "screenMatchMode", "designResolutionX", "designResolutionY", + "fallbackScreenDPI", "defaultSpriteDPI", "constantScaleFactor", "ignoreOrientation"}; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + DrawPropertiesExcluding(serializedObject, propertyToExclude); + + EditorGUILayout.PropertyField(scaleMode); + if ((UIContentScaler.ScaleMode)scaleMode.enumValueIndex == UIContentScaler.ScaleMode.ScaleWithScreenSize) + { + EditorGUILayout.PropertyField(designResolutionX); + EditorGUILayout.PropertyField(designResolutionY); + EditorGUILayout.PropertyField(screenMatchMode); + EditorGUILayout.PropertyField(ignoreOrientation); + } + else if ((UIContentScaler.ScaleMode)scaleMode.enumValueIndex == UIContentScaler.ScaleMode.ConstantPhysicalSize) + { + EditorGUILayout.PropertyField(fallbackScreenDPI); + EditorGUILayout.PropertyField(defaultSpriteDPI); + } + else + EditorGUILayout.PropertyField(constantScaleFactor); + + if (serializedObject.ApplyModifiedProperties()) + (target as UIContentScaler).ApplyModifiedProperties(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs.meta new file mode 100644 index 00000000..edefd7c3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIContentScalerEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 69174d19fa9521b4283e0b8f0e85acc8 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs new file mode 100644 index 00000000..1f71214e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs @@ -0,0 +1,96 @@ +using UnityEngine; +#if UNITY_5_3_OR_NEWER +using UnityEditor.SceneManagement; +#endif +using UnityEditor; +using FairyGUI; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(UIPainter))] + public class UIPainterEditor : Editor + { + SerializedProperty packageName; + SerializedProperty componentName; + SerializedProperty renderCamera; + SerializedProperty fairyBatching; + SerializedProperty touchDisabled; + SerializedProperty sortingOrder; + + string[] propertyToExclude; + + void OnEnable() + { + packageName = serializedObject.FindProperty("packageName"); + componentName = serializedObject.FindProperty("componentName"); + renderCamera = serializedObject.FindProperty("renderCamera"); + fairyBatching = serializedObject.FindProperty("fairyBatching"); + touchDisabled = serializedObject.FindProperty("touchDisabled"); + sortingOrder = serializedObject.FindProperty("sortingOrder"); + + propertyToExclude = new string[] { "m_Script", "packageName", "componentName", "packagePath", + "renderCamera", "fairyBatching", "touchDisabled","sortingOrder" + }; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + UIPainter panel = target as UIPainter; + + DrawPropertiesExcluding(serializedObject, propertyToExclude); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Package Name"); + if (GUILayout.Button(packageName.stringValue, "ObjectField")) + EditorWindow.GetWindow(true, "Select a UI Component").SetSelection(packageName.stringValue, componentName.stringValue); + + if (GUILayout.Button("Clear", GUILayout.Width(50))) + { +#if UNITY_2018_3_OR_NEWER + bool isPrefab = PrefabUtility.GetPrefabAssetType(panel) != PrefabAssetType.NotAPrefab; +#else + bool isPrefab = PrefabUtility.GetPrefabType(panel) == PrefabType.Prefab; +#endif + panel.SendMessage("OnUpdateSource", new object[] { null, null, null, !isPrefab }); + +#if UNITY_5_3_OR_NEWER + EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); +#elif UNITY_5 + EditorApplication.MarkSceneDirty(); +#else + EditorUtility.SetDirty(panel); +#endif + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Component Name"); + if (GUILayout.Button(componentName.stringValue, "ObjectField")) + EditorWindow.GetWindow(true, "Select a UI Component").SetSelection(packageName.stringValue, componentName.stringValue); + EditorGUILayout.EndHorizontal(); + int oldSortingOrder = panel.sortingOrder; + EditorGUILayout.PropertyField(sortingOrder); + EditorGUILayout.PropertyField(renderCamera); + EditorGUILayout.PropertyField(fairyBatching); + EditorGUILayout.PropertyField(touchDisabled); + + if (serializedObject.ApplyModifiedProperties()) + { +#if UNITY_2018_3_OR_NEWER + bool isPrefab = PrefabUtility.GetPrefabAssetType(panel) != PrefabAssetType.NotAPrefab; +#else + bool isPrefab = PrefabUtility.GetPrefabType(panel) == PrefabType.Prefab; +#endif + if (!isPrefab) + { + panel.ApplyModifiedProperties(sortingOrder.intValue != oldSortingOrder); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs.meta new file mode 100644 index 00000000..01757308 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPainterEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5cb0f73c030157845aaa7b42a2b8d577 +timeCreated: 1461566835 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs new file mode 100644 index 00000000..b77eda99 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs @@ -0,0 +1,163 @@ +using UnityEngine; +#if UNITY_5_3_OR_NEWER +using UnityEditor.SceneManagement; +#endif +using UnityEditor; + +namespace FairyGUIEditor +{ + /// + /// + /// + [CustomEditor(typeof(FairyGUI.UIPanel))] + public class UIPanelEditor : Editor + { + SerializedProperty packageName; + SerializedProperty componentName; + SerializedProperty packagePath; + SerializedProperty renderMode; + SerializedProperty renderCamera; + SerializedProperty sortingOrder; + SerializedProperty position; + SerializedProperty scale; + SerializedProperty rotation; + SerializedProperty fairyBatching; + SerializedProperty fitScreen; + SerializedProperty touchDisabled; + SerializedProperty hitTestMode; + SerializedProperty setNativeChildrenOrder; + + string[] propertyToExclude; + + void OnEnable() + { + packageName = serializedObject.FindProperty("packageName"); + componentName = serializedObject.FindProperty("componentName"); + packagePath = serializedObject.FindProperty("packagePath"); + renderMode = serializedObject.FindProperty("renderMode"); + renderCamera = serializedObject.FindProperty("renderCamera"); + sortingOrder = serializedObject.FindProperty("sortingOrder"); + position = serializedObject.FindProperty("position"); + scale = serializedObject.FindProperty("scale"); + rotation = serializedObject.FindProperty("rotation"); + fairyBatching = serializedObject.FindProperty("fairyBatching"); + fitScreen = serializedObject.FindProperty("fitScreen"); + touchDisabled = serializedObject.FindProperty("touchDisabled"); + hitTestMode = serializedObject.FindProperty("hitTestMode"); + setNativeChildrenOrder = serializedObject.FindProperty("setNativeChildrenOrder"); + + + propertyToExclude = new string[] { "m_Script", "packageName", "componentName", "packagePath", "renderMode", + "renderCamera", "sortingOrder", "position", "scale", "rotation", "fairyBatching", "fitScreen","touchDisabled", + "hitTestMode","cachedUISize","setNativeChildrenOrder" + }; + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + FairyGUI.UIPanel panel = target as FairyGUI.UIPanel; + + DrawPropertiesExcluding(serializedObject, propertyToExclude); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Package Name"); + if (GUILayout.Button(packageName.stringValue, "ObjectField")) + EditorWindow.GetWindow(true, "Select a UI Component").SetSelection(packageName.stringValue, componentName.stringValue); + + if (GUILayout.Button("Clear", GUILayout.Width(50))) + { +#if UNITY_2018_3_OR_NEWER + bool isPrefab = PrefabUtility.GetPrefabAssetType(panel) != PrefabAssetType.NotAPrefab; +#else + bool isPrefab = PrefabUtility.GetPrefabType(panel) == PrefabType.Prefab; +#endif + panel.SendMessage("OnUpdateSource", new object[] { null, null, null, !isPrefab }); + +#if UNITY_5_3_OR_NEWER + EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); +#elif UNITY_5 + EditorApplication.MarkSceneDirty(); +#else + EditorUtility.SetDirty(panel); +#endif + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Component Name"); + if (GUILayout.Button(componentName.stringValue, "ObjectField")) + EditorWindow.GetWindow(true, "Select a UI Component").SetSelection(packageName.stringValue, componentName.stringValue); + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Package Path"); + EditorGUILayout.LabelField(packagePath.stringValue, (GUIStyle)"helpbox"); + EditorGUILayout.EndHorizontal(); + + if (Application.isPlaying) + EditorGUILayout.EnumPopup("Render Mode", panel.container.renderMode); + else + EditorGUILayout.PropertyField(renderMode); + if ((RenderMode)renderMode.enumValueIndex != RenderMode.ScreenSpaceOverlay) + EditorGUILayout.PropertyField(renderCamera); + + int oldSortingOrder = panel.sortingOrder; + EditorGUILayout.PropertyField(sortingOrder); + EditorGUILayout.PropertyField(fairyBatching); + EditorGUILayout.PropertyField(hitTestMode); + EditorGUILayout.PropertyField(touchDisabled); + EditorGUILayout.PropertyField(setNativeChildrenOrder); + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("UI Transform", (GUIStyle)"OL Title"); + EditorGUILayout.Separator(); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(position); + EditorGUILayout.PropertyField(rotation); + EditorGUILayout.PropertyField(scale); + EditorGUILayout.Space(); + + FairyGUI.FitScreen oldFitScreen = (FairyGUI.FitScreen)fitScreen.enumValueIndex; + EditorGUILayout.PropertyField(fitScreen); + + if (serializedObject.ApplyModifiedProperties()) + { +#if UNITY_2018_3_OR_NEWER + bool isPrefab = PrefabUtility.GetPrefabAssetType(panel) != PrefabAssetType.NotAPrefab; +#else + bool isPrefab = PrefabUtility.GetPrefabType(panel) == PrefabType.Prefab; +#endif + if (!isPrefab) + { + panel.ApplyModifiedProperties(sortingOrder.intValue != oldSortingOrder, (FairyGUI.FitScreen)fitScreen.enumValueIndex != oldFitScreen); + } + } + } + + void OnSceneGUI() + { + FairyGUI.UIPanel panel = (target as FairyGUI.UIPanel); + if (panel.container == null) + return; + + Vector3 pos = panel.GetUIWorldPosition(); + float sizeFactor = HandleUtility.GetHandleSize(pos); +#if UNITY_2017_1_OR_NEWER + var fmh_147_58_638646183197811786 = Quaternion.identity; Vector3 newPos = Handles.FreeMoveHandle(pos, sizeFactor, Vector3.one, Handles.ArrowHandleCap); +#else + Vector3 newPos = Handles.FreeMoveHandle(pos, Quaternion.identity, sizeFactor, Vector3.one, Handles.ArrowCap); +#endif + if (newPos != pos) + { + Vector2 v1 = HandleUtility.WorldToGUIPoint(pos); + Vector2 v2 = HandleUtility.WorldToGUIPoint(newPos); + Vector3 delta = v2 - v1; + delta.x = (int)delta.x; + delta.y = (int)delta.y; + + panel.MoveUI(delta); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs.meta new file mode 100644 index 00000000..fdbfeaff --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Editor/UIPanelEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 94949994c6eda08448145f618d0db72f +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt b/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt new file mode 100644 index 00000000..14655680 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt @@ -0,0 +1,150 @@ +-------------------- + FairyGUI +Copyright © 2014-2022 FairyGUI.com +Version 4.3.0 +support@fairygui.com +-------------------- +FairyGUI is a flexible UI framework for Unity, working with the professional FREE Game UI Editor: FairyGUI Editor. +Download the editor from here: https://www.fairygui.com/ + +-------------------- +Get Started +-------------------- +Run demos in Assets/FairyGUI/Examples/Scenes. +The UI project is in Examples-UIProject.zip, unzip it anywhere. Use FairyGUI Editor to open it. + +Using FairyGUI in Unity: +* Place a UIPanel in scene by using editor menu GameObject/FairyGUI/UIPanel. +* Or using UIPackage.CreateObject to create UI component dynamically, and then use GRoot.inst.AddChild to show it on screen. + +----------------- + Version History +----------------- +4.3.0 +1. Support truncating text with ellipsis. +2. Add UIConfig.defaultScrollSnappingThreshold/defaultScrollPagingThreshold. +3. Add support for changing skeleton animation in controller and transition. +4. Increase compatibility of package path detection. +5. Provide a better way for cloning spine materials. +6. Ensure GList.defaultItem to be in normalized format for performance issue. +7. Fixed a shape hit test bug. +8. Fixed a scrolling bug if custom input is enabled. + +4.2.0 +1. Improve GoWrapper clipping. +2. Fix a bitmap font bug. +3. Add enter/exit sound for GComponent. +4. Add click sound for GCombobox/GLabel/GProgressbar. +5. Fix emoji align issue. +6. Adapt to new TextMeshPro version. +7. Fix a text shrinking behavior bug. + +4.1.0 +1. Add Stage.GetTouchTarget. +2. Add CustomEase. +3. Add Atlas reference manage mechanism. +4. Fixed: the line settings of polygon is missing. +5. Fixed: nested transitions may not be played. +6. Fixed: wrong parameter for loading Spine/Dragonbones by bundle. +7. Fixed: exceptions when a UIPanel in prefab is being destroyed in editor, since 2018.3. +8. Upgrade example project to Unity 2018. + +4.0.1 +- FIXED: Selection bug in InputTextField. +- FIXED: Wrong TextMeshPro text color in linear color space. +- FIXED: Set initial color to white of GLoader3D. +- FIXED: Recover text after cancelling typing effect. +- FIXED: Invalid command key status in windows. + +4.0.0 +- New: New GLoader3D object for loading Spine and DragonBones. +- New: Support TextMeshPro. +- New: Mouse cursor manager. +- New: Key navigation support. +- New: Async loading mechanism of UIPackage (Convenient for Addressable). +- IMPROVED: User's experience of mouse wheel. + +3.5.1 +- IMPROVED: Outline support for polygon shape. +- FIXED: Branch mechanism not works for GComponent. +- FIXED: Rotated sprite in atlas display incorrectly. + +3.5.0 +- NEW: Editor 5.0 functions. +- FIXED: Nested stencil masks work incorrectly. +- FIXED: TouchScreenKeyboard bug. +- FIXED: Some issues in RTLSupport. + +3.4.1 +- FIXED: Text order issue in fairybatching. +- FIXED: A virtual list bug. +- FIXED: A bug in color control of circle shape. +- FIXED: Fixed a bug in fill mesh. + +3.4.0 +- NEW: Add multi-display support. +- NEW: Add API DynamicFont(name, font). +- IMPROVED: Compatibility with 2018.3. +- FIXED: Incorrect letter spacing on mobile platform. +- FIXED: Same transition hook may be called twice. +- FIXED: Exception raised when texture was disposed before object was disposed. + +3.3.0 +- NEW: Add textfield maxwidth feature. +- NEW: Add API to query package dependencies. +- IMPROVED: Graphics module refactor. Now it is more convenient to create various shapes(pie, lines, polygon etc) and do mesh deform. Memory usage on building mesh is also dropped. Also supports automatically setup uv for arbitrary quad to avoid seam between 2 triangles. All shaders are updated, don't forget to replace shaders in your project. +- IMPROVED: Text-Brighter mechanism is removed, so FairyGUI-Text-Brighter.shader is removed. +- IMPROVED: Add support for shrinking multi-line text. +- IMPROVED: Improve Lua support. + +3.2.0 +- NEW: Add DisplayObjectInfo component. Define script symbol FAIRYGUI_TEST to enable it. +- FIXED: A virtual list scrolling bug. +- FIXED: A BlendMode bug. + +3.1.0 +- NEW: Draw extra 8 directions instead of 4 directions to archive text outline effect. Toggle option is UIConfig.enhancedTextOutlineEffect. +- IMPROVED: Eexecution efficiency optimizations. +- IMPROVED: GoWrapper now supports multiple materials. +- FIXED: Correct cleanup action for RemovePackage. + +3.0.0 +From this version, we change package data format to binary. Editor version 3.9.0 with 'binary format' option checked in publish dialog is required to generating this kind of format. Old XML format is not supported anymore. + +- NEW: Add UIPackage.UnloadAssets and UIPackage.ReloadAssets to allow unload package resources without removing the package. +- NEW: Add TransitionActionType.Text and TransitionActionType.Icon. + +2.4.0 +- NEW: GTween is introduced, DOTween is no longer used inside FairyGUI. +- NEW: Transitions now support playing partially and pausing. +- IMPROVED: Change the way of registering bitmap font. +- FIXED: A GButton pivot issue. +- FIXED: Correct text align behavior. + +2.3.0 +- NEW: Allow loader to load component. +- NEW: Add text template feature. +- FIXED: Exclude invisible object in FairyBatching. + +2.2.0 +- NEW: Modify shaders to fit linear color space. +- IMPROVED: Improve relation system to handle conditions that anchor is set. +- IMPROVED: Eliminate GC in transition. +- FIXED: Fixed a bug of unloading bundle in UIPackage. +- FIXED: Fixed issue that some blend mode(multiply, screen) works improperly. + +2.1.0 +- NEW: Add GGraph.DrawRoundRect. +- NEW: Add FillType.ScaleNoBorder. +- FIXED: Repair potential problems of virtual list. +- FIXED: Fixed a bug in handling shared materials. + +2.0.0 +- NEW: RTL Text rendering support. Define scripting symbols RTL_TEXT_SUPPORT to enabled it. +- NEW: Support for setting GObject.data in editor. +- NEW: Support for setting selectedIcon of list item in editor. +- IMPROVED: Add UIConfig.depthSupportForPaitingMode. +- IMPROVED: Set sorting order of popup automatically. +- FIXED: Fixed a text layout bug when line spacing is negative. +- FIXED: Reset ScrollPane.draggingPane when an active scrollPane is being disposed. +- FIXED: Fixed a bug of skew rendering. \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt.meta b/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt.meta new file mode 100644 index 00000000..1e5dce54 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/ReadMe - 4.3.0.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2b25fe107b6204fd680450b22ba79672 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime.meta new file mode 100644 index 00000000..b0a03d96 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 301fdc52d1f18da46a6b39888abab570 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions.meta new file mode 100644 index 00000000..590cfebf --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee08275ceb5764e62bce73db80126854 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones.meta new file mode 100644 index 00000000..1a5a8960 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2d9a58836214e4e58b41c998e14a4239 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs new file mode 100644 index 00000000..1e9948ac --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs @@ -0,0 +1,109 @@ +#if FAIRYGUI_DRAGONBONES + +using UnityEngine; +using DragonBones; + +namespace FairyGUI +{ + /// + /// + /// + public partial class GLoader3D : GObject + { + UnityArmatureComponent _armatureComponent; + + /// + /// + /// + /// + public UnityArmatureComponent armatureComponent + { + get { return _armatureComponent; } + } + + /// + /// + /// + /// + /// + /// + /// + public void SetDragonBones(DragonBonesData asset, int width, int height, Vector2 anchor) + { + if (_armatureComponent != null) + FreeDragonBones(); + + _armatureComponent = UnityFactory.factory.BuildArmatureComponent(asset.armatureNames[0], asset.name, null, asset.name); + _armatureComponent.gameObject.transform.localScale = new Vector3(100, 100, 1); + _armatureComponent.gameObject.transform.localPosition = new Vector3(anchor.x, -anchor.y, 0); + SetWrapTarget(_armatureComponent.gameObject, true, width, height); + + var ct = _armatureComponent.color; + ct.redMultiplier = _color.r; + ct.greenMultiplier = _color.g; + ct.blueMultiplier = _color.b; + _armatureComponent.color = ct; + + OnChangeDragonBones(null); + } + + protected void LoadDragonBones() + { + DragonBonesData asset = (DragonBonesData)_contentItem.skeletonAsset; + if (asset == null) + return; + + SetDragonBones(asset, _contentItem.width, _contentItem.height, _contentItem.skeletonAnchor); + } + + protected void OnChangeDragonBones(string propertyName) + { + if (_armatureComponent == null) + return; + + if (propertyName == "color") + { + var ct = _armatureComponent.color; + ct.redMultiplier = _color.r; + ct.greenMultiplier = _color.g; + ct.blueMultiplier = _color.b; + _armatureComponent.color = ct; + return; + } + + if (!string.IsNullOrEmpty(_animationName)) + { + if (_playing) + _armatureComponent.animation.Play(_animationName, _loop ? 0 : 1); + else + _armatureComponent.animation.GotoAndStopByFrame(_animationName, (uint)_frame); + } + else + _armatureComponent.animation.Reset(); + } + + protected void FreeDragonBones() + { + if (_armatureComponent != null) + { + _armatureComponent.Dispose(); + if (Application.isPlaying) + GameObject.Destroy(_armatureComponent.gameObject); + else + GameObject.DestroyImmediate(_armatureComponent.gameObject); + } + } + + protected void OnUpdateDragonBones(UpdateContext context) + { + if (_armatureComponent != null) + { + var ct = _armatureComponent.color; + ct.alphaMultiplier = context.alpha * _content.alpha; + _armatureComponent.color = ct; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs.meta new file mode 100644 index 00000000..d3733a21 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/DragonBones/DragonBonesLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d48ba38d2e2e420085e6c98407dc1fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine.meta new file mode 100644 index 00000000..56dde9b5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d55093b745d3d452699bdfe7bd8ac88e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs new file mode 100644 index 00000000..d1d272a7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs @@ -0,0 +1,160 @@ +#if FAIRYGUI_SPINE +using System.Collections.Generic; +using UnityEngine; +using Spine.Unity; + +namespace FairyGUI +{ + /// + /// + /// + public partial class GLoader3D : GObject + { + SkeletonAnimation _spineAnimation; + + /// + /// + /// + /// + public SkeletonAnimation spineAnimation + { + get { return _spineAnimation; } + } + + /// + /// + /// + /// + /// + /// + /// + public void SetSpine(SkeletonDataAsset asset, int width, int height, Vector2 anchor) + { + SetSpine(asset, width, height, anchor, true); + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void SetSpine(SkeletonDataAsset asset, int width, int height, Vector2 anchor, bool cloneMaterial) + { + if (_spineAnimation != null) + FreeSpine(); + + _content.customCloneMaterials = MaterialOverride; + _content.customRecoverMaterials = CleanMaterialOverride; + + _spineAnimation = SkeletonRenderer.NewSpineGameObject(asset); + _spineAnimation.gameObject.name = asset.name; + Spine.SkeletonData dat = asset.GetSkeletonData(false); + _spineAnimation.gameObject.transform.localScale = new Vector3(1 / asset.scale, 1 / asset.scale, 1); + _spineAnimation.gameObject.transform.localPosition = new Vector3(anchor.x, -anchor.y, 0); + SetWrapTarget(_spineAnimation.gameObject, cloneMaterial, width, height); + + _spineAnimation.skeleton.R = _color.r; + _spineAnimation.skeleton.G = _color.g; + _spineAnimation.skeleton.B = _color.b; + + OnChangeSpine(null); + } + + protected void LoadSpine() + { + SkeletonDataAsset asset = (SkeletonDataAsset)_contentItem.skeletonAsset; + if (asset == null) + return; + + SetSpine(asset, _contentItem.width, _contentItem.height, _contentItem.skeletonAnchor); + } + + protected void OnChangeSpine(string propertyName) + { + if (_spineAnimation == null) + return; + + if (propertyName == "color") + { + _spineAnimation.skeleton.R = _color.r; + _spineAnimation.skeleton.G = _color.g; + _spineAnimation.skeleton.B = _color.b; + return; + } + + var skeletonData = _spineAnimation.skeleton.Data; + + var state = _spineAnimation.AnimationState; + Spine.Animation animationToUse = !string.IsNullOrEmpty(_animationName) ? skeletonData.FindAnimation(_animationName) : null; + if (animationToUse != null) + { + var trackEntry = state.GetCurrent(0); + if (trackEntry == null || trackEntry.Animation.Name != _animationName || trackEntry.IsComplete && !trackEntry.Loop) + trackEntry = state.SetAnimation(0, animationToUse, _loop); + else + trackEntry.Loop = _loop; + + if (_playing) + trackEntry.TimeScale = 1; + else + { + trackEntry.TimeScale = 0; + trackEntry.TrackTime = Mathf.Lerp(0, trackEntry.AnimationEnd - trackEntry.AnimationStart, _frame / 100f); + } + } + else + state.ClearTrack(0); + + var skin = !string.IsNullOrEmpty(skinName) ? skeletonData.FindSkin(skinName) : skeletonData.DefaultSkin; + if (skin == null && skeletonData.Skins.Count > 0) + skin = skeletonData.Skins.Items[0]; + if (_spineAnimation.skeleton.Skin != skin) + { + _spineAnimation.skeleton.SetSkin(skin); + _spineAnimation.skeleton.SetSlotsToSetupPose(); + } + } + + protected void FreeSpine() + { + if (_spineAnimation != null) + { + if (Application.isPlaying) + GameObject.Destroy(_spineAnimation.gameObject); + else + GameObject.DestroyImmediate(_spineAnimation.gameObject); + + _content.customCloneMaterials = null; + _content.customRecoverMaterials = null; + } + } + + protected void OnUpdateSpine(UpdateContext context) + { + if (_spineAnimation != null) + _spineAnimation.skeleton.A = context.alpha * _content.alpha; + } + + private void MaterialOverride(Dictionary materials) + { + if (_spineAnimation != null) + { + foreach (var kv in materials) + { + _spineAnimation.CustomMaterialOverride[kv.Key] = kv.Value; + } + } + } + + private void CleanMaterialOverride() + { + if (_spineAnimation != null) + _spineAnimation.CustomMaterialOverride.Clear(); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs.meta new file mode 100644 index 00000000..006fbf12 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/Spine/SpineLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3757a6f06ad143439bb00cd7190c6d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro.meta new file mode 100644 index 00000000..79426095 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1de100836593c444995397fa368017d5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders.meta new file mode 100644 index 00000000..bad37530 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e302db5f01fdb46b5b45f44c25164846 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader new file mode 100644 index 00000000..aa060b36 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader @@ -0,0 +1,338 @@ +Shader "FairyGUI/TextMeshPro/Distance Field" { + +Properties { + _FaceTex ("Face Texture", 2D) = "white" {} + _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 + _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 + _FaceColor ("Face Color", Color) = (1,1,1,1) + _FaceDilate ("Face Dilate", Range(-1,1)) = 0 + + _OutlineColor ("Outline Color", Color) = (0,0,0,1) + _OutlineTex ("Outline Texture", 2D) = "white" {} + _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 + _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 + _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 + _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 + + _Bevel ("Bevel", Range(0,1)) = 0.5 + _BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0 + _BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0 + _BevelClamp ("Bevel Clamp", Range(0,1)) = 0 + _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 + + _LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 + _SpecularColor ("Specular", Color) = (1,1,1,1) + _SpecularPower ("Specular", Range(0,4)) = 2.0 + _Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 + _Diffuse ("Diffuse", Range(0,1)) = 0.5 + _Ambient ("Ambient", Range(1,0)) = 0.5 + + _BumpMap ("Normal map", 2D) = "bump" {} + _BumpOutline ("Bump Outline", Range(0,1)) = 0 + _BumpFace ("Bump Face", Range(0,1)) = 0 + + _ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1) + _ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1) + _Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ } + _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) + + + _UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) + _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 + _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 + _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 + _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 + + _GlowColor ("Color", Color) = (0, 1, 0, 0.5) + _GlowOffset ("Offset", Range(-1,1)) = 0 + _GlowInner ("Inner", Range(0,1)) = 0.05 + _GlowOuter ("Outer", Range(0,1)) = 0.05 + _GlowPower ("Falloff", Range(1, 0)) = 0.75 + + _WeightNormal ("Weight Normal", float) = 0 + _WeightBold ("Weight Bold", float) = 0.5 + + _ShaderFlags ("Flags", float) = 0 + _ScaleRatioA ("Scale RatioA", float) = 1 + _ScaleRatioB ("Scale RatioB", float) = 1 + _ScaleRatioC ("Scale RatioC", float) = 1 + + _MainTex ("Font Atlas", 2D) = "white" {} + _TextureWidth ("Texture Width", float) = 512 + _TextureHeight ("Texture Height", float) = 512 + _GradientScale ("Gradient Scale", float) = 5.0 + _ScaleX ("Scale X", float) = 1.0 + _ScaleY ("Scale Y", float) = 1.0 + _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 + _Sharpness ("Sharpness", Range(-1,1)) = 0 + + _VertexOffsetX ("Vertex OffsetX", float) = 0 + _VertexOffsetY ("Vertex OffsetY", float) = 0 + + _MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767) + _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) + _MaskSoftnessX ("Mask SoftnessX", float) = 0 + _MaskSoftnessY ("Mask SoftnessY", float) = 0 + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 +} + +SubShader { + + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull [_CullMode] + ZWrite Off + Lighting Off + Fog { Mode Off } + ZTest [unity_GUIZTestMode] + Blend One OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass { + CGPROGRAM + #pragma target 3.0 + #pragma vertex VertShader + #pragma fragment PixShader + #pragma shader_feature __ BEVEL_ON + #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER + #pragma shader_feature __ GLOW_ON + + //#pragma multi_compile __ UNITY_UI_CLIP_RECT + //#pragma multi_compile __ UNITY_UI_ALPHACLIP + #pragma multi_compile NOT_CLIPPED CLIPPED + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + //#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc" + //#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc" + #include "Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc" + #include "Assets/TextMesh Pro/Shaders/TMPro.cginc" + + struct vertex_t { + UNITY_VERTEX_INPUT_INSTANCE_ID + float4 position : POSITION; + float3 normal : NORMAL; + fixed4 color : COLOR; + float2 texcoord0 : TEXCOORD0; + float2 texcoord1 : TEXCOORD1; + }; + + + struct pixel_t { + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + float4 position : SV_POSITION; + fixed4 color : COLOR; + float2 atlas : TEXCOORD0; // Atlas + float4 param : TEXCOORD1; // alphaClip, scale, bias, weight + float2 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw) + float3 viewDir : TEXCOORD3; + + #if (UNDERLAY_ON || UNDERLAY_INNER) + float4 texcoord2 : TEXCOORD4; // u,v, scale, bias + fixed4 underlayColor : COLOR1; + #endif + float4 textures : TEXCOORD5; + }; + + // Used by Unity internally to handle Texture Tiling and Offset. + float4 _FaceTex_ST; + float4 _OutlineTex_ST; + + CBUFFER_START(UnityPerMaterial) + #ifdef CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + #endif + CBUFFER_END + + pixel_t VertShader(vertex_t input) + { + pixel_t output; + + UNITY_INITIALIZE_OUTPUT(pixel_t, output); + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input,output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + float bold = step(input.texcoord1.y, 0); + + float4 vert = input.position; + vert.x += _VertexOffsetX; + vert.y += _VertexOffsetY; + + float4 vPosition = UnityObjectToClipPos(vert); + + float2 pixelSize = vPosition.w; + pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + float scale = rsqrt(dot(pixelSize, pixelSize)); + scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1); + if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); + + float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; + weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; + + float bias =(.5 - weight) + (.5 / scale); + + float alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _OutlineSoftness * _ScaleRatioA); + + #if GLOW_ON + alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB); + #endif + + alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight; + + #if (UNDERLAY_ON || UNDERLAY_INNER) + float4 underlayColor = _UnderlayColor; + underlayColor.rgb *= underlayColor.a; + + float bScale = scale; + bScale /= 1 + ((_UnderlaySoftness*_ScaleRatioC) * bScale); + float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale); + + float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; + float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; + float2 bOffset = float2(x, y); + #endif + + // Generate UV for the Masking Texture + // float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + // float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + + // Support for texture tiling and offset + float2 textureUV = UnpackUV(input.texcoord1.x); + float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); + float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); + + output.position = vPosition; + #if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550) + output.color.rgb = GammaToLinearSpace(input.color.rgb); + output.color.a = input.color.a; + #else + output.color = input.color; + #endif + output.atlas = input.texcoord0; + output.param = float4(alphaClip, scale, bias, weight); + //output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); + output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz); + #if (UNDERLAY_ON || UNDERLAY_INNER) + output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias); + output.underlayColor = underlayColor; + #endif + output.textures = float4(faceUV, outlineUV); + + #ifdef CLIPPED + output.mask = mul(unity_ObjectToWorld, input.position).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + return output; + } + + + fixed4 PixShader(pixel_t input) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(input); + + float c = tex2D(_MainTex, input.atlas).a; + + #ifndef UNDERLAY_ON + clip(c - input.param.x); + #endif + + float scale = input.param.y; + float bias = input.param.z; + float weight = input.param.w; + float sd = (bias - c) * scale; + + float outline = (_OutlineWidth * _ScaleRatioA) * scale; + float softness = (_OutlineSoftness * _ScaleRatioA) * scale; + + half4 faceColor = _FaceColor; + half4 outlineColor = _OutlineColor; + + faceColor.rgb *= input.color.rgb; + + faceColor *= tex2D(_FaceTex, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y); + outlineColor *= tex2D(_OutlineTex, input.textures.zw + float2(_OutlineUVSpeedX, _OutlineUVSpeedY) * _Time.y); + + faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); + + #if BEVEL_ON + float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); + float3 n = GetSurfaceNormal(input.atlas, weight, dxy); + + float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz; + bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5)); + n = normalize(n- bump); + + float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), -1.0)); + + float3 col = GetSpecular(n, light); + faceColor.rgb += col*faceColor.a; + faceColor.rgb *= 1-(dot(n, light)*_Diffuse); + faceColor.rgb *= lerp(_Ambient, 1, n.z*n.z); + + fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n)); + faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; + #endif + + #if UNDERLAY_ON + float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; + faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a); + #endif + + #if UNDERLAY_INNER + float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; + faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a); + #endif + + #if GLOW_ON + float4 glowColor = GetGlowColor(sd, scale); + faceColor.rgb += glowColor.rgb * glowColor.a; + #endif + + // Alternative implementation to UnityGet2DClipping with support for softness. + // #if UNITY_UI_CLIP_RECT + // half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); + // faceColor *= m.x * m.y; + // #endif + + // #if UNITY_UI_ALPHACLIP + // clip(faceColor.a - 0.001); + // #endif + + #ifdef CLIPPED + float2 factor = abs(input.mask); + clip(1-max(factor.x, factor.y)); + #endif + + return faceColor * input.color.a; + } + + ENDCG + } +} + +Fallback "TextMeshPro/Mobile/Distance Field" +CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader.meta new file mode 100644 index 00000000..3eee1cd5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: de10f84640569464799f0e0bfa1ab7b0 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs new file mode 100644 index 00000000..92fe3ca4 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs @@ -0,0 +1,542 @@ +#if FAIRYGUI_TMPRO + +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.TextCore; +using TMPro; + +namespace FairyGUI +{ + /// + /// TextMeshPro text adapter for FairyGUI. Most of codes were taken from TextMeshPro! + /// Note that not all of TextMeshPro features are supported. + /// + public class TMPFont : BaseFont + { + protected TMP_FontAsset _fontAsset; + + FontStyles _style; + float _scale; + float _padding; + float _stylePadding; + float _ascent; + float _lineHeight; + float _boldMultiplier; + FontWeight _defaultFontWeight; + FontWeight _fontWeight; + TextFormat _format; + TMP_Character _char; + TMP_Character _lineChar; + Material _material; + MaterialManager _manager; + + public TMPFont() + { + this.canTint = true; + this.shader = "FairyGUI/TextMeshPro/Distance Field"; + this.keepCrisp = true; + + _defaultFontWeight = FontWeight.Medium; + } + + override public void Dispose() + { + Release(); + } + + public TMP_FontAsset fontAsset + { + get { return _fontAsset; } + set + { + _fontAsset = value; + Init(); + } + } + + public FontWeight fontWeight + { + get { return _defaultFontWeight; } + set { _defaultFontWeight = value; } + } + + void Release() + { + if (_manager != null) + { + _manager.onCreateNewMaterial -= OnCreateNewMaterial; + _manager = null; + } + + if (mainTexture != null) + { + mainTexture.Dispose(); + mainTexture = null; + } + + if (_material != null) + { + Material.DestroyImmediate(_material); + _material = null; + } + } + + void Init() + { + Release(); + + mainTexture = new NTexture(_fontAsset.atlasTexture); + mainTexture.destroyMethod = DestroyMethod.None; + + _manager = mainTexture.GetMaterialManager(this.shader); + _manager.onCreateNewMaterial += OnCreateNewMaterial; + + _material = new Material(_fontAsset.material); //copy + _material.SetFloat(ShaderUtilities.ID_TextureWidth, mainTexture.width); + _material.SetFloat(ShaderUtilities.ID_TextureHeight, mainTexture.height); + _material.SetFloat(ShaderUtilities.ID_GradientScale, fontAsset.atlasPadding + 1); + _material.SetFloat(ShaderUtilities.ID_WeightNormal, fontAsset.normalStyle); + _material.SetFloat(ShaderUtilities.ID_WeightBold, fontAsset.boldStyle); + + // _ascent = _fontAsset.faceInfo.ascentLine; + // _lineHeight = _fontAsset.faceInfo.lineHeight; + _ascent = _fontAsset.faceInfo.pointSize; + _lineHeight = _fontAsset.faceInfo.pointSize * 1.25f; + + _lineChar = GetCharacterFromFontAsset('_', FontStyles.Normal); + } + + void OnCreateNewMaterial(Material mat) + { + mat.SetFloat(ShaderUtilities.ID_TextureWidth, mainTexture.width); + mat.SetFloat(ShaderUtilities.ID_TextureHeight, mainTexture.height); + mat.SetFloat(ShaderUtilities.ID_GradientScale, fontAsset.atlasPadding + 1); + mat.SetFloat(ShaderUtilities.ID_WeightNormal, fontAsset.normalStyle); + mat.SetFloat(ShaderUtilities.ID_WeightBold, fontAsset.boldStyle); + } + + override public void UpdateGraphics(NGraphics graphics) + { + MaterialPropertyBlock block = graphics.materialPropertyBlock; + if (_format.outline > 0) + { + graphics.ToggleKeyword("OUTLINE_ON", true); + + block.SetFloat(ShaderUtilities.ID_OutlineWidth, _format.outline); + block.SetColor(ShaderUtilities.ID_OutlineColor, _format.outlineColor); + } + else + { + graphics.ToggleKeyword("OUTLINE_ON", false); + + block.SetFloat(ShaderUtilities.ID_OutlineWidth, 0); + } + + if (_format.shadowOffset.x != 0 || _format.shadowOffset.y != 0) + { + graphics.ToggleKeyword("UNDERLAY_ON", true); + + block.SetColor(ShaderUtilities.ID_UnderlayColor, _format.shadowColor); + block.SetFloat(ShaderUtilities.ID_UnderlayOffsetX, _format.shadowOffset.x); + block.SetFloat(ShaderUtilities.ID_UnderlayOffsetY, -_format.shadowOffset.y); + block.SetFloat(ShaderUtilities.ID_UnderlaySoftness, _format.underlaySoftness); + } + else + { + graphics.ToggleKeyword("UNDERLAY_ON", false); + + block.SetFloat(ShaderUtilities.ID_UnderlayOffsetX, 0); + block.SetFloat(ShaderUtilities.ID_UnderlayOffsetY, 0); + block.SetFloat(ShaderUtilities.ID_UnderlaySoftness, 0); + } + + block.SetFloat(ShaderUtilities.ID_FaceDilate, _format.faceDilate); + block.SetFloat(ShaderUtilities.ID_OutlineSoftness, _format.outlineSoftness); + + if (_material.HasProperty(ShaderUtilities.ID_ScaleRatio_A)) + { + //ShaderUtilities.GetPadding does not support handle materialproperyblock, we have to use a temp material + _material.SetFloat(ShaderUtilities.ID_OutlineWidth, block.GetFloat(ShaderUtilities.ID_OutlineWidth)); + _material.SetFloat(ShaderUtilities.ID_UnderlayOffsetX, block.GetFloat(ShaderUtilities.ID_UnderlayOffsetX)); + _material.SetFloat(ShaderUtilities.ID_UnderlayOffsetY, block.GetFloat(ShaderUtilities.ID_UnderlayOffsetY)); + _material.SetFloat(ShaderUtilities.ID_UnderlaySoftness, block.GetFloat(ShaderUtilities.ID_UnderlaySoftness)); + _material.SetFloat(ShaderUtilities.ID_FaceDilate, block.GetFloat(ShaderUtilities.ID_FaceDilate)); + _material.SetFloat(ShaderUtilities.ID_OutlineSoftness, block.GetFloat(ShaderUtilities.ID_OutlineSoftness)); + + _padding = ShaderUtilities.GetPadding(_material, false, false); + + //and then set back the properteis + block.SetFloat(ShaderUtilities.ID_ScaleRatio_A, _material.GetFloat(ShaderUtilities.ID_ScaleRatio_A)); + block.SetFloat(ShaderUtilities.ID_ScaleRatio_B, _material.GetFloat(ShaderUtilities.ID_ScaleRatio_B)); + block.SetFloat(ShaderUtilities.ID_ScaleRatio_C, _material.GetFloat(ShaderUtilities.ID_ScaleRatio_C)); + } + + // Set Padding based on selected font style + #region Handle Style Padding + if (((_style & FontStyles.Bold) == FontStyles.Bold)) // Checks for any combination of Bold Style. + { + if (_material.HasProperty(ShaderUtilities.ID_GradientScale)) + { + float gradientScale = _material.GetFloat(ShaderUtilities.ID_GradientScale); + _stylePadding = _fontAsset.boldStyle / 4.0f * gradientScale * _material.GetFloat(ShaderUtilities.ID_ScaleRatio_A); + + // Clamp overall padding to Gradient Scale size. + if (_stylePadding + _padding > gradientScale) + _padding = gradientScale - _stylePadding; + } + else + _stylePadding = 0; + } + else + { + if (_material.HasProperty(ShaderUtilities.ID_GradientScale)) + { + float gradientScale = _material.GetFloat(ShaderUtilities.ID_GradientScale); + _stylePadding = _fontAsset.normalStyle / 4.0f * gradientScale * _material.GetFloat(ShaderUtilities.ID_ScaleRatio_A); + + // Clamp overall padding to Gradient Scale size. + if (_stylePadding + _padding > gradientScale) + _padding = gradientScale - _stylePadding; + } + else + _stylePadding = 0; + } + #endregion Handle Style Padding + } + + override public void SetFormat(TextFormat format, float fontSizeScale) + { + _format = format; + + float size = format.size * fontSizeScale; + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript || _format.specialStyle == TextFormat.SpecialStyle.Superscript) + size *= SupScale; + + _scale = size / _fontAsset.faceInfo.pointSize * _fontAsset.faceInfo.scale; + _style = FontStyles.Normal; + if (format.bold) + { + _style |= FontStyles.Bold; + _fontWeight = FontWeight.Bold; + _boldMultiplier = 1 + _fontAsset.boldSpacing * 0.01f; + } + else + { + _fontWeight = _defaultFontWeight; + _boldMultiplier = 1.0f; + } + if (format.italic) + _style |= FontStyles.Italic; + + format.FillVertexColors(vertexColors); + } + + override public bool GetGlyph(char ch, out float width, out float height, out float baseline) + { + _char = GetCharacterFromFontAsset(ch, _style); + if (_char != null) + { + width = _char.glyph.metrics.horizontalAdvance * _boldMultiplier * _scale; + height = _lineHeight * _scale; + baseline = _ascent * _scale; + + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript) + { + height /= SupScale; + baseline /= SupScale; + } + else if (_format.specialStyle == TextFormat.SpecialStyle.Superscript) + { + height = height / SupScale + baseline * SupOffset; + baseline *= (SupOffset + 1 / SupScale); + } + + height = Mathf.RoundToInt(height); + baseline = Mathf.RoundToInt(baseline); + + return true; + } + else + { + width = 0; + height = 0; + baseline = 0; + return false; + } + } + + TMP_Character GetCharacterFromFontAsset(uint unicode, FontStyles fontStyle) + { + bool isAlternativeTypeface; +#pragma warning disable + TMP_FontAsset actualAsset; +#pragma warning restore + return TMP_FontAssetUtilities.GetCharacterFromFontAsset(unicode, _fontAsset, true, fontStyle, _fontWeight, + out isAlternativeTypeface + //,out actualAsset //old TMP version need this line + ); + } + + static Vector3 bottomLeft; + static Vector3 topLeft; + static Vector3 topRight; + static Vector3 bottomRight; + + static Vector4 uvBottomLeft; + static Vector4 uvTopLeft; + static Vector4 uvTopRight; + static Vector4 uvBottomRight; + + static Vector4 uv2BottomLeft; + static Vector4 uv2TopLeft; + static Vector4 uv2TopRight; + static Vector4 uv2BottomRight; + + static Color32[] vertexColors = new Color32[4]; + + override public int DrawGlyph(float x, float y, + List vertList, List uvList, List uv2List, List colList) + { + GlyphMetrics metrics = _char.glyph.metrics; + GlyphRect rect = _char.glyph.glyphRect; + + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript) + y = y - Mathf.RoundToInt(_ascent * _scale * SupOffset); + else if (_format.specialStyle == TextFormat.SpecialStyle.Superscript) + y = y + Mathf.RoundToInt(_ascent * _scale * (1 / SupScale - 1 + SupOffset)); + + topLeft.x = x + (metrics.horizontalBearingX - _padding - _stylePadding) * _scale; + topLeft.y = y + (metrics.horizontalBearingY + _padding) * _scale; + bottomRight.x = topLeft.x + (metrics.width + _padding * 2 + _stylePadding * 2) * _scale; + bottomRight.y = topLeft.y - (metrics.height + _padding * 2) * _scale; + + topRight.x = bottomRight.x; + topRight.y = topLeft.y; + bottomLeft.x = topLeft.x; + bottomLeft.y = bottomRight.y; + + #region Handle Italic & Shearing + if (((_style & FontStyles.Italic) == FontStyles.Italic)) + { + // Shift Top vertices forward by half (Shear Value * height of character) and Bottom vertices back by same amount. + float shear_value = _fontAsset.italicStyle * 0.01f; + Vector3 topShear = new Vector3(shear_value * ((metrics.horizontalBearingY + _padding + _stylePadding) * _scale), 0, 0); + Vector3 bottomShear = new Vector3(shear_value * (((metrics.horizontalBearingY - metrics.height - _padding - _stylePadding)) * _scale), 0, 0); + + topLeft += topShear; + bottomLeft += bottomShear; + topRight += topShear; + bottomRight += bottomShear; + } + #endregion Handle Italics & Shearing + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + float u = (rect.x - _padding - _stylePadding) / _fontAsset.atlasWidth; + float v = (rect.y - _padding - _stylePadding) / _fontAsset.atlasHeight; + float uw = (rect.width + _padding * 2 + _stylePadding * 2) / _fontAsset.atlasWidth; + float vw = (rect.height + _padding * 2 + _stylePadding * 2) / _fontAsset.atlasHeight; + + uvBottomLeft = new Vector2(u, v); + uvTopLeft = new Vector2(u, v + vw); + uvTopRight = new Vector2(u + uw, v + vw); + uvBottomRight = new Vector2(u + uw, v); + + float xScale = _scale * 0.01f; + if (_format.bold) + xScale *= -1; + uv2BottomLeft = new Vector2(0, xScale); + uv2TopLeft = new Vector2(511, xScale); + uv2TopRight = new Vector2(2093567, xScale); + uv2BottomRight = new Vector2(2093056, xScale); + + uvList.Add(uvBottomLeft); + uvList.Add(uvTopLeft); + uvList.Add(uvTopRight); + uvList.Add(uvBottomRight); + + uv2List.Add(uv2BottomLeft); + uv2List.Add(uv2TopLeft); + uv2List.Add(uv2TopRight); + uv2List.Add(uv2BottomRight); + + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + + return 4; + } + + override public int DrawLine(float x, float y, float width, int fontSize, int type, + List vertList, List uvList, List uv2List, List colList) + { + if (_lineChar == null) + return 0; + + float thickness; + float offset; + + if (type == 0) + { + thickness = _fontAsset.faceInfo.underlineThickness; + offset = _fontAsset.faceInfo.underlineOffset; + } + else + { + thickness = _fontAsset.faceInfo.strikethroughThickness; + offset = _fontAsset.faceInfo.strikethroughOffset; + } + + float scale = (float)fontSize / _fontAsset.faceInfo.pointSize * _fontAsset.faceInfo.scale; + float segmentWidth = _lineChar.glyph.metrics.width / 2 * scale; + if (width < _lineChar.glyph.metrics.width * scale) + segmentWidth = width / 2f; + + // UNDERLINE VERTICES FOR (3) LINE SEGMENTS + #region UNDERLINE VERTICES + + thickness = thickness * scale; + if (thickness < 1) + thickness = 1; + offset = Mathf.RoundToInt(offset * scale); + + // Front Part of the Underline + y += offset; + topLeft.x = x; + topLeft.y = y + _padding * scale; + bottomRight.x = x + segmentWidth; + bottomRight.y = y - thickness - _padding * scale; + + topRight.x = bottomRight.x; + topRight.y = topLeft.y; + bottomLeft.x = topLeft.x; + bottomLeft.y = bottomRight.y; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + // Middle Part of the Underline + topLeft = topRight; + bottomLeft = bottomRight; + + topRight.x = x + width - segmentWidth; + bottomRight.x = topRight.x; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + // End Part of the Underline + topLeft = topRight; + bottomLeft = bottomRight; + + topRight.x = x + width; + bottomRight.x = topRight.x; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + #endregion + + // UNDERLINE UV0 + #region HANDLE UV0 + + // Calculate UV required to setup the 3 Quads for the Underline. + Vector2 uv0 = new Vector2((_lineChar.glyph.glyphRect.x - _padding) / _fontAsset.atlasWidth, (_lineChar.glyph.glyphRect.y - _padding) / _fontAsset.atlasHeight); // bottom left + Vector2 uv1 = new Vector2(uv0.x, (_lineChar.glyph.glyphRect.y + _lineChar.glyph.glyphRect.height + _padding) / _fontAsset.atlasHeight); // top left + Vector2 uv2 = new Vector2((_lineChar.glyph.glyphRect.x - _padding + (float)_lineChar.glyph.glyphRect.width / 2) / _fontAsset.atlasWidth, uv1.y); // Mid Top Left + Vector2 uv3 = new Vector2(uv2.x, uv0.y); // Mid Bottom Left + Vector2 uv4 = new Vector2((_lineChar.glyph.glyphRect.x + _padding + (float)_lineChar.glyph.glyphRect.width / 2) / _fontAsset.atlasWidth, uv1.y); // Mid Top Right + Vector2 uv5 = new Vector2(uv4.x, uv0.y); // Mid Bottom right + Vector2 uv6 = new Vector2((_lineChar.glyph.glyphRect.x + _padding + _lineChar.glyph.glyphRect.width) / _fontAsset.atlasWidth, uv1.y); // End Part - Bottom Right + Vector2 uv7 = new Vector2(uv6.x, uv0.y); // End Part - Top Right + + uvList.Add(uv0); + uvList.Add(uv1); + uvList.Add(uv2); + uvList.Add(uv3); + + // Middle Part of the Underline + uvList.Add(new Vector2(uv2.x - uv2.x * 0.001f, uv0.y)); + uvList.Add(new Vector2(uv2.x - uv2.x * 0.001f, uv1.y)); + uvList.Add(new Vector2(uv2.x + uv2.x * 0.001f, uv1.y)); + uvList.Add(new Vector2(uv2.x + uv2.x * 0.001f, uv0.y)); + + // Right Part of the Underline + + uvList.Add(uv5); + uvList.Add(uv4); + uvList.Add(uv6); + uvList.Add(uv7); + + #endregion + + // UNDERLINE UV2 + #region HANDLE UV2 - SDF SCALE + // UV1 contains Face / Border UV layout. + float segUv1 = segmentWidth / width; + float segUv2 = 1 - segUv1; + + //Calculate the xScale or how much the UV's are getting stretched on the X axis for the middle section of the underline. + float xScale = scale * 0.01f; + + uv2List.Add(PackUV(0, 0, xScale)); + uv2List.Add(PackUV(0, 1, xScale)); + uv2List.Add(PackUV(segUv1, 1, xScale)); + uv2List.Add(PackUV(segUv1, 0, xScale)); + + uv2List.Add(PackUV(segUv1, 0, xScale)); + uv2List.Add(PackUV(segUv1, 1, xScale)); + uv2List.Add(PackUV(segUv2, 1, xScale)); + uv2List.Add(PackUV(segUv2, 0, xScale)); + + uv2List.Add(PackUV(segUv2, 0, xScale)); + uv2List.Add(PackUV(segUv2, 1, xScale)); + uv2List.Add(PackUV(1, 1, xScale)); + uv2List.Add(PackUV(1, 0, xScale)); + + #endregion + + // UNDERLINE VERTEX COLORS + #region + // Alpha is the lower of the vertex color or tag color alpha used. + + for (int i = 0; i < 12; i++) + colList.Add(vertexColors[0]); + + #endregion + + return 12; + } + + Vector2 PackUV(float x, float y, float xScale) + { + double x0 = (int)(x * 511); + double y0 = (int)(y * 511); + + return new Vector2((float)((x0 * 4096) + y0), xScale); + } + + override public bool HasCharacter(char ch) + { + return _fontAsset.HasCharacter(ch); + } + + override public int GetLineHeight(int size) + { + return Mathf.RoundToInt(_lineHeight * ((float)size / _fontAsset.faceInfo.pointSize * _fontAsset.faceInfo.scale)); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs.meta new file mode 100644 index 00000000..f8164579 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPFont.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7b7ade279883464288671135d22476f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs new file mode 100644 index 00000000..89758dc0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs @@ -0,0 +1,16 @@ +#if FAIRYGUI_TMPRO + +namespace FairyGUI +{ + /// + /// + /// + public partial class TextFormat + { + public float faceDilate; + public float outlineSoftness; + public float underlaySoftness; + } +} + +#endif \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs.meta new file mode 100644 index 00000000..5a9b3780 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/TMPTextFormat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6dd33b417fbb245f887d32166c8acc1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef new file mode 100644 index 00000000..05ffb2f8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef @@ -0,0 +1,14 @@ +{ + "name": "FairyGUI.Runtime", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef.meta new file mode 100644 index 00000000..a81992d3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f4270d81837019d47b93f11421168dae +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources.meta new file mode 100644 index 00000000..ee4194fd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd78597466f9944429e3daf64a4e2063 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders.meta new file mode 100644 index 00000000..6c41660c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cc39210f7f4d03f4aa637689b9d90d75 +folderAsset: yes +timeCreated: 1446459912 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn.meta new file mode 100644 index 00000000..dddf6b3c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b5137d7a41873f9499f95f860a6cef17 +folderAsset: yes +timeCreated: 1465913233 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader new file mode 100644 index 00000000..06a45a0b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader @@ -0,0 +1,58 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "FairyGUI/BlurFilter" { + Properties { + _MainTex ("Base (RGB)", 2D) = "white" {} +} + +SubShader { + Pass { + ZTest Always + ZWrite Off + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata_t { + float4 vertex : POSITION; + float2 texcoord : TEXCOORD0; + }; + + struct v2f { + float4 vertex : SV_POSITION; + half2 texcoord : TEXCOORD0; + half2 taps[4] : TEXCOORD1; + }; + + sampler2D _MainTex; + half4 _MainTex_TexelSize; + half4 _BlurOffsets; + + v2f vert (appdata_t v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.texcoord = v.texcoord - _BlurOffsets.xy * _MainTex_TexelSize.xy; + o.taps[0] = o.texcoord + _MainTex_TexelSize * _BlurOffsets.xy; + o.taps[1] = o.texcoord - _MainTex_TexelSize * _BlurOffsets.xy; + o.taps[2] = o.texcoord + _MainTex_TexelSize * _BlurOffsets.xy * half2(1,-1); + o.taps[3] = o.texcoord - _MainTex_TexelSize * _BlurOffsets.xy * half2(1,-1); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + half4 color = tex2D(_MainTex, i.taps[0]); + color += tex2D(_MainTex, i.taps[1]); + color += tex2D(_MainTex, i.taps[2]); + color += tex2D(_MainTex, i.taps[3]); + return color * 0.25; + } + ENDCG + } +} +Fallback off +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader.meta new file mode 100644 index 00000000..81312dc5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f83d3bb1d90aaf54d8aed0783317662f +timeCreated: 1465913243 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader new file mode 100644 index 00000000..1c77d8f3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader @@ -0,0 +1,154 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "FairyGUI/BMFont" +{ + Properties + { + _MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {} + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + _BlendSrcFactor ("Blend SrcFactor", Float) = 5 + _BlendDstFactor ("Blend DstFactor", Float) = 10 + } + + SubShader + { + LOD 100 + + Tags + { + "Queue" = "Transparent" + "IgnoreProjector" = "True" + "RenderType" = "Transparent" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + Fog { Mode Off } + Blend [_BlendSrcFactor] [_BlendDstFactor] + ColorMask [_ColorMask] + + Pass + { + CGPROGRAM + #pragma multi_compile NOT_GRAYED GRAYED + #pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED + #pragma vertex vert + #pragma fragment frag + #pragma exclude_renderers d3d9 opengl flash + + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + + #ifdef CLIPPED + float2 clipPos : TEXCOORD1; + #endif + + #ifdef SOFT_CLIPPED + float2 clipPos : TEXCOORD1; + #endif + }; + + sampler2D _MainTex; + + CBUFFER_START(UnityPerMaterial) + #ifdef CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + #endif + + #ifdef SOFT_CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + float4 _ClipSoftness = float4(0, 0, 0, 0); + #endif + CBUFFER_END + + v2f vert (appdata_t v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.texcoord = v.texcoord; + #if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550) + o.color.rgb = GammaToLinearSpace(v.color.rgb); + o.color.a = v.color.a; + #else + o.color = v.color; + #endif + + #ifdef CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + #ifdef SOFT_CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + fixed4 col = i.color; + fixed4 tcol = tex2D(_MainTex, i.texcoord); + col.a *= tcol[i.texcoord.z];//z stores channel + + #ifdef GRAYED + fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114)); + col.rgb = fixed3(grey, grey, grey); + #endif + + #ifdef SOFT_CLIPPED + float2 factor = float2(0,0); + if(i.clipPos.x<0) + factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x; + else + factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z; + if(i.clipPos.y<0) + factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w; + else + factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y; + col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0); + #endif + + #ifdef CLIPPED + float2 factor = abs(i.clipPos); + col.a *= step(max(factor.x, factor.y), 1); + #endif + + return col; + } + ENDCG + } + } + + Fallback "FairyGUI/Text" +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader.meta new file mode 100644 index 00000000..70394890 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cd79153f88fa7334ea6c5564c053bdca +timeCreated: 1459224288 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader new file mode 100644 index 00000000..666cad36 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader @@ -0,0 +1,182 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "FairyGUI/Image" +{ + Properties + { + _MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {} + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + _BlendSrcFactor ("Blend SrcFactor", Float) = 5 + _BlendDstFactor ("Blend DstFactor", Float) = 10 + } + + SubShader + { + LOD 100 + + Tags + { + "Queue" = "Transparent" + "IgnoreProjector" = "True" + "RenderType" = "Transparent" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + Fog { Mode Off } + Blend [_BlendSrcFactor] [_BlendDstFactor], One One + ColorMask [_ColorMask] + + Pass + { + CGPROGRAM + #pragma multi_compile NOT_COMBINED COMBINED + #pragma multi_compile NOT_GRAYED GRAYED COLOR_FILTER + #pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED ALPHA_MASK + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + + #ifdef CLIPPED + float2 clipPos : TEXCOORD1; + #endif + + #ifdef SOFT_CLIPPED + float2 clipPos : TEXCOORD1; + #endif + }; + + sampler2D _MainTex; + + #ifdef COMBINED + sampler2D _AlphaTex; + #endif + + CBUFFER_START(UnityPerMaterial) + #ifdef CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + #endif + + #ifdef SOFT_CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + float4 _ClipSoftness = float4(0, 0, 0, 0); + #endif + CBUFFER_END + + #ifdef COLOR_FILTER + float4x4 _ColorMatrix; + float4 _ColorOffset; + float _ColorOption = 0; + #endif + + v2f vert (appdata_t v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.texcoord = v.texcoord; + #if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550) + o.color.rgb = GammaToLinearSpace(v.color.rgb); + o.color.a = v.color.a; + #else + o.color = v.color; + #endif + + #ifdef CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + #ifdef SOFT_CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + fixed4 col = tex2D(_MainTex, i.texcoord.xy / i.texcoord.w) * i.color; + + #ifdef COMBINED + col.a *= tex2D(_AlphaTex, i.texcoord.xy / i.texcoord.w).g; + #endif + + #ifdef GRAYED + fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114)); + col.rgb = fixed3(grey, grey, grey); + #endif + + #ifdef SOFT_CLIPPED + float2 factor = float2(0,0); + if(i.clipPos.x<0) + factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x; + else + factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z; + if(i.clipPos.y<0) + factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w; + else + factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y; + col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0); + #endif + + #ifdef CLIPPED + float2 factor = abs(i.clipPos); + col.a *= step(max(factor.x, factor.y), 1); + #endif + + #ifdef COLOR_FILTER + if (_ColorOption == 0) + { + fixed4 col2 = col; + col2.r = dot(col, _ColorMatrix[0]) + _ColorOffset.x; + col2.g = dot(col, _ColorMatrix[1]) + _ColorOffset.y; + col2.b = dot(col, _ColorMatrix[2]) + _ColorOffset.z; + col2.a = dot(col, _ColorMatrix[3]) + _ColorOffset.w; + col = col2; + } + else //premultiply alpha + col.rgb *= col.a; + #endif + + #ifdef ALPHA_MASK + clip(col.a - 0.001); + #endif + + return col; + } + ENDCG + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader.meta new file mode 100644 index 00000000..36cfc082 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 263c97191482b3649ac7bf0810cc4f77 +timeCreated: 1459224288 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader new file mode 100644 index 00000000..00899999 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader @@ -0,0 +1,150 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "FairyGUI/Text" +{ + Properties + { + _MainTex ("Alpha (A)", 2D) = "white" {} + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + _BlendSrcFactor ("Blend SrcFactor", Float) = 5 + _BlendDstFactor ("Blend DstFactor", Float) = 10 + } + + SubShader + { + LOD 100 + + Tags + { + "Queue" = "Transparent" + "IgnoreProjector" = "True" + "RenderType" = "Transparent" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + Fog { Mode Off } + Blend [_BlendSrcFactor] [_BlendDstFactor] + ColorMask [_ColorMask] + + Pass + { + CGPROGRAM + #pragma multi_compile NOT_GRAYED GRAYED + #pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float4 texcoord : TEXCOORD0; + + #ifdef CLIPPED + float2 clipPos : TEXCOORD1; + #endif + + #ifdef SOFT_CLIPPED + float2 clipPos : TEXCOORD1; + #endif + }; + + sampler2D _MainTex; + + CBUFFER_START(UnityPerMaterial) + #ifdef CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + #endif + + #ifdef SOFT_CLIPPED + float4 _ClipBox = float4(-2, -2, 0, 0); + float4 _ClipSoftness = float4(0, 0, 0, 0); + #endif + CBUFFER_END + + v2f vert (appdata_t v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.texcoord = v.texcoord; + #if !defined(UNITY_COLORSPACE_GAMMA) && (UNITY_VERSION >= 550) + o.color.rgb = GammaToLinearSpace(v.color.rgb); + o.color.a = v.color.a; + #else + o.color = v.color; + #endif + + #ifdef CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + #ifdef SOFT_CLIPPED + o.clipPos = mul(unity_ObjectToWorld, v.vertex).xy * _ClipBox.zw + _ClipBox.xy; + #endif + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + fixed4 col = i.color; + col.a *= tex2D(_MainTex, i.texcoord).a; + + #ifdef GRAYED + fixed grey = dot(col.rgb, fixed3(0.299, 0.587, 0.114)); + col.rgb = fixed3(grey, grey, grey); + #endif + + #ifdef SOFT_CLIPPED + float2 factor = float2(0,0); + if(i.clipPos.x<0) + factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x; + else + factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z; + if(i.clipPos.y<0) + factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w; + else + factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y; + col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0); + #endif + + #ifdef CLIPPED + float2 factor = abs(i.clipPos); + col.a *= step(max(factor.x, factor.y), 1); + #endif + + return col; + } + ENDCG + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader.meta new file mode 100644 index 00000000..ec6565d6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8526777372c6fef4f8162b3a7901dcb0 +timeCreated: 1459224288 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts.meta new file mode 100644 index 00000000..71aaef2c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6c12af28724b4455ba52362d4621053f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core.meta new file mode 100644 index 00000000..15c8551e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: eed3a919a48726c46a61e180a615ef7d +folderAsset: yes +timeCreated: 1460480287 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs new file mode 100644 index 00000000..dd725ea5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs @@ -0,0 +1,110 @@ +using UnityEngine; +using NativeBlendMode = UnityEngine.Rendering.BlendMode; + +namespace FairyGUI +{ + /*关于BlendMode.Off, è¿™ç§æ¨¡å¼ç›¸å½“于Blend Off指令的效果。当然,在ç€è‰²å™¨é‡Œä½¿ç”¨Blend Off指令å¯ä»¥èŽ·å¾—æ›´é«˜çš„æ•ˆçŽ‡ï¼Œ + 但因为Imageç€è‰²å™¨æœ¬èº«å°±æœ‰å¤šä¸ªå…³é”®å­—,å¤åˆ¶ä¸€ä¸ªè¿™æ ·çš„ç€è‰²å™¨ä»£ä»·å¤ªå¤§ï¼Œæ‰€æœ‰ä¸ºäº†èŠ‚çœShaderæ•°é‡ä¾¿å¢žåŠ äº†è¿™æ ·ä¸€ç§æ¨¡å¼ï¼Œä¹Ÿæ˜¯å¯ä»¥æŽ¥å—的。 + */ + + /// + /// + /// + public enum BlendMode + { + Normal, + None, + Add, + Multiply, + Screen, + Erase, + Mask, + Below, + Off, + One_OneMinusSrcAlpha, + Custom1, + Custom2, + Custom3 + } + + /// + /// + /// + public class BlendModeUtils + { + public class BlendFactor + { + public NativeBlendMode srcFactor; + public NativeBlendMode dstFactor; + public bool pma; + + public BlendFactor(NativeBlendMode srcFactor, NativeBlendMode dstFactor, bool pma = false) + { + this.srcFactor = srcFactor; + this.dstFactor = dstFactor; + this.pma = pma; + } + } + + //Source指的是被计算的颜色,Destination是已ç»åœ¨å±å¹•上的颜色。 + //æ··åˆç»“æžœ=Source * factor1 + Destination * factor2 + public static BlendFactor[] Factors = new BlendFactor[] { + //Normal + new BlendFactor(NativeBlendMode.SrcAlpha, NativeBlendMode.OneMinusSrcAlpha), + //None + new BlendFactor(NativeBlendMode.One, NativeBlendMode.One), + //Add + new BlendFactor(NativeBlendMode.SrcAlpha, NativeBlendMode.One), + //Multiply + new BlendFactor(NativeBlendMode.DstColor, NativeBlendMode.OneMinusSrcAlpha, true), + //Screen + new BlendFactor(NativeBlendMode.One, NativeBlendMode.OneMinusSrcColor, true), + //Erase + new BlendFactor(NativeBlendMode.Zero, NativeBlendMode.OneMinusSrcAlpha), + //Mask + new BlendFactor(NativeBlendMode.Zero, NativeBlendMode.SrcAlpha), + //Below + new BlendFactor(NativeBlendMode.OneMinusDstAlpha, NativeBlendMode.DstAlpha), + //Off + new BlendFactor(NativeBlendMode.One, NativeBlendMode.Zero), + //One_OneMinusSrcAlpha + new BlendFactor(NativeBlendMode.One, NativeBlendMode.OneMinusSrcAlpha), + //Custom1 + new BlendFactor(NativeBlendMode.SrcAlpha, NativeBlendMode.OneMinusSrcAlpha), + //Custom2 + new BlendFactor(NativeBlendMode.SrcAlpha, NativeBlendMode.OneMinusSrcAlpha), + //Custom3 + new BlendFactor(NativeBlendMode.SrcAlpha, NativeBlendMode.OneMinusSrcAlpha) + }; + + /// + /// + /// + /// + /// + public static void Apply(Material mat, BlendMode blendMode) + { + BlendFactor bf = Factors[(int)blendMode]; + mat.SetFloat(ShaderConfig.ID_BlendSrcFactor, (float)bf.srcFactor); + mat.SetFloat(ShaderConfig.ID_BlendDstFactor, (float)bf.dstFactor); + + if (bf.pma) + mat.SetFloat(ShaderConfig.ID_ColorOption, 1); + else + mat.SetFloat(ShaderConfig.ID_ColorOption, 0); + } + + /// + /// + /// + /// + /// + /// + public static void Override(BlendMode blendMode, NativeBlendMode srcFactor, NativeBlendMode dstFactor) + { + BlendFactor bf = Factors[(int)blendMode]; + bf.srcFactor = srcFactor; + bf.dstFactor = dstFactor; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs.meta new file mode 100644 index 00000000..85b25a0b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/BlendMode.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ce4df113fe8d9994c83e22680544ccdb +timeCreated: 1464679834 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs new file mode 100644 index 00000000..cd550477 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs @@ -0,0 +1,202 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class CaptureCamera : MonoBehaviour + { + /// + /// + /// + [System.NonSerialized] + public Transform cachedTransform; + /// + /// + /// + [System.NonSerialized] + public Camera cachedCamera; + + [System.NonSerialized] + static CaptureCamera _main; + + [System.NonSerialized] + static int _layer = -1; + static int _hiddenLayer = -1; + + public const string Name = "Capture Camera"; + public const string LayerName = "VUI"; + public const string HiddenLayerName = "Hidden VUI"; + + void OnEnable() + { + cachedCamera = this.GetComponent(); + cachedTransform = this.gameObject.transform; + + if (this.gameObject.name == Name) + _main = this; + } + + /// + /// + /// + public static void CheckMain() + { + if (_main != null && _main.cachedCamera != null) + return; + + GameObject go = GameObject.Find(Name); + if (go != null) + { + _main = go.GetComponent(); + return; + } + + GameObject cameraObject = new GameObject(Name); + Camera camera = cameraObject.AddComponent(); + camera.depth = 0; + camera.cullingMask = 1 << layer; + camera.clearFlags = CameraClearFlags.SolidColor; + camera.backgroundColor = Color.clear; + camera.orthographic = true; + camera.orthographicSize = 5; + camera.nearClipPlane = -30; + camera.farClipPlane = 30; + camera.enabled = false; +#if UNITY_5_4_OR_NEWER + camera.stereoTargetEye = StereoTargetEyeMask.None; +#endif + +#if UNITY_5_6_OR_NEWER + camera.allowHDR = false; + camera.allowMSAA = false; +#endif + cameraObject.AddComponent(); + } + + /// + /// + /// + public static int layer + { + get + { + if (_layer == -1) + { + _layer = LayerMask.NameToLayer(LayerName); + if (_layer == -1) + { + _layer = 30; + Debug.LogWarning("Please define two layers named '" + CaptureCamera.LayerName + "' and '" + CaptureCamera.HiddenLayerName + "'"); + } + } + + return _layer; + } + } + + /// + /// + /// + public static int hiddenLayer + { + get + { + if (_hiddenLayer == -1) + { + _hiddenLayer = LayerMask.NameToLayer(HiddenLayerName); + if (_hiddenLayer == -1) + { + Debug.LogWarning("Please define two layers named '" + CaptureCamera.LayerName + "' and '" + CaptureCamera.HiddenLayerName + "'"); + _hiddenLayer = 31; + } + } + + return _hiddenLayer; + } + } + + /// + /// + /// + /// + /// + /// + /// + public static RenderTexture CreateRenderTexture(int width, int height, bool stencilSupport) + { + RenderTexture texture = new RenderTexture(width, height, stencilSupport ? 24 : 0, RenderTextureFormat.ARGB32); + texture.antiAliasing = 1; + texture.filterMode = FilterMode.Bilinear; + texture.anisoLevel = 0; + texture.useMipMap = false; + texture.wrapMode = TextureWrapMode.Clamp; + texture.hideFlags = DisplayObject.hideFlags; + return texture; + } + + /// + /// + /// + /// + /// + /// + /// + public static void Capture(DisplayObject target, RenderTexture texture, float contentHeight, Vector2 offset) + { + CheckMain(); + + Matrix4x4 matrix = target.cachedTransform.localToWorldMatrix; + float scaleX = new Vector4(matrix.m00, matrix.m10, matrix.m20, matrix.m30).magnitude; + float scaleY = new Vector4(matrix.m01, matrix.m11, matrix.m21, matrix.m31).magnitude; + + Vector3 forward; + forward.x = matrix.m02; + forward.y = matrix.m12; + forward.z = matrix.m22; + + Vector3 upwards; + upwards.x = matrix.m01; + upwards.y = matrix.m11; + upwards.z = matrix.m21; + + float halfHeight = contentHeight * 0.5f; + + Camera camera = _main.cachedCamera; + camera.targetTexture = texture; + float aspect = (float)texture.width / texture.height; + camera.aspect = aspect * scaleX / scaleY; + camera.orthographicSize = halfHeight * scaleY; + _main.cachedTransform.localPosition = target.cachedTransform.TransformPoint(halfHeight * aspect - offset.x, -halfHeight + offset.y, 0); + if (forward != Vector3.zero) + _main.cachedTransform.localRotation = Quaternion.LookRotation(forward, upwards); + + int oldLayer = 0; + + if (target.graphics != null) + { + oldLayer = target.graphics.gameObject.layer; + target.graphics.gameObject.layer = CaptureCamera.layer; + } + + if (target is Container) + { + oldLayer = ((Container)target).numChildren > 0 ? ((Container)target).GetChildAt(0).layer : CaptureCamera.hiddenLayer; + ((Container)target).SetChildrenLayer(CaptureCamera.layer); + } + + RenderTexture old = RenderTexture.active; + RenderTexture.active = texture; + GL.Clear(true, true, Color.clear); + camera.Render(); + RenderTexture.active = old; + + if (target.graphics != null) + target.graphics.gameObject.layer = oldLayer; + + if (target is Container) + ((Container)target).SetChildrenLayer(oldLayer); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs.meta new file mode 100644 index 00000000..f6278fcd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/CaptureCamera.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d207151359c99fb448f4b3380bf41b0f +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs new file mode 100644 index 00000000..61d6f4c1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs @@ -0,0 +1,1124 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class Container : DisplayObject + { + /// + /// + /// + public RenderMode renderMode; + + /// + /// + /// + public Camera renderCamera; + + /// + /// + /// + public bool opaque; + + /// + /// + /// + public Vector4? clipSoftness; + + /// + /// + /// + public IHitTest hitArea; + + /// + /// + /// + public bool touchChildren; + + /// + /// + /// + public event Action onUpdate; + + /// + /// + /// + public bool reversedMask; + + List _children; + DisplayObject _mask; + Rect? _clipRect; + List _descendants; + + internal int _panelOrder; + internal DisplayObject _lastFocus; + + /// + /// + /// + public Container() + : base() + { + CreateGameObject("Container"); + Init(); + } + + /// + /// + /// + /// + public Container(string gameObjectName) + : base() + { + CreateGameObject(gameObjectName); + Init(); + } + + /// + /// + /// + /// + public Container(GameObject attachTarget) + : base() + { + SetGameObject(attachTarget); + Init(); + } + + void Init() + { + _children = new List(); + touchChildren = true; + } + + /// + /// + /// + public int numChildren + { + get { return _children.Count; } + } + + /// + /// + /// + /// + /// + public DisplayObject AddChild(DisplayObject child) + { + AddChildAt(child, _children.Count); + return child; + } + + /// + /// + /// + /// + /// + /// + public DisplayObject AddChildAt(DisplayObject child, int index) + { + int count = _children.Count; + if (index >= 0 && index <= count) + { + if (child.parent == this) + { + SetChildIndex(child, index); + } + else + { + child.RemoveFromParent(); + if (index == count) + _children.Add(child); + else + _children.Insert(index, child); + child.InternalSetParent(this); + + if (stage != null) + { + if (child is Container) + child.BroadcastEvent("onAddedToStage", null); + else + child.DispatchEvent("onAddedToStage", null); + } + + InvalidateBatchingState(true); + } + return child; + } + else + { + throw new Exception("Invalid child index"); + } + } + + /// + /// + /// + /// + /// + public bool Contains(DisplayObject child) + { + return _children.Contains(child); + } + + /// + /// + /// + /// + /// + public DisplayObject GetChildAt(int index) + { + return _children[index]; + } + + /// + /// + /// + /// + /// + public DisplayObject GetChild(string name) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + if (_children[i].name == name) + return _children[i]; + } + + return null; + } + + /// + /// + /// + /// + public DisplayObject[] GetChildren() + { + return _children.ToArray(); + } + + /// + /// + /// + /// + /// + public int GetChildIndex(DisplayObject child) + { + return _children.IndexOf(child); + } + + /// + /// + /// + /// + /// + public DisplayObject RemoveChild(DisplayObject child) + { + return RemoveChild(child, false); + } + + /// + /// + /// + /// + /// + /// + public DisplayObject RemoveChild(DisplayObject child, bool dispose) + { + if (child.parent != this) + throw new Exception("obj is not a child"); + + int i = _children.IndexOf(child); + if (i >= 0) + return RemoveChildAt(i, dispose); + else + return null; + } + + /// + /// + /// + /// + /// + public DisplayObject RemoveChildAt(int index) + { + return RemoveChildAt(index, false); + } + + /// + /// + /// + /// + /// + /// + public DisplayObject RemoveChildAt(int index, bool dispose) + { + if (index >= 0 && index < _children.Count) + { + DisplayObject child = _children[index]; + + if (stage != null && (child._flags & Flags.Disposed) == 0) + { + if (child is Container) + { + child.BroadcastEvent("onRemovedFromStage", null); + if (child == Stage.inst.focus || ((Container)child).IsAncestorOf(Stage.inst.focus)) + Stage.inst._OnFocusRemoving(this); + } + else + { + child.DispatchEvent("onRemovedFromStage", null); + if (child == Stage.inst.focus) + Stage.inst._OnFocusRemoving(this); + } + } + _children.Remove(child); + InvalidateBatchingState(true); + if (!dispose) + child.InternalSetParent(null); + else + child.Dispose(); + + return child; + } + else + throw new Exception("Invalid child index"); + } + + /// + /// + /// + public void RemoveChildren() + { + RemoveChildren(0, int.MaxValue, false); + } + + /// + /// + /// + /// + /// + /// + public void RemoveChildren(int beginIndex, int endIndex, bool dispose) + { + if (endIndex < 0 || endIndex >= numChildren) + endIndex = numChildren - 1; + + for (int i = beginIndex; i <= endIndex; ++i) + RemoveChildAt(beginIndex, dispose); + } + + /// + /// + /// + /// + /// + public void SetChildIndex(DisplayObject child, int index) + { + int oldIndex = _children.IndexOf(child); + if (oldIndex == index) return; + if (oldIndex == -1) throw new ArgumentException("Not a child of this container"); + _children.RemoveAt(oldIndex); + if (index >= _children.Count) + _children.Add(child); + else + _children.Insert(index, child); + InvalidateBatchingState(true); + } + + /// + /// + /// + /// + /// + public void SwapChildren(DisplayObject child1, DisplayObject child2) + { + int index1 = _children.IndexOf(child1); + int index2 = _children.IndexOf(child2); + if (index1 == -1 || index2 == -1) + throw new Exception("Not a child of this container"); + SwapChildrenAt(index1, index2); + } + + /// + /// + /// + /// + /// + public void SwapChildrenAt(int index1, int index2) + { + DisplayObject obj1 = _children[index1]; + DisplayObject obj2 = _children[index2]; + _children[index1] = obj2; + _children[index2] = obj1; + InvalidateBatchingState(true); + } + + /// + /// + /// + /// + /// + public void ChangeChildrenOrder(IList indice, IList objs) + { + int cnt = objs.Count; + for (int i = 0; i < cnt; i++) + { + DisplayObject obj = objs[i]; + if (obj.parent != this) + throw new Exception("Not a child of this container"); + + _children[indice[i]] = obj; + } + InvalidateBatchingState(true); + } + + /// + /// + /// + /// + public IEnumerator GetDescendants(bool backward) + { + return new DescendantsEnumerator(this, backward); + } + + /// + /// + /// + public Rect? clipRect + { + get { return _clipRect; } + set + { + if (_clipRect != value) + { + _clipRect = value; + UpdateBatchingFlags(); + } + } + } + + /// + /// + /// + public DisplayObject mask + { + get { return _mask; } + set + { + if (_mask != value) + { + _mask = value; + UpdateBatchingFlags(); + } + } + } + + /// + /// + /// + public void CreateGraphics() + { + if (graphics == null) + { + graphics = new NGraphics(this.gameObject); + graphics.texture = NTexture.Empty; + } + } + + public override Rect GetBounds(DisplayObject targetSpace) + { + if (_clipRect != null) + return TransformRect((Rect)_clipRect, targetSpace); + + int count = _children.Count; + + Rect rect; + if (count == 0) + { + Vector2 v = TransformPoint(Vector2.zero, targetSpace); + rect = Rect.MinMaxRect(v.x, v.y, 0, 0); + } + else if (count == 1) + { + rect = _children[0].GetBounds(targetSpace); + } + else + { + float minX = float.MaxValue, maxX = float.MinValue; + float minY = float.MaxValue, maxY = float.MinValue; + + for (int i = 0; i < count; ++i) + { + rect = _children[i].GetBounds(targetSpace); + minX = minX < rect.xMin ? minX : rect.xMin; + maxX = maxX > rect.xMax ? maxX : rect.xMax; + minY = minY < rect.yMin ? minY : rect.yMin; + maxY = maxY > rect.yMax ? maxY : rect.yMax; + } + + rect = Rect.MinMaxRect(minX, minY, maxX, maxY); + } + + return rect; + } + + /// + /// + /// + /// + public Camera GetRenderCamera() + { + if (renderMode == RenderMode.ScreenSpaceOverlay) + return StageCamera.main; + else + { + Camera cam = this.renderCamera; + if (cam == null) + { + if (HitTestContext.cachedMainCamera != null) + cam = HitTestContext.cachedMainCamera; + else + { + cam = Camera.main; + if (cam == null) + cam = StageCamera.main; + } + } + return cam; + } + } + + /// + /// + /// + /// + /// + /// + /// + public DisplayObject HitTest(Vector2 stagePoint, bool forTouch) + { + if (StageCamera.main == null) + { + if (this is Stage) + return this; + else + return null; + } + + HitTestContext.screenPoint = new Vector3(stagePoint.x, Screen.height - stagePoint.y, 0); + if (Display.displays.Length > 1) + { + Vector3 p = Display.RelativeMouseAt(HitTestContext.screenPoint); + if (p != Vector3.zero) + HitTestContext.screenPoint = p; + } + HitTestContext.worldPoint = StageCamera.main.ScreenToWorldPoint(HitTestContext.screenPoint); + HitTestContext.direction = Vector3.back; + HitTestContext.forTouch = forTouch; + HitTestContext.camera = StageCamera.main; + + DisplayObject ret = HitTest(); + if (ret != null) + return ret; + else if (this is Stage) + return this; + else + return null; + } + + override protected DisplayObject HitTest() + { + if ((_flags & Flags.UserGameObject) != 0 && !gameObject.activeInHierarchy) + return null; + + if (this.cachedTransform.localScale.x == 0 || this.cachedTransform.localScale.y == 0) + return null; + + Camera savedCamera = HitTestContext.camera; + Vector3 savedWorldPoint = HitTestContext.worldPoint; + Vector3 savedDirection = HitTestContext.direction; + DisplayObject target; + + if (renderMode != RenderMode.ScreenSpaceOverlay || (_flags & Flags.UserGameObject) != 0) + { + Camera cam = GetRenderCamera(); + if (cam.targetDisplay != HitTestContext.screenPoint.z) + return null; + + HitTestContext.camera = cam; + if (renderMode == RenderMode.WorldSpace) + { + Vector3 screenPoint = HitTestContext.camera.WorldToScreenPoint(this.cachedTransform.position); //only for query z value + screenPoint.x = HitTestContext.screenPoint.x; + screenPoint.y = HitTestContext.screenPoint.y; + + //获得本地zè½´åœ¨ä¸–ç•Œåæ ‡çš„æ–¹å‘ + HitTestContext.worldPoint = HitTestContext.camera.ScreenToWorldPoint(screenPoint); + Ray ray = HitTestContext.camera.ScreenPointToRay(screenPoint); + HitTestContext.direction = Vector3.zero - ray.direction; + } + else if (renderMode == RenderMode.ScreenSpaceCamera) + { + HitTestContext.worldPoint = HitTestContext.camera.ScreenToWorldPoint(HitTestContext.screenPoint); + } + } + else + { + if (HitTestContext.camera.targetDisplay != HitTestContext.screenPoint.z && !(this is Stage)) + return null; + } + + target = HitTest_Container(); + + HitTestContext.camera = savedCamera; + HitTestContext.worldPoint = savedWorldPoint; + HitTestContext.direction = savedDirection; + + return target; + } + + DisplayObject HitTest_Container() + { + Vector2 localPoint = WorldToLocal(HitTestContext.worldPoint, HitTestContext.direction); + if (_vertexMatrix != null) + HitTestContext.worldPoint = this.cachedTransform.TransformPoint(new Vector2(localPoint.x, -localPoint.y)); + + if (hitArea != null) + { + if (!hitArea.HitTest(_contentRect, localPoint)) + return null; + + if (hitArea is MeshColliderHitTest) + localPoint = ((MeshColliderHitTest)hitArea).lastHit; + } + else + { + if (_clipRect != null && !((Rect)_clipRect).Contains(localPoint)) + return null; + } + + if (_mask != null) + { + DisplayObject tmp = _mask.InternalHitTestMask(); + if (!reversedMask && tmp == null || reversedMask && tmp != null) + return null; + } + + DisplayObject target = null; + if (touchChildren) + { + int count = _children.Count; + for (int i = count - 1; i >= 0; --i) // front to back! + { + DisplayObject child = _children[i]; + if ((child._flags & Flags.GameObjectDisposed) != 0) + { + child.DisplayDisposedWarning(); + continue; + } + + if (child == _mask || (child._flags & Flags.TouchDisabled) != 0) + continue; + + target = child.InternalHitTest(); + if (target != null) + break; + } + } + + if (target == null && opaque && (hitArea != null || _contentRect.Contains(localPoint))) + target = this; + + return target; + } + + /// + /// + /// + /// + /// + public bool IsAncestorOf(DisplayObject obj) + { + if (obj == null) + return false; + + Container p = obj.parent; + while (p != null) + { + if (p == this) + return true; + + p = p.parent; + } + return false; + } + + /// + /// + /// + public bool fairyBatching + { + get { return (_flags & Flags.FairyBatching) != 0; } + set + { + bool oldValue = (_flags & Flags.FairyBatching) != 0; + if (oldValue != value) + { + if (value) + _flags |= Flags.FairyBatching; + else + _flags &= ~Flags.FairyBatching; + UpdateBatchingFlags(); + } + } + } + + internal void UpdateBatchingFlags() + { + bool oldValue = (_flags & Flags.BatchingRoot) != 0; + bool newValue = (_flags & Flags.FairyBatching) != 0 || _clipRect != null || _mask != null || _paintingMode > 0; + if (newValue) + _flags |= Flags.BatchingRoot; + else + _flags &= ~Flags.BatchingRoot; + if (oldValue != newValue) + { + if (newValue) + _flags |= Flags.BatchingRequested; + else if (_descendants != null) + _descendants.Clear(); + + InvalidateBatchingState(); + } + } + + /// + /// + /// + /// + public void InvalidateBatchingState(bool childrenChanged) + { + if (childrenChanged && (_flags & Flags.BatchingRoot) != 0) + _flags |= Flags.BatchingRequested; + else + { + Container p = this.parent; + while (p != null) + { + if ((p._flags & Flags.BatchingRoot) != 0) + { + p._flags |= Flags.BatchingRequested; + break; + } + + p = p.parent; + } + } + } + + /// + /// + /// + /// + public void SetChildrenLayer(int value) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + DisplayObject child = _children[i]; + child._SetLayerDirect(value); + if ((child is Container) && child._paintingMode == 0) + ((Container)child).SetChildrenLayer(value); + } + } + + override public void Update(UpdateContext context) + { + if ((_flags & Flags.UserGameObject) != 0 && !gameObject.activeInHierarchy) + return; + + base.Update(context); + + if (_paintingMode != 0) + { + if ((_flags & Flags.CacheAsBitmap) != 0 && _paintingInfo.flag == 2) + { + if (onUpdate != null) + onUpdate(); + return; + } + + context.EnterPaintingMode(); + } + + if (_mask != null) + { + context.EnterClipping(this.id, reversedMask); + if (_mask.graphics != null) + _mask.graphics._PreUpdateMask(context, _mask.id); + } + else if (_clipRect != null) + context.EnterClipping(this.id, this.TransformRect((Rect)_clipRect, null), clipSoftness); + + float savedAlpha = context.alpha; + context.alpha *= this.alpha; + bool savedGrayed = context.grayed; + context.grayed = context.grayed || this.grayed; + + if ((_flags & Flags.FairyBatching) != 0) + context.batchingDepth++; + + if (context.batchingDepth > 0) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + DisplayObject child = _children[i]; + if ((child._flags & Flags.GameObjectDisposed) != 0) + { + child.DisplayDisposedWarning(); + continue; + } + + if (child.visible) + child.Update(context); + } + } + else + { + if (_mask != null) + _mask.renderingOrder = context.renderingOrder++; + + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + DisplayObject child = _children[i]; + if ((child._flags & Flags.GameObjectDisposed) != 0) + { + child.DisplayDisposedWarning(); + continue; + } + + if (child.visible) + { + if (!(child.graphics != null && child.graphics._maskFlag == 1)) //if not a mask + child.renderingOrder = context.renderingOrder++; + + child.Update(context); + } + } + + if (_mask != null) + { + if (_mask.graphics != null) + _mask.graphics._SetStencilEraserOrder(context.renderingOrder++); + } + } + + if ((_flags & Flags.FairyBatching) != 0) + { + if (context.batchingDepth == 1) + SetRenderingOrder(context); + context.batchingDepth--; + } + + context.alpha = savedAlpha; + context.grayed = savedGrayed; + + if (_clipRect != null || _mask != null) + context.LeaveClipping(); + + if (_paintingMode != 0) + { + context.LeavePaintingMode(); + UpdateContext.OnEnd += _paintingInfo.captureDelegate; + } + + if (onUpdate != null) + onUpdate(); + } + + private void SetRenderingOrder(UpdateContext context) + { + if ((_flags & Flags.BatchingRequested) != 0) + DoFairyBatching(); + + if (_mask != null) + _mask.renderingOrder = context.renderingOrder++; + + int cnt = _descendants.Count; + for (int i = 0; i < cnt; i++) + { + DisplayObject child = _descendants[i]; + if (!(child.graphics != null && child.graphics._maskFlag == 1)) + child.renderingOrder = context.renderingOrder++; + + if ((child._flags & Flags.BatchingRoot) != 0) + ((Container)child).SetRenderingOrder(context); + } + + if (_mask != null) + { + if (_mask.graphics != null) + _mask.graphics._SetStencilEraserOrder(context.renderingOrder++); + } + } + + private void DoFairyBatching() + { + _flags &= ~Flags.BatchingRequested; + + if (_descendants == null) + _descendants = new List(); + else + _descendants.Clear(); + CollectChildren(this, false); + + int cnt = _descendants.Count; + + int i, j, k, m; + object curMat, testMat, lastMat; + DisplayObject current, test; + float[] bound; + for (i = 0; i < cnt; i++) + { + current = _descendants[i]; + bound = current._batchingBounds; + curMat = current.material; + if (curMat == null || (current._flags & Flags.SkipBatching) != 0) + continue; + + k = -1; + lastMat = null; + m = i; + for (j = i - 1; j >= 0; j--) + { + test = _descendants[j]; + if ((test._flags & Flags.SkipBatching) != 0) + break; + + testMat = test.material; + if (testMat != null) + { + if (lastMat != testMat) + { + lastMat = testMat; + m = j + 1; + } + + if (curMat == testMat) + k = m; + } + + if ((bound[0] > test._batchingBounds[0] ? bound[0] : test._batchingBounds[0]) + <= (bound[2] < test._batchingBounds[2] ? bound[2] : test._batchingBounds[2]) + && (bound[1] > test._batchingBounds[1] ? bound[1] : test._batchingBounds[1]) + <= (bound[3] < test._batchingBounds[3] ? bound[3] : test._batchingBounds[3])) + { + if (k == -1) + k = m; + break; + } + } + if (k != -1 && i != k) + { + _descendants.RemoveAt(i); + _descendants.Insert(k, current); + } + } + + //Debug.Log("DoFairyBatching " + cnt + "," + this.cachedTransform.GetInstanceID()); + } + + private void CollectChildren(Container initiator, bool outlineChanged) + { + int count = _children.Count; + for (int i = 0; i < count; i++) + { + DisplayObject child = _children[i]; + if (!child.visible) + continue; + + if (child._batchingBounds == null) + child._batchingBounds = new float[4]; + + if (child is Container) + { + Container container = (Container)child; + if ((container._flags & Flags.BatchingRoot) != 0) + { + initiator._descendants.Add(container); + if (outlineChanged || (container._flags & Flags.OutlineChanged) != 0) + { + Rect rect = container.GetBounds(initiator); + container._batchingBounds[0] = rect.xMin; + container._batchingBounds[1] = rect.yMin; + container._batchingBounds[2] = rect.xMax; + container._batchingBounds[3] = rect.yMax; + } + if ((container._flags & Flags.BatchingRequested) != 0) + container.DoFairyBatching(); + } + else + container.CollectChildren(initiator, outlineChanged || (container._flags & Flags.OutlineChanged) != 0); + } + else if (child != initiator._mask) + { + if (outlineChanged || (child._flags & Flags.OutlineChanged) != 0) + { + Rect rect = child.GetBounds(initiator); + child._batchingBounds[0] = rect.xMin; + child._batchingBounds[1] = rect.yMin; + child._batchingBounds[2] = rect.xMax; + child._batchingBounds[3] = rect.yMax; + } + initiator._descendants.Add(child); + } + + child._flags &= ~Flags.OutlineChanged; + } + } + + public override void Dispose() + { + if ((_flags & Flags.Disposed) != 0) + return; + + base.Dispose(); //Destroy GameObject tree first, avoid destroying each seperately; + + int numChildren = _children.Count; + for (int i = numChildren - 1; i >= 0; --i) + { + DisplayObject obj = _children[i]; + obj.InternalSetParent(null); //Avoid RemoveParent call + obj.Dispose(); + } + } + + /// + /// If true, when the container is focused, tab navigation is lock inside it. + /// + public bool tabStopChildren + { + get { return (_flags & Flags.TabStopChildren) != 0; } + set + { + if (value) + _flags |= Flags.TabStopChildren; + else + _flags &= ~Flags.TabStopChildren; + } + } + + struct DescendantsEnumerator : IEnumerator + { + Container _root; + Container _com; + DisplayObject _current; + int _index; + bool _forward; + + public DescendantsEnumerator(Container root, bool backward) + { + _root = root; + _com = _root; + _current = null; + _forward = !backward; + if (_forward) + _index = 0; + else + _index = _com._children.Count - 1; + } + + public DisplayObject Current + { + get { return _current; } + } + + object IEnumerator.Current + { + get { return _current; } + } + + public bool MoveNext() + { + if (_forward) + { + if (_index >= _com._children.Count) + { + if (_com == _root) + { + _current = null; + return false; + } + + _current = _com; + _com = _com.parent; + _index = _com.GetChildIndex(_current) + 1; + return true; + } + else + { + DisplayObject obj = _com._children[_index]; + if (obj is Container) + { + _com = (Container)obj; + _index = 0; + return MoveNext(); + } + _index++; + _current = obj; + return true; + } + } + else + { + if (_index < 0) + { + if (_com == _root) + { + _current = null; + return false; + } + + _current = _com; + _com = _com.parent; + _index = _com.GetChildIndex(_current) - 1; + return true; + } + else + { + DisplayObject obj = _com._children[_index]; + if (obj is Container) + { + _com = (Container)obj; + _index = _com._children.Count - 1; + return MoveNext(); + } + _index--; + _current = obj; + return true; + } + } + } + + public void Reset() + { + _com = _root; + _current = null; + _index = 0; + } + + public void Dispose() + { + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs.meta new file mode 100644 index 00000000..78c838b1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Container.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 531f2c788ec31e7459700f6811410a6f +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs new file mode 100644 index 00000000..5909a65b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs @@ -0,0 +1,1878 @@ +using System; +using System.Text; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class DisplayObject : EventDispatcher + { + /// + /// + /// + public string name; + + /// + /// + /// + public Container parent { get; private set; } + + /// + /// + /// + public GameObject gameObject { get; protected set; } + + /// + /// + /// + public Transform cachedTransform { get; protected set; } + + /// + /// + /// + public NGraphics graphics { get; protected set; } + + /// + /// + /// + public NGraphics paintingGraphics { get; protected set; } + + /// + /// + /// + public event Action onPaint; + + /// + /// + /// + public GObject gOwner; + + /// + /// + /// + public uint id; + + bool _visible; + bool _touchable; + Vector2 _pivot; + Vector3 _pivotOffset; + Vector3 _rotation; //由于万å‘é”,å•独旋转一个轴是会影å“到其他轴的,所以这里需è¦å•独ä¿å­˜ + Vector2 _skew; + int _renderingOrder; + float _alpha; + bool _grayed; + BlendMode _blendMode; + IFilter _filter; + Transform _home; + string _cursor; + bool _perspective; + int _focalLength; + Vector3 _pixelPerfectAdjustment; + int _checkPixelPerfect; + + EventListener _onClick; + EventListener _onRightClick; + EventListener _onTouchBegin; + EventListener _onTouchMove; + EventListener _onTouchEnd; + EventListener _onRollOver; + EventListener _onRollOut; + EventListener _onMouseWheel; + EventListener _onAddedToStage; + EventListener _onRemovedFromStage; + EventListener _onKeyDown; + EventListener _onClickLink; + EventListener _onFocusIn; + EventListener _onFocusOut; + + protected internal int _paintingMode; //1-滤镜,2-blendMode,4-transformMatrix, 8-cacheAsBitmap + protected internal PaintingInfo _paintingInfo; + protected Rect _contentRect; + protected NGraphics.VertexMatrix _vertexMatrix; + protected internal Flags _flags; + protected internal float[] _batchingBounds; + + internal static uint _gInstanceCounter; + + internal static HideFlags hideFlags = HideFlags.None; + + public DisplayObject() + { + id = _gInstanceCounter++; + + _alpha = 1; + _visible = true; + _touchable = true; + _blendMode = BlendMode.Normal; + _focalLength = 2000; + _flags |= Flags.OutlineChanged; + if (UIConfig.makePixelPerfect) + _flags |= Flags.PixelPerfect; + } + + /// + /// + /// + public EventListener onClick + { + get { return _onClick ?? (_onClick = new EventListener(this, "onClick")); } + } + + /// + /// + /// + public EventListener onRightClick + { + get { return _onRightClick ?? (_onRightClick = new EventListener(this, "onRightClick")); } + } + + /// + /// + /// + public EventListener onTouchBegin + { + get { return _onTouchBegin ?? (_onTouchBegin = new EventListener(this, "onTouchBegin")); } + } + + /// + /// + /// + public EventListener onTouchMove + { + get { return _onTouchMove ?? (_onTouchMove = new EventListener(this, "onTouchMove")); } + } + + /// + /// + /// + public EventListener onTouchEnd + { + get { return _onTouchEnd ?? (_onTouchEnd = new EventListener(this, "onTouchEnd")); } + } + + /// + /// + /// + public EventListener onRollOver + { + get { return _onRollOver ?? (_onRollOver = new EventListener(this, "onRollOver")); } + } + + /// + /// + /// + public EventListener onRollOut + { + get { return _onRollOut ?? (_onRollOut = new EventListener(this, "onRollOut")); } + } + + /// + /// + /// + public EventListener onMouseWheel + { + get { return _onMouseWheel ?? (_onMouseWheel = new EventListener(this, "onMouseWheel")); } + } + + /// + /// + /// + public EventListener onAddedToStage + { + get { return _onAddedToStage ?? (_onAddedToStage = new EventListener(this, "onAddedToStage")); } + } + + /// + /// + /// + public EventListener onRemovedFromStage + { + get { return _onRemovedFromStage ?? (_onRemovedFromStage = new EventListener(this, "onRemovedFromStage")); } + } + + /// + /// + /// + public EventListener onKeyDown + { + get { return _onKeyDown ?? (_onKeyDown = new EventListener(this, "onKeyDown")); } + } + + /// + /// + /// + public EventListener onClickLink + { + get { return _onClickLink ?? (_onClickLink = new EventListener(this, "onClickLink")); } + } + + /// + /// + /// + public EventListener onFocusIn + { + get { return _onFocusIn ?? (_onFocusIn = new EventListener(this, "onFocusIn")); } + } + + /// + /// + /// + public EventListener onFocusOut + { + get { return _onFocusOut ?? (_onFocusOut = new EventListener(this, "onFocusOut")); } + + } + + protected void CreateGameObject(string gameObjectName) + { + gameObject = new GameObject(gameObjectName); + cachedTransform = gameObject.transform; + if (Application.isPlaying) + { + UnityEngine.Object.DontDestroyOnLoad(gameObject); + + DisplayObjectInfo info = gameObject.AddComponent(); + info.displayObject = this; + } + gameObject.hideFlags = DisplayObject.hideFlags; + gameObject.SetActive(false); + } + + protected void SetGameObject(GameObject gameObject) + { + this.gameObject = gameObject; + this.cachedTransform = gameObject.transform; + _rotation = cachedTransform.localEulerAngles; + + _flags |= Flags.UserGameObject; + } + + protected void DestroyGameObject() + { + if ((_flags & Flags.UserGameObject) == 0 && gameObject != null) + { + if (Application.isPlaying) + GameObject.Destroy(gameObject); + else + GameObject.DestroyImmediate(gameObject); + gameObject = null; + cachedTransform = null; + } + } + + /// + /// + /// + public float alpha + { + get { return _alpha; } + set { _alpha = value; } + } + + /// + /// + /// + public bool grayed + { + get { return _grayed; } + set { _grayed = value; } + } + + /// + /// + /// + public bool visible + { + get { return _visible; } + set + { + if (_visible != value) + { + _visible = value; + _flags |= Flags.OutlineChanged; + if (parent != null && _visible) + { + gameObject.SetActive(true); + InvalidateBatchingState(); + if (this is Container) + ((Container)this).InvalidateBatchingState(true); + } + else + gameObject.SetActive(false); + } + } + } + + /// + /// + /// + public float x + { + get { return cachedTransform.localPosition.x; } + set + { + SetPosition(value, -cachedTransform.localPosition.y, cachedTransform.localPosition.z); + } + } + + /// + /// + /// + public float y + { + get { return -cachedTransform.localPosition.y; } + set + { + SetPosition(cachedTransform.localPosition.x, value, cachedTransform.localPosition.z); + } + } + + /// + /// + /// + public float z + { + get { return cachedTransform.localPosition.z; } + set + { + SetPosition(cachedTransform.localPosition.x, -cachedTransform.localPosition.y, value); + } + } + + /// + /// + /// + public Vector2 xy + { + get { return new Vector2(this.x, this.y); } + set { SetPosition(value.x, value.y, cachedTransform.localPosition.z); } + } + + /// + /// + /// + public Vector3 position + { + get { return new Vector3(this.x, this.y, this.z); } + set { SetPosition(value.x, value.y, value.z); } + } + + /// + /// + /// + /// + /// + public void SetXY(float xv, float yv) + { + SetPosition(xv, yv, cachedTransform.localPosition.z); + } + + /// + /// + /// + /// + /// + /// + public void SetPosition(float xv, float yv, float zv) + { + Vector3 v = new Vector3(); + v.x = xv; + v.y = -yv; + v.z = zv; + if (v != cachedTransform.localPosition) + { + cachedTransform.localPosition = v; + _flags |= Flags.OutlineChanged; + if ((_flags & Flags.PixelPerfect) != 0) + { + //总在下一帧å†å®ŒæˆPixelPerfect,这样当物体在连续è¿åŠ¨æ—¶ï¼Œä¸ä¼šå› ä¸ºPixelPerfect而å‘生抖动。 + _checkPixelPerfect = Time.frameCount; + _pixelPerfectAdjustment = Vector3.zero; + } + } + } + + /// + /// If the object position is align by pixel + /// + public bool pixelPerfect + { + get { return (_flags & Flags.PixelPerfect) != 0; } + set + { + if (value) + _flags |= Flags.PixelPerfect; + else + _flags &= ~Flags.PixelPerfect; + } + } + + /// + /// + /// + public float width + { + get + { + EnsureSizeCorrect(); + return _contentRect.width; + } + set + { + if (!Mathf.Approximately(value, _contentRect.width)) + { + _contentRect.width = value; + _flags |= Flags.WidthChanged; + _flags &= ~Flags.HeightChanged; + OnSizeChanged(); + } + } + } + + /// + /// + /// + public float height + { + get + { + EnsureSizeCorrect(); + return _contentRect.height; + } + set + { + if (!Mathf.Approximately(value, _contentRect.height)) + { + _contentRect.height = value; + _flags &= ~Flags.WidthChanged; + _flags |= Flags.HeightChanged; + OnSizeChanged(); + } + } + } + + /// + /// + /// + public Vector2 size + { + get + { + EnsureSizeCorrect(); + return _contentRect.size; + } + set + { + SetSize(value.x, value.y); + } + } + + /// + /// + /// + /// + /// + public void SetSize(float wv, float hv) + { + if (!Mathf.Approximately(wv, _contentRect.width)) + _flags |= Flags.WidthChanged; + else + _flags &= ~Flags.WidthChanged; + if (!Mathf.Approximately(hv, _contentRect.height)) + _flags |= Flags.HeightChanged; + else + _flags &= ~Flags.HeightChanged; + + if ((_flags & Flags.WidthChanged) != 0 || (_flags & Flags.HeightChanged) != 0) + { + _contentRect.width = wv; + _contentRect.height = hv; + OnSizeChanged(); + } + } + + virtual public void EnsureSizeCorrect() + { + } + + virtual protected void OnSizeChanged() + { + ApplyPivot(); + + if (_paintingInfo != null) + _paintingInfo.flag = 1; + if (graphics != null) + graphics.contentRect = _contentRect; + _flags |= Flags.OutlineChanged; + } + + /// + /// + /// + public float scaleX + { + get { return cachedTransform.localScale.x; } + set + { + Vector3 v = cachedTransform.localScale; + v.x = v.z = ValidateScale(value); + cachedTransform.localScale = v; + _flags |= Flags.OutlineChanged; + ApplyPivot(); + } + } + + /// + /// + /// + public float scaleY + { + get { return cachedTransform.localScale.y; } + set + { + Vector3 v = cachedTransform.localScale; + v.y = ValidateScale(value); + cachedTransform.localScale = v; + _flags |= Flags.OutlineChanged; + ApplyPivot(); + } + } + + /// + /// + /// + /// + /// + public void SetScale(float xv, float yv) + { + Vector3 v = new Vector3(); + v.x = v.z = ValidateScale(xv); + v.y = ValidateScale(yv); + cachedTransform.localScale = v; + _flags |= Flags.OutlineChanged; + ApplyPivot(); + } + + /// + /// 在scaleè¿‡å°æƒ…况(æžç«¯æƒ…况=0),当使用Transformçš„åæ ‡å˜æ¢æ—¶ï¼Œå˜æ¢åˆ°ä¸–界,å†ä»Žä¸–ç•Œå˜æ¢åˆ°æœ¬åœ°ï¼Œä¼šç”±äºŽç²¾åº¦é—®é¢˜é€ æˆç»“果错误。 + /// è¿™ç§é”™è¯¯ä¼šå¯¼è‡´Batching错误,因为Batching会使用缓存的outline。 + /// 这里é™åˆ¶ä¸€ä¸‹scale的最å°å€¼ä½œä¸ºå½“å‰è§£å†³æ–¹æ¡ˆã€‚ + /// 这个方案并ä¸å®Œç¾Žï¼Œå› ä¸ºé™åˆ¶äº†æœ¬åœ°scale值并ä¸èƒ½ä¿è¯å¯¹ä¸–界scaleä¸ä¼šè¿‡å°ã€‚ + /// + /// + /// + private float ValidateScale(float value) + { + if (value >= 0 && value < 0.001f) + value = 0.001f; + else if (value < 0 && value > -0.001f) + value = -0.001f; + return value; + } + + /// + /// + /// + public Vector2 scale + { + get { return cachedTransform.localScale; } + set + { + SetScale(value.x, value.y); + } + } + + /// + /// + /// + public float rotation + { + get + { + //å’ŒUnity默认的旋转方å‘相å + return -_rotation.z; + } + set + { + _rotation.z = -value; + _flags |= Flags.OutlineChanged; + if (_perspective) + UpdateTransformMatrix(); + else + { + cachedTransform.localEulerAngles = _rotation; + ApplyPivot(); + } + } + } + + /// + /// + /// + public float rotationX + { + get + { + return _rotation.x; + } + set + { + _rotation.x = value; + _flags |= Flags.OutlineChanged; + if (_perspective) + UpdateTransformMatrix(); + else + { + cachedTransform.localEulerAngles = _rotation; + ApplyPivot(); + } + } + } + + /// + /// + /// + public float rotationY + { + get + { + return _rotation.y; + } + set + { + _rotation.y = value; + _flags |= Flags.OutlineChanged; + if (_perspective) + UpdateTransformMatrix(); + else + { + cachedTransform.localEulerAngles = _rotation; + ApplyPivot(); + } + } + } + + /// + /// + /// + public Vector2 skew + { + get { return _skew; } + set + { + _skew = value; + _flags |= Flags.OutlineChanged; + + if (!Application.isPlaying) //ç¼–è¾‘æœŸé—´ä¸æ”¯æŒï¼ï¼ + return; + + UpdateTransformMatrix(); + } + } + + /// + /// 当对象处于ScreenSpace,也就是使用正交相机渲染时,对象虽然å¯ä»¥ç»•X轴或者Y轴旋转,但没有é€è§†æ•ˆæžœã€‚设置perspective,å¯ä»¥æ¨¡æ‹Ÿå‡ºé€è§†æ•ˆæžœã€‚ + /// + public bool perspective + { + get + { + return _perspective; + } + set + { + if (_perspective != value) + { + _perspective = value; + if (_perspective)//å±è”½Unityè‡ªèº«çš„æ—‹è½¬å˜æ¢ + cachedTransform.localEulerAngles = Vector3.zero; + else + cachedTransform.localEulerAngles = _rotation; + + ApplyPivot(); + UpdateTransformMatrix(); + } + } + } + + /// + /// + /// + public int focalLength + { + get { return _focalLength; } + set + { + if (value <= 0) + value = 1; + + _focalLength = value; + if (_vertexMatrix != null) + UpdateTransformMatrix(); + } + } + + void UpdateTransformMatrix() + { + Matrix4x4 matrix = Matrix4x4.identity; + if (_skew.x != 0 || _skew.y != 0) + ToolSet.SkewMatrix(ref matrix, _skew.x, _skew.y); + if (_perspective) + matrix *= Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(_rotation), Vector3.one); + if (matrix.isIdentity) + _vertexMatrix = null; + else if (_vertexMatrix == null) + _vertexMatrix = new NGraphics.VertexMatrix(); + + //组件的transformMatrix是通过paintingModeå®žçŽ°çš„ï¼Œå› ä¸ºå…¨éƒ¨é€šè¿‡çŸ©é˜µå˜æ¢çš„è¯ï¼Œå’Œunityè‡ªèº«çš„å˜æ¢æ··æ‚åœ¨ä¸€èµ·ï¼Œæ— åŠ›ç†æ¸…。 + if (_vertexMatrix != null) + { + _vertexMatrix.matrix = matrix; + _vertexMatrix.cameraPos = new Vector3(_pivot.x * _contentRect.width, -_pivot.y * _contentRect.height, _focalLength); + + if (graphics == null) + EnterPaintingMode(4, null); + } + else + { + if (graphics == null) + LeavePaintingMode(4); + } + + if (_paintingMode > 0) + { + paintingGraphics.vertexMatrix = _vertexMatrix; + _paintingInfo.flag = 1; + } + else if (graphics != null) + graphics.vertexMatrix = _vertexMatrix; + + _flags |= Flags.OutlineChanged; + } + + /// + /// + /// + public Vector2 pivot + { + get { return _pivot; } + set + { + Vector3 deltaPivot = new Vector2((value.x - _pivot.x) * _contentRect.width, (_pivot.y - value.y) * _contentRect.height); + Vector3 oldOffset = _pivotOffset; + + _pivot = value; + UpdatePivotOffset(); + Vector3 v = cachedTransform.localPosition; + v += oldOffset - _pivotOffset + deltaPivot; + cachedTransform.localPosition = v; + _flags |= Flags.OutlineChanged; + } + } + + void UpdatePivotOffset() + { + float px = _pivot.x * _contentRect.width; + float py = _pivot.y * _contentRect.height; + + //注æ„这里ä¸ç”¨å¤„ç†skewï¼Œå› ä¸ºåœ¨é¡¶ç‚¹å˜æ¢é‡Œæœ‰å¯¹pivotçš„å¤„ç† + Matrix4x4 matrix = Matrix4x4.TRS(Vector3.zero, cachedTransform.localRotation, cachedTransform.localScale); + _pivotOffset = matrix.MultiplyPoint(new Vector3(px, -py, 0)); + + if (_vertexMatrix != null) + _vertexMatrix.cameraPos = new Vector3(_pivot.x * _contentRect.width, -_pivot.y * _contentRect.height, _focalLength); + } + + void ApplyPivot() + { + if (_pivot.x != 0 || _pivot.y != 0) + { + Vector3 oldOffset = _pivotOffset; + + UpdatePivotOffset(); + Vector3 v = cachedTransform.localPosition; + + if ((_flags & Flags.PixelPerfect) != 0) + { + v -= _pixelPerfectAdjustment; + _checkPixelPerfect = Time.frameCount; + _pixelPerfectAdjustment = Vector3.zero; + } + + v += oldOffset - _pivotOffset; + cachedTransform.localPosition = v; + _flags |= Flags.OutlineChanged; + } + } + + /// + /// This is the pivot position + /// + public Vector3 location + { + get + { + Vector3 pos = this.position; + pos.x += _pivotOffset.x; + pos.y -= _pivotOffset.y; + pos.z += _pivotOffset.z; + return pos; + } + + set + { + this.SetPosition(value.x - _pivotOffset.x, value.y + _pivotOffset.y, value.z - _pivotOffset.z); + } + } + + /// + /// + /// + virtual public Material material + { + get + { + if (graphics != null) + return graphics.material; + else + return null; + } + set + { + if (graphics != null) + graphics.material = value; + } + } + + /// + /// + /// + virtual public string shader + { + get + { + if (graphics != null) + return graphics.shader; + else + return null; + } + set + { + if (graphics != null) + graphics.shader = value; + } + } + + /// + /// + /// + virtual public int renderingOrder + { + get + { + return _renderingOrder; + } + set + { + if ((_flags & Flags.GameObjectDisposed) != 0) + { + DisplayDisposedWarning(); + return; + } + + _renderingOrder = value; + if (graphics != null) + graphics.sortingOrder = value; + if (_paintingMode > 0) + paintingGraphics.sortingOrder = value; + } + } + + /// + /// + /// + public int layer + { + get + { + if (_paintingMode > 0) + return paintingGraphics.gameObject.layer; + else + return gameObject.layer; + } + set + { + SetLayer(value, false); + } + } + + /// + /// If the object can be focused? + /// + public bool focusable + { + get { return (_flags & Flags.NotFocusable) == 0; } + set + { + if (value) + _flags &= ~Flags.NotFocusable; + else + _flags |= Flags.NotFocusable; + } + } + + /// + /// If the object can be navigated by TAB? + /// + public bool tabStop + { + get { return (_flags & Flags.TabStop) != 0; } + set + { + if (value) + _flags |= Flags.TabStop; + else + _flags &= ~Flags.TabStop; + } + } + + /// + /// If the object focused? + /// + public bool focused + { + get + { + return Stage.inst.focus == this || (this is Container) && ((Container)this).IsAncestorOf(Stage.inst.focus); + } + } + + internal bool _AcceptTab() + { + if (_touchable && _visible + && ((_flags & Flags.TabStop) != 0 || (_flags & Flags.TabStopChildren) != 0) + && (_flags & Flags.NotFocusable) == 0) + { + Stage.inst.SetFocus(this, true); + return true; + } + else + return false; + } + + /// + /// + /// + /// + public string cursor + { + get { return _cursor; } + set + { + _cursor = value; + if (Application.isPlaying + && (this == Stage.inst.touchTarget || (this is Container) && ((Container)this).IsAncestorOf(Stage.inst.touchTarget))) + { + Stage.inst._ChangeCursor(_cursor); + } + } + } + + /// + /// + /// + public bool isDisposed + { + get { return (_flags & Flags.Disposed) != 0 || gameObject == null; } + } + + internal void InternalSetParent(Container value) + { + if (parent != value) + { + if (value == null && (parent._flags & Flags.Disposed) != 0) + parent = value; + else + { + parent = value; + UpdateHierarchy(); + } + _flags |= Flags.OutlineChanged; + } + } + + /// + /// + /// + public Container topmost + { + get + { + DisplayObject currentObject = this; + while (currentObject.parent != null) + currentObject = currentObject.parent; + return currentObject as Container; + } + } + + /// + /// + /// + public Stage stage + { + get + { + return topmost as Stage; + } + } + + /// + /// + /// + public Container worldSpaceContainer + { + get + { + Container wsc = null; + DisplayObject currentObject = this; + while (currentObject.parent != null) + { + if ((currentObject is Container) && ((Container)currentObject).renderMode == RenderMode.WorldSpace) + { + wsc = (Container)currentObject; + break; + } + currentObject = currentObject.parent; + } + + return wsc; + } + } + + /// + /// + /// + public bool touchable + { + get { return _touchable; } + set + { + if (_touchable != value) + { + _touchable = value; + if (this is Container) + { + ColliderHitTest hitArea = ((Container)this).hitArea as ColliderHitTest; + if (hitArea != null) + hitArea.collider.enabled = value; + } + } + } + } + + /// + /// + /// + /// + public bool touchDisabled + { + get { return (_flags & Flags.TouchDisabled) != 0; } + } + + /// + /// 进入绘画模å¼ï¼Œæ•´ä¸ªå¯¹è±¡å°†ç”»åˆ°ä¸€å¼ RenderTexture上,然åŽè¿™ç§è´´å›¾å°†ä»£æ›¿åŽŸæœ‰çš„æ˜¾ç¤ºå†…å®¹ã€‚ + /// å¯ä»¥åœ¨onPaint回调里对这张纹ç†è¿›è¡Œè¿›ä¸€æ­¥æ“作,实现特殊效果。 + /// + public void EnterPaintingMode() + { + EnterPaintingMode(16384, null, 1); + } + + /// + /// 进入绘画模å¼ï¼Œæ•´ä¸ªå¯¹è±¡å°†ç”»åˆ°ä¸€å¼ RenderTexture上,然åŽè¿™ç§è´´å›¾å°†ä»£æ›¿åŽŸæœ‰çš„æ˜¾ç¤ºå†…å®¹ã€‚ + /// å¯ä»¥åœ¨onPaint回调里对这张纹ç†è¿›è¡Œè¿›ä¸€æ­¥æ“作,实现特殊效果。 + /// å¯èƒ½æœ‰å¤šä¸ªåœ°æ–¹è¦æ±‚进入绘画模å¼ï¼Œè¿™é‡Œç”¨requestorId加以区别,å–值是1ã€2ã€4ã€8ã€16以此类推。1024内内部ä¿ç•™ã€‚用户自定义的id从1024开始。 + /// + /// 请求者id + /// 纹ç†å››å‘¨çš„留空。如果特殊处ç†åŽçš„内容大于原内容,那么这里的设置å¯ä»¥ä½¿çº¹ç†æ‰©å¤§ã€‚ + public void EnterPaintingMode(int requestorId, Margin? extend) + { + EnterPaintingMode(requestorId, extend, 1); + } + + /// + /// 进入绘画模å¼ï¼Œæ•´ä¸ªå¯¹è±¡å°†ç”»åˆ°ä¸€å¼ RenderTexture上,然åŽè¿™ç§è´´å›¾å°†ä»£æ›¿åŽŸæœ‰çš„æ˜¾ç¤ºå†…å®¹ã€‚ + /// å¯ä»¥åœ¨onPaint回调里对这张纹ç†è¿›è¡Œè¿›ä¸€æ­¥æ“作,实现特殊效果。 + /// å¯èƒ½æœ‰å¤šä¸ªåœ°æ–¹è¦æ±‚进入绘画模å¼ï¼Œè¿™é‡Œç”¨requestorId加以区别,å–值是1ã€2ã€4ã€8ã€16以此类推。1024内内部ä¿ç•™ã€‚用户自定义的id从1024开始。 + /// + /// 请求者id + /// 扩展纹ç†ã€‚如果特殊处ç†åŽçš„内容大于原内容,那么这里的设置å¯ä»¥ä½¿çº¹ç†æ‰©å¤§ã€‚ + /// 附加一个缩放系数 + public void EnterPaintingMode(int requestorId, Margin? extend, float scale) + { + bool first = _paintingMode == 0; + _paintingMode |= requestorId; + if (first) + { + if (_paintingInfo == null) + { + _paintingInfo = new PaintingInfo() + { + captureDelegate = Capture, + scale = 1 + }; + } + + if (paintingGraphics == null) + { + if (graphics == null) + paintingGraphics = new NGraphics(this.gameObject); + else + { + GameObject go = new GameObject(this.gameObject.name + " (Painter)"); + go.layer = this.gameObject.layer; + go.transform.SetParent(cachedTransform, false); + go.hideFlags = DisplayObject.hideFlags; + paintingGraphics = new NGraphics(go); + } + } + else + paintingGraphics.enabled = true; + paintingGraphics.vertexMatrix = null; + + if (this is Container) + { + ((Container)this).SetChildrenLayer(CaptureCamera.hiddenLayer); + ((Container)this).UpdateBatchingFlags(); + } + else + this.InvalidateBatchingState(); + + if (graphics != null) + this.gameObject.layer = CaptureCamera.hiddenLayer; + } + if (extend != null) + _paintingInfo.extend = (Margin)extend; + _paintingInfo.scale = scale; + _paintingInfo.flag = 1; + } + + /// + /// ç¦»å¼€ç»˜ç”»æ¨¡å¼ + /// + /// + public void LeavePaintingMode(int requestorId) + { + if (_paintingMode == 0 || (_flags & Flags.Disposed) != 0) + return; + + _paintingMode ^= requestorId; + if (_paintingMode == 0) + { + paintingGraphics.enabled = false; + + if (this is Container) + { + ((Container)this).SetChildrenLayer(this.layer); + ((Container)this).UpdateBatchingFlags(); + } + else + this.InvalidateBatchingState(); + + if (graphics != null) + this.gameObject.layer = paintingGraphics.gameObject.layer; + } + } + + /// + /// + /// + public bool paintingMode + { + get { return _paintingMode > 0; } + } + + /// + /// 将整个显示对象(如果是容器,则容器包å«çš„æ•´ä¸ªæ˜¾ç¤ºåˆ—è¡¨ï¼‰é™æ€åŒ–,所有内容被缓冲到一张纹ç†ä¸Šã€‚ + /// DCå°†ä¿æŒä¸º1。CPU消耗将é™åˆ°æœ€ä½Žã€‚但对象的任何å˜åŒ–ä¸ä¼šæ›´æ–°ã€‚ + /// 当cacheAsBitmapå·²ç»ä¸ºtrueæ—¶ï¼Œå†æ¬¡è°ƒç”¨cacheAsBitmap=true将会刷新对象一次。 + /// + public bool cacheAsBitmap + { + get { return (_flags & Flags.CacheAsBitmap) != 0; } + set + { + if (value) + { + _flags |= Flags.CacheAsBitmap; + EnterPaintingMode(8, null, UIContentScaler.scaleFactor); + } + else + { + _flags &= ~Flags.CacheAsBitmap; + LeavePaintingMode(8); + } + } + } + + /// + /// + /// + /// + /// + /// + public Texture2D GetScreenShot(Margin? extend, float scale) + { + EnterPaintingMode(8, null, scale); + UpdatePainting(); + Capture(); + + Texture2D output; + if (paintingGraphics.texture == null) + output = new Texture2D(1, 1, TextureFormat.RGBA32, false, true); + else + { + RenderTexture rt = (RenderTexture)paintingGraphics.texture.nativeTexture; + output = new Texture2D(rt.width, rt.height, TextureFormat.RGBA32, false, true); + RenderTexture old = RenderTexture.active; + RenderTexture.active = rt; + output.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0); + output.Apply(); + RenderTexture.active = old; + } + + LeavePaintingMode(8); + + return output; + } + + /// + /// + /// + public IFilter filter + { + get + { + return _filter; + } + + set + { + if (!Application.isPlaying) //ç¼–è¾‘æœŸé—´ä¸æ”¯æŒï¼ï¼ + return; + + if (value == _filter) + return; + + if (_filter != null) + _filter.Dispose(); + + if (value != null && value.target != null) + value.target.filter = null; + + _filter = value; + if (_filter != null) + _filter.target = this; + } + } + + /// + /// + /// + public BlendMode blendMode + { + get { return _blendMode; } + set + { + _blendMode = value; + InvalidateBatchingState(); + + if (graphics == null) + { + if (_blendMode != BlendMode.Normal) + { + if (!Application.isPlaying) //Not supported in edit modeï¼ + return; + + EnterPaintingMode(2, null); + paintingGraphics.blendMode = _blendMode; + } + else + LeavePaintingMode(2); + } + else + graphics.blendMode = _blendMode; + } + } + + /// + /// + /// + /// + /// + virtual public Rect GetBounds(DisplayObject targetSpace) + { + EnsureSizeCorrect(); + + if (targetSpace == this) // optimization + { + return _contentRect; + } + else if (targetSpace == parent && _rotation.z == 0) + { + return new Rect(cachedTransform.localPosition.x, -cachedTransform.localPosition.y, + _contentRect.width * cachedTransform.localScale.x, _contentRect.height * cachedTransform.localScale.y); + } + else + return TransformRect(_contentRect, targetSpace); + } + + internal DisplayObject InternalHitTest() + { + if (_visible && (!HitTestContext.forTouch || _touchable)) + return HitTest(); + else + return null; + } + + internal DisplayObject InternalHitTestMask() + { + if (_visible) + return HitTest(); + else + return null; + } + + virtual protected DisplayObject HitTest() + { + Rect rect = GetBounds(this); + if (rect.width == 0 || rect.height == 0) + return null; + + Vector2 localPoint = WorldToLocal(HitTestContext.worldPoint, HitTestContext.direction); + if (rect.Contains(localPoint)) + return this; + else + return null; + } + + /// + /// 将舞å°å标转æ¢ä¸ºæœ¬åœ°åæ ‡ + /// + /// + /// + public Vector2 GlobalToLocal(Vector2 point) + { + Container wsc = this.worldSpaceContainer; + + if (wsc != null)//I am in a world space + { + Camera cam = wsc.GetRenderCamera(); + Vector3 worldPoint; + Vector3 direction; + Vector3 screenPoint = new Vector3(); + screenPoint.x = point.x; + screenPoint.y = Screen.height - point.y; + + if (wsc.hitArea is MeshColliderHitTest) + { + Ray ray = cam.ScreenPointToRay(screenPoint); + RaycastHit hit; + if (((MeshColliderHitTest)wsc.hitArea).collider.Raycast(ray, out hit, 100)) + { + point = new Vector2(hit.textureCoord.x * _contentRect.width, (1 - hit.textureCoord.y) * _contentRect.height); + worldPoint = Stage.inst.cachedTransform.TransformPoint(point.x, -point.y, 0); + direction = Vector3.back; + } + else //å½“å°„çº¿æ²¡æœ‰å‡»ä¸­æ¨¡åž‹æ—¶ï¼Œæ— æ³•ç¡®å®šæœ¬åœ°åæ ‡ + return new Vector2(float.NaN, float.NaN); + } + else + { + screenPoint.z = cam.WorldToScreenPoint(this.cachedTransform.position).z; + worldPoint = cam.ScreenToWorldPoint(screenPoint); + Ray ray = cam.ScreenPointToRay(screenPoint); + direction = Vector3.zero - ray.direction; + } + + return this.WorldToLocal(worldPoint, direction); + } + else //I am in stage space + { + Vector3 worldPoint = Stage.inst.cachedTransform.TransformPoint(point.x, -point.y, 0); + return this.WorldToLocal(worldPoint, Vector3.back); + } + } + + /// + /// å°†æœ¬åœ°åæ ‡è½¬æ¢ä¸ºèˆžå°åæ ‡ + /// + /// + /// + public Vector2 LocalToGlobal(Vector2 point) + { + Container wsc = this.worldSpaceContainer; + + Vector3 worldPoint = this.cachedTransform.TransformPoint(point.x, -point.y, 0); + if (wsc != null) + { + if (wsc.hitArea is MeshColliderHitTest) //Not supported for UIPainter, use TransfromPoint instead. + return new Vector2(float.NaN, float.NaN); + + Vector3 screePoint = wsc.GetRenderCamera().WorldToScreenPoint(worldPoint); + return new Vector2(screePoint.x, Stage.inst.size.y - screePoint.y); + } + else + { + point = Stage.inst.cachedTransform.InverseTransformPoint(worldPoint); + point.y = -point.y; + return point; + } + } + + /// + /// 转æ¢ä¸–ç•Œåæ ‡ç‚¹åˆ°ç­‰æ•ˆçš„æœ¬åœ°xyå¹³é¢çš„ç‚¹ã€‚ç­‰æ•ˆçš„æ„æ€æ˜¯ä»–们在å±å¹•æ–¹å‘看到的ä½ç½®ä¸€æ ·ã€‚ + /// è¿”å›žçš„ç‚¹æ˜¯åœ¨å¯¹è±¡çš„æœ¬åœ°åæ ‡ç©ºé—´ï¼Œä¸”z=0 + /// + /// + /// + /// + public Vector3 WorldToLocal(Vector3 worldPoint, Vector3 direction) + { + Vector3 localPoint = this.cachedTransform.InverseTransformPoint(worldPoint); + if (localPoint.z != 0) //如果对象绕x轴或y轴旋转过,或者对象是在é€è§†ç›¸æœºï¼Œé‚£ä¹ˆz值å¯èƒ½ä¸ä¸º0, + { + //å°†ä¸–ç•Œåæ ‡çš„æ‘„影机方å‘在本地空间上投射,求出与xyå¹³é¢çš„交点 + direction = this.cachedTransform.InverseTransformDirection(direction); + float distOnLine = Vector3.Dot(Vector3.zero - localPoint, Vector3.forward) / Vector3.Dot(direction, Vector3.forward); + if (float.IsInfinity(distOnLine)) + return Vector2.zero; + + localPoint = localPoint + direction * distOnLine; + } + else if (_vertexMatrix != null) + { + Vector3 center = _vertexMatrix.cameraPos; + center.z = 0; + center -= _vertexMatrix.matrix.MultiplyPoint(center); + + Matrix4x4 mm = _vertexMatrix.matrix.inverse; + + localPoint -= center; + localPoint = mm.MultiplyPoint(localPoint); + + Vector3 camPos = mm.MultiplyPoint(_vertexMatrix.cameraPos); + Vector3 vec = localPoint - camPos; + float lambda = -camPos.z / vec.z; + localPoint = camPos + lambda * vec; + localPoint.z = 0; + } + localPoint.y = -localPoint.y; + + return localPoint; + } + + /// + /// + /// + /// + /// + public Vector3 LocalToWorld(Vector3 localPoint) + { + localPoint.y = -localPoint.y; + if (_vertexMatrix != null) + { + Vector3 center = _vertexMatrix.cameraPos; + center.z = 0; + center -= _vertexMatrix.matrix.MultiplyPoint(center); + + localPoint = _vertexMatrix.matrix.MultiplyPoint(localPoint); + localPoint += center; + + Vector3 camPos = _vertexMatrix.cameraPos; + Vector3 vec = localPoint - camPos; + float lambda = -camPos.z / vec.z; + localPoint = camPos + lambda * vec; + localPoint.z = 0; + } + + return this.cachedTransform.TransformPoint(localPoint); + } + + /// + /// + /// + /// + /// null if to world space + /// + public Vector2 TransformPoint(Vector2 point, DisplayObject targetSpace) + { + if (targetSpace == this) + return point; + + point = LocalToWorld(point); + if (targetSpace != null) + point = targetSpace.WorldToLocal(point, Vector3.back); + + return point; + } + + /// + /// + /// + /// + /// null if to world space + /// + public Rect TransformRect(Rect rect, DisplayObject targetSpace) + { + if (targetSpace == this) + return rect; + + if (targetSpace == parent && _rotation.z == 0) // optimization + { + Vector3 vec = cachedTransform.localScale; + return new Rect((this.x + rect.x) * vec.x, (this.y + rect.y) * vec.y, + rect.width * vec.x, rect.height * vec.y); + } + else + { + Vector4 vec4 = new Vector4(float.MaxValue, float.MaxValue, float.MinValue, float.MinValue); + + TransformRectPoint(rect.xMin, rect.yMin, targetSpace, ref vec4); + TransformRectPoint(rect.xMax, rect.yMin, targetSpace, ref vec4); + TransformRectPoint(rect.xMin, rect.yMax, targetSpace, ref vec4); + TransformRectPoint(rect.xMax, rect.yMax, targetSpace, ref vec4); + + return Rect.MinMaxRect(vec4.x, vec4.y, vec4.z, vec4.w); + } + } + + protected void TransformRectPoint(float px, float py, DisplayObject targetSpace, ref Vector4 vec4) + { + Vector2 v = TransformPoint(new Vector2(px, py), targetSpace); + + if (vec4.x > v.x) vec4.x = v.x; + if (vec4.z < v.x) vec4.z = v.x; + if (vec4.y > v.y) vec4.y = v.y; + if (vec4.w < v.y) vec4.w = v.y; + } + + /// + /// + /// + public void RemoveFromParent() + { + if (parent != null) + parent.RemoveChild(this); + } + + /// + /// + /// + public void InvalidateBatchingState() + { + if (parent != null) + parent.InvalidateBatchingState(true); + } + + virtual public void Update(UpdateContext context) + { + if (_checkPixelPerfect != 0) + { + if (_rotation == Vector3.zero) + { + Vector3 v = cachedTransform.localPosition; + v.x = Mathf.Round(v.x); + v.y = Mathf.Round(v.y); + _pixelPerfectAdjustment = v - cachedTransform.localPosition; + if (_pixelPerfectAdjustment != Vector3.zero) + cachedTransform.localPosition = v; + } + _checkPixelPerfect = 0; + } + + if (graphics != null) + graphics.Update(context, context.alpha * _alpha, context.grayed | _grayed); + + if (_paintingMode != 0) + { + UpdatePainting(); + + //如果是容器,Captureè¦ç­‰åˆ°Container.Updateçš„æœ€åŽæ‰§è¡Œï¼Œå› ä¸ºå®¹å™¨ä¸­å¯èƒ½ä¹Ÿæœ‰éœ€è¦Capture的内容,è¦ç­‰ä»–们完æˆåŽå†è¿›è¡Œå®¹å™¨çš„Capture。 + if (!(this is Container)) + { + if ((_flags & Flags.CacheAsBitmap) == 0 || _paintingInfo.flag != 2) + UpdateContext.OnEnd += _paintingInfo.captureDelegate; + } + + paintingGraphics.Update(context, 1, false); + } + + if (_filter != null) + _filter.Update(); + + Stats.ObjectCount++; + } + + void UpdatePainting() + { + NTexture paintingTexture = paintingGraphics.texture; + if (paintingTexture != null && paintingTexture.disposed) //Textureå¯èƒ½å·²è¢«Stage.MonitorTextureé”€æ¯ + { + paintingTexture = null; + _paintingInfo.flag = 1; + } + + if (_paintingInfo.flag == 1) + { + _paintingInfo.flag = 0; + + //从优化考虑,决定使用绘画模å¼çš„å®¹å™¨éƒ½éœ€è¦æ˜Žç¡®æŒ‡å®šå¤§å°ï¼Œè€Œä¸æ˜¯è‡ªåŠ¨è®¡ç®—åŒ…å›´ã€‚è¿™åœ¨UI使用上并没有问题,因为组件总是有固定大å°çš„ + Margin extend = _paintingInfo.extend; + paintingGraphics.contentRect = new Rect(-extend.left, -extend.top, _contentRect.width + extend.left + extend.right, _contentRect.height + extend.top + extend.bottom); + int textureWidth = Mathf.RoundToInt(paintingGraphics.contentRect.width * _paintingInfo.scale); + int textureHeight = Mathf.RoundToInt(paintingGraphics.contentRect.height * _paintingInfo.scale); + if (paintingTexture == null || paintingTexture.width != textureWidth || paintingTexture.height != textureHeight) + { + if (paintingTexture != null) + paintingTexture.Dispose(); + if (textureWidth > 0 && textureHeight > 0) + { + paintingTexture = new NTexture(CaptureCamera.CreateRenderTexture(textureWidth, textureHeight, UIConfig.depthSupportForPaintingMode)); + Stage.inst.MonitorTexture(paintingTexture); + } + else + paintingTexture = null; + paintingGraphics.texture = paintingTexture; + } + } + + if (paintingTexture != null) + paintingTexture.lastActive = Time.time; + } + + void Capture() + { + if (paintingGraphics.texture == null) + return; + + Vector2 offset = new Vector2(_paintingInfo.extend.left, _paintingInfo.extend.top); + CaptureCamera.Capture(this, (RenderTexture)paintingGraphics.texture.nativeTexture, paintingGraphics.contentRect.height, offset); + + _paintingInfo.flag = 2; //2表示已完æˆä¸€æ¬¡Capture + if (onPaint != null) + onPaint(); + } + + /// + /// 为对象设置一个默认的父Transform。当对象ä¸åœ¨æ˜¾ç¤ºåˆ—表里时,它的GameObject挂到哪里。 + /// + public Transform home + { + get { return _home; } + set + { + _home = value; + if (value != null && cachedTransform.parent == null) + cachedTransform.SetParent(value, false); + } + } + + void UpdateHierarchy() + { + if ((_flags & Flags.GameObjectDisposed) != 0) + return; + + if ((_flags & Flags.UserGameObject) != 0) + { + //we dont change transform parent of this object + if (gameObject != null) + { + if (parent != null && visible) + gameObject.SetActive(true); + else + gameObject.SetActive(false); + } + } + else if (parent != null) + { + cachedTransform.SetParent(parent.cachedTransform, false); + + if (_visible) + gameObject.SetActive(true); + + int layerValue = parent.gameObject.layer; + if (parent._paintingMode != 0) + layerValue = CaptureCamera.hiddenLayer; + SetLayer(layerValue, true); + } + else if ((_flags & Flags.Disposed) == 0 && this.gameObject != null && !StageEngine.beingQuit) + { + if (Application.isPlaying) + { + if (gOwner == null || gOwner.parent == null)//如果gOwner还有parentçš„è¯ï¼Œè¯´æ˜Žåªæ˜¯æš‚æ—¶çš„éšè— + { + cachedTransform.SetParent(_home, false); + if (_home == null) + UnityEngine.Object.DontDestroyOnLoad(this.gameObject); + } + } + + gameObject.SetActive(false); + } + } + + virtual protected bool SetLayer(int value, bool fromParent) + { + if ((_flags & Flags.LayerSet) != 0) //setted + { + if (fromParent) + return false; + } + else if ((_flags & Flags.LayerFromParent) != 0) //inherit from parent + { + if (!fromParent) + _flags |= Flags.LayerSet; + } + else + { + if (fromParent) + _flags |= Flags.LayerFromParent; + else + _flags |= Flags.LayerSet; + } + + if (_paintingMode > 0) + paintingGraphics.gameObject.layer = value; + else if (gameObject.layer != value) + { + gameObject.layer = value; + if ((this is Container)) + { + int cnt = ((Container)this).numChildren; + for (int i = 0; i < cnt; i++) + { + DisplayObject child = ((Container)this).GetChildAt(i); + child.SetLayer(value, true); + } + } + } + + return true; + } + + internal void _SetLayerDirect(int value) + { + if (_paintingMode > 0) + paintingGraphics.gameObject.layer = value; + else + gameObject.layer = value; + } + + virtual public void Dispose() + { + if ((_flags & Flags.Disposed) != 0) + return; + + _flags |= Flags.Disposed; + RemoveFromParent(); + RemoveEventListeners(); + if (graphics != null) + graphics.Dispose(); + if (_filter != null) + _filter.Dispose(); + if (paintingGraphics != null) + { + if (paintingGraphics.texture != null) + paintingGraphics.texture.Dispose(); + + paintingGraphics.Dispose(); + if (paintingGraphics.gameObject != this.gameObject) + { + if (Application.isPlaying) + UnityEngine.Object.Destroy(paintingGraphics.gameObject); + else + UnityEngine.Object.DestroyImmediate(paintingGraphics.gameObject); + } + } + DestroyGameObject(); + } + + internal void DisplayDisposedWarning() + { + if ((_flags & Flags.DisposedWarning) == 0) + { + _flags |= Flags.DisposedWarning; + + StringBuilder sb = new StringBuilder(); + sb.Append("DisplayObject is still in use but GameObject was disposed. ("); + if (gOwner != null) + { + sb.Append("type=").Append(gOwner.GetType().Name).Append(", x=").Append(gOwner.x).Append(", y=").Append(gOwner.y).Append(", name=").Append(gOwner.name); + if (gOwner.packageItem != null) + sb.Append(", res=" + gOwner.packageItem.name); + } + else + { + sb.Append("id=").Append(id).Append(", type=").Append(this.GetType().Name).Append(", name=").Append(name); + } + sb.Append(")"); + Debug.LogError(sb.ToString()); + } + } + + protected internal class PaintingInfo + { + public Action captureDelegate; //缓存这个delegate,å¯ä»¥é˜²æ­¢Capture状æ€ä¸‹æ¯å¸§104Bçš„GC + public Margin extend; + public float scale; + public int flag; + } + + [Flags] + protected internal enum Flags + { + Disposed = 1, + UserGameObject = 2, + TouchDisabled = 4, + OutlineChanged = 8, + UpdatingSize = 0x10, + WidthChanged = 0x20, + HeightChanged = 0x40, + PixelPerfect = 0x80, + LayerSet = 0x100, + LayerFromParent = 0x200, + NotFocusable = 0x400, + TabStop = 0x800, + TabStopChildren = 0x1000, + FairyBatching = 0x2000, + BatchingRequested = 0x4000, + BatchingRoot = 0x8000, + SkipBatching = 0x10000, + CacheAsBitmap = 0x20000, + GameObjectDisposed = 0x40000, + DisposedWarning = 0x80000 + } + } + + /// + /// + /// + public class DisplayObjectInfo : MonoBehaviour + { + /// + /// + /// /// + [System.NonSerialized] + public DisplayObject displayObject; + + private void OnDestroy() + { + if (displayObject != null) + displayObject._flags |= DisplayObject.Flags.GameObjectDisposed; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs.meta new file mode 100644 index 00000000..6fcef79e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/DisplayObject.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 24d09ba8cf3faa74f8dcd1c86ad38588 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs new file mode 100644 index 00000000..e3dbdd0e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs @@ -0,0 +1,393 @@ +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine.Pool; + +namespace FairyGUI +{ + /// + /// GoWrapper is class for wrapping common gameobject into UI display list. + /// + public class GoWrapper : DisplayObject + { + [Obsolete("No need to manually set this flag anymore, coz it will be handled automatically.")] + public bool supportStencil; + + public event Action onUpdate; + public Action> customCloneMaterials; + public Action customRecoverMaterials; + + protected GameObject _wrapTarget; + protected List _renderers; + protected Dictionary _materialsBackup; + protected Canvas _canvas; + protected bool _cloneMaterial; + protected bool _shouldCloneMaterial; + + protected struct RendererInfo + { + public Renderer renderer; + public Material[] materials; + public int sortingOrder; + } + + // protected static List helperTransformList = new List(); + + /// + /// + /// + public GoWrapper() + { + // _flags |= Flags.SkipBatching; + + _renderers = new List(); + _materialsBackup = new Dictionary(); + + CreateGameObject("GoWrapper"); + } + + /// + /// + /// + /// 包装对象。 + public GoWrapper(GameObject go) : this() + { + SetWrapTarget(go, false); + } + + /// + /// 设置包装对象。注æ„å¦‚æžœåŽŸæ¥æœ‰åŒ…装对象,设置新的包装对象åŽï¼ŒåŽŸæ¥çš„包装对象åªä¼šè¢«åˆ é™¤å¼•用,但ä¸ä¼šè¢«é”€æ¯ã€‚ + /// 对象包å«çš„æ‰€æœ‰æè´¨ä¸ä¼šè¢«å¤åˆ¶ï¼Œå¦‚æžœæè´¨å·²ç»æ˜¯å…¬ç”¨çš„,这å¯èƒ½å½±å“到其他对象。如果希望自动å¤åˆ¶ï¼Œæ”¹ä¸ºä½¿ç”¨SetWrapTarget(target, true)设置。 + /// + public GameObject wrapTarget + { + get { return _wrapTarget; } + set { SetWrapTarget(value, false); } + } + + [Obsolete("setWrapTarget is deprecated. Use SetWrapTarget instead.")] + public void setWrapTarget(GameObject target, bool cloneMaterial) + { + SetWrapTarget(target, cloneMaterial); + } + + /// + /// 设置包装对象。注æ„å¦‚æžœåŽŸæ¥æœ‰åŒ…装对象,设置新的包装对象åŽï¼ŒåŽŸæ¥çš„包装对象åªä¼šè¢«åˆ é™¤å¼•用,但ä¸ä¼šè¢«é”€æ¯ã€‚ + /// + /// + /// 如果true,则å¤åˆ¶æè´¨ï¼Œå¦åˆ™ç›´æŽ¥ä½¿ç”¨sharedMaterial。 + public void SetWrapTarget(GameObject target, bool cloneMaterial) + { + // set Flags.SkipBatching only target not null + if (target == null) _flags &= ~Flags.SkipBatching; + else _flags |= Flags.SkipBatching; + InvalidateBatchingState(); + + RecoverMaterials(); + + _cloneMaterial = cloneMaterial; + if (_wrapTarget != null) + _wrapTarget.transform.SetParent(null, false); + + _canvas = null; + _wrapTarget = target; + _shouldCloneMaterial = false; + _renderers.Clear(); + + if (_wrapTarget != null) + { + _wrapTarget.transform.SetParent(this.cachedTransform, false); + _canvas = _wrapTarget.GetComponent(); + if (_canvas != null) + { + _canvas.renderMode = RenderMode.WorldSpace; + _canvas.worldCamera = StageCamera.main; + _canvas.overrideSorting = true; + + RectTransform rt = _canvas.GetComponent(); + rt.pivot = new Vector2(0, 1); + rt.position = new Vector3(0, 0, 0); + this.SetSize(rt.rect.width, rt.rect.height); + } + else + { + CacheRenderers(); + this.SetSize(0, 0); + } + + SetGoLayers(this.layer); + } + } + + /// + /// GoWrapper will cache all renderers of your gameobject on constructor. + /// If your gameobject change laterly, call this function to update the cache. + /// GoWrapper会在构造函数里查询你的gameobject所有的Rendererå¹¶ä¿å­˜ã€‚如果你的gameobject + /// åŽç»­å‘生了改å˜ï¼Œè°ƒç”¨è¿™ä¸ªå‡½æ•°é€šçŸ¥GoWrapper釿–°æŸ¥è¯¢å’Œä¿å­˜ã€‚ + /// + public void CacheRenderers() + { + if (_canvas != null) + return; + + RecoverMaterials(); + _renderers.Clear(); + + var items = ListPool.Get(); + _wrapTarget.GetComponentsInChildren(true, items); + + int cnt = items.Count; + _renderers.Capacity = cnt; + for (int i = 0; i < cnt; i++) + { + Renderer r = items[i]; + Material[] mats = r.sharedMaterials; + RendererInfo ri = new RendererInfo() + { + renderer = r, + materials = mats, + sortingOrder = r.sortingOrder + }; + _renderers.Add(ri); + + if (!_cloneMaterial && mats != null + && ((r is SkinnedMeshRenderer) || (r is MeshRenderer))) + { + int mcnt = mats.Length; + for (int j = 0; j < mcnt; j++) + { + Material mat = mats[j]; + if (mat != null && mat.renderQueue != 3000) //Set the object rendering in Transparent Queue as UI objects + mat.renderQueue = 3000; + } + } + } + ListPool.Release(items); + _renderers.Sort((RendererInfo c1, RendererInfo c2) => { return c1.sortingOrder - c2.sortingOrder; }); + + _shouldCloneMaterial = _cloneMaterial; + } + + void CloneMaterials() + { + _shouldCloneMaterial = false; + + int cnt = _renderers.Count; + for (int i = 0; i < cnt; i++) + { + RendererInfo ri = _renderers[i]; + Material[] mats = ri.materials; + if (mats == null) + continue; + + bool shouldSetRQ = (ri.renderer is SkinnedMeshRenderer) || (ri.renderer is MeshRenderer); + + int mcnt = mats.Length; + for (int j = 0; j < mcnt; j++) + { + Material mat = mats[j]; + if (mat == null) + continue; + + //ç¡®ä¿ç›¸åŒçš„æè´¨ä¸ä¼šå¤åˆ¶ä¸¤æ¬¡ + Material newMat; + if (!_materialsBackup.TryGetValue(mat, out newMat)) + { + newMat = new Material(mat); + _materialsBackup[mat] = newMat; + } + + mats[j] = newMat; + + if (shouldSetRQ && mat.renderQueue != 3000) //Set the object rendering in Transparent Queue as UI objects + newMat.renderQueue = 3000; + } + + if (customCloneMaterials != null) + customCloneMaterials.Invoke(_materialsBackup); + else if (ri.renderer != null) + ri.renderer.sharedMaterials = mats; + } + } + + void RecoverMaterials() + { + if (_materialsBackup.Count == 0) + return; + + int cnt = _renderers.Count; + for (int i = 0; i < cnt; i++) + { + RendererInfo ri = _renderers[i]; + if (ri.renderer == null) + continue; + + Material[] mats = ri.materials; + if (mats == null) + continue; + + int mcnt = mats.Length; + for (int j = 0; j < mcnt; j++) + { + Material mat = mats[j]; + + foreach (KeyValuePair kv in _materialsBackup) + { + if (kv.Value == mat) + mats[j] = kv.Key; + } + } + + if (customRecoverMaterials != null) + customRecoverMaterials.Invoke(); + else + ri.renderer.sharedMaterials = mats; + } + + foreach (KeyValuePair kv in _materialsBackup) + Material.DestroyImmediate(kv.Value); + + _materialsBackup.Clear(); + } + + public override int renderingOrder + { + get { return base.renderingOrder; } + set + { + base.renderingOrder = value; + + if (_canvas != null) + _canvas.sortingOrder = value; + else + { + int cnt = _renderers.Count; + for (int i = 0; i < cnt; i++) + { + RendererInfo ri = _renderers[i]; + if (ri.renderer != null) + { + if (i != 0 && _renderers[i].sortingOrder != _renderers[i - 1].sortingOrder) + value = UpdateContext.current.renderingOrder++; + ri.renderer.sortingOrder = value; + } + } + } + } + } + + override protected bool SetLayer(int value, bool fromParent) + { + if (base.SetLayer(value, fromParent)) + { + SetGoLayers(value); + return true; + } + else + return false; + } + + protected void SetGoLayers(int layer) + { + if (_wrapTarget == null) + return; + + var helperTransformList = ListPool.Get(); + _wrapTarget.GetComponentsInChildren(true, helperTransformList); + int cnt = helperTransformList.Count; + for (int i = 0; i < cnt; i++) + { + helperTransformList[i].gameObject.layer = layer; + } + ListPool.Release(helperTransformList); + // helperTransformList.Clear(); + } + + override public void Update(UpdateContext context) + { + if (onUpdate != null) + onUpdate(context); + + if (_shouldCloneMaterial) + CloneMaterials(); + + ApplyClipping(context); + + base.Update(context); + } + + private List helperMaterials = new List(); + + virtual protected void ApplyClipping(UpdateContext context) + { +#if UNITY_2018_2_OR_NEWER + int cnt = _renderers.Count; + for (int i = 0; i < cnt; i++) + { + Renderer renderer = _renderers[i].renderer; + if (renderer == null) + continue; + + if (customCloneMaterials != null) + helperMaterials.AddRange(_materialsBackup.Values); + else + renderer.GetSharedMaterials(helperMaterials); + + int cnt2 = helperMaterials.Count; + for (int j = 0; j < cnt2; j++) + { + Material mat = helperMaterials[j]; + if (mat != null) + context.ApplyClippingProperties(mat, false); + } + + helperMaterials.Clear(); + } +#else + int cnt = _renderers.Count; + for (int i = 0; i < cnt; i++) + { + Material[] mats = _renderers[i].materials; + if (mats == null) + continue; + + int cnt2 = mats.Length; + for (int j = 0; j < cnt2; j++) + { + Material mat = mats[j]; + if (mat != null) + context.ApplyClippingProperties(mat, false); + } + } +#endif + } + + public override void Dispose() + { + if ((_flags & Flags.Disposed) != 0) + return; + + if (_wrapTarget != null) + { + UnityEngine.Object.Destroy(_wrapTarget); + _wrapTarget = null; + + if (_materialsBackup.Count > 0) + { + //如果有备份,说明æè´¨æ˜¯å¤åˆ¶å‡ºæ¥çš„,应该删除 + foreach (KeyValuePair kv in _materialsBackup) + Material.DestroyImmediate(kv.Value); + } + } + + _renderers = null; + _materialsBackup = null; + _canvas = null; + customCloneMaterials = null; + customRecoverMaterials = null; + + base.Dispose(); + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs.meta new file mode 100644 index 00000000..15bca9e3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/GoWrapper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 796d0bdebe7368c47adfdf04a1abdfc6 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest.meta new file mode 100644 index 00000000..77f99f3e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 736ceb6630254bd42b41568b387cbcbe +folderAsset: yes +timeCreated: 1461773297 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs new file mode 100644 index 00000000..cc7f4914 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class ColliderHitTest : IHitTest + { + /// + /// + /// + public Collider collider; + + /// + /// + /// + /// + /// + /// + virtual public bool HitTest(Rect contentRect, Vector2 localPoint) + { + RaycastHit hit; + if (!HitTestContext.GetRaycastHitFromCache(HitTestContext.camera, out hit)) + return false; + + if (hit.collider != collider) + return false; + + return true; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs.meta new file mode 100644 index 00000000..8f1e6603 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ColliderHitTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ffed53edbd969f3439a942ca847cd43d +timeCreated: 1461773299 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs new file mode 100644 index 00000000..fd343caa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs @@ -0,0 +1,79 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class HitTestContext + { + //set before hit test + public static Vector3 screenPoint; + public static Vector3 worldPoint; + public static Vector3 direction; + public static bool forTouch; + public static Camera camera; + + public static int layerMask = -1; + public static float maxDistance = Mathf.Infinity; + + public static Camera cachedMainCamera; + + static Dictionary raycastHits = new Dictionary(); + + /// + /// + /// + /// + /// + /// + public static bool GetRaycastHitFromCache(Camera camera, out RaycastHit hit) + { + RaycastHit? hitRef; + if (!raycastHits.TryGetValue(camera, out hitRef)) + { + Ray ray = camera.ScreenPointToRay(screenPoint); + if (Physics.Raycast(ray, out hit, maxDistance, layerMask)) + { + raycastHits[camera] = hit; + return true; + } + else + { + raycastHits[camera] = null; + return false; + } + } + else if (hitRef == null) + { + hit = new RaycastHit(); + return false; + } + else + { + hit = (RaycastHit)hitRef; + return true; + } + } + + /// + /// + /// + /// + /// + public static void CacheRaycastHit(Camera camera, ref RaycastHit hit) + { + raycastHits[camera] = hit; + } + + /// + /// + /// + public static void ClearRaycastHitCache() + { + raycastHits.Clear(); + } + } + +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs.meta new file mode 100644 index 00000000..642095ba --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/HitTestContext.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 19869d6307205b84a81aef6031ba1f33 +timeCreated: 1461750571 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs new file mode 100644 index 00000000..6b57e5f6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public enum HitTestMode + { + Default, + Raycast + } + + /// + /// + /// + public interface IHitTest + { + /// + /// + /// + /// + /// + /// + bool HitTest(Rect contentRect, Vector2 localPoint); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs.meta new file mode 100644 index 00000000..7397c035 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/IHitTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8bbadf82645501c41957c257ab020708 +timeCreated: 1461853133 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs new file mode 100644 index 00000000..00d8644d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class MeshColliderHitTest : ColliderHitTest + { + public Vector2 lastHit; + + /// + /// + /// + /// + public MeshColliderHitTest(MeshCollider collider) + { + this.collider = collider; + } + + /// + /// + /// + /// + /// + /// + override public bool HitTest(Rect contentRect, Vector2 localPoint) + { + RaycastHit hit; + if (!HitTestContext.GetRaycastHitFromCache(HitTestContext.camera, out hit)) + return false; + + if (hit.collider != collider) + return false; + + lastHit = new Vector2(hit.textureCoord.x * contentRect.width, (1 - hit.textureCoord.y) * contentRect.height); + HitTestContext.direction = Vector3.back; + HitTestContext.worldPoint = StageCamera.main.ScreenToWorldPoint(new Vector2(lastHit.x, Screen.height - lastHit.y)); + + return true; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs.meta new file mode 100644 index 00000000..5fddd956 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/MeshColliderHitTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6d0a2fa0c7008814795dc7f5f3bd4b19 +timeCreated: 1461750571 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs new file mode 100644 index 00000000..f4a719ca --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs @@ -0,0 +1,82 @@ +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class PixelHitTestData + { + public int pixelWidth; + public float scale; + public byte[] pixels; + public int pixelsLength; + public int pixelsOffset; + + public void Load(ByteBuffer ba) + { + ba.ReadInt(); + pixelWidth = ba.ReadInt(); + scale = 1.0f / ba.ReadByte(); + pixels = ba.buffer; + pixelsLength = ba.ReadInt(); + pixelsOffset = ba.position; + ba.Skip(pixelsLength); + } + } + + /// + /// + /// + public class PixelHitTest : IHitTest + { + public int offsetX; + public int offsetY; + public float sourceWidth; + public float sourceHeight; + + PixelHitTestData _data; + + /// + /// + /// + /// + /// + /// + public PixelHitTest(PixelHitTestData data, int offsetX, int offsetY, float sourceWidth, float sourceHeight) + { + _data = data; + this.offsetX = offsetX; + this.offsetY = offsetY; + this.sourceWidth = sourceWidth; + this.sourceHeight = sourceHeight; + } + + /// + /// + /// + /// + /// + /// + public bool HitTest(Rect contentRect, Vector2 localPoint) + { + if (!contentRect.Contains(localPoint)) + return false; + + int x = Mathf.FloorToInt((localPoint.x * sourceWidth / contentRect.width - offsetX) * _data.scale); + int y = Mathf.FloorToInt((localPoint.y * sourceHeight / contentRect.height - offsetY) * _data.scale); + if (x < 0 || y < 0 || x >= _data.pixelWidth) + return false; + + int pos = y * _data.pixelWidth + x; + int pos2 = pos / 8; + int pos3 = pos % 8; + + if (pos2 >= 0 && pos2 < _data.pixelsLength) + return ((_data.pixels[_data.pixelsOffset + pos2] >> pos3) & 0x1) > 0; + else + return false; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs.meta new file mode 100644 index 00000000..3b3febe5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/PixelHitTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 98cb65df7f5853c4b8e3719a28d4d81f +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs new file mode 100644 index 00000000..80e9f1f0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class RectHitTest : IHitTest + { + /// + /// + /// + public Rect rect; + + /// + /// + /// + /// + /// + /// + public bool HitTest(Rect contentRect, Vector2 localPoint) + { + return rect.Contains(localPoint); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs.meta new file mode 100644 index 00000000..561da713 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/RectHitTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 92768f03d9b8dea47b1649613c4d0de7 +timeCreated: 1474896442 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs new file mode 100644 index 00000000..08d6cf4d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class ShapeHitTest : IHitTest + { + /// + /// + /// + public DisplayObject shape; + + public ShapeHitTest(DisplayObject obj) + { + shape = obj; + } + + /// + /// + /// + /// + /// + /// + public bool HitTest(Rect contentRect, Vector2 localPoint) + { + if (shape.graphics == null) + return false; + + if (shape.parent != null) + { + localPoint = shape.parent.TransformPoint(localPoint, shape); + contentRect.size = shape.size; + } + + IHitTest ht = shape.graphics.meshFactory as IHitTest; + if (ht == null) + return false; + + return ht.HitTest(contentRect, localPoint); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs.meta new file mode 100644 index 00000000..614d5098 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/HitTest/ShapeHitTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cd85528f2766431cafc5282f956c060 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs new file mode 100644 index 00000000..3125aa45 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs @@ -0,0 +1,436 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class Image : DisplayObject, IMeshFactory + { + protected Rect? _scale9Grid; + protected bool _scaleByTile; + protected Vector2 _textureScale; + protected int _tileGridIndice; + protected FillMesh _fillMesh; + + public Image() : this(null) + { + } + + /// + /// + /// + /// + public Image(NTexture texture) + : base() + { + _flags |= Flags.TouchDisabled; + + CreateGameObject("Image"); + graphics = new NGraphics(gameObject); + graphics.shader = ShaderConfig.imageShader; + graphics.meshFactory = this; + + _textureScale = Vector2.one; + + if (texture != null) + UpdateTexture(texture); + } + + /// + /// + /// + public NTexture texture + { + get { return graphics.texture; } + set + { + UpdateTexture(value); + } + } + + public Vector2 textureScale + { + get { return _textureScale; } + set + { + _textureScale = value; + graphics.SetMeshDirty(); + } + } + + /// + /// + /// + public Color color + { + get + { + return graphics.color; + } + set + { + graphics.color = value; + graphics.Tint(); + } + } + + /// + /// + /// + public FillMethod fillMethod + { + get { return _fillMesh != null ? _fillMesh.method : FillMethod.None; } + set + { + if (_fillMesh == null) + { + if (value == FillMethod.None) + return; + + _fillMesh = new FillMesh(); + } + if (_fillMesh.method != value) + { + _fillMesh.method = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public int fillOrigin + { + get { return _fillMesh != null ? _fillMesh.origin : 0; } + set + { + if (_fillMesh == null) + _fillMesh = new FillMesh(); + + if (_fillMesh.origin != value) + { + _fillMesh.origin = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public bool fillClockwise + { + get { return _fillMesh != null ? _fillMesh.clockwise : true; } + set + { + if (_fillMesh == null) + _fillMesh = new FillMesh(); + + if (_fillMesh.clockwise != value) + { + _fillMesh.clockwise = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public float fillAmount + { + get { return _fillMesh != null ? _fillMesh.amount : 0; } + set + { + if (_fillMesh == null) + _fillMesh = new FillMesh(); + + if (_fillMesh.amount != value) + { + _fillMesh.amount = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public Rect? scale9Grid + { + get { return _scale9Grid; } + set + { + if (_scale9Grid != value) + { + _scale9Grid = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public bool scaleByTile + { + get { return _scaleByTile; } + set + { + if (_scaleByTile != value) + { + _scaleByTile = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public int tileGridIndice + { + get { return _tileGridIndice; } + set + { + if (_tileGridIndice != value) + { + _tileGridIndice = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public void SetNativeSize() + { + if (graphics.texture != null) + SetSize(graphics.texture.width, graphics.texture.height); + else + SetSize(0, 0); + } + + virtual protected void UpdateTexture(NTexture value) + { + if (value == graphics.texture) + return; + + graphics.texture = value; + _textureScale = Vector2.one; + if (_contentRect.width == 0) + SetNativeSize(); + InvalidateBatchingState(); + } + + public void OnPopulateMesh(VertexBuffer vb) + { + if (_fillMesh != null && _fillMesh.method != FillMethod.None) + { + _fillMesh.OnPopulateMesh(vb); + } + else if (_scaleByTile) + { + NTexture texture = graphics.texture; + if (texture.root == texture + && texture.nativeTexture != null + && texture.nativeTexture.wrapMode == TextureWrapMode.Repeat) + { + Rect uvRect = vb.uvRect; + uvRect.width *= vb.contentRect.width / texture.width * _textureScale.x; + uvRect.height *= vb.contentRect.height / texture.height * _textureScale.y; + + vb.AddQuad(vb.contentRect, vb.vertexColor, uvRect); + vb.AddTriangles(); + } + else + { + Rect contentRect = vb.contentRect; + contentRect.width *= _textureScale.x; + contentRect.height *= _textureScale.y; + + TileFill(vb, contentRect, vb.uvRect, texture.width, texture.height); + vb.AddTriangles(); + } + } + else if (_scale9Grid != null) + { + SliceFill(vb); + } + else + graphics.OnPopulateMesh(vb); + } + + static int[] TRIANGLES_9_GRID = new int[] { + 4,0,1,1,5,4, + 5,1,2,2,6,5, + 6,2,3,3,7,6, + 8,4,5,5,9,8, + 9,5,6,6,10,9, + 10,6,7,7,11,10, + 12,8,9,9,13,12, + 13,9,10,10,14,13, + 14,10,11, + 11,15,14 + }; + + static int[] gridTileIndice = new int[] { -1, 0, -1, 2, 4, 3, -1, 1, -1 }; + static float[] gridX = new float[4]; + static float[] gridY = new float[4]; + static float[] gridTexX = new float[4]; + static float[] gridTexY = new float[4]; + + public void SliceFill(VertexBuffer vb) + { + NTexture texture = graphics.texture; + Rect gridRect = (Rect)_scale9Grid; + Rect contentRect = vb.contentRect; + contentRect.width *= _textureScale.x; + contentRect.height *= _textureScale.y; + Rect uvRect = vb.uvRect; + + float sourceW = texture.width; + float sourceH = texture.height; + + if (graphics.flip != FlipType.None) + { + if (graphics.flip == FlipType.Horizontal || graphics.flip == FlipType.Both) + { + gridRect.x = sourceW - gridRect.xMax; + gridRect.xMax = gridRect.x + gridRect.width; + } + + if (graphics.flip == FlipType.Vertical || graphics.flip == FlipType.Both) + { + gridRect.y = sourceH - gridRect.yMax; + gridRect.yMax = gridRect.y + gridRect.height; + } + } + + float sx = uvRect.width / sourceW; + float sy = uvRect.height / sourceH; + float xMax = uvRect.xMax; + float yMax = uvRect.yMax; + float xMax2 = gridRect.xMax; + float yMax2 = gridRect.yMax; + + gridTexX[0] = uvRect.x; + gridTexX[1] = uvRect.x + gridRect.x * sx; + gridTexX[2] = uvRect.x + xMax2 * sx; + gridTexX[3] = xMax; + gridTexY[0] = yMax; + gridTexY[1] = yMax - gridRect.y * sy; + gridTexY[2] = yMax - yMax2 * sy; + gridTexY[3] = uvRect.y; + + if (contentRect.width >= (sourceW - gridRect.width)) + { + gridX[1] = gridRect.x; + gridX[2] = contentRect.width - (sourceW - xMax2); + gridX[3] = contentRect.width; + } + else + { + float tmp = gridRect.x / (sourceW - xMax2); + tmp = contentRect.width * tmp / (1 + tmp); + gridX[1] = tmp; + gridX[2] = tmp; + gridX[3] = contentRect.width; + } + + if (contentRect.height >= (sourceH - gridRect.height)) + { + gridY[1] = gridRect.y; + gridY[2] = contentRect.height - (sourceH - yMax2); + gridY[3] = contentRect.height; + } + else + { + float tmp = gridRect.y / (sourceH - yMax2); + tmp = contentRect.height * tmp / (1 + tmp); + gridY[1] = tmp; + gridY[2] = tmp; + gridY[3] = contentRect.height; + } + + if (_tileGridIndice == 0) + { + for (int cy = 0; cy < 4; cy++) + { + for (int cx = 0; cx < 4; cx++) + vb.AddVert(new Vector2(gridX[cx] / _textureScale.x, gridY[cy] / _textureScale.y), vb.vertexColor, new Vector2(gridTexX[cx], gridTexY[cy])); + } + vb.AddTriangles(TRIANGLES_9_GRID); + } + else + { + Rect drawRect; + Rect texRect; + int row, col; + int part; + + for (int pi = 0; pi < 9; pi++) + { + col = pi % 3; + row = pi / 3; + part = gridTileIndice[pi]; + drawRect = Rect.MinMaxRect(gridX[col], gridY[row], gridX[col + 1], gridY[row + 1]); + texRect = Rect.MinMaxRect(gridTexX[col], gridTexY[row + 1], gridTexX[col + 1], gridTexY[row]); + + if (part != -1 && (_tileGridIndice & (1 << part)) != 0) + { + TileFill(vb, drawRect, texRect, + (part == 0 || part == 1 || part == 4) ? gridRect.width : drawRect.width, + (part == 2 || part == 3 || part == 4) ? gridRect.height : drawRect.height); + } + else + { + drawRect.x /= _textureScale.x; + drawRect.y /= _textureScale.y; + drawRect.width /= _textureScale.x; + drawRect.height /= _textureScale.y; + + vb.AddQuad(drawRect, vb.vertexColor, texRect); + } + } + + vb.AddTriangles(); + } + } + + void TileFill(VertexBuffer vb, Rect contentRect, Rect uvRect, float sourceW, float sourceH) + { + int hc = Mathf.CeilToInt(contentRect.width / sourceW); + int vc = Mathf.CeilToInt(contentRect.height / sourceH); + float tailWidth = contentRect.width - (hc - 1) * sourceW; + float tailHeight = contentRect.height - (vc - 1) * sourceH; + float xMax = uvRect.xMax; + float yMax = uvRect.yMax; + + for (int i = 0; i < hc; i++) + { + for (int j = 0; j < vc; j++) + { + Rect uvTmp = uvRect; + if (i == hc - 1) + uvTmp.xMax = Mathf.Lerp(uvRect.x, xMax, tailWidth / sourceW); + if (j == vc - 1) + uvTmp.yMin = Mathf.Lerp(uvRect.y, yMax, 1 - tailHeight / sourceH); + + Rect drawRect = new Rect(contentRect.x + i * sourceW, contentRect.y + j * sourceH, + i == (hc - 1) ? tailWidth : sourceW, j == (vc - 1) ? tailHeight : sourceH); + + drawRect.x /= _textureScale.x; + drawRect.y /= _textureScale.y; + drawRect.width /= _textureScale.x; + drawRect.height /= _textureScale.y; + + vb.AddQuad(drawRect, vb.vertexColor, uvTmp); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs.meta new file mode 100644 index 00000000..c91560be --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Image.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 948ec8822e3c52942bc6e7f6265b264c +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs new file mode 100644 index 00000000..a60d3cff --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace FairyGUI +{ + [Flags] + public enum MaterialFlags + { + Clipped = 1, + SoftClipped = 2, + StencilTest = 4, + AlphaMask = 8, + Grayed = 16, + ColorFilter = 32 + } + + /// + /// Every texture-shader combination has a MaterialManager. + /// + public class MaterialManager + { + public event Action onCreateNewMaterial; + + public bool firstMaterialInFrame; + + NTexture _texture; + Shader _shader; + List _addKeywords; + Dictionary> _materials; + bool _combineTexture; + + class MaterialRef + { + public Material material; + public int frame; + public BlendMode blendMode; + public uint group; + } + + const int internalKeywordsCount = 6; + static string[] internalKeywords = new[] { "CLIPPED", "SOFT_CLIPPED", null, "ALPHA_MASK", "GRAYED", "COLOR_FILTER" }; + + /// + /// + /// + /// + /// + internal MaterialManager(NTexture texture, Shader shader) + { + _texture = texture; + _shader = shader; + _materials = new Dictionary>(); + _combineTexture = texture.alphaTexture != null; + } + + /// + /// + /// + /// + /// + public int GetFlagsByKeywords(IList keywords) + { + if (_addKeywords == null) + _addKeywords = new List(); + + int flags = 0; + for (int i = 0; i < keywords.Count; i++) + { + string s = keywords[i]; + if (string.IsNullOrEmpty(s)) + continue; + int j = _addKeywords.IndexOf(s); + if (j == -1) + { + j = _addKeywords.Count; + _addKeywords.Add(s); + } + flags += (1 << (j + internalKeywordsCount)); + } + + return flags; + } + + /// + /// + /// + /// + /// + /// + /// + public Material GetMaterial(int flags, BlendMode blendMode, uint group) + { + if (blendMode != BlendMode.Normal && BlendModeUtils.Factors[(int)blendMode].pma) + flags |= (int)MaterialFlags.ColorFilter; + + List items; + if (!_materials.TryGetValue(flags, out items)) + { + items = new List(); + _materials[flags] = items; + } + + int frameId = Time.frameCount; + int cnt = items.Count; + MaterialRef result = null; + for (int i = 0; i < cnt; i++) + { + MaterialRef item = items[i]; + + if (item.group == group && item.blendMode == blendMode) + { + if (item.frame != frameId) + { + firstMaterialInFrame = true; + item.frame = frameId; + } + else + firstMaterialInFrame = false; + + if (_combineTexture) + item.material.SetTexture(ShaderConfig.ID_AlphaTex, _texture.alphaTexture); + + return item.material; + } + else if (result == null && (item.frame > frameId || item.frame < frameId - 1)) //collect materials if it is unused in last frame + result = item; + } + + if (result == null) + { + result = new MaterialRef() { material = CreateMaterial(flags) }; + items.Add(result); + } + else if (_combineTexture) + result.material.SetTexture(ShaderConfig.ID_AlphaTex, _texture.alphaTexture); + + if (result.blendMode != blendMode) + { + BlendModeUtils.Apply(result.material, blendMode); + result.blendMode = blendMode; + } + + result.group = group; + result.frame = frameId; + firstMaterialInFrame = true; + return result.material; + } + + /// + /// + /// + /// + Material CreateMaterial(int flags) + { + Material mat = new Material(_shader); + + mat.mainTexture = _texture.nativeTexture; + if (_texture.alphaTexture != null) + { + mat.EnableKeyword("COMBINED"); + mat.SetTexture(ShaderConfig.ID_AlphaTex, _texture.alphaTexture); + } + + for (int i = 0; i < internalKeywordsCount; i++) + { + if ((flags & (1 << i)) != 0) + { + string s = internalKeywords[i]; + if (s != null) + mat.EnableKeyword(s); + } + } + if (_addKeywords != null) + { + int keywordCnt = _addKeywords.Count; + for (int i = 0; i < keywordCnt; i++) + { + if ((flags & (1 << (i + internalKeywordsCount))) != 0) + mat.EnableKeyword(_addKeywords[i]); + } + } + + mat.hideFlags = DisplayObject.hideFlags; + if (onCreateNewMaterial != null) + onCreateNewMaterial(mat); + + return mat; + } + + /// + /// + /// + public void DestroyMaterials() + { + var iter = _materials.GetEnumerator(); + while (iter.MoveNext()) + { + List items = iter.Current.Value; + if (Application.isPlaying) + { + int cnt = items.Count; + for (int j = 0; j < cnt; j++) + Object.Destroy(items[j].material); + } + else + { + int cnt = items.Count; + for (int j = 0; j < cnt; j++) + Object.DestroyImmediate(items[j].material); + } + items.Clear(); + } + iter.Dispose(); + } + + /// + /// + /// + public void RefreshMaterials() + { + _combineTexture = _texture.alphaTexture != null; + var iter = _materials.GetEnumerator(); + while (iter.MoveNext()) + { + List items = iter.Current.Value; + int cnt = items.Count; + for (int j = 0; j < cnt; j++) + { + Material mat = items[j].material; + mat.mainTexture = _texture.nativeTexture; + if (_combineTexture) + { + mat.EnableKeyword("COMBINED"); + mat.SetTexture(ShaderConfig.ID_AlphaTex, _texture.alphaTexture); + } + } + } + iter.Dispose(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs.meta new file mode 100644 index 00000000..c5ce34fb --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MaterialManager.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7223c4628e56c1e448c70e10168f5fa1 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh.meta new file mode 100644 index 00000000..95fab4af --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fca659474d209d94fbded309f407995c +folderAsset: yes +timeCreated: 1545987172 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs new file mode 100644 index 00000000..3578ec46 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs @@ -0,0 +1,75 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class CompositeMesh : IMeshFactory, IHitTest + { + /// + /// + /// + public readonly List elements; + + /// + /// If it is -1, means all elements are active, otherwise, only the specific element is active + /// + public int activeIndex; + + public CompositeMesh() + { + elements = new List(); + activeIndex = -1; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + int cnt = elements.Count; + if (cnt == 1) + elements[0].OnPopulateMesh(vb); + else + { + VertexBuffer vb2 = VertexBuffer.Begin(vb); + + for (int i = 0; i < cnt; i++) + { + if (activeIndex == -1 || i == activeIndex) + { + vb2.Clear(); + elements[i].OnPopulateMesh(vb2); + vb.Append(vb2); + } + } + + vb2.End(); + } + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + if (!contentRect.Contains(point)) + return false; + + bool flag = false; + int cnt = elements.Count; + for (int i = 0; i < cnt; i++) + { + if (activeIndex == -1 || i == activeIndex) + { + IHitTest ht = elements[i] as IHitTest; + if (ht != null) + { + if (ht.HitTest(contentRect, point)) + return true; + } + else + flag = true; + } + } + + return flag; + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs.meta new file mode 100644 index 00000000..4a3e77ce --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/CompositeMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ba3d921c1f6e95f4e9105f45fd67bda5 +timeCreated: 1546159121 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs new file mode 100644 index 00000000..2510321c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs @@ -0,0 +1,200 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class EllipseMesh : IMeshFactory, IHitTest + { + /// + /// + /// + public Rect? drawRect; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public Color32 lineColor; + + /// + /// + /// + public Color32? centerColor; + + /// + /// + /// + public Color32? fillColor; + + /// + /// + /// + public float startDegree; + + /// + /// + /// + public float endDegreee; + + static int[] SECTOR_CENTER_TRIANGLES = new int[] { + 0, 4, 1, + 0, 3, 4, + 0, 2, 3, + 0, 8, 5, + 0, 7, 8, + 0, 6, 7, + 6, 5, 2, + 2, 1, 6 + }; + + public EllipseMesh() + { + lineColor = Color.black; + startDegree = 0; + endDegreee = 360; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + Rect rect = drawRect != null ? (Rect)drawRect : vb.contentRect; + Color32 color = fillColor != null ? (Color32)fillColor : vb.vertexColor; + + float sectionStart = Mathf.Clamp(startDegree, 0, 360); + float sectionEnd = Mathf.Clamp(endDegreee, 0, 360); + bool clipped = sectionStart > 0 || sectionEnd < 360; + sectionStart = sectionStart * Mathf.Deg2Rad; + sectionEnd = sectionEnd * Mathf.Deg2Rad; + Color32 centerColor2 = centerColor == null ? color : (Color32)centerColor; + + float radiusX = rect.width / 2; + float radiusY = rect.height / 2; + int sides = Mathf.CeilToInt(Mathf.PI * (radiusX + radiusY) / 4); + sides = Mathf.Clamp(sides, 40, 800); + float angleDelta = 2 * Mathf.PI / sides; + float angle = 0; + float lineAngle = 0; + + if (lineWidth > 0 && clipped) + { + lineAngle = lineWidth / Mathf.Max(radiusX, radiusY); + sectionStart += lineAngle; + sectionEnd -= lineAngle; + } + + int vpos = vb.currentVertCount; + float centerX = rect.x + radiusX; + float centerY = rect.y + radiusY; + vb.AddVert(new Vector3(centerX, centerY, 0), centerColor2); + for (int i = 0; i < sides; i++) + { + if (angle < sectionStart) + angle = sectionStart; + else if (angle > sectionEnd) + angle = sectionEnd; + Vector3 vec = new Vector3(Mathf.Cos(angle) * (radiusX - lineWidth) + centerX, Mathf.Sin(angle) * (radiusY - lineWidth) + centerY, 0); + vb.AddVert(vec, color); + if (lineWidth > 0) + { + vb.AddVert(vec, lineColor); + vb.AddVert(new Vector3(Mathf.Cos(angle) * radiusX + centerX, Mathf.Sin(angle) * radiusY + centerY, 0), lineColor); + } + angle += angleDelta; + } + + if (lineWidth > 0) + { + int cnt = sides * 3; + for (int i = 0; i < cnt; i += 3) + { + if (i != cnt - 3) + { + vb.AddTriangle(0, i + 1, i + 4); + vb.AddTriangle(i + 5, i + 2, i + 3); + vb.AddTriangle(i + 3, i + 6, i + 5); + } + else if (!clipped) + { + vb.AddTriangle(0, i + 1, 1); + vb.AddTriangle(2, i + 2, i + 3); + vb.AddTriangle(i + 3, 3, 2); + } + else + { + vb.AddTriangle(0, i + 1, i + 1); + vb.AddTriangle(i + 2, i + 2, i + 3); + vb.AddTriangle(i + 3, i + 3, i + 2); + } + } + } + else + { + for (int i = 0; i < sides; i++) + { + if (i != sides - 1) + vb.AddTriangle(0, i + 1, i + 2); + else if (!clipped) + vb.AddTriangle(0, i + 1, 1); + else + vb.AddTriangle(0, i + 1, i + 1); + } + } + + if (lineWidth > 0 && clipped) + { + //æ‰‡å½¢å†…è¾¹ç¼˜çš„çº¿æ¡ + + vb.AddVert(new Vector3(radiusX, radiusY, 0), lineColor); + float centerRadius = lineWidth * 0.5f; + + sectionStart -= lineAngle; + angle = sectionStart + lineAngle * 0.5f + Mathf.PI * 0.5f; + vb.AddVert(new Vector3(Mathf.Cos(angle) * centerRadius + radiusX, Mathf.Sin(angle) * centerRadius + radiusY, 0), lineColor); + angle -= Mathf.PI; + vb.AddVert(new Vector3(Mathf.Cos(angle) * centerRadius + radiusX, Mathf.Sin(angle) * centerRadius + radiusY, 0), lineColor); + vb.AddVert(new Vector3(Mathf.Cos(sectionStart) * radiusX + radiusX, Mathf.Sin(sectionStart) * radiusY + radiusY, 0), lineColor); + vb.AddVert(vb.GetPosition(vpos + 3), lineColor); + + sectionEnd += lineAngle; + angle = sectionEnd - lineAngle * 0.5f + Mathf.PI * 0.5f; + vb.AddVert(new Vector3(Mathf.Cos(angle) * centerRadius + radiusX, Mathf.Sin(angle) * centerRadius + radiusY, 0), lineColor); + angle -= Mathf.PI; + vb.AddVert(new Vector3(Mathf.Cos(angle) * centerRadius + radiusX, Mathf.Sin(angle) * centerRadius + radiusY, 0), lineColor); + vb.AddVert(vb.GetPosition(vpos + sides * 3), lineColor); + vb.AddVert(new Vector3(Mathf.Cos(sectionEnd) * radiusX + radiusX, Mathf.Sin(sectionEnd) * radiusY + radiusY, 0), lineColor); + + vb.AddTriangles(SECTOR_CENTER_TRIANGLES, sides * 3 + 1); + } + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + if (!contentRect.Contains(point)) + return false; + + float radiusX = contentRect.width * 0.5f; + float raduisY = contentRect.height * 0.5f; + float xx = point.x - radiusX - contentRect.x; + float yy = point.y - raduisY - contentRect.y; + if (Mathf.Pow(xx / radiusX, 2) + Mathf.Pow(yy / raduisY, 2) < 1) + { + if (startDegree != 0 || endDegreee != 360) + { + float deg = Mathf.Atan2(yy, xx) * Mathf.Rad2Deg; + if (deg < 0) + deg += 360; + return deg >= startDegree && deg <= endDegreee; + } + else + return true; + } + + return false; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs.meta new file mode 100644 index 00000000..7b0807d2 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/EllipseMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7ea96854995120948847301fb48d1675 +timeCreated: 1545987173 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs new file mode 100644 index 00000000..85c89608 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs @@ -0,0 +1,400 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class FillMesh : IMeshFactory + { + /// + /// + /// + public FillMethod method; + + /// + /// + /// + public int origin; + + /// + /// + /// + public float amount; + + /// + /// + /// + public bool clockwise; + + public FillMesh() + { + clockwise = true; + amount = 1; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + float amount = Mathf.Clamp01(this.amount); + switch (method) + { + case FillMethod.Horizontal: + FillHorizontal(vb, vb.contentRect, origin, amount); + break; + + case FillMethod.Vertical: + FillVertical(vb, vb.contentRect, origin, amount); + break; + + case FillMethod.Radial90: + FillRadial90(vb, vb.contentRect, (Origin90)origin, amount, clockwise); + break; + + case FillMethod.Radial180: + FillRadial180(vb, vb.contentRect, (Origin180)origin, amount, clockwise); + break; + + case FillMethod.Radial360: + FillRadial360(vb, vb.contentRect, (Origin360)origin, amount, clockwise); + break; + } + } + + static void FillHorizontal(VertexBuffer vb, Rect vertRect, int origin, float amount) + { + float a = vertRect.width * amount; + if ((OriginHorizontal)origin == OriginHorizontal.Right || (OriginVertical)origin == OriginVertical.Bottom) + vertRect.x += (vertRect.width - a); + vertRect.width = a; + + vb.AddQuad(vertRect); + vb.AddTriangles(); + } + + static void FillVertical(VertexBuffer vb, Rect vertRect, int origin, float amount) + { + float a = vertRect.height * amount; + if ((OriginHorizontal)origin == OriginHorizontal.Right || (OriginVertical)origin == OriginVertical.Bottom) + vertRect.y += (vertRect.height - a); + vertRect.height = a; + + vb.AddQuad(vertRect); + vb.AddTriangles(); + } + + //4 vertex + static void FillRadial90(VertexBuffer vb, Rect vertRect, Origin90 origin, float amount, bool clockwise) + { + bool flipX = origin == Origin90.TopRight || origin == Origin90.BottomRight; + bool flipY = origin == Origin90.BottomLeft || origin == Origin90.BottomRight; + if (flipX != flipY) + clockwise = !clockwise; + + float ratio = clockwise ? amount : (1 - amount); + float tan = Mathf.Tan(Mathf.PI * 0.5f * ratio); + bool thresold = false; + if (ratio != 1) + thresold = (vertRect.height / vertRect.width - tan) > 0; + if (!clockwise) + thresold = !thresold; + float x = vertRect.x + (ratio == 0 ? float.MaxValue : (vertRect.height / tan)); + float y = vertRect.y + (ratio == 1 ? float.MaxValue : (vertRect.width * tan)); + float x2 = x; + float y2 = y; + if (flipX) + x2 = vertRect.width - x; + if (flipY) + y2 = vertRect.height - y; + float xMin = flipX ? (vertRect.width - vertRect.x) : vertRect.xMin; + float yMin = flipY ? (vertRect.height - vertRect.y) : vertRect.yMin; + float xMax = flipX ? -vertRect.xMin : vertRect.xMax; + float yMax = flipY ? -vertRect.yMin : vertRect.yMax; + + vb.AddVert(new Vector3(xMin, yMin, 0)); + + if (clockwise) + vb.AddVert(new Vector3(xMax, yMin, 0)); + + if (y > vertRect.yMax) + { + if (thresold) + vb.AddVert(new Vector3(x2, yMax, 0)); + else + vb.AddVert(new Vector3(xMax, yMax, 0)); + } + else + vb.AddVert(new Vector3(xMax, y2, 0)); + + if (x > vertRect.xMax) + { + if (thresold) + vb.AddVert(new Vector3(xMax, y2, 0)); + else + vb.AddVert(new Vector3(xMax, yMax, 0)); + } + else + vb.AddVert(new Vector3(x2, yMax, 0)); + + if (!clockwise) + vb.AddVert(new Vector3(xMin, yMax, 0)); + + if (flipX == flipY) + { + vb.AddTriangle(0, 1, 2); + vb.AddTriangle(0, 2, 3); + } + else + { + vb.AddTriangle(2, 1, 0); + vb.AddTriangle(3, 2, 0); + } + } + + //8 vertex + static void FillRadial180(VertexBuffer vb, Rect vertRect, Origin180 origin, float amount, bool clockwise) + { + switch (origin) + { + case Origin180.Top: + if (amount <= 0.5f) + { + vertRect.width /= 2; + if (clockwise) + vertRect.x += vertRect.width; + + FillRadial90(vb, vertRect, clockwise ? Origin90.TopLeft : Origin90.TopRight, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-4); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.width /= 2; + if (!clockwise) + vertRect.x += vertRect.width; + + FillRadial90(vb, vertRect, clockwise ? Origin90.TopRight : Origin90.TopLeft, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.x += vertRect.width; + else + vertRect.x -= vertRect.width; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + + case Origin180.Bottom: + if (amount <= 0.5f) + { + vertRect.width /= 2; + if (!clockwise) + vertRect.x += vertRect.width; + + FillRadial90(vb, vertRect, clockwise ? Origin90.BottomRight : Origin90.BottomLeft, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-4); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.width /= 2; + if (clockwise) + vertRect.x += vertRect.width; + + FillRadial90(vb, vertRect, clockwise ? Origin90.BottomLeft : Origin90.BottomRight, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.x -= vertRect.width; + else + vertRect.x += vertRect.width; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + + case Origin180.Left: + if (amount <= 0.5f) + { + vertRect.height /= 2; + if (!clockwise) + vertRect.y += vertRect.height; + + FillRadial90(vb, vertRect, clockwise ? Origin90.BottomLeft : Origin90.TopLeft, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-4); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.height /= 2; + if (clockwise) + vertRect.y += vertRect.height; + + FillRadial90(vb, vertRect, clockwise ? Origin90.TopLeft : Origin90.BottomLeft, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.y -= vertRect.height; + else + vertRect.y += vertRect.height; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + + case Origin180.Right: + if (amount <= 0.5f) + { + vertRect.height /= 2; + if (clockwise) + vertRect.y += vertRect.height; + + FillRadial90(vb, vertRect, clockwise ? Origin90.TopRight : Origin90.BottomRight, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-4); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.height /= 2; + if (!clockwise) + vertRect.y += vertRect.height; + + FillRadial90(vb, vertRect, clockwise ? Origin90.BottomRight : Origin90.TopRight, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.y += vertRect.height; + else + vertRect.y -= vertRect.height; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + } + } + + //12 vertex + static void FillRadial360(VertexBuffer vb, Rect vertRect, Origin360 origin, float amount, bool clockwise) + { + switch (origin) + { + case Origin360.Top: + if (amount < 0.5f) + { + vertRect.width /= 2; + if (clockwise) + vertRect.x += vertRect.width; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Left : Origin180.Right, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-8); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.width /= 2; + if (!clockwise) + vertRect.x += vertRect.width; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Right : Origin180.Left, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.x += vertRect.width; + else + vertRect.x -= vertRect.width; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + + break; + + case Origin360.Bottom: + if (amount < 0.5f) + { + vertRect.width /= 2; + if (!clockwise) + vertRect.x += vertRect.width; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Right : Origin180.Left, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-8); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.width /= 2; + if (clockwise) + vertRect.x += vertRect.width; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Left : Origin180.Right, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.x -= vertRect.width; + else + vertRect.x += vertRect.width; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + + case Origin360.Left: + if (amount < 0.5f) + { + vertRect.height /= 2; + if (!clockwise) + vertRect.y += vertRect.height; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Bottom : Origin180.Top, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-8); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.height /= 2; + if (clockwise) + vertRect.y += vertRect.height; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Top : Origin180.Bottom, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.y -= vertRect.height; + else + vertRect.y += vertRect.height; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + + case Origin360.Right: + if (amount < 0.5f) + { + vertRect.height /= 2; + if (clockwise) + vertRect.y += vertRect.height; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Top : Origin180.Bottom, amount / 0.5f, clockwise); + Vector3 vec = vb.GetPosition(-8); + vb.AddQuad(new Rect(vec.x, vec.y, 0, 0)); + vb.AddTriangles(-4); + } + else + { + vertRect.height /= 2; + if (!clockwise) + vertRect.y += vertRect.height; + + FillRadial180(vb, vertRect, clockwise ? Origin180.Bottom : Origin180.Top, (amount - 0.5f) / 0.5f, clockwise); + + if (clockwise) + vertRect.y += vertRect.height; + else + vertRect.y -= vertRect.height; + vb.AddQuad(vertRect); + vb.AddTriangles(-4); + } + break; + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs.meta new file mode 100644 index 00000000..117f8011 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/FillMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8b37d56dc1840734a8fdb4971f5bc733 +timeCreated: 1545987173 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs new file mode 100644 index 00000000..2da619aa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs @@ -0,0 +1,179 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// Inspired by kim ki won (http://mypi.ruliweb.daum.net/mypi.htm?id=newtypekorea) + /// + public class LineMesh : IMeshFactory + { + /// + /// + /// + public GPath path; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public AnimationCurve lineWidthCurve; + + /// + /// + /// + public Gradient gradient; + + /// + /// + /// + public bool roundEdge; + + /// + /// + /// + public float fillStart; + + /// + /// + /// + public float fillEnd; + + /// + /// + /// + public float pointDensity; + + /// + /// + /// + public bool repeatFill; + + static List points = new List(); + static List ts = new List(); + + public LineMesh() + { + path = new GPath(); + lineWidth = 2; + fillStart = 0; + fillEnd = 1; + pointDensity = 0.1f; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + Vector2 uvMin = vb.uvRect.position; + Vector2 uvMax = new Vector2(vb.uvRect.xMax, vb.uvRect.yMax); + float uvRatio = path.length / vb.textureSize.x; + + int segCount = path.segmentCount; + float t = 0; + float lw = lineWidth; + float u; + for (int si = 0; si < segCount; si++) + { + float ratio = path.GetSegmentLength(si) / path.length; + float t0 = Mathf.Clamp(fillStart - t, 0, ratio) / ratio; + float t1 = Mathf.Clamp(fillEnd - t, 0, ratio) / ratio; + if (t0 >= t1) + { + t += ratio; + continue; + } + + points.Clear(); + ts.Clear(); + path.GetPointsInSegment(si, t0, t1, points, ts, pointDensity); + int cnt = points.Count; + + Color c0 = vb.vertexColor; + Color c1 = vb.vertexColor; + if (gradient != null) + c0 = gradient.Evaluate(t); + if (lineWidthCurve != null) + lw = lineWidthCurve.Evaluate(t); + + if (roundEdge && si == 0 && t0 == 0) + DrawRoundEdge(vb, points[0], points[1], lw, c0, uvMin); + + int vertCount = vb.currentVertCount; + for (int i = 1; i < cnt; i++) + { + Vector3 p0 = points[i - 1]; + Vector3 p1 = points[i]; + int k = vertCount + (i - 1) * 2; + float tc = t + ratio * ts[i]; + + Vector3 lineVector = p1 - p0; + Vector3 widthVector = Vector3.Cross(lineVector, new Vector3(0, 0, 1)); + widthVector.Normalize(); + + if (i == 1) + { + if (repeatFill) + u = tc * uvRatio * uvMax.x; + else + u = Mathf.Lerp(uvMin.x, uvMax.x, t + ratio * ts[i - 1]); + vb.AddVert(p0 - widthVector * lw * 0.5f, c0, new Vector2(u, uvMax.y)); + vb.AddVert(p0 + widthVector * lw * 0.5f, c0, new Vector2(u, uvMin.y)); + + if (si != 0) //joint + { + vb.AddTriangle(k - 2, k - 1, k + 1); + vb.AddTriangle(k - 2, k + 1, k); + } + } + if (gradient != null) + c1 = gradient.Evaluate(tc); + + if (lineWidthCurve != null) + lw = lineWidthCurve.Evaluate(tc); + + if (repeatFill) + u = tc * uvRatio * uvMax.x; + else + u = Mathf.Lerp(uvMin.x, uvMax.x, tc); + vb.AddVert(p1 - widthVector * lw * 0.5f, c1, new Vector2(u, uvMax.y)); + vb.AddVert(p1 + widthVector * lw * 0.5f, c1, new Vector2(u, uvMin.y)); + + vb.AddTriangle(k, k + 1, k + 3); + vb.AddTriangle(k, k + 3, k + 2); + } + + if (roundEdge && si == segCount - 1 && t1 == 1) + DrawRoundEdge(vb, points[cnt - 1], points[cnt - 2], lw, c1, uvMax); + + t += ratio; + } + } + + void DrawRoundEdge(VertexBuffer vb, Vector2 p0, Vector2 p1, float lw, Color32 color, Vector2 uv) + { + Vector2 widthVector = Vector3.Cross(p0 - p1, new Vector3(0, 0, 1)); + widthVector.Normalize(); + widthVector = widthVector * lw / 2f; + Vector2 lineVector = (p0 - p1).normalized * lw / 2f; + + int sides = Mathf.CeilToInt(Mathf.PI * lw / 2); + if (sides < 6) + sides = 6; + int current = vb.currentVertCount; + float angleUnit = Mathf.PI / (sides - 1); + + vb.AddVert(p0, color, uv); + vb.AddVert(p0 + widthVector, color, uv); + + for (int n = 0; n < sides; n++) + { + vb.AddVert(p0 + Mathf.Cos(angleUnit * n) * widthVector + Mathf.Sin(angleUnit * n) * lineVector, color, uv); + vb.AddTriangle(current, current + 1 + n, current + 2 + n); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs.meta new file mode 100644 index 00000000..16fe3b9c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/LineMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6d1935a924fabf74a92c72b22a042279 +timeCreated: 1546519483 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs new file mode 100644 index 00000000..ce688abe --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs @@ -0,0 +1,15 @@ + +namespace FairyGUI +{ + /// + /// + /// + public interface IMeshFactory + { + /// + /// + /// + /// + void OnPopulateMesh(VertexBuffer vb); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs.meta new file mode 100644 index 00000000..f444755d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/MeshFactory.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 274275eaa3fbbc94697cbe90a0fb52f1 +timeCreated: 1545987172 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs new file mode 100644 index 00000000..4062bf85 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class PlaneMesh : IMeshFactory + { + public int gridSize = 30; + + public void OnPopulateMesh(VertexBuffer vb) + { + float w = vb.contentRect.width; + float h = vb.contentRect.height; + float xMax = vb.contentRect.xMax; + float yMax = vb.contentRect.yMax; + int hc = (int)Mathf.Min(Mathf.CeilToInt(w / gridSize), 9); + int vc = (int)Mathf.Min(Mathf.CeilToInt(h / gridSize), 9); + int eachPartX = Mathf.FloorToInt(w / hc); + int eachPartY = Mathf.FloorToInt(h / vc); + float x, y; + for (int i = 0; i <= vc; i++) + { + if (i == vc) + y = yMax; + else + y = vb.contentRect.y + i * eachPartY; + for (int j = 0; j <= hc; j++) + { + if (j == hc) + x = xMax; + else + x = vb.contentRect.x + j * eachPartX; + vb.AddVert(new Vector3(x, y, 0)); + } + } + + for (int i = 0; i < vc; i++) + { + int k = i * (hc + 1); + for (int j = 1; j <= hc; j++) + { + int m = k + j; + vb.AddTriangle(m - 1, m, m + hc); + vb.AddTriangle(m, m + hc + 1, m + hc); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs.meta new file mode 100644 index 00000000..cc345abe --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PlaneMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 121b756a7a8240c49b63fa9de560691a +timeCreated: 1547970144 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs new file mode 100644 index 00000000..006e756e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs @@ -0,0 +1,291 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class PolygonMesh : IMeshFactory, IHitTest + { + /// + /// points must be in clockwise order, and must start from bottom-left if stretchUV is set. + /// + public readonly List points; + + /// + /// if you dont want to provide uv, leave it empty. + /// + public readonly List texcoords; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public Color32 lineColor; + + /// + /// + /// + public Color32? fillColor; + + /// + /// + /// + public Color32[] colors; + + /// + /// + /// + public bool usePercentPositions; + + static List sRestIndices = new List(); + + public PolygonMesh() + { + points = new List(); + texcoords = new List(); + } + + /// + /// + /// + /// + public void Add(Vector2 point) + { + points.Add(point); + } + + /// + /// + /// + /// + /// + public void Add(Vector2 point, Vector2 texcoord) + { + points.Add(point); + texcoords.Add(texcoord); + } + + public void OnPopulateMesh(VertexBuffer vb) + { + int numVertices = points.Count; + if (numVertices < 3) + return; + + int restIndexPos, numRestIndices; + Color32 color = fillColor != null ? (Color32)fillColor : vb.vertexColor; + + float w = vb.contentRect.width; + float h = vb.contentRect.height; + bool useTexcoords = texcoords.Count >= numVertices; + bool fullUV = true; + for (int i = 0; i < numVertices; i++) + { + Vector3 vec = new Vector3(points[i].x, points[i].y, 0); + if (usePercentPositions) + { + vec.x *= w; + vec.y *= h; + } + if (useTexcoords) + { + Vector2 uv = texcoords[i]; + if (uv.x != 0 && uv.x != 1 || uv.y != 0 && uv.y != 1) + fullUV = false; + uv.x = Mathf.Lerp(vb.uvRect.x, vb.uvRect.xMax, uv.x); + uv.y = Mathf.Lerp(vb.uvRect.y, vb.uvRect.yMax, uv.y); + vb.AddVert(vec, color, uv); + } + else + vb.AddVert(vec, color); + } + + if (useTexcoords && fullUV && numVertices == 4) + vb._isArbitraryQuad = true; + + // Algorithm "Ear clipping method" described here: + // -> https://en.wikipedia.org/wiki/Polygon_triangulation + // + // Implementation inspired by: + // -> http://polyk.ivank.net + // -> Starling + + sRestIndices.Clear(); + for (int i = 0; i < numVertices; ++i) + sRestIndices.Add(i); + + restIndexPos = 0; + numRestIndices = numVertices; + + Vector2 a, b, c, p; + int otherIndex; + bool earFound; + int i0, i1, i2; + + while (numRestIndices > 3) + { + earFound = false; + i0 = sRestIndices[restIndexPos % numRestIndices]; + i1 = sRestIndices[(restIndexPos + 1) % numRestIndices]; + i2 = sRestIndices[(restIndexPos + 2) % numRestIndices]; + + a = points[i0]; + b = points[i1]; + c = points[i2]; + + if ((a.y - b.y) * (c.x - b.x) + (b.x - a.x) * (c.y - b.y) >= 0) + { + earFound = true; + for (int i = 3; i < numRestIndices; ++i) + { + otherIndex = sRestIndices[(restIndexPos + i) % numRestIndices]; + p = points[otherIndex]; + + if (IsPointInTriangle(ref p, ref a, ref b, ref c)) + { + earFound = false; + break; + } + } + } + + if (earFound) + { + vb.AddTriangle(i0, i1, i2); + sRestIndices.RemoveAt((restIndexPos + 1) % numRestIndices); + + numRestIndices--; + restIndexPos = 0; + } + else + { + restIndexPos++; + if (restIndexPos == numRestIndices) break; // no more ears + } + } + vb.AddTriangle(sRestIndices[0], sRestIndices[1], sRestIndices[2]); + + if (colors != null) + vb.RepeatColors(colors, 0, vb.currentVertCount); + + if (lineWidth > 0) + DrawOutline(vb); + } + + void DrawOutline(VertexBuffer vb) + { + int numVertices = points.Count; + int start = vb.currentVertCount - numVertices; + int k = vb.currentVertCount; + for (int i = 0; i < numVertices; i++) + { + Vector3 p0 = vb.vertices[start + i]; + p0.y = -p0.y; + Vector3 p1; + if (i < numVertices - 1) + p1 = vb.vertices[start + i + 1]; + else + p1 = vb.vertices[start]; + p1.y = -p1.y; + + Vector3 lineVector = p1 - p0; + Vector3 widthVector = Vector3.Cross(lineVector, new Vector3(0, 0, 1)); + widthVector.Normalize(); + + vb.AddVert(p0 - widthVector * lineWidth * 0.5f, lineColor); + vb.AddVert(p0 + widthVector * lineWidth * 0.5f, lineColor); + vb.AddVert(p1 - widthVector * lineWidth * 0.5f, lineColor); + vb.AddVert(p1 + widthVector * lineWidth * 0.5f, lineColor); + + k += 4; + vb.AddTriangle(k - 4, k - 3, k - 1); + vb.AddTriangle(k - 4, k - 1, k - 2); + + //joint + if (i != 0) + { + vb.AddTriangle(k - 6, k - 5, k - 3); + vb.AddTriangle(k - 6, k - 3, k - 4); + } + if (i == numVertices - 1) + { + start += numVertices; + vb.AddTriangle(k - 2, k - 1, start + 1); + vb.AddTriangle(k - 2, start + 1, start); + } + } + } + + bool IsPointInTriangle(ref Vector2 p, ref Vector2 a, ref Vector2 b, ref Vector2 c) + { + // From Starling + // This algorithm is described well in this article: + // http://www.blackpawn.com/texts/pointinpoly/default.html + + float v0x = c.x - a.x; + float v0y = c.y - a.y; + float v1x = b.x - a.x; + float v1y = b.y - a.y; + float v2x = p.x - a.x; + float v2y = p.y - a.y; + + float dot00 = v0x * v0x + v0y * v0y; + float dot01 = v0x * v1x + v0y * v1y; + float dot02 = v0x * v2x + v0y * v2y; + float dot11 = v1x * v1x + v1y * v1y; + float dot12 = v1x * v2x + v1y * v2y; + + float invDen = 1.0f / (dot00 * dot11 - dot01 * dot01); + float u = (dot11 * dot02 - dot01 * dot12) * invDen; + float v = (dot00 * dot12 - dot01 * dot02) * invDen; + + return (u >= 0) && (v >= 0) && (u + v < 1); + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + if (!contentRect.Contains(point)) + return false; + + // Algorithm & implementation thankfully taken from: + // -> http://alienryderflex.com/polygon/ + // inspired by Starling + int len = points.Count; + int i; + int j = len - 1; + bool oddNodes = false; + float w = contentRect.width; + float h = contentRect.height; + + for (i = 0; i < len; ++i) + { + float ix = points[i].x; + float iy = points[i].y; + float jx = points[j].x; + float jy = points[j].y; + if (usePercentPositions) + { + ix *= w; + iy *= h; + ix *= w; + iy *= h; + } + + if ((iy < point.y && jy >= point.y || jy < point.y && iy >= point.y) && (ix <= point.x || jx <= point.x)) + { + if (ix + (point.y - iy) / (jy - iy) * (jx - ix) < point.x) + oddNodes = !oddNodes; + } + + j = i; + } + + return oddNodes; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs.meta new file mode 100644 index 00000000..3abfec8e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/PolygonMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: db020628cd79e714fbafdbaaa2cc355f +timeCreated: 1545987173 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs new file mode 100644 index 00000000..4702552d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs @@ -0,0 +1,85 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class RectMesh : IMeshFactory, IHitTest + { + /// + /// + /// + public Rect? drawRect; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public Color32 lineColor; + + /// + /// + /// + public Color32? fillColor; + + /// + /// + /// + public Color32[] colors; + + public RectMesh() + { + lineColor = Color.black; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + Rect rect = drawRect != null ? (Rect)drawRect : vb.contentRect; + Color32 color = fillColor != null ? (Color32)fillColor : vb.vertexColor; + if (lineWidth == 0) + { + if (color.a != 0)//optimized + vb.AddQuad(rect, color); + } + else + { + Rect part; + + //left,right + part = new Rect(rect.x, rect.y, lineWidth, rect.height); + vb.AddQuad(part, lineColor); + part = new Rect(rect.xMax - lineWidth, rect.y, lineWidth, rect.height); + vb.AddQuad(part, lineColor); + + //top, bottom + part = new Rect(rect.x + lineWidth, rect.y, rect.width - lineWidth * 2, lineWidth); + vb.AddQuad(part, lineColor); + part = new Rect(rect.x + lineWidth, rect.yMax - lineWidth, rect.width - lineWidth * 2, lineWidth); + vb.AddQuad(part, lineColor); + + //middle + if (color.a != 0)//optimized + { + part = Rect.MinMaxRect(rect.x + lineWidth, rect.y + lineWidth, rect.xMax - lineWidth, rect.yMax - lineWidth); + if (part.width > 0 && part.height > 0) + vb.AddQuad(part, color); + } + } + + if (colors != null) + vb.RepeatColors(colors, 0, vb.currentVertCount); + + vb.AddTriangles(); + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + return contentRect.Contains(point); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs.meta new file mode 100644 index 00000000..ef15df7e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RectMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 13a3a9d0d365d834696112114d7bf951 +timeCreated: 1545987172 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs new file mode 100644 index 00000000..61259816 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs @@ -0,0 +1,128 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class RegularPolygonMesh : IMeshFactory, IHitTest + { + /// + /// + /// + public Rect? drawRect; + + /// + /// + /// + public int sides; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public Color32 lineColor; + + /// + /// + /// + public Color32? centerColor; + + /// + /// + /// + public Color32? fillColor; + + /// + /// + /// + public float[] distances; + + /// + /// + /// + public float rotation; + + public RegularPolygonMesh() + { + sides = 3; + lineColor = Color.black; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + if (distances != null && distances.Length < sides) + { + Debug.LogError("distances.Length 0) + { + vb.AddVert(vec, lineColor); + + xv = Mathf.Cos(angle) * r + centerX; + yv = Mathf.Sin(angle) * r + centerY; + vb.AddVert(new Vector3(xv, yv, 0), lineColor); + } + angle += angleDelta; + } + + if (lineWidth > 0) + { + int tmp = sides * 3; + for (int i = 0; i < tmp; i += 3) + { + if (i != tmp - 3) + { + vb.AddTriangle(0, i + 1, i + 4); + vb.AddTriangle(i + 5, i + 2, i + 3); + vb.AddTriangle(i + 3, i + 6, i + 5); + } + else + { + vb.AddTriangle(0, i + 1, 1); + vb.AddTriangle(2, i + 2, i + 3); + vb.AddTriangle(i + 3, 3, 2); + } + } + } + else + { + for (int i = 0; i < sides; i++) + vb.AddTriangle(0, i + 1, (i == sides - 1) ? 1 : i + 2); + } + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + if (drawRect != null) + return ((Rect)drawRect).Contains(point); + else + return contentRect.Contains(point); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs.meta new file mode 100644 index 00000000..1d026e4f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RegularPolygonMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a4084bdb2f1738340a28ab5699977f3b +timeCreated: 1545987173 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs new file mode 100644 index 00000000..542b9309 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs @@ -0,0 +1,177 @@ +using UnityEngine; + +namespace FairyGUI +{ + public class RoundedRectMesh : IMeshFactory, IHitTest + { + /// + /// + /// + public Rect? drawRect; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public Color32 lineColor; + + /// + /// + /// + public Color32? fillColor; + + /// + /// + /// + public float topLeftRadius; + + /// + /// + /// + public float topRightRadius; + + /// + /// + /// + public float bottomLeftRadius; + + /// + /// + /// + public float bottomRightRadius; + + public RoundedRectMesh() + { + lineColor = Color.black; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + Rect rect = drawRect != null ? (Rect)drawRect : vb.contentRect; + Color32 color = fillColor != null ? (Color32)fillColor : vb.vertexColor; + + float radiusX = rect.width / 2; + float radiusY = rect.height / 2; + float cornerMaxRadius = Mathf.Min(radiusX, radiusY); + float centerX = radiusX + rect.x; + float centerY = radiusY + rect.y; + + vb.AddVert(new Vector3(centerX, centerY, 0), color); + + int cnt = vb.currentVertCount; + for (int i = 0; i < 4; i++) + { + float radius = 0; + switch (i) + { + case 0: + radius = bottomRightRadius; + break; + + case 1: + radius = bottomLeftRadius; + break; + + case 2: + radius = topLeftRadius; + break; + + case 3: + radius = topRightRadius; + break; + } + radius = Mathf.Min(cornerMaxRadius, radius); + + float offsetX = rect.x; + float offsetY = rect.y; + + if (i == 0 || i == 3) + offsetX = rect.xMax - radius * 2; + if (i == 0 || i == 1) + offsetY = rect.yMax - radius * 2; + + if (radius != 0) + { + int partNumSides = Mathf.Max(1, Mathf.CeilToInt(Mathf.PI * radius / 8)) + 1; + float angleDelta = Mathf.PI / 2 / partNumSides; + float angle = Mathf.PI / 2 * i; + float startAngle = angle; + + for (int j = 1; j <= partNumSides; j++) + { + if (j == partNumSides) //消除精度误差带æ¥çš„ä¸å¯¹é½ + angle = startAngle + Mathf.PI / 2; + Vector3 v1 = new Vector3(offsetX + Mathf.Cos(angle) * (radius - lineWidth) + radius, + offsetY + Mathf.Sin(angle) * (radius - lineWidth) + radius, 0); + vb.AddVert(v1, color); + if (lineWidth != 0) + { + vb.AddVert(v1, lineColor); + vb.AddVert(new Vector3(offsetX + Mathf.Cos(angle) * radius + radius, + offsetY + Mathf.Sin(angle) * radius + radius, 0), lineColor); + } + angle += angleDelta; + } + } + else + { + Vector3 v1 = new Vector3(offsetX, offsetY, 0); + if (lineWidth != 0) + { + if (i == 0 || i == 3) + offsetX -= lineWidth; + else + offsetX += lineWidth; + if (i == 0 || i == 1) + offsetY -= lineWidth; + else + offsetY += lineWidth; + Vector3 v2 = new Vector3(offsetX, offsetY, 0); + vb.AddVert(v2, color); + vb.AddVert(v2, lineColor); + vb.AddVert(v1, lineColor); + } + else + vb.AddVert(v1, color); + } + } + cnt = vb.currentVertCount - cnt; + + if (lineWidth > 0) + { + for (int i = 0; i < cnt; i += 3) + { + if (i != cnt - 3) + { + vb.AddTriangle(0, i + 1, i + 4); + vb.AddTriangle(i + 5, i + 2, i + 3); + vb.AddTriangle(i + 3, i + 6, i + 5); + } + else + { + vb.AddTriangle(0, i + 1, 1); + vb.AddTriangle(2, i + 2, i + 3); + vb.AddTriangle(i + 3, 3, 2); + } + } + } + else + { + for (int i = 0; i < cnt; i++) + vb.AddTriangle(0, i + 1, (i == cnt - 1) ? 1 : i + 2); + } + } + + public bool HitTest(Rect contentRect, Vector2 point) + { + if (drawRect != null) + return ((Rect)drawRect).Contains(point); + else + return contentRect.Contains(point); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs.meta new file mode 100644 index 00000000..1bfac805 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/RoundedRectMesh.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2f910c4392a714c41b421c296621562b +timeCreated: 1545987172 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs new file mode 100644 index 00000000..5cd375f4 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs @@ -0,0 +1,90 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class StraightLineMesh : IMeshFactory + { + /// + /// + /// + public Color color; + + /// + /// + /// + public Vector3 origin; + + /// + /// + /// + public Vector3 end; + + /// + /// + /// + public float lineWidth; + + /// + /// + /// + public bool repeatFill; + + public StraightLineMesh() + { + color = Color.black; + lineWidth = 1; + } + + /// + /// + /// + /// + /// + /// + public StraightLineMesh(float lineWidth, Color color, bool repeatFill) + { + this.lineWidth = lineWidth; + this.color = color; + this.repeatFill = repeatFill; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + if (origin == end) + return; + + float length = Vector2.Distance(origin, end); + Vector3 lineVector = end - origin; + Vector3 widthVector = Vector3.Cross(lineVector, new Vector3(0, 0, 1)); + widthVector.Normalize(); + + Vector3 v0, v1, v2, v3; + + if (repeatFill) + { + float ratio = length / vb.textureSize.x; + v0 = VertexBuffer.NormalizedUV[0]; + v1 = VertexBuffer.NormalizedUV[1]; + v2 = new Vector2(ratio, 1); + v3 = new Vector2(ratio, 0); + } + else + { + v0 = new Vector2(vb.uvRect.xMin, vb.uvRect.yMin); + v1 = new Vector2(vb.uvRect.xMin, vb.uvRect.yMax); + v2 = new Vector2(vb.uvRect.xMax, vb.uvRect.yMax); + v3 = new Vector2(vb.uvRect.xMax, vb.uvRect.yMin); + } + + vb.AddVert(origin - widthVector * lineWidth * 0.5f, color, v0); + vb.AddVert(origin + widthVector * lineWidth * 0.5f, color, v1); + vb.AddVert(end + widthVector * lineWidth * 0.5f, color, v2); + vb.AddVert(end - widthVector * lineWidth * 0.5f, color, v3); + + vb.AddTriangles(); + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs.meta new file mode 100644 index 00000000..19278bfa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/StraightLineMesh.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27b002bc89d804a7b8058b9d16d5c506 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs new file mode 100644 index 00000000..f379f2cc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs @@ -0,0 +1,441 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public sealed class VertexBuffer + { + /// + /// + /// + public Rect contentRect; + + /// + /// + /// + public Rect uvRect; + + /// + /// + /// + public Color32 vertexColor; + + /// + /// + /// + public Vector2 textureSize; + + /// + /// + /// + public readonly List vertices; + + /// + /// + /// + public readonly List colors; + + /// + /// + /// + public readonly List uvs; + + /// + /// + /// + public readonly List uvs2; + + /// + /// + /// + public readonly List triangles; + + static public Vector2[] NormalizedUV = new Vector2[] { + new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0) }; + + static public Vector2[] NormalizedPosition = new Vector2[] { + new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1) }; + + internal bool _alphaInVertexColor; + internal bool _isArbitraryQuad; + + static Stack _pool = new Stack(); + + /// + /// + /// + /// + public static VertexBuffer Begin() + { + if (_pool.Count > 0) + { + VertexBuffer inst = _pool.Pop(); + inst.Clear(); + return inst; + } + else + return new VertexBuffer(); + } + + /// + /// + /// + /// + public static VertexBuffer Begin(VertexBuffer source) + { + VertexBuffer vb = Begin(); + vb.contentRect = source.contentRect; + vb.uvRect = source.uvRect; + vb.vertexColor = source.vertexColor; + vb.textureSize = source.textureSize; + + return vb; + } + + private VertexBuffer() + { + vertices = new List(); + colors = new List(); + uvs = new List(); + uvs2 = new List(); + triangles = new List(); + } + + /// + /// + /// + public void End() + { + _pool.Push(this); + } + + /// + /// + /// + public void Clear() + { + vertices.Clear(); + colors.Clear(); + uvs.Clear(); + uvs2.Clear(); + triangles.Clear(); + + _isArbitraryQuad = false; + _alphaInVertexColor = false; + } + + /// + /// + /// + public int currentVertCount + { + get + { + return vertices.Count; + } + } + + /// + /// + /// + /// + public void AddVert(Vector3 position) + { + position.y = -position.y; + vertices.Add(position); + colors.Add(vertexColor); + if (vertexColor.a != 255) + _alphaInVertexColor = true; + uvs.Add(new Vector2( + Mathf.Lerp(uvRect.xMin, uvRect.xMax, (position.x - contentRect.xMin) / contentRect.width), + Mathf.Lerp(uvRect.yMax, uvRect.yMin, (-position.y - contentRect.yMin) / contentRect.height))); + } + + /// + /// + /// + /// + /// + public void AddVert(Vector3 position, Color32 color) + { + position.y = -position.y; + vertices.Add(position); + colors.Add(color); + if (color.a != 255) + _alphaInVertexColor = true; + uvs.Add(new Vector2( + Mathf.Lerp(uvRect.xMin, uvRect.xMax, (position.x - contentRect.xMin) / contentRect.width), + Mathf.Lerp(uvRect.yMax, uvRect.yMin, (-position.y - contentRect.yMin) / contentRect.height))); + } + + /// + /// + /// + /// + /// + /// + public void AddVert(Vector3 position, Color32 color, Vector2 uv) + { + position.y = -position.y; + vertices.Add(position); + uvs.Add(new Vector2(uv.x, uv.y)); + colors.Add(color); + if (color.a != 255) + _alphaInVertexColor = true; + } + + /// + /// + /// 1---2 + /// | / | + /// 0---3 + /// + /// + public void AddQuad(Rect vertRect) + { + AddVert(new Vector3(vertRect.xMin, vertRect.yMax, 0f)); + AddVert(new Vector3(vertRect.xMin, vertRect.yMin, 0f)); + AddVert(new Vector3(vertRect.xMax, vertRect.yMin, 0f)); + AddVert(new Vector3(vertRect.xMax, vertRect.yMax, 0f)); + } + + /// + /// + /// + /// + /// + public void AddQuad(Rect vertRect, Color32 color) + { + AddVert(new Vector3(vertRect.xMin, vertRect.yMax, 0f), color); + AddVert(new Vector3(vertRect.xMin, vertRect.yMin, 0f), color); + AddVert(new Vector3(vertRect.xMax, vertRect.yMin, 0f), color); + AddVert(new Vector3(vertRect.xMax, vertRect.yMax, 0f), color); + } + + /// + /// + /// + /// + /// + /// + public void AddQuad(Rect vertRect, Color32 color, Rect uvRect) + { + vertices.Add(new Vector3(vertRect.xMin, -vertRect.yMax, 0f)); + vertices.Add(new Vector3(vertRect.xMin, -vertRect.yMin, 0f)); + vertices.Add(new Vector3(vertRect.xMax, -vertRect.yMin, 0f)); + vertices.Add(new Vector3(vertRect.xMax, -vertRect.yMax, 0f)); + + uvs.Add(new Vector2(uvRect.xMin, uvRect.yMin)); + uvs.Add(new Vector2(uvRect.xMin, uvRect.yMax)); + uvs.Add(new Vector2(uvRect.xMax, uvRect.yMax)); + uvs.Add(new Vector2(uvRect.xMax, uvRect.yMin)); + + colors.Add(color); + colors.Add(color); + colors.Add(color); + colors.Add(color); + + if (color.a != 255) + _alphaInVertexColor = true; + } + + static List helperV4List = new List(4) { Vector4.zero, Vector4.zero, Vector4.zero, Vector4.zero }; + internal List FixUVForArbitraryQuad() + { + //ref1 http://www.reedbeta.com/blog/quadrilateral-interpolation-part-1/ + //ref2 https://bitlush.com/blog/arbitrary-quadrilaterals-in-opengl-es-2-0 + + Vector4 qq = Vector4.one; + Vector2 a = vertices[2] - vertices[0]; + Vector2 b = vertices[1] - vertices[3]; + Vector2 c = vertices[0] - vertices[3]; + + float cross = a.x * b.y - a.y * b.x; + if (cross != 0) + { + float s = (a.x * c.y - a.y * c.x) / cross; + if (s > 0 && s < 1) + { + float t = (b.x * c.y - b.y * c.x) / cross; + if (t > 0 && t < 1) + { + qq.x = 1 / (1 - t); + qq.y = 1 / s; + qq.z = 1 / t; + qq.w = 1 / (1 - s); + } + } + } + + for (int i = 0; i < 4; i++) + { + Vector4 v = uvs[i]; + float q = qq[i]; + v.x *= q; + v.y *= q; + v.w = q; + helperV4List[i] = v; + } + + return helperV4List; + } + + /// + /// + /// + /// + /// + /// + public void RepeatColors(Color32[] value, int startIndex, int count) + { + int len = Mathf.Min(startIndex + count, vertices.Count); + int colorCount = value.Length; + int k = 0; + for (int i = startIndex; i < len; i++) + { + Color32 c = value[(k++) % colorCount]; + colors[i] = c; + if (c.a != 255) + _alphaInVertexColor = true; + } + } + + /// + /// + /// + /// + /// + /// + public void AddTriangle(int idx0, int idx1, int idx2) + { + triangles.Add(idx0); + triangles.Add(idx1); + triangles.Add(idx2); + } + + /// + /// + /// + /// + /// + public void AddTriangles(int[] idxList, int startVertexIndex = 0) + { + if (startVertexIndex != 0) + { + if (startVertexIndex < 0) + startVertexIndex = vertices.Count + startVertexIndex; + + int cnt = idxList.Length; + for (int i = 0; i < cnt; i++) + triangles.Add(idxList[i] + startVertexIndex); + } + else + triangles.AddRange(idxList); + } + + /// + /// + /// + /// + public void AddTriangles(int startVertexIndex = 0) + { + int cnt = vertices.Count; + if (startVertexIndex < 0) + startVertexIndex = cnt + startVertexIndex; + + for (int i = startVertexIndex; i < cnt; i += 4) + { + triangles.Add(i); + triangles.Add(i + 1); + triangles.Add(i + 2); + + triangles.Add(i + 2); + triangles.Add(i + 3); + triangles.Add(i); + } + } + + /// + /// + /// + /// + /// + public Vector3 GetPosition(int index) + { + if (index < 0) + index = vertices.Count + index; + + Vector3 vec = vertices[index]; + vec.y = -vec.y; + return vec; + } + + /// + /// + /// + /// + /// + /// + public Vector2 GetUVAtPosition(Vector2 position, bool usePercent) + { + if (usePercent) + { + return new Vector2(Mathf.Lerp(uvRect.xMin, uvRect.xMax, position.x), + Mathf.Lerp(uvRect.yMax, uvRect.yMin, position.y)); + } + else + return new Vector2(Mathf.Lerp(uvRect.xMin, uvRect.xMax, (position.x - contentRect.xMin) / contentRect.width), + Mathf.Lerp(uvRect.yMax, uvRect.yMin, (position.y - contentRect.yMin) / contentRect.height)); + } + + /// + /// + /// + /// + public void Append(VertexBuffer vb) + { + int len = vertices.Count; + vertices.AddRange(vb.vertices); + uvs.AddRange(vb.uvs); + uvs2.AddRange(vb.uvs2); + colors.AddRange(vb.colors); + if (len != 0) + { + int len1 = vb.triangles.Count; + for (int i = 0; i < len1; i++) + triangles.Add(vb.triangles[i] + len); + } + else + triangles.AddRange(vb.triangles); + + if (vb._alphaInVertexColor) + _alphaInVertexColor = true; + } + + /// + /// + /// + /// + public void Insert(VertexBuffer vb) + { + vertices.InsertRange(0, vb.vertices); + uvs.InsertRange(0, vb.uvs); + uvs2.InsertRange(0, vb.uvs2); + colors.InsertRange(0, vb.colors); + int len = triangles.Count; + if (len != 0) + { + int len1 = vb.vertices.Count; + for (int i = 0; i < len; i++) + triangles[i] += len1; + } + triangles.InsertRange(0, vb.triangles); + + if (vb._alphaInVertexColor) + _alphaInVertexColor = true; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs.meta new file mode 100644 index 00000000..c0657072 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Mesh/VertexBuffer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8d5501e8f84e40e47835611ab3896029 +timeCreated: 1545987173 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs new file mode 100644 index 00000000..3a571e20 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs @@ -0,0 +1,414 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class MovieClip : Image + { + /// + /// + /// + public class Frame + { + public NTexture texture; + public float addDelay; + } + + /// + /// + /// + public float interval; + + /// + /// + /// + public bool swing; + + /// + /// + /// + public float repeatDelay; + + /// + /// + /// + public float timeScale; + + /// + /// Whether to ignore Unity time scale. + /// + public bool ignoreEngineTimeScale; + + Frame[] _frames; + int _frameCount; + int _frame; + bool _playing; + int _start; + int _end; + int _times; + int _endAt; + int _status; //0-none, 1-next loop, 2-ending, 3-ended + + float _frameElapsed; //当å‰å¸§å»¶è¿Ÿ + bool _reversed; + int _repeatedCount; + TimerCallback _timerDelegate; + + EventListener _onPlayEnd; + + /// + /// + /// + public MovieClip() + { + interval = 0.1f; + _playing = true; + _timerDelegate = OnTimer; + timeScale = 1; + ignoreEngineTimeScale = false; + + if (Application.isPlaying) + { + onAddedToStage.Add(OnAddedToStage); + onRemovedFromStage.Add(OnRemoveFromStage); + } + + SetPlaySettings(); + } + + /// + /// + /// + public EventListener onPlayEnd + { + get { return _onPlayEnd ?? (_onPlayEnd = new EventListener(this, "onPlayEnd")); } + } + + /// + /// + /// + public Frame[] frames + { + get + { + return _frames; + } + set + { + _frames = value; + _scale9Grid = null; + _scaleByTile = false; + + if (_frames == null) + { + _frameCount = 0; + graphics.texture = null; + CheckTimer(); + return; + } + _frameCount = frames.Length; + + if (_end == -1 || _end > _frameCount - 1) + _end = _frameCount - 1; + if (_endAt == -1 || _endAt > _frameCount - 1) + _endAt = _frameCount - 1; + + if (_frame < 0 || _frame > _frameCount - 1) + _frame = _frameCount - 1; + + InvalidateBatchingState(); + + _frameElapsed = 0; + _repeatedCount = 0; + _reversed = false; + + DrawFrame(); + CheckTimer(); + } + } + + /// + /// + /// + public bool playing + { + get { return _playing; } + set + { + if (_playing != value) + { + _playing = value; + CheckTimer(); + } + } + } + + /// + /// + /// + public int frame + { + get { return _frame; } + set + { + if (_frame != value) + { + if (_frames != null && value >= _frameCount) + value = _frameCount - 1; + + _frame = value; + _frameElapsed = 0; + DrawFrame(); + } + } + } + + /// + /// + /// + public void Rewind() + { + _frame = 0; + _frameElapsed = 0; + _reversed = false; + _repeatedCount = 0; + DrawFrame(); + } + + /// + /// + /// + /// + public void SyncStatus(MovieClip anotherMc) + { + _frame = anotherMc._frame; + _frameElapsed = anotherMc._frameElapsed; + _reversed = anotherMc._reversed; + _repeatedCount = anotherMc._repeatedCount; + DrawFrame(); + } + + /// + /// + /// + /// + public void Advance(float time) + { + int beginFrame = _frame; + bool beginReversed = _reversed; + float backupTime = time; + while (true) + { + float tt = interval + _frames[_frame].addDelay; + if (_frame == 0 && _repeatedCount > 0) + tt += repeatDelay; + if (time < tt) + { + _frameElapsed = 0; + break; + } + + time -= tt; + + if (swing) + { + if (_reversed) + { + _frame--; + if (_frame <= 0) + { + _frame = 0; + _repeatedCount++; + _reversed = !_reversed; + } + } + else + { + _frame++; + if (_frame > _frameCount - 1) + { + _frame = Mathf.Max(0, _frameCount - 2); + _repeatedCount++; + _reversed = !_reversed; + } + } + } + else + { + _frame++; + if (_frame > _frameCount - 1) + { + _frame = 0; + _repeatedCount++; + } + } + + if (_frame == beginFrame && _reversed == beginReversed) //走了一轮了 + { + float roundTime = backupTime - time; //这就是一轮需è¦çš„æ—¶é—´ + time -= Mathf.FloorToInt(time / roundTime) * roundTime; //跳过 + } + } + + DrawFrame(); + } + + /// + /// + /// + public void SetPlaySettings() + { + SetPlaySettings(0, -1, 0, -1); + } + + /// + /// 从start帧开始,播放到end帧(-1表示结尾),é‡å¤times次(0表示无é™å¾ªçŽ¯ï¼‰ï¼Œå¾ªçŽ¯ç»“æŸåŽï¼Œåœæ­¢åœ¨endAt帧(-1è¡¨ç¤ºå‚æ•°end) + /// + /// + /// + /// + /// + public void SetPlaySettings(int start, int end, int times, int endAt) + { + _start = start; + _end = end; + if (_end == -1 || _end > _frameCount - 1) + _end = _frameCount - 1; + _times = times; + _endAt = endAt; + if (_endAt == -1) + _endAt = _end; + _status = 0; + this.frame = start; + } + + void OnAddedToStage() + { + if (_playing && _frameCount > 0) + Timers.inst.AddUpdate(_timerDelegate); + } + + void OnRemoveFromStage() + { + Timers.inst.Remove(_timerDelegate); + } + + void CheckTimer() + { + if (!Application.isPlaying) + return; + + if (_playing && _frameCount > 0 && this.stage != null) + Timers.inst.AddUpdate(_timerDelegate); + else + Timers.inst.Remove(_timerDelegate); + } + + void OnTimer(object param) + { + if (!_playing || _frameCount == 0 || _status == 3) + return; + + float dt; + if (ignoreEngineTimeScale) + { + dt = Time.unscaledDeltaTime; + if (dt > 0.1f) + dt = 0.1f; + } + else + dt = Time.deltaTime; + if (timeScale != 1) + dt *= timeScale; + + _frameElapsed += dt; + float tt = interval + _frames[_frame].addDelay; + if (_frame == 0 && _repeatedCount > 0) + tt += repeatDelay; + if (_frameElapsed < tt) + return; + + _frameElapsed -= tt; + if (_frameElapsed > interval) + _frameElapsed = interval; + + if (swing) + { + if (_reversed) + { + _frame--; + if (_frame <= 0) + { + _frame = 0; + _repeatedCount++; + _reversed = !_reversed; + } + } + else + { + _frame++; + if (_frame > _frameCount - 1) + { + _frame = Mathf.Max(0, _frameCount - 2); + _repeatedCount++; + _reversed = !_reversed; + } + } + } + else + { + _frame++; + if (_frame > _frameCount - 1) + { + _frame = 0; + _repeatedCount++; + } + } + + if (_status == 1) //new loop + { + _frame = _start; + _frameElapsed = 0; + _status = 0; + DrawFrame(); + } + else if (_status == 2) //ending + { + _frame = _endAt; + _frameElapsed = 0; + _status = 3; //ended + DrawFrame(); + + DispatchEvent("onPlayEnd", null); + } + else + { + DrawFrame(); + if (_frame == _end) + { + if (_times > 0) + { + _times--; + if (_times == 0) + _status = 2; //ending + else + _status = 1; //new loop + } + else if (_start != 0) + _status = 1; //new loop + } + } + } + + void DrawFrame() + { + if (_frameCount > 0) + { + Frame frame = _frames[_frame]; + graphics.texture = frame.texture; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs.meta new file mode 100644 index 00000000..8344cdd1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/MovieClip.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5ddeeb52259b7ed4e8a604fa8cd47897 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs new file mode 100644 index 00000000..1f712aa6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs @@ -0,0 +1,67 @@ +using System; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class NAudioClip + { + public static Action CustomDestroyMethod; + + /// + /// + /// + public DestroyMethod destroyMethod; + + /// + /// + /// + public AudioClip nativeClip; + + /// + /// + /// + /// + public NAudioClip(AudioClip audioClip) + { + nativeClip = audioClip; + } + + /// + /// + /// + public void Unload() + { + if (nativeClip == null) + return; + + if (destroyMethod == DestroyMethod.Unload) + Resources.UnloadAsset(nativeClip); + else if (destroyMethod == DestroyMethod.Destroy) + UnityEngine.Object.DestroyImmediate(nativeClip, true); + else if (destroyMethod == DestroyMethod.Custom) + { + if (CustomDestroyMethod == null) + Debug.LogWarning("NAudioClip.CustomDestroyMethod must be set to handle DestroyMethod.Custom"); + else + CustomDestroyMethod(nativeClip); + } + + nativeClip = null; + } + + /// + /// + /// + /// + public void Reload(AudioClip audioClip) + { + if (nativeClip != null && nativeClip != audioClip) + Unload(); + + nativeClip = audioClip; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs.meta new file mode 100644 index 00000000..280723f4 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NAudioClip.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e081bc28928c3474194543c862fadec5 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs new file mode 100644 index 00000000..8366dfe1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs @@ -0,0 +1,842 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; +using Object = UnityEngine.Object; + +namespace FairyGUI +{ + /// + /// + /// + public class NGraphics : IMeshFactory + { + /// + /// + /// + public GameObject gameObject { get; private set; } + + /// + /// + /// + public MeshFilter meshFilter { get; private set; } + + /// + /// + /// + public MeshRenderer meshRenderer { get; private set; } + + /// + /// + /// + public Mesh mesh { get; private set; } + + /// + /// + /// + public BlendMode blendMode; + + /// + /// ä¸å‚ä¸Žå‰ªè£ + /// + public bool dontClip; + + /// + /// 当Meshæ›´æ–°æ—¶è§¦å‘ + /// + public event Action meshModifier; + + NTexture _texture; + string _shader; + Material _material; + int _customMatarial; //0-none, 1-common, 2-support internal mask, 128-owns material + MaterialManager _manager; + string[] _shaderKeywords; + int _materialFlags; + IMeshFactory _meshFactory; + + float _alpha; + Color _color; + bool _meshDirty; + Rect _contentRect; + FlipType _flip; + + public class VertexMatrix + { + public Vector3 cameraPos; + public Matrix4x4 matrix; + } + VertexMatrix _vertexMatrix; + + bool hasAlphaBackup; + List _alphaBackup; //逿˜Žåº¦æ”¹å˜éœ€è¦é€šè¿‡ä¿®æ”¹é¡¶ç‚¹é¢œè‰²å®žçŽ°ï¼Œä½†é¡¶ç‚¹é¢œè‰²æœ¬èº«å¯èƒ½å°±å¸¦æœ‰é€æ˜Žåº¦ï¼Œæ‰€ä»¥è¿™é‡Œè¦æœ‰ä¸€ä¸ªå¤‡ä»½ + + internal int _maskFlag; + StencilEraser _stencilEraser; + +#if !UNITY_5_6_OR_NEWER + Color32[] _colors; +#endif + + MaterialPropertyBlock _propertyBlock; + bool _blockUpdated; + + /// + /// + /// + /// + public NGraphics(GameObject gameObject) + { + this.gameObject = gameObject; + + _alpha = 1f; + _shader = ShaderConfig.imageShader; + _color = Color.white; + _meshFactory = this; + + meshFilter = gameObject.AddComponent(); + meshRenderer = gameObject.AddComponent(); + meshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; + meshRenderer.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; + meshRenderer.receiveShadows = false; + + mesh = new Mesh(); + mesh.name = gameObject.name; + mesh.MarkDynamic(); + + meshFilter.mesh = mesh; + + meshFilter.hideFlags = DisplayObject.hideFlags; + meshRenderer.hideFlags = DisplayObject.hideFlags; + mesh.hideFlags = DisplayObject.hideFlags; + + Stats.LatestGraphicsCreation++; + } + + /// + /// + /// + public IMeshFactory meshFactory + { + get { return _meshFactory; } + set + { + if (_meshFactory != value) + { + _meshFactory = value; + _meshDirty = true; + } + } + } + + /// + /// + /// + /// + /// + public T GetMeshFactory() where T : IMeshFactory, new() + { + if (!(_meshFactory is T)) + { + _meshFactory = new T(); + _meshDirty = true; + } + return (T)_meshFactory; + } + + /// + /// + /// + public Rect contentRect + { + get { return _contentRect; } + set + { + _contentRect = value; + _meshDirty = true; + } + } + + /// + /// + /// + public FlipType flip + { + get { return _flip; } + set + { + if (_flip != value) + { + _flip = value; + _meshDirty = true; + } + } + } + + /// + /// + /// + public NTexture texture + { + get { return _texture; } + set + { + if (_texture != value) + { + if (value != null) + value.AddRef(); + if (_texture != null) + _texture.ReleaseRef(); + + _texture = value; + if (_customMatarial != 0 && _material != null) + _material.mainTexture = _texture != null ? _texture.nativeTexture : null; + _meshDirty = true; + UpdateManager(); + } + } + } + + /// + /// + /// + public string shader + { + get { return _shader; } + set + { + _shader = value; + UpdateManager(); + } + } + + /// + /// + /// + /// + /// + public void SetShaderAndTexture(string shader, NTexture texture) + { + _shader = shader; + if (_texture != texture) + this.texture = texture; + else + UpdateManager(); + } + + /// + /// + /// + public Material material + { + get + { + if (_customMatarial == 0 && _material == null && _manager != null) + _material = _manager.GetMaterial(_materialFlags, blendMode, 0); + return _material; + } + set + { + if ((_customMatarial & 128) != 0 && _material != null) + Object.DestroyImmediate(_material); + + _material = value; + if (_material != null) + { + _customMatarial = 1; + if (_material.HasProperty(ShaderConfig.ID_Stencil) || _material.HasProperty(ShaderConfig.ID_ClipBox)) + _customMatarial |= 2; + + meshRenderer.sharedMaterial = _material; + if (_texture != null) + _material.mainTexture = _texture.nativeTexture; + } + else + { + _customMatarial = 0; + meshRenderer.sharedMaterial = null; + } + } + } + + /// + /// Same as material property except that ownership is transferred to this object. + /// + /// + public void SetMaterial(Material material) + { + this.material = material; + _customMatarial |= 128; + } + + /// + /// + /// + public string[] materialKeywords + { + get { return _shaderKeywords; } + set + { + _shaderKeywords = value; + UpdateMaterialFlags(); + } + } + + /// + /// + /// + /// + /// + public void ToggleKeyword(string keyword, bool enabled) + { + if (enabled) + { + if (_shaderKeywords == null) + { + _shaderKeywords = new string[] { keyword }; + UpdateMaterialFlags(); + } + else if (Array.IndexOf(_shaderKeywords, keyword) == -1) + { + Array.Resize(ref _shaderKeywords, _shaderKeywords.Length + 1); + _shaderKeywords[_shaderKeywords.Length - 1] = keyword; + UpdateMaterialFlags(); + } + } + else + { + if (_shaderKeywords != null) + { + int i = Array.IndexOf(_shaderKeywords, keyword); + if (i != -1) + { + _shaderKeywords[i] = null; + UpdateMaterialFlags(); + } + } + } + } + + void UpdateManager() + { + if (_texture != null) + _manager = _texture.GetMaterialManager(_shader); + else + _manager = null; + UpdateMaterialFlags(); + } + + void UpdateMaterialFlags() + { + if (_customMatarial != 0) + { + if (material != null) + material.shaderKeywords = _shaderKeywords; + } + else if (_shaderKeywords != null && _manager != null) + _materialFlags = _manager.GetFlagsByKeywords(_shaderKeywords); + else + _materialFlags = 0; + } + + /// + /// + /// + public bool enabled + { + get { return meshRenderer.enabled; } + set { meshRenderer.enabled = value; } + } + + /// + /// + /// + public int sortingOrder + { + get { return meshRenderer.sortingOrder; } + set { meshRenderer.sortingOrder = value; } + } + + /// + /// + /// + /// + internal void _SetStencilEraserOrder(int value) + { + _stencilEraser.meshRenderer.sortingOrder = value; + } + + /// + /// + /// + /// + public Color color + { + get { return _color; } + set { _color = value; } + } + + /// + /// + /// + public void Tint() + { + if (_meshDirty) + return; + + int vertCount = mesh.vertexCount; + if (vertCount == 0) + return; + +#if !UNITY_5_6_OR_NEWER + Color32[] colors = _colors; + if (colors == null) + colors = mesh.colors32; +#else + VertexBuffer vb = VertexBuffer.Begin(); + mesh.GetColors(vb.colors); + List colors = vb.colors; +#endif + for (int i = 0; i < vertCount; i++) + { + Color32 col = _color; + col.a = (byte)(_alpha * (hasAlphaBackup ? _alphaBackup[i] : (byte)255)); + colors[i] = col; + } + +#if !UNITY_5_6_OR_NEWER + mesh.colors32 = colors; +#else + mesh.SetColors(vb.colors); + vb.End(); +#endif + } + + void ChangeAlpha(float value) + { + _alpha = value; + + int vertCount = mesh.vertexCount; + if (vertCount == 0) + return; + +#if !UNITY_5_6_OR_NEWER + Color32[] colors = _colors; + if (colors == null) + colors = mesh.colors32; +#else + VertexBuffer vb = VertexBuffer.Begin(); + mesh.GetColors(vb.colors); + List colors = vb.colors; +#endif + for (int i = 0; i < vertCount; i++) + { + Color32 col = colors[i]; + col.a = (byte)(_alpha * (hasAlphaBackup ? _alphaBackup[i] : (byte)255)); + colors[i] = col; + } + +#if !UNITY_5_6_OR_NEWER + mesh.colors32 = colors; +#else + mesh.SetColors(vb.colors); + vb.End(); +#endif + } + + /// + /// + /// + public VertexMatrix vertexMatrix + { + get { return _vertexMatrix; } + set + { + _vertexMatrix = value; + _meshDirty = true; + } + } + + /// + /// + /// + /// + public MaterialPropertyBlock materialPropertyBlock + { + get + { + if (_propertyBlock == null) + _propertyBlock = new MaterialPropertyBlock(); + + _blockUpdated = true; + return _propertyBlock; + } + } + + /// + /// + /// + public void SetMeshDirty() + { + _meshDirty = true; + } + + /// + /// + /// + /// + public bool UpdateMesh() + { + if (_meshDirty) + { + UpdateMeshNow(); + return true; + } + else + return false; + } + + /// + /// + /// + public void Dispose() + { + if (mesh != null) + { + if (Application.isPlaying) + Object.Destroy(mesh); + else + Object.DestroyImmediate(mesh); + mesh = null; + } + if ((_customMatarial & 128) != 0 && _material != null) + Object.DestroyImmediate(_material); + + if (_texture != null) + { + _texture.ReleaseRef(); + _texture = null; + } + + _manager = null; + _material = null; + meshRenderer = null; + meshFilter = null; + _stencilEraser = null; + meshModifier = null; + } + + /// + /// + /// + /// + /// + /// + public void Update(UpdateContext context, float alpha, bool grayed) + { + Stats.GraphicsCount++; + + if (_meshDirty) + { + _alpha = alpha; + UpdateMeshNow(); + } + else if (_alpha != alpha) + ChangeAlpha(alpha); + + if (_propertyBlock != null && _blockUpdated) + { + meshRenderer.SetPropertyBlock(_propertyBlock); + _blockUpdated = false; + } + + if (_customMatarial != 0) + { + if ((_customMatarial & 2) != 0 && _material != null) + context.ApplyClippingProperties(_material, false); + } + else + { + if (_manager != null) + { + if (_maskFlag == 1) + { + _material = _manager.GetMaterial((int)MaterialFlags.AlphaMask | _materialFlags, BlendMode.Normal, context.clipInfo.clipId); + context.ApplyAlphaMaskProperties(_material, false); + } + else + { + int matFlags = _materialFlags; + if (grayed) + matFlags |= (int)MaterialFlags.Grayed; + + if (context.clipped) + { + if (context.stencilReferenceValue > 0) + matFlags |= (int)MaterialFlags.StencilTest; + if (context.rectMaskDepth > 0) + { + if (context.clipInfo.soft) + matFlags |= (int)MaterialFlags.SoftClipped; + else + matFlags |= (int)MaterialFlags.Clipped; + } + + _material = _manager.GetMaterial(matFlags, blendMode, context.clipInfo.clipId); + if (_manager.firstMaterialInFrame) + context.ApplyClippingProperties(_material, true); + } + else + _material = _manager.GetMaterial(matFlags, blendMode, 0); + } + } + else + _material = null; + + if (!Material.ReferenceEquals(_material, meshRenderer.sharedMaterial)) + meshRenderer.sharedMaterial = _material; + } + + if (_maskFlag != 0) + { + if (_maskFlag == 1) + _maskFlag = 2; + else + { + if (_stencilEraser != null) + _stencilEraser.enabled = false; + + _maskFlag = 0; + } + } + } + + internal void _PreUpdateMask(UpdateContext context, uint maskId) + { + //_maskFlag: 0-new mask, 1-active mask, 2-mask complete + if (_maskFlag == 0) + { + if (_stencilEraser == null) + { + _stencilEraser = new StencilEraser(gameObject.transform); + _stencilEraser.meshFilter.mesh = mesh; + } + else + _stencilEraser.enabled = true; + } + + _maskFlag = 1; + + if (_manager != null) + { + //这里使用maskIdè€Œä¸æ˜¯clipInfo.clipId,是因为é®ç½©æœ‰ä¸¤ä¸ªç”¨é€”,一个是写入é®ç½©ï¼Œä¸€ä¸ªæ˜¯æ“¦é™¤ï¼Œä¸¤ä¸ªä¸èƒ½ç”¨åŒä¸€ä¸ªæè´¨ + Material mat = _manager.GetMaterial((int)MaterialFlags.AlphaMask | _materialFlags, BlendMode.Normal, maskId); + if (!Material.ReferenceEquals(mat, _stencilEraser.meshRenderer.sharedMaterial)) + _stencilEraser.meshRenderer.sharedMaterial = mat; + + context.ApplyAlphaMaskProperties(mat, true); + } + } + + void UpdateMeshNow() + { + _meshDirty = false; + + if (_texture == null || _meshFactory == null) + { + if (mesh.vertexCount > 0) + { + mesh.Clear(); + + if (meshModifier != null) + meshModifier(); + } + return; + } + + VertexBuffer vb = VertexBuffer.Begin(); + vb.contentRect = _contentRect; + vb.uvRect = _texture.uvRect; + if (_texture != null) + vb.textureSize = new Vector2(_texture.width, _texture.height); + else + vb.textureSize = new Vector2(0, 0); + if (_flip != FlipType.None) + { + if (_flip == FlipType.Horizontal || _flip == FlipType.Both) + { + float tmp = vb.uvRect.xMin; + vb.uvRect.xMin = vb.uvRect.xMax; + vb.uvRect.xMax = tmp; + } + if (_flip == FlipType.Vertical || _flip == FlipType.Both) + { + float tmp = vb.uvRect.yMin; + vb.uvRect.yMin = vb.uvRect.yMax; + vb.uvRect.yMax = tmp; + } + } + vb.vertexColor = _color; + _meshFactory.OnPopulateMesh(vb); + + int vertCount = vb.currentVertCount; + if (vertCount == 0) + { + if (mesh.vertexCount > 0) + { + mesh.Clear(); + + if (meshModifier != null) + meshModifier(); + } + vb.End(); + return; + } + + if (_texture.rotated) + { + float xMin = _texture.uvRect.xMin; + float yMin = _texture.uvRect.yMin; + float yMax = _texture.uvRect.yMax; + float tmp; + for (int i = 0; i < vertCount; i++) + { + Vector2 vec = vb.uvs[i]; + tmp = vec.y; + vec.y = yMin + vec.x - xMin; + vec.x = xMin + yMax - tmp; + vb.uvs[i] = vec; + } + } + + hasAlphaBackup = vb._alphaInVertexColor; + if (hasAlphaBackup) + { + if (_alphaBackup == null) + _alphaBackup = new List(); + else + _alphaBackup.Clear(); + for (int i = 0; i < vertCount; i++) + { + Color32 col = vb.colors[i]; + _alphaBackup.Add(col.a); + + col.a = (byte)(col.a * _alpha); + vb.colors[i] = col; + } + } + else if (_alpha != 1) + { + for (int i = 0; i < vertCount; i++) + { + Color32 col = vb.colors[i]; + col.a = (byte)(col.a * _alpha); + vb.colors[i] = col; + } + } + + if (_vertexMatrix != null) + { + Vector3 camPos = _vertexMatrix.cameraPos; + Vector3 center = new Vector3(camPos.x, camPos.y, 0); + center -= _vertexMatrix.matrix.MultiplyPoint(center); + for (int i = 0; i < vertCount; i++) + { + Vector3 pt = vb.vertices[i]; + pt = _vertexMatrix.matrix.MultiplyPoint(pt); + pt += center; + Vector3 vec = pt - camPos; + float lambda = -camPos.z / vec.z; + pt.x = camPos.x + lambda * vec.x; + pt.y = camPos.y + lambda * vec.y; + pt.z = 0; + + vb.vertices[i] = pt; + } + } + + mesh.Clear(); + +#if UNITY_5_2 || UNITY_5_3_OR_NEWER + mesh.SetVertices(vb.vertices); + if (vb._isArbitraryQuad) + mesh.SetUVs(0, vb.FixUVForArbitraryQuad()); + else + mesh.SetUVs(0, vb.uvs); + mesh.SetColors(vb.colors); + mesh.SetTriangles(vb.triangles, 0); + if (vb.uvs2.Count == vb.uvs.Count) + mesh.SetUVs(1, vb.uvs2); + +#if !UNITY_5_6_OR_NEWER + _colors = null; +#endif +#else + Vector3[] vertices = new Vector3[vertCount]; + Vector2[] uv = new Vector2[vertCount]; + _colors = new Color32[vertCount]; + int[] triangles = new int[vb.triangles.Count]; + + vb.vertices.CopyTo(vertices); + vb.uvs.CopyTo(uv); + vb.colors.CopyTo(_colors); + vb.triangles.CopyTo(triangles); + + mesh.vertices = vertices; + mesh.uv = uv; + mesh.triangles = triangles; + mesh.colors32 = _colors; + + if(vb.uvs2.Count==uv.Length) + { + uv = new Vector2[vertCount]; + vb.uvs2.CopyTo(uv); + mesh.uv2 = uv; + } +#endif + vb.End(); + + if (meshModifier != null) + meshModifier(); + } + + public void OnPopulateMesh(VertexBuffer vb) + { + Rect rect = texture.GetDrawRect(vb.contentRect); + + vb.AddQuad(rect, vb.vertexColor, vb.uvRect); + vb.AddTriangles(); + vb._isArbitraryQuad = _vertexMatrix != null; + } + + class StencilEraser + { + public GameObject gameObject; + public MeshFilter meshFilter; + public MeshRenderer meshRenderer; + + public StencilEraser(Transform parent) + { + gameObject = new GameObject("StencilEraser"); + gameObject.transform.SetParent(parent, false); + + meshFilter = gameObject.AddComponent(); + meshRenderer = gameObject.AddComponent(); + meshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; + meshRenderer.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; + meshRenderer.receiveShadows = false; + + gameObject.layer = parent.gameObject.layer; + gameObject.hideFlags = parent.gameObject.hideFlags; + meshFilter.hideFlags = parent.gameObject.hideFlags; + meshRenderer.hideFlags = parent.gameObject.hideFlags; + } + + public bool enabled + { + get { return meshRenderer.enabled; } + set { meshRenderer.enabled = value; } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs.meta new file mode 100644 index 00000000..81633995 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NGraphics.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b84f79fb60acc974cb58c5368b257716 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs new file mode 100644 index 00000000..208126cd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs @@ -0,0 +1,515 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace FairyGUI +{ + /// + /// + /// + public enum DestroyMethod + { + Destroy, + Unload, + None, + ReleaseTemp, + Custom + } + + /// + /// + /// + public class NTexture + { + /// + /// This event will trigger when a texture is destroying if its destroyMethod is Custom + /// + public static event Action CustomDestroyMethod; + + /// + /// + /// + public Rect uvRect; + + /// + /// + /// + public bool rotated; + + /// + /// + /// + public int refCount; + + /// + /// + /// + public float lastActive; + + /// + /// + /// + public DestroyMethod destroyMethod; + + /// + /// This event will trigger when texture reloaded and size changed. + /// + public event Action onSizeChanged; + + /// + /// This event will trigger when ref count is zero. + /// + public event Action onRelease; + + private Texture _nativeTexture; + private Texture _alphaTexture; + + private Rect _region; + private Vector2 _offset; + private Vector2 _originalSize; + + private NTexture _root; + private Dictionary _materialManagers; + + internal static Texture2D CreateEmptyTexture() + { + var emptyTexture = new Texture2D(1, 1, TextureFormat.RGB24, false); + emptyTexture.name = "White Texture"; + emptyTexture.hideFlags = DisplayObject.hideFlags; + emptyTexture.SetPixel(0, 0, Color.white); + emptyTexture.Apply(); + return emptyTexture; + } + + private static NTexture _empty; + + /// + /// + /// + public static NTexture Empty + { + get + { + if (_empty == null) + _empty = new NTexture(CreateEmptyTexture()); + + return _empty; + } + } + + /// + /// + /// + public static void DisposeEmpty() + { + if (_empty != null) + { + var tmp = _empty; + _empty = null; + tmp.Dispose(); + } + } + + /// + /// + /// + /// + public NTexture(Texture texture) : this(texture, null, 1, 1) + { + } + + /// + /// + /// + /// + /// + /// + public NTexture(Texture texture, Texture alphaTexture, float xScale, float yScale) + { + _root = this; + _nativeTexture = texture; + _alphaTexture = alphaTexture; + uvRect = new Rect(0, 0, xScale, yScale); + if (yScale < 0) + { + uvRect.y = -yScale; + uvRect.yMax = 0; + } + + if (xScale < 0) + { + uvRect.x = -xScale; + uvRect.xMax = 0; + } + + if (_nativeTexture != null) + _originalSize = new Vector2(_nativeTexture.width, _nativeTexture.height); + _region = new Rect(0, 0, _originalSize.x, _originalSize.y); + } + + /// + /// + /// + /// + /// + public NTexture(Texture texture, Rect region) + { + _root = this; + _nativeTexture = texture; + _region = region; + _originalSize = new Vector2(_region.width, _region.height); + if (_nativeTexture != null) + uvRect = new Rect(region.x / _nativeTexture.width, 1 - region.yMax / _nativeTexture.height, + region.width / _nativeTexture.width, region.height / _nativeTexture.height); + else + uvRect.Set(0, 0, 1, 1); + } + + /// + /// + /// + /// + /// + /// + public NTexture(NTexture root, Rect region, bool rotated) + { + _root = root; + this.rotated = rotated; + region.x += root._region.x; + region.y += root._region.y; + uvRect = new Rect(region.x * root.uvRect.width / root.width, + 1 - region.yMax * root.uvRect.height / root.height, + region.width * root.uvRect.width / root.width, region.height * root.uvRect.height / root.height); + if (rotated) + { + var tmp = region.width; + region.width = region.height; + region.height = tmp; + + tmp = uvRect.width; + uvRect.width = uvRect.height; + uvRect.height = tmp; + } + + _region = region; + _originalSize = _region.size; + } + + /// + /// + /// + /// + /// + /// + /// + /// + public NTexture(NTexture root, Rect region, bool rotated, Vector2 originalSize, Vector2 offset) + : this(root, region, rotated) + { + _originalSize = originalSize; + _offset = offset; + } + + /// + /// + /// + /// + public NTexture(Sprite sprite) + { + var rect = sprite.textureRect; + rect.y = sprite.texture.height - rect.yMax; + + _root = this; + _nativeTexture = sprite.texture; + _region = rect; + _originalSize = new Vector2(_region.width, _region.height); + uvRect = new Rect(_region.x / _nativeTexture.width, 1 - _region.yMax / _nativeTexture.height, + _region.width / _nativeTexture.width, _region.height / _nativeTexture.height); + } + + /// + /// + /// + public int width => (int)_region.width; + + /// + /// + /// + public int height => (int)_region.height; + + /// + /// 修改æºç ï¼Œunity里sprite用fguiçš„å›¾ï¼Œè½¬æ¢æ—¶è¦ç”¨ + /// + public Rect region => _region; + + /// + /// + /// + public Vector2 offset + { + get => _offset; + set => _offset = value; + } + + /// + /// + /// + public Vector2 originalSize + { + get => _originalSize; + set => _originalSize = value; + } + + /// + /// + /// + /// + /// + public Rect GetDrawRect(Rect drawRect) + { + if (_originalSize.x == _region.width && _originalSize.y == _region.height) + return drawRect; + + var sx = drawRect.width / _originalSize.x; + var sy = drawRect.height / _originalSize.y; + return new Rect(_offset.x * sx, _offset.y * sy, _region.width * sx, _region.height * sy); + } + + /// + /// + /// + /// + public void GetUV(Vector2[] uv) + { + uv[0] = uvRect.position; + uv[1] = new Vector2(uvRect.xMin, uvRect.yMax); + uv[2] = new Vector2(uvRect.xMax, uvRect.yMax); + uv[3] = new Vector2(uvRect.xMax, uvRect.yMin); + if (rotated) + { + var xMin = uvRect.xMin; + var yMin = uvRect.yMin; + var yMax = uvRect.yMax; + + float tmp; + for (var i = 0; i < 4; i++) + { + var m = uv[i]; + tmp = m.y; + m.y = yMin + m.x - xMin; + m.x = xMin + yMax - tmp; + uv[i] = m; + } + } + } + + /// + /// + /// + public NTexture root => _root; + + /// + /// + /// + public bool disposed => _root == null; + + /// + /// + /// + public Texture nativeTexture => _root != null ? _root._nativeTexture : null; + + /// + /// + /// + public Texture alphaTexture => _root != null ? _root._alphaTexture : null; + + /// + /// + /// + public MaterialManager GetMaterialManager(string shaderName) + { + if (_root != this) + { + if (_root == null) + return null; + else + return _root.GetMaterialManager(shaderName); + } + + if (_materialManagers == null) + _materialManagers = new Dictionary(); + + MaterialManager mm; + if (!_materialManagers.TryGetValue(shaderName, out mm)) + { + mm = new MaterialManager(this, ShaderConfig.GetShader(shaderName)); + _materialManagers.Add(shaderName, mm); + } + + return mm; + } + + /// + /// + /// + public void Unload() + { + Unload(false); + } + + /// + /// + /// + public void Unload(bool destroyMaterials) + { + if (this == _empty) + return; + + if (_root != this) + throw new Exception("Unload is not allow to call on none root NTexture."); + + if (_nativeTexture != null) + { + DestroyTexture(); + + if (destroyMaterials) + DestroyMaterials(); + else + RefreshMaterials(); + } + } + + /// + /// + /// + /// + /// + public void Reload(Texture nativeTexture, Texture alphaTexture) + { + if (_root != this) + throw new Exception("Reload is not allow to call on none root NTexture."); + + if (_nativeTexture != null && _nativeTexture != nativeTexture) + DestroyTexture(); + + _nativeTexture = nativeTexture; + _alphaTexture = alphaTexture; + + var lastSize = _originalSize; + if (_nativeTexture != null) + _originalSize = new Vector2(_nativeTexture.width, _nativeTexture.height); + else + _originalSize = Vector2.zero; + _region = new Rect(0, 0, _originalSize.x, _originalSize.y); + + RefreshMaterials(); + + if (onSizeChanged != null && lastSize != _originalSize) + onSizeChanged(this); + } + + private void DestroyTexture() + { + switch (destroyMethod) + { + case DestroyMethod.Destroy: + Object.DestroyImmediate(_nativeTexture, true); + if (_alphaTexture != null) + Object.DestroyImmediate(_alphaTexture, true); + break; + case DestroyMethod.Unload: + Resources.UnloadAsset(_nativeTexture); + if (_alphaTexture != null) + Resources.UnloadAsset(_alphaTexture); + break; + case DestroyMethod.ReleaseTemp: + RenderTexture.ReleaseTemporary((RenderTexture)_nativeTexture); + if (_alphaTexture is RenderTexture) + RenderTexture.ReleaseTemporary((RenderTexture)_alphaTexture); + break; + case DestroyMethod.Custom: + if (CustomDestroyMethod == null) + { + Debug.LogWarning("NTexture.CustomDestroyMethod must be set to handle DestroyMethod.Custom"); + } + else + { + CustomDestroyMethod(_nativeTexture); + if (_alphaTexture != null) + CustomDestroyMethod(_alphaTexture); + } + + break; + } + + _nativeTexture = null; + _alphaTexture = null; + } + + private void RefreshMaterials() + { + if (_materialManagers != null && _materialManagers.Count > 0) + { + var iter = _materialManagers.GetEnumerator(); + while (iter.MoveNext()) + iter.Current.Value.RefreshMaterials(); + iter.Dispose(); + } + } + + private void DestroyMaterials() + { + if (_materialManagers != null && _materialManagers.Count > 0) + { + var iter = _materialManagers.GetEnumerator(); + while (iter.MoveNext()) + iter.Current.Value.DestroyMaterials(); + iter.Dispose(); + } + } + + public void AddRef() + { + if (_root == null) //disposed + return; + + if (_root != this && refCount == 0) + _root.AddRef(); + + refCount++; + } + + public void ReleaseRef() + { + if (_root == null) //disposed + return; + + refCount--; + + if (refCount == 0) + { + if (_root != this) + _root.ReleaseRef(); + + if (onRelease != null) + onRelease(this); + } + } + + /// + /// + /// + public void Dispose() + { + if (this == _empty) + return; + + if (_root == this) + Unload(true); + _root = null; + onSizeChanged = null; + onRelease = null; + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs.meta new file mode 100644 index 00000000..45a5f6e7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/NTexture.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cdb420f5e4ef87d419c4467d1b8f2ddf +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs new file mode 100644 index 00000000..6b548492 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs @@ -0,0 +1,95 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public static class ShaderConfig + { + /// + /// + /// + /// + /// + public delegate Shader GetFunction(string name); + + /// + /// + /// + public static GetFunction Get = Shader.Find; + + /// + /// + /// + public static string imageShader = "FairyGUI/Image"; + + /// + /// + /// + public static string textShader = "FairyGUI/Text"; + + /// + /// + /// + public static string bmFontShader = "FairyGUI/BMFont"; + + /// + /// + /// + public static string TMPFontShader = "FairyGUI/TMP"; + + public static int ID_ClipBox; + public static int ID_ClipSoftness; + public static int ID_AlphaTex; + public static int ID_StencilComp; + public static int ID_Stencil; + public static int ID_StencilOp; + public static int ID_StencilReadMask; + public static int ID_ColorMask; + public static int ID_ColorMatrix; + public static int ID_ColorOffset; + public static int ID_BlendSrcFactor; + public static int ID_BlendDstFactor; + public static int ID_ColorOption; + + public static int ID_Stencil2; + + static ShaderConfig() + { + ID_ClipBox = Shader.PropertyToID("_ClipBox"); + ID_ClipSoftness = Shader.PropertyToID("_ClipSoftness"); + ID_AlphaTex = Shader.PropertyToID("_AlphaTex"); + ID_StencilComp = Shader.PropertyToID("_StencilComp"); + ID_Stencil = Shader.PropertyToID("_Stencil"); + ID_StencilOp = Shader.PropertyToID("_StencilOp"); + ID_StencilReadMask = Shader.PropertyToID("_StencilReadMask"); + ID_ColorMask = Shader.PropertyToID("_ColorMask"); + ID_ColorMatrix = Shader.PropertyToID("_ColorMatrix"); + ID_ColorOffset = Shader.PropertyToID("_ColorOffset"); + ID_BlendSrcFactor = Shader.PropertyToID("_BlendSrcFactor"); + ID_BlendDstFactor = Shader.PropertyToID("_BlendDstFactor"); + ID_ColorOption = Shader.PropertyToID("_ColorOption"); + + ID_Stencil2 = Shader.PropertyToID("_StencilRef"); + } + + /// + /// + /// + /// + /// + public static Shader GetShader(string name) + { + Shader shader = Get(name); + if (shader == null) + { + Debug.LogWarning("FairyGUI: shader not found: " + name); + shader = Shader.Find("UI/Default"); + } + shader.hideFlags = DisplayObject.hideFlags; + + return shader; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs.meta new file mode 100644 index 00000000..b9cb9cb3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/ShaderConfig.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c4eae4be32683c04a96ac1c4cd1834ab +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs new file mode 100644 index 00000000..36a89d0c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs @@ -0,0 +1,250 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class Shape : DisplayObject + { + /// + /// + /// + public Shape() + { + CreateGameObject("Shape"); + graphics = new NGraphics(gameObject); + graphics.texture = NTexture.Empty; + graphics.meshFactory = null; + } + + /// + /// + /// + public Color color + { + get + { + return graphics.color; + } + set + { + graphics.color = value; + graphics.SetMeshDirty(); + } + } + + /// + /// + /// + /// + /// + /// + public void DrawRect(float lineSize, Color lineColor, Color fillColor) + { + RectMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = lineSize; + mesh.lineColor = lineColor; + mesh.fillColor = null; + mesh.colors = null; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + public void DrawRect(float lineSize, Color32[] colors) + { + RectMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = lineSize; + mesh.colors = colors; + + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void DrawRoundRect(float lineSize, Color lineColor, Color fillColor, + float topLeftRadius, float topRightRadius, float bottomLeftRadius, float bottomRightRadius) + { + RoundedRectMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = lineSize; + mesh.lineColor = lineColor; + mesh.fillColor = null; + mesh.topLeftRadius = topLeftRadius; + mesh.topRightRadius = topRightRadius; + mesh.bottomLeftRadius = bottomLeftRadius; + mesh.bottomRightRadius = bottomRightRadius; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + public void DrawEllipse(Color fillColor) + { + EllipseMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = 0; + mesh.startDegree = 0; + mesh.endDegreee = 360; + mesh.fillColor = null; + mesh.centerColor = null; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void DrawEllipse(float lineSize, Color centerColor, Color lineColor, Color fillColor, float startDegree, float endDegree) + { + EllipseMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = lineSize; + if (centerColor.Equals(fillColor)) + mesh.centerColor = null; + else + mesh.centerColor = centerColor; + mesh.lineColor = lineColor; + mesh.fillColor = null; + mesh.startDegree = startDegree; + mesh.endDegreee = endDegree; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + public void DrawPolygon(IList points, Color fillColor) + { + PolygonMesh mesh = graphics.GetMeshFactory(); + mesh.points.Clear(); + mesh.points.AddRange(points); + mesh.fillColor = null; + mesh.colors = null; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + public void DrawPolygon(IList points, Color32[] colors) + { + PolygonMesh mesh = graphics.GetMeshFactory(); + mesh.points.Clear(); + mesh.points.AddRange(points); + mesh.fillColor = null; + mesh.colors = colors; + + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + /// + /// + public void DrawPolygon(IList points, Color fillColor, float lineSize, Color lineColor) + { + PolygonMesh mesh = graphics.GetMeshFactory(); + mesh.points.Clear(); + mesh.points.AddRange(points); + mesh.fillColor = null; + mesh.lineWidth = lineSize; + mesh.lineColor = lineColor; + mesh.colors = null; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void DrawRegularPolygon(int sides, float lineSize, Color centerColor, Color lineColor, Color fillColor, float rotation, float[] distances) + { + RegularPolygonMesh mesh = graphics.GetMeshFactory(); + mesh.sides = sides; + mesh.lineWidth = lineSize; + mesh.centerColor = centerColor; + mesh.lineColor = lineColor; + mesh.fillColor = null; + mesh.rotation = rotation; + mesh.distances = distances; + + graphics.color = fillColor; + graphics.SetMeshDirty(); + } + + /// + /// + /// + public void Clear() + { + graphics.meshFactory = null; + } + + /// + /// + /// + public bool isEmpty + { + get { return graphics.meshFactory == null; } + } + + protected override DisplayObject HitTest() + { + if (graphics.meshFactory == null) + return null; + + Vector2 localPoint = WorldToLocal(HitTestContext.worldPoint, HitTestContext.direction); + + IHitTest ht = graphics.meshFactory as IHitTest; + if (ht != null) + return ht.HitTest(_contentRect, localPoint) ? this : null; + else if (_contentRect.Contains(localPoint)) + return this; + else + return null; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs.meta new file mode 100644 index 00000000..bed9f0f1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Shape.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cbcf11c269a33474aa9adaafd9867711 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs new file mode 100644 index 00000000..419cc9d0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs @@ -0,0 +1,1768 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +#if UNITY_5_3_OR_NEWER + +using UnityEngine.SceneManagement; + +#endif + +namespace FairyGUI +{ + /// + /// + /// + public class Stage : Container + { + [Obsolete("Use size.y")] + public int stageHeight + { get { return (int)_contentRect.height; } } + + [Obsolete("Use size.x")] + public int stageWidth + { get { return (int)_contentRect.width; } } + + /// + /// + /// + public float soundVolume { get; set; } + + public event Action beforeUpdate; + + public event Action afterUpdate; + + private DisplayObject _touchTarget; + private DisplayObject _focused; + private InputTextField _lastInput; + private bool _IMEComposite; + private UpdateContext _updateContext; + private List _rollOutChain; + private List _rollOverChain; + private TouchInfo[] _touches; + private int _touchCount; + private Vector2 _touchPosition; + private int _frameGotHitTarget; + private int _frameGotTouchPosition; + private bool _customInput; + private Vector2 _customInputPos; + private bool _customInputButtonDown; + private AudioSource _audio; + private List _toCollectTextures = new List(); + private EventListener _onStageResized; + private List _focusOutChain; + private List _focusInChain; + private List _focusHistory; + private Container _nextFocus; + + private class CursorDef + { + public Texture2D texture; + public Vector2 hotspot; + } + + private Dictionary _cursors; + private string _currentCursor; + + private static bool _touchScreen; + internal static int _clickTestThreshold; +#pragma warning disable 0649 + private static IKeyboard _keyboard; +#pragma warning restore 0649 + + private static Stage _inst; + + /// + /// + /// + public static Stage inst + { + get + { + if (_inst == null) + Instantiate(); + + return _inst; + } + } + + /// + /// + /// + public static void Instantiate() + { + if (_inst == null) + { + _inst = new Stage(); + GRoot._inst = new GRoot(); + GRoot._inst.ApplyContentScaleFactor(); + _inst.AddChild(GRoot._inst.displayObject); + + StageCamera.CheckMainCamera(); + } + } + + /// + /// 如果是true,表示触摸输入,将使用Input.GetTouch接å£è¯»å–触摸å±è¾“入。 + /// 如果是false,表示使用鼠标输入,将使用Input.GetMouseButtonXXX接å£è¯»å–鼠标输入。 + /// 一般æ¥è¯´ï¼Œä¸éœ€è¦è®¾ç½®ï¼Œåº•层会自动根æ®ç³»ç»ŸçŽ¯å¢ƒè®¾ç½®æ­£ç¡®çš„å€¼ã€‚ + /// + public static bool touchScreen + { + get { return _touchScreen; } + set + { + _touchScreen = value; + if (_touchScreen) + { +#if !(UNITY_WEBPLAYER || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR) + _keyboard = new FairyGUI.TouchScreenKeyboard(); + keyboardInput = true; +#endif + _clickTestThreshold = 50; + } + else + { + _keyboard = null; + keyboardInput = false; + Stage.inst.ResetInputState(); + _clickTestThreshold = 10; + } + } + } + + /// + /// 如果是true,表示使用å±å¹•上弹出的键盘输入文字。常è§äºŽç§»åŠ¨è®¾å¤‡ã€‚ + /// 如果是falseï¼Œè¡¨ç¤ºæ˜¯æŽ¥å—æŒ‰é”®æ¶ˆæ¯è¾“入文字。常è§äºŽPC。 + /// 一般æ¥è¯´ï¼Œä¸éœ€è¦è®¾ç½®ï¼Œåº•层会自动根æ®ç³»ç»ŸçŽ¯å¢ƒè®¾ç½®æ­£ç¡®çš„å€¼ã€‚ + /// + public static bool keyboardInput + { + get; set; + } + + /// + /// + /// + public static bool isTouchOnUI + { + get + { + return _inst != null && _inst.touchTarget != null; + } + } + + /// + /// As unity does not provide ways to detect this, you should set it by yourself. + /// This will effect: + /// 1. compoistion cursor pos. + /// 2. mouse wheel speed. + /// + public static float devicePixelRatio + { + get; set; + } + + /// + /// + /// + public Stage() + : base() + { + _inst = this; + soundVolume = 1; + + _updateContext = new UpdateContext(); + _frameGotHitTarget = -1; + + _touches = new TouchInfo[5]; + for (int i = 0; i < _touches.Length; i++) + _touches[i] = new TouchInfo(); + + bool isOSX = Application.platform == RuntimePlatform.OSXPlayer + || Application.platform == RuntimePlatform.OSXEditor; + if (Application.platform == RuntimePlatform.WindowsPlayer + || Application.platform == RuntimePlatform.WindowsEditor + || isOSX) + touchScreen = false; + else + touchScreen = Input.touchSupported && SystemInfo.deviceType != DeviceType.Desktop; + //在PC上,是å¦retinaå±å¯¹è¾“入法ä½ç½®ï¼Œé¼ æ ‡æ»šè½®é€Ÿåº¦éƒ½æœ‰å½±å“,但现在没å‘现Unity有获得的方å¼ã€‚仅判断是å¦Macå¯èƒ½ä¸å¤Ÿï¼ˆå¤–接显示器的情况)。所以最好自行设置。 + devicePixelRatio = (isOSX && Screen.dpi > 96) ? 2 : 1; + + _rollOutChain = new List(); + _rollOverChain = new List(); + _focusOutChain = new List(); + _focusInChain = new List(); + _focusHistory = new List(); + _cursors = new Dictionary(); + + SetSize(Screen.width, Screen.height); + this.cachedTransform.localScale = new Vector3(StageCamera.DefaultUnitsPerPixel, StageCamera.DefaultUnitsPerPixel, StageCamera.DefaultUnitsPerPixel); + + StageEngine engine = GameObject.FindObjectOfType(); + if (engine != null) + UnityEngine.Object.Destroy(engine.gameObject); + + this.gameObject.name = "Stage"; + this.gameObject.layer = LayerMask.NameToLayer(StageCamera.LayerName); + this.gameObject.AddComponent(); + this.gameObject.AddComponent(); + this.gameObject.SetActive(true); + UnityEngine.Object.DontDestroyOnLoad(this.gameObject); + + EnableSound(); + + Timers.inst.Add(5, 0, RunTextureCollector); + +#if UNITY_5_4_OR_NEWER + SceneManager.sceneLoaded += SceneManager_sceneLoaded; +#endif + } + +#if UNITY_5_4_OR_NEWER + + private void SceneManager_sceneLoaded(Scene scene, LoadSceneMode mode) + { + StageCamera.CheckMainCamera(); + } + +#endif + + public override void Dispose() + { + base.Dispose(); + + Timers.inst.Remove(RunTextureCollector); + +#if UNITY_5_4_OR_NEWER + SceneManager.sceneLoaded -= SceneManager_sceneLoaded; +#endif + } + + /// + /// + /// + public EventListener onStageResized + { + get { return _onStageResized ?? (_onStageResized = new EventListener(this, "onStageResized")); } + } + + /// + /// + /// + public DisplayObject touchTarget + { + get + { + if (_frameGotHitTarget != Time.frameCount) + GetHitTarget(); + + if (_touchTarget == this) + return null; + else + return _touchTarget; + } + } + + /// + /// + /// + public DisplayObject focus + { + get + { + if (_focused != null && _focused.isDisposed) + _focused = null; + return _focused; + } + set + { + SetFocus(value); + } + } + + public void SetFocus(DisplayObject newFocus, bool byKey = false) + { + if (newFocus == this) + newFocus = null; + + _nextFocus = null; + + if (_focused == newFocus) + return; + + Container navRoot = null; + DisplayObject element = newFocus; + while (element != null) + { + if (!element.focusable) + return; + else if ((element is Container) && ((Container)element).tabStopChildren) + { + if (navRoot == null) + navRoot = element as Container; + } + + element = element.parent; + } + + DisplayObject oldFocus = _focused; + _focused = newFocus; + + if (navRoot != null) + { + navRoot._lastFocus = _focused; + int pos = _focusHistory.IndexOf(navRoot); + if (pos != -1) + { + if (pos < _focusHistory.Count - 1) + _focusHistory.RemoveRange(pos + 1, _focusHistory.Count - pos - 1); + } + else + { + _focusHistory.Add(navRoot); + if (_focusHistory.Count > 10) + _focusHistory.RemoveAt(0); + } + } + + _focusInChain.Clear(); + _focusOutChain.Clear(); + + element = oldFocus; + while (element != null) + { + if (element.focusable) + _focusOutChain.Add(element); + element = element.parent; + } + + element = _focused; + int i; + while (element != null) + { + i = _focusOutChain.IndexOf(element); + if (i != -1) + { + _focusOutChain.RemoveRange(i, _focusOutChain.Count - i); + break; + } + if (element.focusable) + _focusInChain.Add(element); + + element = element.parent; + } + + int cnt = _focusOutChain.Count; + if (cnt > 0) + { + for (i = 0; i < cnt; i++) + { + element = _focusOutChain[i]; + if (element.stage != null) + { + element.DispatchEvent("onFocusOut", null); + if (_focused != newFocus) //focus changed in event + return; + } + } + _focusOutChain.Clear(); + } + + cnt = _focusInChain.Count; + if (cnt > 0) + { + for (i = 0; i < cnt; i++) + { + element = _focusInChain[i]; + if (element.stage != null) + { + element.DispatchEvent("onFocusIn", byKey ? "key" : null); + if (_focused != newFocus) //focus changed in event + return; + } + } + _focusInChain.Clear(); + } + + if (_focused is InputTextField) + _lastInput = (InputTextField)_focused; + } + + internal void _OnFocusRemoving(Container sender) + { + _nextFocus = sender; + if (_focusHistory.Count > 0) + { + int i = _focusHistory.Count - 1; + DisplayObject test = _focusHistory[i]; + DisplayObject element = _focused; + while (element != null && element != sender) + { + if ((element is Container) && ((Container)element).tabStopChildren && element == test) + { + i--; + if (i < 0) + break; + + test = _focusHistory[i]; + } + + element = element.parent; + } + + if (i != _focusHistory.Count - 1) + { + _focusHistory.RemoveRange(i + 1, _focusHistory.Count - i - 1); + if (_focusHistory.Count > 0) + _nextFocus = _focusHistory[_focusHistory.Count - 1]; + } + } + + if (_focused is InputTextField) + _lastInput = null; + _focused = null; + } + + /// + /// + /// + /// + public void DoKeyNavigate(bool backward) + { + Container navBase = null; + DisplayObject element = _focused; + while (element != null) + { + if ((element is Container) && ((Container)element).tabStopChildren) + { + navBase = element as Container; + break; + } + + element = element.parent; + } + + if (navBase == null) + navBase = this; + + var it = navBase.GetDescendants(backward); + bool started = _focused == null; + DisplayObject test2 = _focused != null ? _focused.parent : null; + + while (it.MoveNext()) + { + DisplayObject dobj = it.Current; + if (started) + { + if (dobj == test2) + test2 = test2.parent; + else if (dobj._AcceptTab()) + return; + } + else if (dobj == _focused) + started = true; + } + + if (started) + { + it.Reset(); + while (it.MoveNext()) + { + DisplayObject dobj = it.Current; + if (dobj == _focused) + break; + + if (dobj == test2) + test2 = test2.parent; + else if (dobj._AcceptTab()) + return; + } + } + } + + /// + /// + /// + public Vector2 touchPosition + { + get + { + UpdateTouchPosition(); + return _touchPosition; + } + } + + /// + /// + /// + /// + /// + public Vector2 GetTouchPosition(int touchId) + { + UpdateTouchPosition(); + + if (touchId < 0) + return _touchPosition; + + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + if (touch.touchId == touchId) + return new Vector2(touch.x, touch.y); + } + + return _touchPosition; + } + + /// + /// + /// + /// + /// + public DisplayObject GetTouchTarget(int touchId) + { + if (_frameGotHitTarget != Time.frameCount) + GetHitTarget(); + + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + if (touch.touchId == touchId) + return touch.target != this ? touch.target : null; + } + + return null; + } + + /// + /// + /// + public int touchCount + { + get { return _touchCount; } + } + + public int[] GetAllTouch(int[] result) + { + if (result == null) + result = new int[_touchCount]; + int i = 0; + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + if (touch.touchId != -1) + { + result[i++] = touch.touchId; + if (i >= result.Length) + break; + } + } + return result; + } + + /// + /// + /// + public void ResetInputState() + { + for (int j = 0; j < 5; j++) + _touches[j].Reset(); + + if (!touchScreen) + _touches[0].touchId = 0; + + _touchCount = 0; + } + + /// + /// + /// + /// + public void CancelClick(int touchId) + { + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + if (touch.touchId == touchId) + touch.clickCancelled = true; + } + } + + /// + /// + /// + public void EnableSound() + { + if (_audio == null) + { + _audio = gameObject.AddComponent(); + _audio.bypassEffects = true; + } + } + + /// + /// + /// + public void DisableSound() + { + if (_audio != null) + { + UnityEngine.Object.Destroy(_audio); + _audio = null; + } + } + + /// + /// + /// + /// + /// + public void PlayOneShotSound(AudioClip clip, float volumeScale) + { + if (_audio != null && this.soundVolume > 0) + _audio.PlayOneShot(clip, volumeScale * this.soundVolume); + } + + /// + /// + /// + /// + public void PlayOneShotSound(AudioClip clip) + { + if (_audio != null && this.soundVolume > 0) + _audio.PlayOneShot(clip, this.soundVolume); + } + + /// + /// + /// + public IKeyboard keyboard + { + get { return _keyboard; } + set { _keyboard = value; } + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void OpenKeyboard(string text, bool autocorrection, bool multiline, bool secure, + bool alert, string textPlaceholder, int keyboardType, bool hideInput) + { + if (_keyboard != null) + { + _keyboard.Open(text, autocorrection, multiline, secure, alert, textPlaceholder, keyboardType, hideInput); + } + } + + /// + /// + /// + public void CloseKeyboard() + { + if (_keyboard != null) + { + _keyboard.Close(); + } + } + + /// + /// 输入字符到当å‰å…‰æ ‡ä½ç½® + /// + /// + public void InputString(string value) + { + if (_lastInput != null) + _lastInput.ReplaceSelection(value); + } + + /// + /// + /// + /// + /// + public void SetCustomInput(Vector2 screenPos, bool buttonDown) + { + _customInput = true; + _customInputButtonDown = buttonDown; + _customInputPos = screenPos; + _frameGotHitTarget = 0; + } + + /// + /// + /// + /// + /// + /// + public void SetCustomInput(Vector2 screenPos, bool buttonDown, bool buttonUp) + { + _customInput = true; + if (buttonDown) + _customInputButtonDown = true; + else if (buttonUp) + _customInputButtonDown = false; + _customInputPos = screenPos; + _frameGotHitTarget = 0; + } + + /// + /// + /// + /// + /// + public void SetCustomInput(ref RaycastHit hit, bool buttonDown) + { + Vector2 screenPos = HitTestContext.cachedMainCamera.WorldToScreenPoint(hit.point); + HitTestContext.CacheRaycastHit(HitTestContext.cachedMainCamera, ref hit); + SetCustomInput(screenPos, buttonDown); + } + + /// + /// + /// + /// + /// + /// + public void SetCustomInput(ref RaycastHit hit, bool buttonDown, bool buttonUp) + { + Vector2 screenPos = HitTestContext.cachedMainCamera.WorldToScreenPoint(hit.point); + HitTestContext.CacheRaycastHit(HitTestContext.cachedMainCamera, ref hit); + SetCustomInput(screenPos, buttonDown, buttonUp); + } + + public void ForceUpdate() + { + _updateContext.Begin(); + Update(_updateContext); + _updateContext.End(); + } + + internal void InternalUpdate() + { + HandleEvents(); + + if (_nextFocus != null) + { + if (_nextFocus.stage != null) + { + if (_nextFocus.tabStopChildren) + { + if (_nextFocus._lastFocus != null && _nextFocus.IsAncestorOf(_nextFocus._lastFocus)) + SetFocus(_nextFocus._lastFocus); + else + SetFocus(_nextFocus); + } + else + SetFocus(_nextFocus); + } + _nextFocus = null; + } + + if (beforeUpdate != null) + beforeUpdate(); + + _updateContext.Begin(); + Update(_updateContext); + _updateContext.End(); + + if (BaseFont.textRebuildFlag) + { + //å­—ä½“è´´å›¾æ›´æ”¹äº†ï¼Œé‡æ–°æ¸²æŸ“一é,防止本帧文字显示错误 + _updateContext.Begin(); + Update(_updateContext); + _updateContext.End(); + + BaseFont.textRebuildFlag = false; + } + + if (afterUpdate != null) + afterUpdate(); + } + + private void GetHitTarget() + { + if (_frameGotHitTarget == Time.frameCount) + return; + + _frameGotHitTarget = Time.frameCount; + + if (_customInput) + { + Vector2 pos = _customInputPos; + pos.y = _contentRect.height - pos.y; + + TouchInfo touch = _touches[0]; + _touchTarget = HitTest(pos, true); + touch.target = _touchTarget; + } + else if (touchScreen) + { + _touchTarget = null; + for (int i = 0; i < Input.touchCount; ++i) + { + Touch uTouch = Input.GetTouch(i); + + Vector2 pos = uTouch.position; + pos.y = _contentRect.height - pos.y; + + TouchInfo touch = null; + TouchInfo free = null; + for (int j = 0; j < 5; j++) + { + if (_touches[j].touchId == uTouch.fingerId) + { + touch = _touches[j]; + break; + } + + if (_touches[j].touchId == -1) + free = _touches[j]; + } + if (touch == null) + { + touch = free; + if (touch == null || uTouch.phase != TouchPhase.Began) + continue; + + touch.touchId = uTouch.fingerId; + } + + if (uTouch.phase == TouchPhase.Stationary) + _touchTarget = touch.target; + else + { + _touchTarget = HitTest(pos, true); + touch.target = _touchTarget; + } + } + } + else + { + Vector2 pos = Input.mousePosition; + pos.y = Screen.height - pos.y; + TouchInfo touch = _touches[0]; + if (pos.x < 0 || pos.y < 0) //outside of the window + _touchTarget = this; + else + _touchTarget = HitTest(pos, true); + touch.target = _touchTarget; + } + + HitTestContext.ClearRaycastHitCache(); + } + + internal void HandleScreenSizeChanged(int screenWidth, int screenHeight, float unitsPerPixel) + { + SetSize(screenWidth, screenHeight); + this.cachedTransform.localScale = new Vector3(unitsPerPixel, unitsPerPixel, unitsPerPixel); + + if (!DispatchEvent("onStageResized", null)) + { + UIContentScaler scaler = this.gameObject.GetComponent(); + scaler.ApplyChange(); + GRoot.inst.ApplyContentScaleFactor(); + } + } + + internal void HandleGUIEvents(Event evt) + { + if (evt.rawType == EventType.KeyDown) + { + if (_IMEComposite && Input.compositionString.Length == 0) + { + _IMEComposite = false; + //eat one key on IME closing + if (evt.keyCode != KeyCode.None) + return; + } + + TouchInfo touch = _touches[0]; + touch.keyCode = evt.keyCode; + touch.modifiers = evt.modifiers; + touch.character = evt.character; + + touch.UpdateEvent(); + DisplayObject f = this.focus; + if (f != null) + f.BubbleEvent("onKeyDown", touch.evt); + else + DispatchEvent("onKeyDown", touch.evt); + } + else if (evt.rawType == EventType.KeyUp) + { + TouchInfo touch = _touches[0]; + touch.keyCode = evt.keyCode; + touch.modifiers = evt.modifiers; + touch.character = evt.character; + + touch.UpdateEvent(); + DisplayObject f = this.focus; + if (f != null) + f.BubbleEvent("onKeyUp", touch.evt); + else + DispatchEvent("onKeyUp", touch.evt); + } +#if UNITY_2017_1_OR_NEWER + else if (evt.type == EventType.ScrollWheel) +#else + else if (evt.type == EventType.scrollWheel) +#endif + { + if (_touchTarget != null) + { + TouchInfo touch = _touches[0]; + touch.mouseWheelDelta = evt.delta.y; + touch.UpdateEvent(); + _touchTarget.BubbleEvent("onMouseWheel", touch.evt); + touch.mouseWheelDelta = 0; + } + } + } + + private void HandleEvents() + { + GetHitTarget(); + + UpdateTouchPosition(); + + if (_customInput) + { + HandleCustomInput(); + _customInput = false; + } + else if (touchScreen) + HandleTouchEvents(); + else + HandleMouseEvents(); + + if (_focused is InputTextField) + HandleTextInput(); + } + + private void UpdateTouchPosition() + { + if (_frameGotTouchPosition != Time.frameCount) + { + _frameGotTouchPosition = Time.frameCount; + if (_customInput) + { + _touchPosition = _customInputPos; + _touchPosition.y = _contentRect.height - _touchPosition.y; + } + else if (touchScreen) + { + for (int i = 0; i < Input.touchCount; ++i) + { + Touch uTouch = Input.GetTouch(i); + _touchPosition = uTouch.position; + _touchPosition.y = _contentRect.height - _touchPosition.y; + } + } + else + { + Vector2 pos = Input.mousePosition; + if (pos.x >= 0 && pos.y >= 0) //ç¼–è¾‘å™¨çŽ¯å¢ƒä¸‹åæ ‡æœ‰æ—¶æ˜¯è´Ÿ + { + pos.y = _contentRect.height - pos.y; + _touchPosition = pos; + } + } + } + } + + private void HandleTextInput() + { + _IMEComposite = Input.compositionString.Length > 0; + + InputTextField textField = (InputTextField)_focused; + if (!textField.editable) + return; + + if (keyboardInput) + { + if (textField.keyboardInput && _keyboard != null) + { + string s = _keyboard.GetInput(); + if (s != null) + { + if (_keyboard.supportsCaret) + textField.ReplaceSelection(s); + else + textField.ReplaceText(s); + } + + if (_keyboard.done) + SetFocus(null); + } + } + else + textField.CheckComposition(); + } + + private void HandleCustomInput() + { + Vector2 pos = _customInputPos; + pos.y = _contentRect.height - pos.y; + TouchInfo touch = _touches[0]; + + if (touch.x != pos.x || touch.y != pos.y) + { + touch.x = pos.x; + touch.y = pos.y; + touch.Move(); + } + + if (touch.lastRollOver != touch.target) + HandleRollOver(touch); + + if (_customInputButtonDown) + { + if (!touch.began) + { + _touchCount = 1; + touch.Begin(); + touch.button = 0; + touch.touchId = 0; + SetFocus(touch.target); + + touch.UpdateEvent(); + touch.target.BubbleEvent("onTouchBegin", touch.evt); + } + } + else if (touch.began) + { + _touchCount = 0; + touch.End(); + + DisplayObject clickTarget = touch.ClickTest(); + if (clickTarget != null) + { + touch.UpdateEvent(); + clickTarget.BubbleEvent("onClick", touch.evt); + } + + touch.button = -1; + } + } + + private void HandleMouseEvents() + { + TouchInfo touch = _touches[0]; + if (touch.x != _touchPosition.x || touch.y != _touchPosition.y) + { + touch.x = _touchPosition.x; + touch.y = _touchPosition.y; + touch.Move(); + } + + if (touch.lastRollOver != touch.target) + HandleRollOver(touch); + + if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2)) + { + if (!touch.began) + { + _touchCount = 1; + touch.Begin(); + touch.button = Input.GetMouseButtonDown(2) ? 2 : (Input.GetMouseButtonDown(1) ? 1 : 0); + SetFocus(touch.target); + + touch.UpdateEvent(); + touch.target.BubbleEvent("onTouchBegin", touch.evt); + } + } + if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2)) + { + if (touch.began) + { + _touchCount = 0; + touch.End(); + + DisplayObject clickTarget = touch.ClickTest(); + if (clickTarget != null) + { + touch.UpdateEvent(); + + if (Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2)) + clickTarget.BubbleEvent("onRightClick", touch.evt); + else + clickTarget.BubbleEvent("onClick", touch.evt); + } + + touch.button = -1; + } + } + + //We have to do this, coz the cursor will auto change back after a click or dragging + if (Input.GetMouseButtonUp(0) && _currentCursor != null) + _ChangeCursor(_currentCursor); + } + + private void HandleTouchEvents() + { + int tc = Input.touchCount; + for (int i = 0; i < tc; ++i) + { + Touch uTouch = Input.GetTouch(i); + + if (uTouch.phase == TouchPhase.Stationary) + continue; + + Vector2 pos = uTouch.position; + pos.y = _contentRect.height - pos.y; + + TouchInfo touch = null; + for (int j = 0; j < 5; j++) + { + if (_touches[j].touchId == uTouch.fingerId) + { + touch = _touches[j]; + break; + } + } + if (touch == null) + continue; + + if (touch.x != pos.x || touch.y != pos.y) + { + touch.x = pos.x; + touch.y = pos.y; + if (touch.began) + touch.Move(); + } + + if (touch.lastRollOver != touch.target) + HandleRollOver(touch); + + if (uTouch.phase == TouchPhase.Began) + { + if (!touch.began) + { + _touchCount++; + touch.Begin(); + touch.button = 0; + SetFocus(touch.target); + + touch.UpdateEvent(); + touch.target.BubbleEvent("onTouchBegin", touch.evt); + } + } + else if (uTouch.phase == TouchPhase.Canceled || uTouch.phase == TouchPhase.Ended) + { + if (touch.began) + { + _touchCount--; + touch.End(); + + if (uTouch.phase != TouchPhase.Canceled) + { + DisplayObject clickTarget = touch.ClickTest(); + if (clickTarget != null) + { + touch.clickCount = uTouch.tapCount; + touch.UpdateEvent(); + clickTarget.BubbleEvent("onClick", touch.evt); + } + } + + touch.target = null; + HandleRollOver(touch); + + touch.touchId = -1; + } + } + } + } + + public void ForceTouchEnd() + { + if (touchScreen) + { + int tc = Input.touchCount; + for (int i = 0; i < tc; ++i) + { + Touch uTouch = Input.GetTouch(i); + + if (uTouch.phase == TouchPhase.Stationary) + continue; + + Vector2 pos = uTouch.position; + pos.y = _contentRect.height - pos.y; + + TouchInfo touch = null; + for (int j = 0; j < 5; j++) + { + if (_touches[j].touchId == uTouch.fingerId) + { + touch = _touches[j]; + break; + } + } + if (touch == null) + continue; + + if (touch.began) + { + _touchCount--; + touch.End(); + + if (uTouch.phase != TouchPhase.Canceled) + { + DisplayObject clickTarget = touch.ClickTest(); + if (clickTarget != null) + { + touch.clickCount = uTouch.tapCount; + touch.UpdateEvent(); + clickTarget.BubbleEvent("onClick", touch.evt); + } + } + + touch.target = null; + HandleRollOver(touch); + + touch.touchId = -1; + } + } + } + else + { + TouchInfo touch = _touches[0]; + + if (touch.began) + { + _touchCount = 0; + touch.End(); + + DisplayObject clickTarget = touch.ClickTest(); + if (clickTarget != null) + { + touch.UpdateEvent(); + + if (Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2)) + clickTarget.BubbleEvent("onRightClick", touch.evt); + else + clickTarget.BubbleEvent("onClick", touch.evt); + } + + touch.button = -1; + } + + //We have to do this, coz the cursor will auto change back after a click or dragging + if (Input.GetMouseButtonUp(0) && _currentCursor != null) + _ChangeCursor(_currentCursor); + } + + + } + + private void HandleRollOver(TouchInfo touch) + { + DisplayObject element; + _rollOverChain.Clear(); + _rollOutChain.Clear(); + + element = touch.lastRollOver; + while (element != null) + { + _rollOutChain.Add(element); + element = element.parent; + } + + touch.lastRollOver = touch.target; + + string cursor = this.cursor; + if (cursor == null) + { + element = touch.target; + while (element != null) + { + if (element.cursor != null && cursor == null) + cursor = element.cursor; + element = element.parent; + } + } + + element = touch.target; + int i; + while (element != null) + { + i = _rollOutChain.IndexOf(element); + if (i != -1) + { + _rollOutChain.RemoveRange(i, _rollOutChain.Count - i); + break; + } + _rollOverChain.Add(element); + + element = element.parent; + } + + int cnt = _rollOutChain.Count; + if (cnt > 0) + { + for (i = 0; i < cnt; i++) + { + element = _rollOutChain[i]; + if (element.stage != null) + element.DispatchEvent("onRollOut", null); + } + _rollOutChain.Clear(); + } + + cnt = _rollOverChain.Count; + if (cnt > 0) + { + for (i = 0; i < cnt; i++) + { + element = _rollOverChain[i]; + if (element.stage != null) + element.DispatchEvent("onRollOver", null); + } + _rollOverChain.Clear(); + } + + if (cursor != _currentCursor) + _ChangeCursor(cursor); + } + + /// + /// 设置UIPanel/UIPainter等的渲染层次,由UIPanel等内部调用。开å‘者ä¸éœ€è¦è°ƒç”¨ã€‚ + /// + /// + /// + public void ApplyPanelOrder(Container target) + { + int sortingOrder = target._panelOrder; + int numChildren = this.numChildren; + int i = 0; + int j; + int curIndex = -1; + for (; i < numChildren; i++) + { + DisplayObject obj = GetChildAt(i); + if (obj == target) + { + curIndex = i; + continue; + } + + if (obj == GRoot.inst.displayObject) + j = 1000; + else if (obj is Container) + j = ((Container)obj)._panelOrder; + else + continue; + + if (sortingOrder <= j) + { + if (curIndex != -1) + AddChildAt(target, i - 1); + else + AddChildAt(target, i); + break; + } + } + if (i == numChildren) + AddChild(target); + } + + private static List sTempList1; + private static List sTempList2; + private static Dictionary sTempDict; + + /// + /// Adjust display order of all UIPanels rendering in worldspace by their z order. + /// + /// Only UIPanel.sortingOrder equals to this value will be involve in this sorting + public void SortWorldSpacePanelsByZOrder(int panelSortingOrder) + { + if (sTempList1 == null) + { + sTempList1 = new List(); + sTempList2 = new List(); + sTempDict = new Dictionary(); + } + + int numChildren = this.numChildren; + for (int i = 0; i < numChildren; i++) + { + Container obj = GetChildAt(i) as Container; + if (obj == null || obj.renderMode != RenderMode.WorldSpace || obj._panelOrder != panelSortingOrder) + continue; + + sTempDict[obj.id] = i; + + sTempList1.Add(obj); + sTempList2.Add(i); + } + + sTempList1.Sort((DisplayObject c1, DisplayObject c2) => + { + int ret = c2.cachedTransform.position.z.CompareTo(c1.cachedTransform.position.z); + if (ret == 0) + { + //如果大家z值一样,使用原æ¥çš„顺åºï¼Œé˜²æ­¢ä¸åœäº¤æ¢é¡ºåºï¼ˆé—ªçƒï¼‰ + return sTempDict[c1.id].CompareTo(sTempDict[c2.id]); + } + else + return ret; + }); + + ChangeChildrenOrder(sTempList2, sTempList1); + + sTempList1.Clear(); + sTempList2.Clear(); + sTempDict.Clear(); + } + + /// + /// + /// + /// + public void MonitorTexture(NTexture texture) + { + if (_toCollectTextures.IndexOf(texture) == -1) + _toCollectTextures.Add(texture); + } + + private void RunTextureCollector(object param) + { + int cnt = _toCollectTextures.Count; + float curTime = Time.time; + int i = 0; + while (i < cnt) + { + NTexture texture = _toCollectTextures[i]; + if (texture.disposed) + { + _toCollectTextures.RemoveAt(i); + cnt--; + } + else if (curTime - texture.lastActive > 5) + { + texture.Dispose(); + _toCollectTextures.RemoveAt(i); + cnt--; + } + else + i++; + } + } + + public void AddTouchMonitor(int touchId, EventDispatcher target) + { + TouchInfo touch = null; + for (int j = 0; j < 5; j++) + { + touch = _touches[j]; + if (touchId == -1 && touch.touchId != -1 + || touchId != -1 && touch.touchId == touchId) + break; + } + if (touch.touchMonitors.IndexOf(target) == -1) + touch.touchMonitors.Add(target); + } + + public void RemoveTouchMonitor(EventDispatcher target) + { + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + int i = touch.touchMonitors.IndexOf(target); + if (i != -1) + touch.touchMonitors[i] = null; + } + } + + public bool IsTouchMonitoring(EventDispatcher target) + { + for (int j = 0; j < 5; j++) + { + TouchInfo touch = _touches[j]; + int i = touch.touchMonitors.IndexOf(target); + if (i != -1) + return true; + } + + return false; + } + + internal Transform CreatePoolManager(string name) + { + GameObject go = new GameObject("[" + name + "]"); + go.SetActive(false); + + Transform t = go.transform; + t.SetParent(cachedTransform, false); + + return t; + } + + /// + /// + /// + /// + /// + /// + public void RegisterCursor(string cursorName, Texture2D texture, Vector2 hotspot) + { + _cursors[cursorName] = new CursorDef() { texture = texture, hotspot = hotspot }; + } + + /// + /// + /// + /// + public string activeCursor + { + get { return _currentCursor; } + } + + /// + /// + /// + /// + internal void _ChangeCursor(string cursorName) + { + CursorDef cursorDef; + if (cursorName != null && _cursors.TryGetValue(cursorName, out cursorDef)) + { + if (_currentCursor == cursorName) + Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); + _currentCursor = cursorName; + Cursor.SetCursor(cursorDef.texture, cursorDef.hotspot, CursorMode.Auto); + } + else + { + _currentCursor = null; + Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); + } + } + } + + internal class TouchInfo + { + public float x; + public float y; + public int touchId; + public int clickCount; + public KeyCode keyCode; + public char character; + public EventModifiers modifiers; + public float mouseWheelDelta; + public int button; + + public float downX; + public float downY; + public float downTime; + public int downFrame; + public bool began; + public bool clickCancelled; + public float lastClickTime; + public float lastClickX; + public float lastClickY; + public int lastClickButton; + public float holdTime; + public DisplayObject target; + public List downTargets; + public DisplayObject lastRollOver; + public List touchMonitors; + + public InputEvent evt; + + private static List sHelperChain = new List(); + + public TouchInfo() + { + evt = new InputEvent(); + downTargets = new List(); + touchMonitors = new List(); + Reset(); + } + + public void Reset() + { + touchId = -1; + x = 0; + y = 0; + clickCount = 0; + button = -1; + keyCode = KeyCode.None; + character = '\0'; + modifiers = 0; + mouseWheelDelta = 0; + lastClickTime = 0; + began = false; + target = null; + downTargets.Clear(); + lastRollOver = null; + clickCancelled = false; + touchMonitors.Clear(); + } + + public void UpdateEvent() + { + evt.touchId = this.touchId; + evt.x = this.x; + evt.y = this.y; + evt.clickCount = this.clickCount; + evt.keyCode = this.keyCode; + evt.character = this.character; + evt.modifiers = this.modifiers; + evt.mouseWheelDelta = this.mouseWheelDelta; + evt.button = this.button; + evt.holdTime = this.holdTime; + } + + public void Begin() + { + began = true; + clickCancelled = false; + downX = x; + downY = y; + downTime = Time.unscaledTime; + downFrame = Time.frameCount; + holdTime = 0; + + downTargets.Clear(); + if (target != null) + { + downTargets.Add(target); + DisplayObject obj = target; + while (obj != null) + { + downTargets.Add(obj); + obj = obj.parent; + } + } + } + + public void Move() + { + if (began) + holdTime = (Time.frameCount - downFrame) == 1 ? (1f / Application.targetFrameRate) : (Time.unscaledTime - downTime); + + UpdateEvent(); + + if (Mathf.Abs(x - downX) > 50 || Mathf.Abs(y - downY) > 50) clickCancelled = true; + + if (touchMonitors.Count > 0) + { + int len = touchMonitors.Count; + for (int i = 0; i < len; i++) + { + EventDispatcher e = touchMonitors[i]; + if (e != null) + { + if ((e is DisplayObject) && ((DisplayObject)e).stage == null) + continue; + if ((e is GObject) && !((GObject)e).onStage) + continue; + e.GetChainBridges("onTouchMove", sHelperChain, false); + } + } + + Stage.inst.BubbleEvent("onTouchMove", evt, sHelperChain); + sHelperChain.Clear(); + } + else + Stage.inst.DispatchEvent("onTouchMove", evt); + } + + public void End() + { + began = false; + + if (downTargets.Count == 0 + || clickCancelled + || Mathf.Abs(x - downX) > Stage._clickTestThreshold + || Mathf.Abs(y - downY) > Stage._clickTestThreshold) + { + clickCancelled = true; + lastClickTime = 0; + clickCount = 1; + } + else + { + if (Time.unscaledTime - lastClickTime < 0.35f + && Mathf.Abs(x - lastClickX) < Stage._clickTestThreshold + && Mathf.Abs(y - lastClickY) < Stage._clickTestThreshold + && lastClickButton == button) + { + if (clickCount == 2) + clickCount = 1; + else + clickCount++; + } + else + clickCount = 1; + lastClickTime = Time.unscaledTime; + lastClickX = x; + lastClickY = y; + lastClickButton = button; + } + + //当间隔一帧时,使用帧率计算时间,é¿å…掉帧因素 + holdTime = (Time.frameCount - downFrame) == 1 ? (1f / Application.targetFrameRate) : (Time.unscaledTime - downTime); + UpdateEvent(); + + if (touchMonitors.Count > 0) + { + int len = touchMonitors.Count; + for (int i = 0; i < len; i++) + { + EventDispatcher e = touchMonitors[i]; + if (e != null) + e.GetChainBridges("onTouchEnd", sHelperChain, false); + } + target.BubbleEvent("onTouchEnd", evt, sHelperChain); + + touchMonitors.Clear(); + sHelperChain.Clear(); + } + else + target.BubbleEvent("onTouchEnd", evt); + } + + public DisplayObject ClickTest() + { + if (clickCancelled) + { + downTargets.Clear(); + return null; + } + + DisplayObject obj = downTargets[0]; + if (obj.stage != null) //ä¾ç„¶æ´¾å‘到原æ¥çš„downTarget,虽然å¯èƒ½å®ƒå·²ç»å离当å‰ä½ç½®ï¼Œä¸»è¦æ˜¯ä¸ºäº†æ­£ç¡®å¤„ç†ç‚¹å‡»ç¼©æ”¾çš„æ•ˆæžœ + { + downTargets.Clear(); + return obj; + } + + obj = target; + while (obj != null) + { + int i = downTargets.IndexOf(obj); + if (i != -1 && obj.stage != null) + break; + + obj = obj.parent; + } + + downTargets.Clear(); + + return obj; + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs.meta new file mode 100644 index 00000000..6e6d98f6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stage.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6650441f8140eae4c896682b7fd5b3e6 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs new file mode 100644 index 00000000..f6f7467b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs @@ -0,0 +1,196 @@ +using System; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Stage Camera is an orthographic camera for UI rendering. + /// + [ExecuteInEditMode] + [AddComponentMenu("FairyGUI/UI Camera")] + public class StageCamera : MonoBehaviour + { + /// + /// + /// + public bool constantSize = true; + + /// + /// + /// + [NonSerialized] + public float unitsPerPixel = 0.02f; + + [NonSerialized] + public Transform cachedTransform; + [NonSerialized] + public Camera cachedCamera; + + [NonSerialized] + int screenWidth; + [NonSerialized] + int screenHeight; + [NonSerialized] + bool isMain; + [NonSerialized] + Display _display; + + /// + /// + /// + [NonSerialized] + public static Camera main; + + /// + /// + /// + [NonSerialized] + public static int screenSizeVer = 1; + + public const string Name = "Stage Camera"; + public const string LayerName = "UI"; + + public static float DefaultCameraSize = 5; + public static float DefaultUnitsPerPixel = 0.02f; + + void OnEnable() + { + cachedTransform = this.transform; + cachedCamera = this.GetComponent(); + if (this.gameObject.name == Name) + { + main = cachedCamera; + isMain = true; + } + + if (Display.displays.Length > 1 && cachedCamera.targetDisplay != 0 && cachedCamera.targetDisplay < Display.displays.Length) + _display = Display.displays[cachedCamera.targetDisplay]; + + if (_display == null) + OnScreenSizeChanged(Screen.width, Screen.height); + else + OnScreenSizeChanged(_display.renderingWidth, _display.renderingHeight); + } + + void Update() + { + if (_display == null) + { + if (screenWidth != Screen.width || screenHeight != Screen.height) + OnScreenSizeChanged(Screen.width, Screen.height); + } + else + { + if (screenWidth != _display.renderingWidth || screenHeight != _display.renderingHeight) + OnScreenSizeChanged(_display.renderingWidth, _display.renderingHeight); + } + } + + void OnScreenSizeChanged(int newWidth, int newHeight) + { + if (newWidth == 0 || newHeight == 0) + return; + + screenWidth = newWidth; + screenHeight = newHeight; + + if (constantSize) + { + cachedCamera.orthographicSize = DefaultCameraSize; + unitsPerPixel = cachedCamera.orthographicSize * 2 / screenHeight; + } + else + { + unitsPerPixel = DefaultUnitsPerPixel; + cachedCamera.orthographicSize = screenHeight / 2 * unitsPerPixel; + } + cachedTransform.localPosition = new Vector3(cachedCamera.orthographicSize * screenWidth / screenHeight, -cachedCamera.orthographicSize); + + if (isMain) + { + screenSizeVer++; + if (Application.isPlaying) + Stage.inst.HandleScreenSizeChanged(screenWidth, screenHeight, unitsPerPixel); + else + { + UIContentScaler scaler = GameObject.FindObjectOfType(); + if (scaler != null) + scaler.ApplyChange(); + else + UIContentScaler.scaleFactor = 1; + } + } + } + + void OnRenderObject() + { + //Updateå’ŒOnGUI在EditMode的调用都ä¸é‚£ä¹ˆåŠæ—¶ï¼ŒOnRenderObject则比较频ç¹ï¼Œå¯ä»¥ä¿è¯ç•Œé¢åŠæ—¶åˆ·æ–°ã€‚所以使用OnRenderObject + if (isMain && !Application.isPlaying) + { + EMRenderSupport.Update(); + } + } + + public void ApplyModifiedProperties() + { + screenWidth = 0; //force OnScreenSizeChanged called in next update + } + + /// + /// Check if there is a stage camera in the scene. If none, create one. + /// + public static void CheckMainCamera() + { + if (GameObject.Find(Name) == null) + { + int layer = LayerMask.NameToLayer(LayerName); + CreateCamera(Name, 1 << layer); + } + + HitTestContext.cachedMainCamera = Camera.main; + } + + /// + /// + /// + public static void CheckCaptureCamera() + { + if (GameObject.Find(Name) == null) + { + int layer = LayerMask.NameToLayer(LayerName); + CreateCamera(Name, 1 << layer); + } + } + + /// + /// + /// + /// + /// + /// + public static Camera CreateCamera(string name, int cullingMask) + { + GameObject cameraObject = new GameObject(name); + Camera camera = cameraObject.AddComponent(); + camera.depth = 1; + camera.cullingMask = cullingMask; + camera.clearFlags = CameraClearFlags.Depth; + camera.orthographic = true; + camera.orthographicSize = DefaultCameraSize; + camera.nearClipPlane = -30; + camera.farClipPlane = 30; + +#if UNITY_5_4_OR_NEWER + camera.stereoTargetEye = StereoTargetEyeMask.None; +#endif + +#if UNITY_5_6_OR_NEWER + camera.allowHDR = false; + camera.allowMSAA = false; +#endif + cameraObject.AddComponent(); + + return camera; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs.meta new file mode 100644 index 00000000..a2a6f8cc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageCamera.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 367e80e3fa958344491a9a196a902b72 +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs new file mode 100644 index 00000000..f5181cde --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class StageEngine : MonoBehaviour + { + public int ObjectsOnStage; + public int GraphicsOnStage; + + public static bool beingQuit; + + void Start() + { + useGUILayout = false; + } + + void LateUpdate() + { + Stage.inst.InternalUpdate(); + + ObjectsOnStage = Stats.ObjectCount; + GraphicsOnStage = Stats.GraphicsCount; + } + + void OnGUI() + { + Stage.inst.HandleGUIEvents(Event.current); + } + +#if !UNITY_5_4_OR_NEWER + void OnLevelWasLoaded() + { + StageCamera.CheckMainCamera(); + } +#endif + + void OnApplicationQuit() + { + if (Application.isEditor) + { + beingQuit = true; + UIPackage.RemoveAllPackages(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs.meta new file mode 100644 index 00000000..db1d0227 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/StageEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0922848d650639f479e29635982d4a4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs new file mode 100644 index 00000000..16a15b41 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs @@ -0,0 +1,29 @@ + +namespace FairyGUI +{ + /// + /// + /// + public class Stats + { + /// + /// + /// + public static int ObjectCount; + + /// + /// + /// + public static int GraphicsCount; + + /// + /// + /// + public static int LatestObjectCreation; + + /// + /// + /// + public static int LatestGraphicsCreation; + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs.meta new file mode 100644 index 00000000..09c2e151 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Stats.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: baddfd53a8a771f4eaa567ee3eb2ccc0 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text.meta new file mode 100644 index 00000000..57906553 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b6a329985f59cbd4ba1618ac71c89d7d +folderAsset: yes +timeCreated: 1460480287 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs new file mode 100644 index 00000000..6e1e11c7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Base class for all kind of fonts. + /// + public class BaseFont + { + /// + /// The name of this font object. + /// + public string name; + + /// + /// The texture of this font object. + /// + public NTexture mainTexture; + + /// + /// Can this font be tinted? Will be true for dynamic font and fonts generated by BMFont. + /// + public bool canTint; + + /// + /// If true, it will use extra vertices to enhance bold effect + /// + public bool customBold; + + /// + /// If true, it will use extra vertices to enhance bold effect ONLY when it is in italic style. + /// + public bool customBoldAndItalic; + + /// + /// If true, it will use extra vertices(4 direction) to enhance outline effect + /// + public bool customOutline; + + /// + /// The shader for this font object. + /// + public string shader; + + /// + /// Keep text crisp. + /// + public bool keepCrisp; + + /// + /// + /// + public int version; + + protected internal static bool textRebuildFlag; + + protected const float SupScale = 0.58f; + protected const float SupOffset = 0.33f; + + virtual public void UpdateGraphics(NGraphics graphics) + { + } + + virtual public void SetFormat(TextFormat format, float fontSizeScale) + { + } + + virtual public void PrepareCharacters(string text) + { + } + + virtual public bool GetGlyph(char ch, out float width, out float height, out float baseline) + { + width = 0; + height = 0; + baseline = 0; + return false; + } + + virtual public int DrawGlyph(float x, float y, + List vertList, List uvList, List uv2List, List colList) + { + return 0; + } + + virtual public int DrawLine(float x, float y, float width, int fontSize, int type, + List vertList, List uvList, List uv2List, List colList) + { + return 0; + } + + virtual public bool HasCharacter(char ch) + { + return false; + } + + virtual public int GetLineHeight(int size) + { + return 0; + } + + virtual public void Dispose() + { + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs.meta new file mode 100644 index 00000000..d3203440 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BaseFont.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 242acb07eafac7a43a60dc4107fbd6b4 +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs new file mode 100644 index 00000000..92069acb --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs @@ -0,0 +1,177 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class BitmapFont : BaseFont + { + /// + /// + /// + public class BMGlyph + { + public float x; + public float y; + public float width; + public float height; + public int advance; + public int lineHeight; + public Vector2[] uv = new Vector2[4]; + public int channel;//0-n/a, 1-r,2-g,3-b,4-alpha + } + + /// + /// + /// + public int size; + + /// + /// + /// + public bool resizable; + + /// + /// Font generated by BMFont use channels. + /// + public bool hasChannel; + + protected Dictionary _dict; + protected BMGlyph _glyph; + float _scale; + + public BitmapFont() + { + this.canTint = true; + this.hasChannel = false; + this.customOutline = true; + this.shader = ShaderConfig.bmFontShader; + + _dict = new Dictionary(); + _scale = 1; + } + + public void AddChar(char ch, BMGlyph glyph) + { + _dict[ch] = glyph; + } + + override public void SetFormat(TextFormat format, float fontSizeScale) + { + if (resizable) + _scale = (float)format.size / size * fontSizeScale; + else + _scale = fontSizeScale; + + if (canTint) + format.FillVertexColors(vertexColors); + } + + override public bool GetGlyph(char ch, out float width, out float height, out float baseline) + { + if (ch == ' ') + { + width = Mathf.RoundToInt(size * _scale / 2); + height = Mathf.RoundToInt(size * _scale); + baseline = height; + _glyph = null; + return true; + } + else if (_dict.TryGetValue((int)ch, out _glyph)) + { + width = Mathf.RoundToInt(_glyph.advance * _scale); + height = Mathf.RoundToInt(_glyph.lineHeight * _scale); + baseline = height; + return true; + } + else + { + width = 0; + height = 0; + baseline = 0; + return false; + } + } + + static Vector3 bottomLeft; + static Vector3 topLeft; + static Vector3 topRight; + static Vector3 bottomRight; + + static Color32[] vertexColors = new Color32[4]; + + override public int DrawGlyph(float x, float y, + List vertList, List uvList, List uv2List, List colList) + { + if (_glyph == null) //space + return 0; + + topLeft.x = x + _glyph.x * _scale; + topLeft.y = y + (_glyph.lineHeight - _glyph.y) * _scale; + bottomRight.x = x + (_glyph.x + _glyph.width) * _scale; + bottomRight.y = topLeft.y - _glyph.height * _scale; + + topRight.x = bottomRight.x; + topRight.y = topLeft.y; + bottomLeft.x = topLeft.x; + bottomLeft.y = bottomRight.y; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + uvList.AddRange(_glyph.uv); + + if (hasChannel) + { + Vector2 channel = new Vector2(_glyph.channel, 0); + uv2List.Add(channel); + uv2List.Add(channel); + uv2List.Add(channel); + uv2List.Add(channel); + } + + if (canTint) + { + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + } + else + { + colList.Add(Color.white); + colList.Add(Color.white); + colList.Add(Color.white); + colList.Add(Color.white); + } + + return 4; + } + + override public bool HasCharacter(char ch) + { + return ch == ' ' || _dict.ContainsKey((int)ch); + } + + override public int GetLineHeight(int size) + { + if (_dict.Count > 0) + { + using (var et = _dict.GetEnumerator()) + { + et.MoveNext(); + if (resizable) + return Mathf.RoundToInt((float)et.Current.Value.lineHeight * size / this.size); + else + return et.Current.Value.lineHeight; + } + } + else + return 0; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs.meta new file mode 100644 index 00000000..5e76dfd9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/BitmapFont.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b1441c09e3389a046827b23ee409a37a +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs new file mode 100644 index 00000000..19f91693 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs @@ -0,0 +1,385 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class DynamicFont : BaseFont + { + Font _font; + int _size; + float _ascent; + float _lineHeight; + float _scale; + TextFormat _format; + FontStyle _style; + bool _boldVertice; + CharacterInfo _char; + CharacterInfo _lineChar; + bool _gotLineChar; + + public DynamicFont() + { + this.canTint = true; + this.keepCrisp = true; + this.customOutline = true; + this.shader = ShaderConfig.textShader; + } + + /// + /// + /// + /// + /// + /// + public DynamicFont(string name, Font font) : this() + { + this.name = name; + this.nativeFont = font; + } + + override public void Dispose() + { + Font.textureRebuilt -= textureRebuildCallback; + } + + public Font nativeFont + { + get { return _font; } + set + { + if (_font != null) + Font.textureRebuilt -= textureRebuildCallback; + + _font = value; + Font.textureRebuilt += textureRebuildCallback; + _font.hideFlags = DisplayObject.hideFlags; + _font.material.hideFlags = DisplayObject.hideFlags; + _font.material.mainTexture.hideFlags = DisplayObject.hideFlags; + + if (mainTexture != null) + mainTexture.Dispose(); + mainTexture = new NTexture(_font.material.mainTexture); + mainTexture.destroyMethod = DestroyMethod.None; + + // _ascent = _font.ascent; + // _lineHeight = _font.lineHeight; + _ascent = _font.fontSize; + _lineHeight = _font.fontSize * 1.25f; + } + } + + override public void SetFormat(TextFormat format, float fontSizeScale) + { + _format = format; + float size = format.size * fontSizeScale; + if (keepCrisp) + size *= UIContentScaler.scaleFactor; + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript || _format.specialStyle == TextFormat.SpecialStyle.Superscript) + size *= SupScale; + _size = Mathf.FloorToInt(size); + if (_size == 0) + _size = 1; + _scale = (float)_size / _font.fontSize; + + if (format.bold && !customBold) + { + if (format.italic) + { + if (customBoldAndItalic) + _style = FontStyle.Italic; + else + _style = FontStyle.BoldAndItalic; + } + else + _style = FontStyle.Bold; + } + else + { + if (format.italic) + _style = FontStyle.Italic; + else + _style = FontStyle.Normal; + } + + _boldVertice = format.bold && (customBold || (format.italic && customBoldAndItalic)); + format.FillVertexColors(vertexColors); + } + + override public void PrepareCharacters(string text) + { + _font.RequestCharactersInTexture(text, _size, _style); + } + + override public bool GetGlyph(char ch, out float width, out float height, out float baseline) + { + if (!_font.GetCharacterInfo(ch, out _char, _size, _style)) + { + if (ch == ' ') + { + //space may not be prepared, try again + _font.RequestCharactersInTexture(" ", _size, _style); + _font.GetCharacterInfo(ch, out _char, _size, _style); + } + else + { + width = height = baseline = 0; + return false; + } + } + + width = _char.advance; + height = _lineHeight * _scale; + baseline = _ascent * _scale; + if (_boldVertice) + width++; + + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript) + { + height /= SupScale; + baseline /= SupScale; + } + else if (_format.specialStyle == TextFormat.SpecialStyle.Superscript) + { + height = height / SupScale + baseline * SupOffset; + baseline *= (SupOffset + 1 / SupScale); + } + + height = Mathf.RoundToInt(height); + baseline = Mathf.RoundToInt(baseline); + + if (keepCrisp) + { + width /= UIContentScaler.scaleFactor; + height /= UIContentScaler.scaleFactor; + baseline /= UIContentScaler.scaleFactor; + } + + return true; + } + + static Vector3 bottomLeft; + static Vector3 topLeft; + static Vector3 topRight; + static Vector3 bottomRight; + + static Vector2 uvBottomLeft; + static Vector2 uvTopLeft; + static Vector2 uvTopRight; + static Vector2 uvBottomRight; + + static Color32[] vertexColors = new Color32[4]; + + static Vector3[] BOLD_OFFSET = new Vector3[] + { + new Vector3(-0.5f, 0f, 0f), + new Vector3(0.5f, 0f, 0f), + new Vector3(0f, -0.5f, 0f), + new Vector3(0f, 0.5f, 0f) + }; + + override public int DrawGlyph(float x, float y, + List vertList, List uvList, List uv2List, List colList) + { + topLeft.x = _char.minX; + topLeft.y = _char.maxY; + bottomRight.x = _char.maxX; + if (_char.glyphWidth == 0) //zero width, space etc + bottomRight.x = topLeft.x + _size / 2; + bottomRight.y = _char.minY; + + if (keepCrisp) + { + topLeft /= UIContentScaler.scaleFactor; + bottomRight /= UIContentScaler.scaleFactor; + } + + if (_format.specialStyle == TextFormat.SpecialStyle.Subscript) + y = y - Mathf.RoundToInt(_ascent * _scale * SupOffset); + else if (_format.specialStyle == TextFormat.SpecialStyle.Superscript) + y = y + Mathf.RoundToInt(_ascent * _scale * (1 / SupScale - 1 + SupOffset)); + + topLeft.x += x; + topLeft.y += y; + bottomRight.x += x; + bottomRight.y += y; + + topRight.x = bottomRight.x; + topRight.y = topLeft.y; + bottomLeft.x = topLeft.x; + bottomLeft.y = bottomRight.y; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + uvBottomLeft = _char.uvBottomLeft; + uvTopLeft = _char.uvTopLeft; + uvTopRight = _char.uvTopRight; + uvBottomRight = _char.uvBottomRight; + + uvList.Add(uvBottomLeft); + uvList.Add(uvTopLeft); + uvList.Add(uvTopRight); + uvList.Add(uvBottomRight); + + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + + if (_boldVertice) + { + for (int b = 0; b < 4; b++) + { + Vector3 boldOffset = BOLD_OFFSET[b]; + + vertList.Add(bottomLeft + boldOffset); + vertList.Add(topLeft + boldOffset); + vertList.Add(topRight + boldOffset); + vertList.Add(bottomRight + boldOffset); + + uvList.Add(uvBottomLeft); + uvList.Add(uvTopLeft); + uvList.Add(uvTopRight); + uvList.Add(uvBottomRight); + + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + } + + return 20; + } + else + return 4; + } + + override public int DrawLine(float x, float y, float width, int fontSize, int type, + List vertList, List uvList, List uv2List, List colList) + { + if (!_gotLineChar) + { + _gotLineChar = true; + _font.RequestCharactersInTexture("_", 50, FontStyle.Normal); + _font.GetCharacterInfo('_', out _lineChar, 50, FontStyle.Normal); + } + + float thickness; + float offset; + + thickness = Mathf.Max(1, fontSize / 16f); //guest underline size + if (type == 0) + offset = Mathf.RoundToInt(_lineChar.minY * (float)fontSize / 50 + thickness); + else + offset = Mathf.RoundToInt(_ascent * 0.4f * fontSize / _font.fontSize); + if (thickness < 1) + thickness = 1; + + topLeft.x = x; + topLeft.y = y + offset; + bottomRight.x = x + width; + bottomRight.y = topLeft.y - thickness; + + topRight.x = bottomRight.x; + topRight.y = topLeft.y; + bottomLeft.x = topLeft.x; + bottomLeft.y = bottomRight.y; + + vertList.Add(bottomLeft); + vertList.Add(topLeft); + vertList.Add(topRight); + vertList.Add(bottomRight); + + uvBottomLeft = _lineChar.uvBottomLeft; + uvTopLeft = _lineChar.uvTopLeft; + uvTopRight = _lineChar.uvTopRight; + uvBottomRight = _lineChar.uvBottomRight; + + //å–中点的UV + Vector2 u0; + if (_lineChar.uvBottomLeft.x != _lineChar.uvBottomRight.x) + u0.x = (_lineChar.uvBottomLeft.x + _lineChar.uvBottomRight.x) * 0.5f; + else + u0.x = (_lineChar.uvBottomLeft.x + _lineChar.uvTopLeft.x) * 0.5f; + + if (_lineChar.uvBottomLeft.y != _lineChar.uvTopLeft.y) + u0.y = (_lineChar.uvBottomLeft.y + _lineChar.uvTopLeft.y) * 0.5f; + else + u0.y = (_lineChar.uvBottomLeft.y + _lineChar.uvBottomRight.y) * 0.5f; + + uvList.Add(u0); + uvList.Add(u0); + uvList.Add(u0); + uvList.Add(u0); + + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + + if (_boldVertice) + { + for (int b = 0; b < 4; b++) + { + Vector3 boldOffset = BOLD_OFFSET[b]; + + vertList.Add(bottomLeft + boldOffset); + vertList.Add(topLeft + boldOffset); + vertList.Add(topRight + boldOffset); + vertList.Add(bottomRight + boldOffset); + + uvList.Add(u0); + uvList.Add(u0); + uvList.Add(u0); + uvList.Add(u0); + + colList.Add(vertexColors[0]); + colList.Add(vertexColors[1]); + colList.Add(vertexColors[2]); + colList.Add(vertexColors[3]); + } + + return 20; + } + else + return 4; + } + + override public bool HasCharacter(char ch) + { + return _font.HasCharacter(ch); + } + + override public int GetLineHeight(int size) + { + return Mathf.RoundToInt(_lineHeight * size / _font.fontSize); + } + + void textureRebuildCallback(Font targetFont) + { + if (_font != targetFont) + return; + + if (mainTexture == null || !Application.isPlaying) + { + mainTexture = new NTexture(_font.material.mainTexture); + mainTexture.destroyMethod = DestroyMethod.None; + } + else + mainTexture.Reload(_font.material.mainTexture, null); + + _gotLineChar = false; + + textRebuildFlag = true; + version++; + + //Debug.Log("Font texture rebuild: " + name + "," + mainTexture.width + "," + mainTexture.height); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs.meta new file mode 100644 index 00000000..d3d895ae --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/DynamicFont.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 37b73f8527098974cb0ccf518ff95351 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs new file mode 100644 index 00000000..e5341c03 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + public class Emoji + { + /// + /// 代表图片资æºurl。 + /// + public string url; + + /// + /// 图片宽度。ä¸è®¾ç½®ï¼ˆ0)则表示使用原始宽度。 + /// + public int width; + + /// + /// 图片高度。ä¸è®¾ç½®ï¼ˆ0)则表示使用原始高度。 + /// + public int height; + + /// + /// + /// + /// + /// + /// + public Emoji(string url, int width, int height) + { + this.url = url; + this.width = width; + this.height = height; + } + + /// + /// + /// + /// + public Emoji(string url) + { + this.url = url; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs.meta new file mode 100644 index 00000000..478805b4 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/Emoji.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3859ae9020061394cadacd1624e04ed9 +timeCreated: 1475139464 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs new file mode 100644 index 00000000..c9852235 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class FontManager + { + public static Dictionary sFontFactory = new Dictionary(); + + /// + /// + /// + /// + /// + static public void RegisterFont(BaseFont font, string alias = null) + { + sFontFactory[font.name] = font; + if (alias != null) + sFontFactory[alias] = font; + } + + /// + /// + /// + /// + static public void UnregisterFont(BaseFont font) + { + List toDelete = new List(); + foreach (KeyValuePair kv in sFontFactory) + { + if (kv.Value == font) + toDelete.Add(kv.Key); + } + + foreach (string key in toDelete) + sFontFactory.Remove(key); + } + + /// + /// + /// + /// + /// + static public BaseFont GetFont(string name) + { + BaseFont font; + if (name.StartsWith(UIPackage.URL_PREFIX)) + { + font = UIPackage.GetItemAssetByURL(name) as BaseFont; + if (font != null) + return font; + } + + if (sFontFactory.TryGetValue(name, out font)) + return font; + + object asset = Resources.Load(name); + if (asset == null) + asset = Resources.Load("Fonts/" + name); + + //Try to use new API in Uinty5 to load + if (asset == null) + { + if (name.IndexOf(",") != -1) + { + string[] arr = name.Split(','); + int cnt = arr.Length; + for (int i = 0; i < cnt; i++) + arr[i] = arr[i].Trim(); + asset = Font.CreateDynamicFontFromOSFont(arr, 16); + } + else + asset = Font.CreateDynamicFontFromOSFont(name, 16); + } + + if (asset == null) + return Fallback(name); + + if (asset is Font) + { + font = new DynamicFont(); + font.name = name; + sFontFactory.Add(name, font); + + ((DynamicFont)font).nativeFont = (Font)asset; + } +#if FAIRYGUI_TMPRO + else if (asset is TMPro.TMP_FontAsset) + { + font = new TMPFont(); + font.name = name; + sFontFactory.Add(name, font); + ((TMPFont)font).fontAsset = (TMPro.TMP_FontAsset)asset; + } +#endif + else + { + if (asset.GetType().Name.Contains("TMP_FontAsset")) + Debug.LogWarning("To enable TextMeshPro support, add script define symbol: FAIRYGUI_TMPRO"); + + return Fallback(name); + } + + return font; + } + + static BaseFont Fallback(string name) + { + if (name != UIConfig.defaultFont) + { + BaseFont ff; + if (sFontFactory.TryGetValue(UIConfig.defaultFont, out ff)) + { + sFontFactory[name] = ff; + return ff; + } + } + + Font asset = (Font)Resources.GetBuiltinResource(typeof(Font), "Arial.ttf"); + if (asset == null) + throw new Exception("Failed to load font '" + name + "'"); + + BaseFont font = new DynamicFont(); + font.name = name; + ((DynamicFont)font).nativeFont = asset; + + sFontFactory.Add(name, font); + return font; + } + + /// + /// + /// + static public void Clear() + { + foreach (KeyValuePair kv in sFontFactory) + kv.Value.Dispose(); + + sFontFactory.Clear(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs.meta new file mode 100644 index 00000000..b6a6b835 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/FontManager.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5084c28e388b94a4fa4e2a80485296b3 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs new file mode 100644 index 00000000..15d3f85c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs @@ -0,0 +1,42 @@ +namespace FairyGUI +{ + /// + /// ç”¨äºŽæ–‡æœ¬è¾“å…¥çš„é”®ç›˜æŽ¥å£ + /// + public interface IKeyboard + { + /// + /// é”®ç›˜å·²æ”¶å›žï¼Œè¾“å…¥å·²å®Œæˆ + /// + bool done { get; } + + /// + /// æ˜¯å¦æ”¯æŒåœ¨å…‰æ ‡å¤„输入。如果为true,GetInput返回的是在当å‰å…‰æ ‡å¤„éœ€è¦æ’入的文本,如果为false,GetInput返回的是整个文本。 + /// + bool supportsCaret { get; } + + /// + /// 用户输入的文本。 + /// + /// + string GetInput(); + + /// + /// 打开键盘 + /// + /// + /// + /// + /// + /// + /// + /// + /// + void Open(string text, bool autocorrection, bool multiline, bool secure, bool alert, string textPlaceholder, int keyboardType, bool hideInput); + + /// + /// 关闭键盘 + /// + void Close(); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs.meta new file mode 100644 index 00000000..74314dab --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/IKeyboard.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4e3b9d951c903b049b8495c2d16f67fe +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs new file mode 100644 index 00000000..b0c2b63b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs @@ -0,0 +1,1569 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// 接收用户输入的文本控件。因为支æŒç›´æŽ¥è¾“入表情,所以从RichTextField派生。 + /// + public class InputTextField : RichTextField + { + /// + /// + /// + public int maxLength { get; set; } + + /// + /// 如果是true,则当文本获得焦点时,弹出键盘进行输入,如果是false则ä¸ä¼šã€‚ + /// 默认是使用Stage.keyboardInput的值。 + /// + public bool keyboardInput { get; set; } + + /// + /// + /// + public int keyboardType { get; set; } + + /// + /// + /// + public bool hideInput { get; set; } + + /// + /// + /// + public bool disableIME { get; set; } + + /// + /// + /// + public bool mouseWheelEnabled { get; set; } + + /// + /// + /// + public static Action onCopy; + + /// + /// + /// + public static Action onPaste; + + /// + /// + /// + public static PopupMenu contextMenu; + + string _text; + string _restrict; + Regex _restrictPattern; + bool _displayAsPassword; + string _promptText; + string _decodedPromptText; + int _border; + int _corner; + Color _borderColor; + Color _backgroundColor; + bool _editable; + + bool _editing; + int _caretPosition; + int _selectionStart; + int _composing; + char _highSurrogateChar; + string _textBeforeEdit; + + EventListener _onChanged; + EventListener _onSubmit; + + Shape _caret; + SelectionShape _selectionShape; + float _nextBlink; + + const int GUTTER_X = 2; + const int GUTTER_Y = 2; + + public InputTextField() + { + gameObject.name = "InputTextField"; + + _text = string.Empty; + maxLength = 0; + _editable = true; + _composing = 0; + keyboardInput = Stage.keyboardInput; + _borderColor = Color.black; + _backgroundColor = Color.clear; + mouseWheelEnabled = true; + this.tabStop = true; + cursor = "text-ibeam"; + + /* 因为InputTextField定义了ClipRect,而ClipRect是四周缩进了2个åƒç´ çš„(GUTTER),默认的点击测试 + * 是使用ClipRectçš„ï¼Œé‚£ä¼šé€ æˆæ— æ³•点击四周的空白区域。所以这里自定义了一个HitArea + */ + this.hitArea = new RectHitTest(); + this.touchChildren = false; + + onFocusIn.Add(__focusIn); + onFocusOut.AddCapture(__focusOut); + onKeyDown.Add(__keydown); + onTouchBegin.AddCapture(__touchBegin); + onTouchMove.AddCapture(__touchMove); + onMouseWheel.Add(__mouseWheel); + onClick.Add(__click); + onRightClick.Add(__rightClick); + } + + /// + /// + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// + /// + public EventListener onSubmit + { + get { return _onSubmit ?? (_onSubmit = new EventListener(this, "onSubmit")); } + } + + /// + /// + /// + public override string text + { + get + { + return _text; + } + set + { + _text = value; + ClearSelection(); + UpdateText(); + } + } + + /// + /// + /// + public override TextFormat textFormat + { + get + { + return base.textFormat; + } + set + { + base.textFormat = value; + if (_editing) + { + _caret.height = textField.textFormat.size; + _caret.DrawRect(0, Color.clear, textField.textFormat.color); + } + } + } + + /// + /// + /// + public string restrict + { + get { return _restrict; } + set + { + _restrict = value; + if (string.IsNullOrEmpty(_restrict)) + _restrictPattern = null; + else + _restrictPattern = new Regex(value); + } + } + + /// + /// + /// + public int caretPosition + { + get + { + textField.Redraw(); + return _caretPosition; + } + set + { + SetSelection(value, 0); + } + } + + public int selectionBeginIndex + { + get { return _selectionStart < _caretPosition ? _selectionStart : _caretPosition; } + } + + public int selectionEndIndex + { + get { return _selectionStart < _caretPosition ? _caretPosition : _selectionStart; } + } + + /// + /// + /// + public string promptText + { + get + { + return _promptText; + } + set + { + _promptText = value; + if (!string.IsNullOrEmpty(_promptText)) + _decodedPromptText = UBBParser.inst.Parse(XMLUtils.EncodeString(_promptText)); + else + _decodedPromptText = null; + UpdateText(); + } + } + + /// + /// + /// + public bool displayAsPassword + { + get { return _displayAsPassword; } + set + { + if (_displayAsPassword != value) + { + _displayAsPassword = value; + UpdateText(); + } + } + } + + /// + /// + /// + public bool editable + { + get { return _editable; } + set + { + _editable = value; + if (_caret != null) + _caret.visible = _editable; + } + } + + /// + /// + /// + public int border + { + get { return _border; } + set + { + _border = value; + UpdateShape(); + } + } + + /// + /// + /// + public int corner + { + get { return _corner; } + set + { + _corner = value; + UpdateShape(); + } + } + + /// + /// + /// + public Color borderColor + { + get { return _borderColor; } + set + { + _borderColor = value; + UpdateShape(); + } + } + + /// + /// + /// + public Color backgroundColor + { + get { return _backgroundColor; } + set + { + _backgroundColor = value; + UpdateShape(); + } + } + + void UpdateShape() + { + if (_border > 0 || _backgroundColor.a > 0) + { + CreateGraphics(); + + graphics.enabled = true; + RoundedRectMesh mesh = graphics.GetMeshFactory(); + mesh.lineWidth = _border; + mesh.lineColor = _borderColor; + mesh.fillColor = _backgroundColor; + mesh.topLeftRadius = mesh.topRightRadius = mesh.bottomLeftRadius = mesh.bottomRightRadius = corner; + graphics.SetMeshDirty(); + } + else + { + if (graphics != null) + graphics.enabled = false; + } + } + + /// + /// + /// + /// + /// -1 means the rest count from start + public void SetSelection(int start, int length) + { + if (!_editing) + Stage.inst.focus = this; + + _selectionStart = start; + _caretPosition = length < 0 ? int.MaxValue : (start + length); + if (!textField.Redraw()) + { + int cnt = textField.charPositions.Count; + if (_caretPosition >= cnt) + _caretPosition = cnt - 1; + if (_selectionStart >= cnt) + _selectionStart = cnt - 1; + UpdateCaret(); + } + } + + /// + /// + /// + /// + public void ReplaceSelection(string value) + { + if (keyboardInput && Stage.keyboardInput && !Stage.inst.keyboard.supportsCaret) + { + this.text = _text + value; + OnChanged(); + return; + } + + if (!_editing) + Stage.inst.focus = this; + + textField.Redraw(); + + int t0, t1; + if (_selectionStart != _caretPosition) + { + if (_selectionStart < _caretPosition) + { + t0 = _selectionStart; + t1 = _caretPosition; + _caretPosition = _selectionStart; + } + else + { + t0 = _caretPosition; + t1 = _selectionStart; + _selectionStart = _caretPosition; + } + } + else + { + if (string.IsNullOrEmpty(value)) + return; + + t0 = t1 = _caretPosition; + } + + StringBuilder buffer = new StringBuilder(); + GetPartialText(0, t0, buffer); + if (!string.IsNullOrEmpty(value)) + { + value = ValidateInput(value); + buffer.Append(value); + + _caretPosition += GetTextlength(value); + } + GetPartialText(t1 + _composing, -1, buffer); + + string newText = buffer.ToString(); + if (maxLength > 0) + { + string newText2 = TruncateText(newText, maxLength); + if (newText2.Length != newText.Length) + _caretPosition += (newText2.Length - newText.Length); + newText = newText2; + } + + this.text = newText; + OnChanged(); + } + + /// + /// + /// + /// + public void ReplaceText(string value) + { + if (value == _text) + return; + + if (value == null) + value = string.Empty; + + value = ValidateInput(value); + + if (maxLength > 0) + value = TruncateText(value, maxLength); + + _caretPosition = value.Length; + + this.text = value; + OnChanged(); + } + + void GetPartialText(int startIndex, int endIndex, StringBuilder buffer) + { + int elementCount = textField.htmlElements.Count; + int lastIndex = startIndex; + string tt; + if (_displayAsPassword) + tt = _text; + else + tt = textField.parsedText; + if (endIndex < 0) + endIndex = tt.Length; + for (int i = 0; i < elementCount; i++) + { + HtmlElement element = textField.htmlElements[i]; + if (element.htmlObject != null && element.text != null) + { + if (element.charIndex >= startIndex && element.charIndex < endIndex) + { + buffer.Append(tt.Substring(lastIndex, element.charIndex - lastIndex)); + buffer.Append(element.text); + lastIndex = element.charIndex + 1; + } + } + } + if (lastIndex < tt.Length) + buffer.Append(tt.Substring(lastIndex, endIndex - lastIndex)); + } + + int GetTextlength(string value) + { + int textLen = value.Length; + int ret = textLen; + for (int i = 0; i < textLen; i++) + { + if (char.IsHighSurrogate(value[i])) + ret--; + } + return ret; + } + + string TruncateText(string value, int length) + { + int textLen = value.Length; + int len = 0; + int i = 0; + while (i < textLen) + { + if (len == length) + return value.Substring(0, i); + + if (char.IsHighSurrogate(value[i])) + i++; + i++; + len++; + } + return value; + } + + string ValidateInput(string source) + { + if (_restrict != null) + { + StringBuilder sb = new StringBuilder(); + Match mc = _restrictPattern.Match(source); + int lastPos = 0; + string s; + while (mc != Match.Empty) + { + if (mc.Index != lastPos) + { + //ä¿ç•™tab和回车 + for (int i = lastPos; i < mc.Index; i++) + { + if (source[i] == '\n' || source[i] == '\t') + sb.Append(source[i]); + } + } + + s = mc.ToString(); + lastPos = mc.Index + s.Length; + sb.Append(s); + + mc = mc.NextMatch(); + } + for (int i = lastPos; i < source.Length; i++) + { + if (source[i] == '\n' || source[i] == '\t') + sb.Append(source[i]); + } + + return sb.ToString(); + } + else + return source; + } + + void UpdateText() + { + if (!_editing && _text.Length == 0 && !string.IsNullOrEmpty(_decodedPromptText)) + { + textField.htmlText = _decodedPromptText; + return; + } + + if (_displayAsPassword) + textField.text = EncodePasswordText(_text); + else + textField.text = _text; + + _composing = Input.compositionString.Length; + if (_composing > 0) + { + StringBuilder buffer = new StringBuilder(); + GetPartialText(0, _caretPosition, buffer); + buffer.Append(Input.compositionString); + GetPartialText(_caretPosition, -1, buffer); + + textField.text = buffer.ToString(); + } + } + + string EncodePasswordText(string value) + { + int textLen = value.Length; + StringBuilder tmp = new StringBuilder(textLen); + int i = 0; + while (i < textLen) + { + char c = value[i]; + if (c == '\n') + tmp.Append(c); + else + { + if (char.IsHighSurrogate(c)) + i++; + tmp.Append("*"); + } + i++; + } + return tmp.ToString(); + } + + void ClearSelection() + { + if (_selectionStart != _caretPosition) + { + if (_selectionShape != null) + _selectionShape.Clear(); + _selectionStart = _caretPosition; + } + } + + public string GetSelection() + { + if (_selectionStart == _caretPosition) + return string.Empty; + + StringBuilder buffer = new StringBuilder(); + if (_selectionStart < _caretPosition) + GetPartialText(_selectionStart, _caretPosition, buffer); + else + GetPartialText(_caretPosition, _selectionStart, buffer); + return buffer.ToString(); + } + + void Scroll(int hScroll, int vScroll) + { + vScroll = Mathf.Clamp(vScroll, 0, textField.lines.Count - 1); + TextField.LineInfo line = textField.lines[vScroll]; + hScroll = Mathf.Clamp(hScroll, 0, line.charCount - 1); + + TextField.CharPosition cp = GetCharPosition(line.charIndex + hScroll); + Vector2 pt = GetCharLocation(cp); + MoveContent(new Vector2(GUTTER_X - pt.x, GUTTER_Y - pt.y), false); + } + + void AdjustCaret(TextField.CharPosition cp, bool moveSelectionHeader = false) + { + _caretPosition = cp.charIndex; + if (moveSelectionHeader) + _selectionStart = _caretPosition; + + UpdateCaret(); + } + + void UpdateCaret(bool forceUpdate = false) + { + TextField.CharPosition cp; + if (_editing) + cp = GetCharPosition(_caretPosition + Input.compositionString.Length); + else + cp = GetCharPosition(_caretPosition); + + Vector2 pos = GetCharLocation(cp); + TextField.LineInfo line = textField.lines[cp.lineIndex]; + Vector2 offset = pos + textField.xy; + + if (offset.x < textField.textFormat.size) + offset.x += Mathf.Min(50, _contentRect.width * 0.5f); + else if (offset.x > _contentRect.width - GUTTER_X - textField.textFormat.size) + offset.x -= Mathf.Min(50, _contentRect.width * 0.5f); + + if (offset.x < GUTTER_X) + offset.x = GUTTER_X; + else if (offset.x > _contentRect.width - GUTTER_X) + offset.x = Mathf.Max(GUTTER_X, _contentRect.width - GUTTER_X); + + if (offset.y < GUTTER_Y) + offset.y = GUTTER_Y; + else if (offset.y + line.height >= _contentRect.height - GUTTER_Y) + offset.y = Mathf.Max(GUTTER_Y, _contentRect.height - line.height - GUTTER_Y); + + MoveContent(offset - pos, forceUpdate); + + if (_editing) + { + _caret.position = textField.xy + pos; + _caret.height = line.height > 0 ? line.height : textField.textFormat.size; + + if (_editable) + { + Vector2 cursorPos = _caret.LocalToWorld(new Vector2(0, _caret.height)); + cursorPos = StageCamera.main.WorldToScreenPoint(cursorPos); +#if !UNITY_2019_OR_NEWER + if (Stage.devicePixelRatio == 1) + { +#endif + cursorPos.y = Screen.height - cursorPos.y; + cursorPos = cursorPos / Stage.devicePixelRatio; + Input.compositionCursorPos = cursorPos + new Vector2(0, 20); +#if !UNITY_2019_OR_NEWER + } + else + Input.compositionCursorPos = cursorPos - new Vector2(0, 20); +#endif + } + + _nextBlink = Time.time + 0.5f; + _caret.graphics.enabled = true; + + UpdateSelection(cp); + } + } + + void MoveContent(Vector2 pos, bool forceUpdate) + { + float ox = textField.x; + float oy = textField.y; + float nx = pos.x; + float ny = pos.y; + float rectWidth = _contentRect.width - 1; //-1 to avoid cursor be clipped + if (rectWidth - nx > textField.textWidth) + nx = rectWidth - textField.textWidth; + if (_contentRect.height - ny > textField.textHeight) + ny = _contentRect.height - textField.textHeight; + if (nx > 0) + nx = 0; + if (ny > 0) + ny = 0; + nx = (int)nx; + ny = (int)ny; + + if (nx != ox || ny != oy || forceUpdate) + { + if (_caret != null) + { + _caret.SetXY(nx + _caret.x - ox, ny + _caret.y - oy); + _selectionShape.SetXY(nx, ny); + } + textField.SetXY(nx, ny); + + List elements = textField.htmlElements; + int count = elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = elements[i]; + if (element.htmlObject != null) + element.htmlObject.SetPosition(element.position.x + nx, element.position.y + ny); + } + } + } + + void UpdateSelection(TextField.CharPosition cp) + { + if (_selectionStart == _caretPosition) + { + _selectionShape.Clear(); + return; + } + + TextField.CharPosition start; + if (_editing && Input.compositionString.Length > 0) + { + if (_selectionStart < _caretPosition) + { + cp = GetCharPosition(_caretPosition); + start = GetCharPosition(_selectionStart); + } + else + start = GetCharPosition(_selectionStart + Input.compositionString.Length); + } + else + start = GetCharPosition(_selectionStart); + if (start.charIndex > cp.charIndex) + { + TextField.CharPosition tmp = start; + start = cp; + cp = tmp; + } + + Vector2 v1 = GetCharLocation(start); + Vector2 v2 = GetCharLocation(cp); + + _selectionShape.rects.Clear(); + textField.GetLinesShape(start.lineIndex, v1.x, cp.lineIndex, v2.x, false, _selectionShape.rects); + _selectionShape.Refresh(); + } + + TextField.CharPosition GetCharPosition(int caretIndex) + { + if (caretIndex < 0) + caretIndex = 0; + else if (caretIndex >= textField.charPositions.Count) + caretIndex = textField.charPositions.Count - 1; + + return textField.charPositions[caretIndex]; + } + + /// + /// é€šè¿‡æœ¬åœ°åæ ‡èŽ·å¾—å­—ç¬¦ç´¢å¼•ä½ç½® + /// + /// æœ¬åœ°åæ ‡ + /// + TextField.CharPosition GetCharPosition(Vector2 location) + { + if (textField.charPositions.Count <= 1) + return textField.charPositions[0]; + + location.x -= textField.x; + location.y -= textField.y; + + List lines = textField.lines; + int len = lines.Count; + TextField.LineInfo line; + int i; + for (i = 0; i < len; i++) + { + line = lines[i]; + if (line.y + line.height > location.y) + break; + } + if (i == len) + i = len - 1; + + int lineIndex = i; + + len = textField.charPositions.Count; + TextField.CharPosition v; + int firstInLine = -1; + for (i = 0; i < len; i++) + { + v = textField.charPositions[i]; + if (v.lineIndex == lineIndex) + { + if (firstInLine == -1) + firstInLine = i; + if (v.offsetX + v.width * 0.5f > location.x) + return v; + } + else if (firstInLine != -1) + return v; + } + + return textField.charPositions[i - 1]; + } + + /// + /// èŽ·å¾—å­—ç¬¦çš„åæ ‡ã€‚ + /// + /// + /// + Vector2 GetCharLocation(TextField.CharPosition cp) + { + TextField.LineInfo line = textField.lines[cp.lineIndex]; + Vector2 pos; + if (line.charCount == 0 || textField.charPositions.Count == 0) + { + if (textField.align == AlignType.Center) + pos.x = (int)(_contentRect.width / 2); + else + pos.x = GUTTER_X; + } + else + { + TextField.CharPosition v = textField.charPositions[Math.Min(cp.charIndex, textField.charPositions.Count - 1)]; + pos.x = v.offsetX; + } + pos.y = line.y; + return pos; + } + + override internal void RefreshObjects() + { + base.RefreshObjects(); + + if (_editing) + { + SetChildIndex(_selectionShape, 0); + SetChildIndex(_caret, this.numChildren - 1); + } + + int cnt = textField.charPositions.Count; + if (_caretPosition >= cnt) + _caretPosition = cnt - 1; + if (_selectionStart >= cnt) + _selectionStart = cnt - 1; + + UpdateCaret(true); + } + + protected void OnChanged() + { + DispatchEvent("onChanged", null); + + TextInputHistory.inst.MarkChanged(this); + } + + protected override void OnSizeChanged() + { + base.OnSizeChanged(); + + Rect rect = _contentRect; + rect.x += GUTTER_X; + rect.y += GUTTER_Y; + rect.width -= GUTTER_X * 2; + rect.height -= GUTTER_Y * 2; + this.clipRect = rect; + ((RectHitTest)this.hitArea).rect = _contentRect; + } + + public override void Update(UpdateContext context) + { + base.Update(context); + + if (_editing) + { + if (_nextBlink < Time.time) + { + _nextBlink = Time.time + 0.5f; + _caret.graphics.enabled = !_caret.graphics.enabled; + } + } + } + + public override void Dispose() + { + if ((_flags & Flags.Disposed) != 0) + return; + + _editing = false; + if (_caret != null) + { + _caret.Dispose(); + _selectionShape.Dispose(); + } + + base.Dispose(); + } + + void DoCopy(string value) + { + if (onCopy != null) + { + onCopy(this, value); + return; + } + +#if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR + TextEditor textEditor = new TextEditor(); +#if UNITY_5_3_OR_NEWER + textEditor.text = value; +#else + textEditor.content = new GUIContent(value); +#endif + textEditor.OnFocus(); + textEditor.Copy(); +#endif + } + + void DoPaste() + { + if (onPaste != null) + { + onPaste(this); + return; + } + +#if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR + TextEditor textEditor = new TextEditor(); +#if UNITY_5_3_OR_NEWER + textEditor.text = string.Empty; +#else + textEditor.content = new GUIContent(string.Empty); +#endif + textEditor.multiline = !textField.singleLine; + textEditor.Paste(); +#if UNITY_5_3_OR_NEWER + string value = textEditor.text; +#else + string value = textEditor.content.text; +#endif + if (!string.IsNullOrEmpty(value)) + ReplaceSelection(value); +#endif + } + + void CreateCaret() + { + _caret = new Shape(); + _caret.gameObject.name = "Caret"; + _caret.touchable = false; + _caret._flags |= Flags.SkipBatching; + _caret.xy = textField.xy; + + _selectionShape = new SelectionShape(); + _selectionShape.gameObject.name = "Selection"; + _selectionShape.color = UIConfig.inputHighlightColor; + _selectionShape._flags |= Flags.SkipBatching; + _selectionShape.touchable = false; + _selectionShape.xy = textField.xy; + } + + void __touchBegin(EventContext context) + { + if (!_editing || textField.charPositions.Count <= 1 + || keyboardInput && Stage.keyboardInput && !Stage.inst.keyboard.supportsCaret + || context.inputEvent.button != 0) + return; + + ClearSelection(); + + Vector3 v = Stage.inst.touchPosition; + v = this.GlobalToLocal(v); + TextField.CharPosition cp = GetCharPosition(v); + + AdjustCaret(cp, true); + + context.CaptureTouch(); + } + + void __touchMove(EventContext context) + { + if (!_editing) + return; + + Vector3 v = Stage.inst.touchPosition; + v = this.GlobalToLocal(v); + if (float.IsNaN(v.x)) + return; + + TextField.CharPosition cp = GetCharPosition(v); + if (cp.charIndex != _caretPosition) + AdjustCaret(cp); + } + + void __mouseWheel(EventContext context) + { + if (_editing && mouseWheelEnabled) + { + context.StopPropagation(); + + TextField.CharPosition cp = GetCharPosition(new Vector2(GUTTER_X, GUTTER_Y)); + int vScroll = cp.lineIndex; + int hScroll = cp.charIndex - textField.lines[cp.lineIndex].charIndex; + if (context.inputEvent.mouseWheelDelta < 0) + vScroll--; + else + vScroll++; + Scroll(hScroll, vScroll); + } + } + + void __focusIn(EventContext context) + { + if (!Application.isPlaying) + return; + + _editing = true; + _textBeforeEdit = _text; + + if (_caret == null) + CreateCaret(); + + if (!string.IsNullOrEmpty(_promptText)) + UpdateText(); + + float caretSize; + //如果界é¢ç¼©å°è¿‡ï¼Œå…‰æ ‡å¾ˆå®¹æ˜“看ä¸è§ï¼Œè¿™é‡Œæ”¾å¤§ä¸€ä¸‹ + if (UIConfig.inputCaretSize == 1 && UIContentScaler.scaleFactor < 1) + caretSize = UIConfig.inputCaretSize / UIContentScaler.scaleFactor; + else + caretSize = UIConfig.inputCaretSize; + _caret.SetSize(caretSize, textField.textFormat.size); + _caret.DrawRect(0, Color.clear, textField.textFormat.color); + _caret.visible = _editable; + AddChild(_caret); + + _selectionShape.Clear(); + AddChildAt(_selectionShape, 0); + + if (!textField.Redraw()) + { + TextField.CharPosition cp = GetCharPosition(_caretPosition); + AdjustCaret(cp); + } + + if (Stage.keyboardInput) + { + if (keyboardInput) + { + if (_editable) + Stage.inst.OpenKeyboard(_text, false, _displayAsPassword ? false : !textField.singleLine, + _displayAsPassword, false, null, keyboardType, hideInput); + + SetSelection(0, -1); + } + } + else + { + if (!disableIME && !_displayAsPassword) + Input.imeCompositionMode = IMECompositionMode.On; + else + Input.imeCompositionMode = IMECompositionMode.Off; + _composing = 0; + + if ((string)context.data == "key") //select all if got focus by tab key + SetSelection(0, -1); + + TextInputHistory.inst.StartRecord(this); + } + } + + void __focusOut(EventContext contxt) + { + if (!_editing) + return; + + _editing = false; + if (Stage.keyboardInput) + { + if (keyboardInput) + Stage.inst.CloseKeyboard(); + } + else + { + Input.imeCompositionMode = IMECompositionMode.Auto; + TextInputHistory.inst.StopRecord(this); + } + + if (!string.IsNullOrEmpty(_promptText)) + UpdateText(); + + _caret.RemoveFromParent(); + _selectionShape.RemoveFromParent(); + + if (contextMenu != null && contextMenu.contentPane.onStage) + contextMenu.Hide(); + } + + void __keydown(EventContext context) + { + if (!_editing) + return; + + if (HandleKey(context.inputEvent)) + context.StopPropagation(); + } + + bool HandleKey(InputEvent evt) + { + bool keyCodeHandled = true; + switch (evt.keyCode) + { + case KeyCode.Backspace: + { + if (evt.command) + { + //for mac:CMD+Backspace=Delete + if (_selectionStart == _caretPosition && _caretPosition < textField.charPositions.Count - 1) + _selectionStart = _caretPosition + 1; + } + else + { + if (_selectionStart == _caretPosition && _caretPosition > 0) + _selectionStart = _caretPosition - 1; + } + if (_editable) + ReplaceSelection(null); + break; + } + + case KeyCode.Delete: + { + if (_selectionStart == _caretPosition && _caretPosition < textField.charPositions.Count - 1) + _selectionStart = _caretPosition + 1; + if (_editable) + ReplaceSelection(null); + break; + } + + case KeyCode.LeftArrow: + { + if (!evt.shift) + ClearSelection(); + if (_caretPosition > 0) + { + if (evt.command) //mac keyboard + { + TextField.CharPosition cp = GetCharPosition(_caretPosition); + TextField.LineInfo line = textField.lines[cp.lineIndex]; + cp = GetCharPosition(new Vector2(int.MinValue, line.y + textField.y)); + AdjustCaret(cp, !evt.shift); + } + else + { + TextField.CharPosition cp = GetCharPosition(_caretPosition - 1); + AdjustCaret(cp, !evt.shift); + } + } + break; + } + + case KeyCode.RightArrow: + { + if (!evt.shift) + ClearSelection(); + if (_caretPosition < textField.charPositions.Count - 1) + { + if (evt.command) + { + TextField.CharPosition cp = GetCharPosition(_caretPosition); + TextField.LineInfo line = textField.lines[cp.lineIndex]; + cp = GetCharPosition(new Vector2(int.MaxValue, line.y + textField.y)); + AdjustCaret(cp, !evt.shift); + } + else + { + TextField.CharPosition cp = GetCharPosition(_caretPosition + 1); + AdjustCaret(cp, !evt.shift); + } + } + break; + } + + case KeyCode.UpArrow: + { + if (!evt.shift) + ClearSelection(); + + TextField.CharPosition cp = GetCharPosition(_caretPosition); + if (cp.lineIndex > 0) + { + TextField.LineInfo line = textField.lines[cp.lineIndex - 1]; + cp = GetCharPosition(new Vector2(_caret.x, line.y + textField.y)); + AdjustCaret(cp, !evt.shift); + } + break; + } + + case KeyCode.DownArrow: + { + if (!evt.shift) + ClearSelection(); + + TextField.CharPosition cp = GetCharPosition(_caretPosition); + if (cp.lineIndex == textField.lines.Count - 1) + cp.charIndex = textField.charPositions.Count - 1; + else + { + TextField.LineInfo line = textField.lines[cp.lineIndex + 1]; + cp = GetCharPosition(new Vector2(_caret.x, line.y + textField.y)); + } + AdjustCaret(cp, !evt.shift); + break; + } + + case KeyCode.PageUp: + { + ClearSelection(); + break; + } + + case KeyCode.PageDown: + { + ClearSelection(); + break; + } + + case KeyCode.Home: + { + if (!evt.shift) + ClearSelection(); + + TextField.CharPosition cp = GetCharPosition(_caretPosition); + TextField.LineInfo line = textField.lines[cp.lineIndex]; + cp = GetCharPosition(new Vector2(int.MinValue, line.y + textField.y)); + AdjustCaret(cp, !evt.shift); + break; + } + + case KeyCode.End: + { + if (!evt.shift) + ClearSelection(); + + TextField.CharPosition cp = GetCharPosition(_caretPosition); + TextField.LineInfo line = textField.lines[cp.lineIndex]; + cp = GetCharPosition(new Vector2(int.MaxValue, line.y + textField.y)); + AdjustCaret(cp, !evt.shift); + + break; + } + + //Select All + case KeyCode.A: + { + if (evt.ctrlOrCmd) + { + _selectionStart = 0; + AdjustCaret(GetCharPosition(int.MaxValue)); + } + break; + } + + //Copy + case KeyCode.C: + { + if (evt.ctrlOrCmd && !_displayAsPassword) + { + string s = GetSelection(); + if (!string.IsNullOrEmpty(s)) + DoCopy(s); + } + break; + } + + //Paste + case KeyCode.V: + { + if (evt.ctrlOrCmd && _editable) + DoPaste(); + break; + } + + //Cut + case KeyCode.X: + { + if (evt.ctrlOrCmd && !_displayAsPassword) + { + string s = GetSelection(); + if (!string.IsNullOrEmpty(s)) + { + DoCopy(s); + if (_editable) + ReplaceSelection(null); + } + } + break; + } + + case KeyCode.Z: + { + if (evt.ctrlOrCmd && _editable) + { + if (evt.shift) + TextInputHistory.inst.Redo(this); + else + TextInputHistory.inst.Undo(this); + } + break; + } + + case KeyCode.Y: + { + if (evt.ctrlOrCmd && _editable) + TextInputHistory.inst.Redo(this); + break; + } + + case KeyCode.Return: + case KeyCode.KeypadEnter: + { + if (textField.singleLine) + { + Stage.inst.focus = parent; + DispatchEvent("onSubmit", null); + DispatchEvent("onKeyDown", null); //for backward compatibility + } + break; + } + + case KeyCode.Tab: + { + if (textField.singleLine) + { + Stage.inst.DoKeyNavigate(evt.shift); + keyCodeHandled = false; + } + break; + } + + case KeyCode.Escape: + { + this.text = _textBeforeEdit; + Stage.inst.focus = parent; + break; + } + + default: + keyCodeHandled = (int)evt.keyCode <= 272 && !evt.ctrlOrCmd; + break; + } + + char c = evt.character; + if (c != 0) + { + if (evt.ctrlOrCmd) + return true; + + if (c == '\r' || c == 3) + c = '\n'; + + if (c == 25)/*shift+tab*/ + c = '\t'; + + if (c == 27/*escape*/ || textField.singleLine && (c == '\n' || c == '\t')) + return true; + + if (char.IsHighSurrogate(c)) + { + _highSurrogateChar = c; + return true; + } + + if (_editable) + { + if (char.IsLowSurrogate(c)) + ReplaceSelection(char.ConvertFromUtf32(((int)c & 0x03FF) + ((((int)_highSurrogateChar & 0x03FF) + 0x40) << 10))); + else + ReplaceSelection(c.ToString()); + } + + return true; + } + else + { + if (Input.compositionString.Length > 0 && _editable) + { + int composing = _composing; + _composing = Input.compositionString.Length; + + StringBuilder buffer = new StringBuilder(); + GetPartialText(0, _caretPosition, buffer); + buffer.Append(Input.compositionString); + GetPartialText(_caretPosition + composing, -1, buffer); + + textField.text = buffer.ToString(); + } + + return keyCodeHandled; + } + } + + internal void CheckComposition() + { + if (_composing != 0 && Input.compositionString.Length == 0) + UpdateText(); + } + + void __click(EventContext context) + { + if (_editing && context.inputEvent.isDoubleClick) + { + context.StopPropagation(); + _selectionStart = 0; + AdjustCaret(GetCharPosition(int.MaxValue)); + } + } + + void __rightClick(EventContext context) + { + if (contextMenu != null) + { + context.StopPropagation(); + contextMenu.Show(); + } + } + } + + class TextInputHistory + { + static TextInputHistory _inst; + public static TextInputHistory inst + { + get + { + if (_inst == null) + _inst = new TextInputHistory(); + return _inst; + } + } + + List _undoBuffer; + List _redoBuffer; + string _currentText; + InputTextField _textField; + bool _lock; + int _changedFrame; + + public const int maxHistoryLength = 5; + + public TextInputHistory() + { + _undoBuffer = new List(); + _redoBuffer = new List(); + } + + public void StartRecord(InputTextField textField) + { + _undoBuffer.Clear(); + _redoBuffer.Clear(); + _textField = textField; + _lock = false; + _currentText = textField.text; + _changedFrame = 0; + } + + public void MarkChanged(InputTextField textField) + { + if (_textField != textField) + return; + + if (_lock) + return; + + string newText = _textField.text; + if (_currentText == newText) + return; + + if (_changedFrame != Time.frameCount) + { + _changedFrame = Time.frameCount; + _undoBuffer.Add(_currentText); + if (_undoBuffer.Count > maxHistoryLength) + _undoBuffer.RemoveAt(0); + } + else + { + int cnt = _undoBuffer.Count; + if (cnt > 0 && newText == _undoBuffer[cnt - 1]) + _undoBuffer.RemoveAt(cnt - 1); + } + _currentText = newText; + } + + public void StopRecord(InputTextField textField) + { + if (_textField != textField) + return; + + _undoBuffer.Clear(); + _redoBuffer.Clear(); + _textField = null; + _currentText = null; + } + + public void Undo(InputTextField textField) + { + if (_textField != textField) + return; + + if (_undoBuffer.Count == 0) + return; + + string text = _undoBuffer[_undoBuffer.Count - 1]; + _undoBuffer.RemoveAt(_undoBuffer.Count - 1); + _redoBuffer.Add(_currentText); + _lock = true; + int caretPos = _textField.caretPosition; + _textField.text = text; + int dlen = text.Length - _currentText.Length; + if (dlen < 0) + _textField.caretPosition = caretPos + dlen; + _currentText = text; + _lock = false; + } + + public void Redo(InputTextField textField) + { + if (_textField != textField) + return; + + if (_redoBuffer.Count == 0) + return; + + string text = _redoBuffer[_redoBuffer.Count - 1]; + _redoBuffer.RemoveAt(_redoBuffer.Count - 1); + _undoBuffer.Add(_currentText); + _lock = true; + int caretPos = _textField.caretPosition; + _textField.text = text; + int dlen = text.Length - _currentText.Length; + if (dlen > 0) + _textField.caretPosition = caretPos + dlen; + _currentText = text; + _lock = false; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs.meta new file mode 100644 index 00000000..8a05de64 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/InputTextField.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 87f693de944eb7d4ab4ccb9b65af352a +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs new file mode 100644 index 00000000..38198bc8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs @@ -0,0 +1,701 @@ +/******************************************************************** + Copyright (c) 2018, Tadpole Studio + All rights reserved + + 文件å称: RTL.cs + 说 明: RTLå­—ç¬¦è½¬æ¢ + + 版 本: 1.00 + æ—¶ 间: 2018/2/24 9:02:12 + 作 者: AQ QQ:355010366 + 概 述: 新建 + +*********************************************************************/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FairyGUI +{ + public class RTLSupport + { + internal enum CharState + { + isolated, + final, + lead, + middle, + } + + // Bidirectional Character Types + public enum DirectionType + { + UNKNOW = 0, + LTR, + RTL, + NEUTRAL, + } + +#if RTL_TEXT_SUPPORT + public static DirectionType BaseDirection = DirectionType.RTL; // ä¸»ä½“è¯­è¨€æ˜¯å¦æ˜¯RTL的语言 +#else + public static DirectionType BaseDirection = DirectionType.UNKNOW; +#endif + private static bool isCharsInitialized = false; + private static Dictionary mapping = new Dictionary(); + + private static List listFinal = new List(); + private static List listRep = new List(); + private static StringBuilder sbRep = new StringBuilder(); + private static StringBuilder sbN = new StringBuilder(); + private static StringBuilder sbFinal = new StringBuilder(); + private static StringBuilder sbReverse = new StringBuilder(); + + public static bool IsArabicLetter(char ch) + { + if (ch >= 0x600 && ch <= 0x6ff) + { + if ((ch >= 0x660 && ch <= 0x66D) || (ch >= 0x6f0 && ch <= 0x6f9)) // 标准阿拉伯语数字和东阿拉伯语数字 [2019/3/1/ 17:45:18 by aq_1000] + { + return false; + } + return true; + } + else if (ch >= 0x750 && ch <= 0x77f) + return true; + else if (ch >= 0xfb50 && ch <= 0xfc3f) + return true; + else if (ch >= 0xfe70 && ch <= 0xfefc) + return true; + return false; + } + + public static string ConvertNumber(string strNumber) + { + sbRep.Length = 0; + foreach (char ch in strNumber) + { + int un = ch; + if (un == 0x66c || ch == ',') // åŽ»æŽ‰é€—å· + continue; + else if (un == 0x660 || un == 0x6f0) + sbRep.Append('0'); + else if (un == 0x661 || un == 0x6f1) + sbRep.Append('1'); + else if (un == 0x662 || un == 0x6f2) + sbRep.Append('2'); + else if (un == 0x663 || un == 0x6f3) + sbRep.Append('3'); + else if (un == 0x664 || un == 0x6f4) + sbRep.Append('4'); + else if (un == 0x665 || un == 0x6f5) + sbRep.Append('5'); + else if (un == 0x666 || un == 0x6f6) + sbRep.Append('6'); + else if (un == 0x667 || un == 0x6f7) + sbRep.Append('7'); + else if (un == 0x668 || un == 0x6f8) + sbRep.Append('8'); + else if (un == 0x669 || un == 0x6f9) + sbRep.Append('9'); + else + sbRep.Append(ch); + } + return sbRep.ToString(); + } + + public static bool ContainsArabicLetters(string text) + { + foreach (char character in text) + { + if (character >= 0x600 && character <= 0x6ff) + return true; + + if (character >= 0x750 && character <= 0x77f) + return true; + + if (character >= 0xfb50 && character <= 0xfc3f) + return true; + + if (character >= 0xfe70 && character <= 0xfefc) + return true; + } + return false; + } + + // æ£€æµ‹æ–‡æœ¬ä¸»æ–¹å‘ + public static DirectionType DetectTextDirection(string text) + { + bool isContainRTL = false; + bool isContainLTR = false; + foreach (char ch in text) + { + if (IsArabicLetter(ch)) + { + isContainRTL = true; + if (isContainLTR) + break; + } + else if (char.IsLetter(ch)) + { + isContainLTR = true; + if (isContainRTL) + break; + } + } + if (!isContainRTL) + return DirectionType.UNKNOW; // 这边unknow暂时代表文本一个RTL字符都没有,无需进行RTLè½¬æ¢ + else if (!isContainLTR) + return DirectionType.RTL; + return BaseDirection; + } + + private static bool CheckSeparator(char input) + { + if (!IsArabicLetter(input)) + { + return true; + } + else + { + return (input == 'ØŒ') || (input == '?') || (input == 'ØŸ'); + } + + // if ((input != ' ') && (input != '\t') && (input != '!') && (input != '.') && + // (input != 'ØŒ') && (input != '?') && (input != 'ØŸ') && + // !_IsBracket(input) && // 括å·ä¹Ÿç®— [2018/8/1/ 15:12:20 by aq_1000] + // !_IsNeutrality(input)) + // { + // return false; + // } + // return true; + } + + private static bool CheckSpecific(char input) + { + int num = input; + if ((num != 0x622) && (num != 0x623) && (num != 0x627) && (num != 0x62f) && (num != 0x625) && + (num != 0x630) && (num != 0x631) && (num != 0x632) && (num != 0x698) && (num != 0x648) && + !_CheckSoundmark(input)) + { + return false; + } + return true; + } + + private static bool _CheckSoundmark(char ch) + { + int un = ch; + return (un >= 0x610 && un <= 0x61e) || (un >= 0x64b && un <= 0x65f); + } + + public static string DoMapping(string input) + { + if (!isCharsInitialized) + { + isCharsInitialized = true; + InitChars(); + } + + // 伊斯兰教真主安拉在阿拉伯文里写作الله + // 键盘输入时输入 Ù„ (lam) + Ù„ (lam) + Ù‡ (ha) åŽä¼šè‡ªåŠ¨è½¬æ¢æˆå¸¦è®°å·çš„符å·ã€‚ [2018/3/13 20:03:45 --By aq_1000] + if (input == "الله") + { + input = "ï·²"; + } + + sbFinal.Length = 0; + sbFinal.Append(input); + char perChar = '\0'; + for (int i = 0; i < sbFinal.Length; i++) + { + if (!mapping.ContainsKey(sbFinal[i])) + { + perChar = sbFinal[i]; + continue; + } + + if ((i + 1) == sbFinal.Length) + { + if (sbFinal.Length == 1) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + else if (CheckSeparator(perChar) || CheckSpecific(perChar)) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.final]; + } + } + else if (i == 0) + { + if (!CheckSeparator(sbFinal[i + 1])) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.lead]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + } + else if (CheckSeparator(sbFinal[i + 1])) + { + if (CheckSeparator(perChar) || CheckSpecific(perChar)) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.final]; + } + } + else if (CheckSeparator(perChar)) + { + if (CheckSeparator(sbFinal[i + 1])) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.lead]; + } + } + else if (CheckSpecific(sbFinal[i + 1])) + { + if (CheckSeparator(perChar) || CheckSpecific(perChar)) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.lead]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.middle]; + } + } + else if (CheckSpecific(perChar)) + { + if (CheckSeparator(sbFinal[i + 1])) + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.isolated]; + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.lead]; + } + } + else + { + perChar = sbFinal[i]; + sbFinal[i] = mapping[sbFinal[i]][(int)CharState.middle]; + } + } + return sbFinal.ToString(); + } + + // 主体语言是LTR + public static string ConvertLineL(string source) + { + listFinal.Clear(); + listRep.Clear(); + sbRep.Length = 0; + sbN.Length = 0; + int iReplace = 0; + DirectionType ePre = DirectionType.LTR; + char nextChar = '\0'; + for (int j = 0; j < source.Length; j++) + { + if (j < source.Length - 1) + nextChar = source[j + 1]; + else + nextChar = '\0'; + char item = source[j]; + DirectionType eCType = _GetDirection(item, nextChar, ePre, DirectionType.LTR); + if (eCType == DirectionType.RTL) + { + if (sbRep.Length == 0) + { + listFinal.Add('\x00bf'); + iReplace++; + } + + if (sbN.Length > 0) + sbRep.Append(sbN.ToString()); + sbN.Length = 0; + sbRep.Append(item); + } + else if (eCType == DirectionType.LTR) + { + if (sbRep.Length > 0) + { + listRep.Add(sbRep.ToString()); + } + sbRep.Length = 0; + + if (sbN.Length > 0) + { + for (int n = 0; n < sbN.Length; ++n) + { + listFinal.Add(sbN[n]); + } + } + sbN.Length = 0; + + // item = _ProcessBracket(item); // 文本主方å‘为LTRçš„è¯ï¼Œæ‹¬å·ä¸éœ€è¦ç¿»è½¬ [2018/12/20/ 17:03:23 by aq_1000] + listFinal.Add(item); + } + else + { + sbN.Append(item); + } + ePre = eCType; + } + if (sbRep.Length > 0) + { + listRep.Add(sbRep.ToString()); + } + + // ä¸€è¡Œä¸­éƒ½åªæœ‰ä¸­ç«‹å­—符的情况,就直接返回中立字符 [2018/12/6/ 16:34:38 by aq_1000] + if (sbN.Length > 0) + { + for (int n = 0; n < sbN.Length; ++n) + { + listFinal.Add(sbN[n]); + } + } + + sbRep.Length = 0; + sbN.Length = 0; + sbFinal.Length = 0; + sbFinal.Append(listFinal.ToArray()); + for (int m = 0; m < iReplace; m++) + { + for (int n = 0; n < sbFinal.Length; n++) + { + if (sbFinal[n] == '\x00bf') + { + sbRep.Length = 0; + sbRep.Append(_Reverse(listRep[0])); + listRep.RemoveAt(0); + + // 字符串åå‘çš„æ—¶å€™é€ æˆæœ«å°¾ç©ºæ ¼è·‘到è¯é¦– [2018/4/11 20:04:35 --By aq_1000] + sbN.Length = 0; + for (int num4 = 0; num4 < sbRep.Length; num4++) + { + if (!_IsNeutrality(sbRep[num4])) + break; + sbN.Append(sbRep[num4]); + } + if (sbN.Length > 0) // è¯é¦–ç©ºæ ¼é‡æ–°æ”¾åˆ°è¯å°¾ + { + sbRep.Remove(0, sbN.Length); + for (int iSpace = sbN.Length - 1; iSpace >= 0; --iSpace) // 空格也è¦å–å + { + sbRep.Append(sbN[iSpace]); + } + } + + sbFinal.Replace(sbFinal[n].ToString(), sbRep.ToString(), n, 1); + break; + } + } + } + return sbFinal.ToString(); + } + + // 主体语言是RTL,整个文本就从å³å¾€å·¦è¯»ï¼ŒLTRè¯­è¨€å°±ä½œä¸ºåµŒå…¥è¯­æ®µå¤„ç† + public static string ConvertLineR(string source) + { + listFinal.Clear(); + listRep.Clear(); + sbRep.Length = 0; + sbN.Length = 0; + int iReplace = 0; + DirectionType ePre = DirectionType.RTL; + char nextChar = '\0'; + for (int j = 0; j < source.Length; j++) + { + if (j < source.Length - 1) + nextChar = source[j + 1]; + else + nextChar = '\0'; + char item = source[j]; + DirectionType eCType = _GetDirection(item, nextChar, ePre, DirectionType.RTL); + if (eCType == DirectionType.LTR) + { + if (sbRep.Length == 0) + { + listFinal.Add('\x00bf'); + iReplace++; + } + + if (sbN.Length > 0) + sbRep.Append(sbN.ToString()); + sbN.Length = 0; + sbRep.Append(item); + } + else if (eCType == DirectionType.RTL) + { + if (sbRep.Length > 0) + { + listRep.Add(sbRep.ToString()); + } + sbRep.Length = 0; + + if (sbN.Length > 0) + { + for (int n = 0; n < sbN.Length; ++n) + { + listFinal.Add(sbN[n]); + } + } + sbN.Length = 0; + + item = _ProcessBracket(item); + listFinal.Add(item); + } + else + { + sbN.Append(item); + } + ePre = eCType; + } + if (sbRep.Length > 0) + { + listRep.Add(sbRep.ToString()); + } + + // ä¸€è¡Œä¸­éƒ½åªæœ‰ä¸­ç«‹å­—符的情况,就直接返回中立字符 [2018/12/6/ 16:34:38 by aq_1000] + if (sbN.Length > 0) + { + for (int n = 0; n < sbN.Length; ++n) + { + listFinal.Add(sbN[n]); + } + } + + sbFinal.Length = 0; + sbFinal.Append(listFinal.ToArray()); + for (int m = 0; m < iReplace; m++) + { + for (int n = 0; n < sbFinal.Length; n++) + { + if (sbFinal[n] == '\x00bf') + { + sbRep.Length = 0; + sbRep.Append(_Reverse(listRep[0])); + listRep.RemoveAt(0); + + // 字符串åå‘çš„æ—¶å€™é€ æˆæœ«å°¾ç©ºæ ¼è·‘到è¯é¦– [2018/4/11 20:04:35 --By aq_1000] + sbN.Length = 0; + for (int num4 = 0; num4 < sbRep.Length; num4++) + { + if (!_IsNeutrality(sbRep[num4])) + break; + sbN.Append(sbRep[num4]); + } + if (sbN.Length > 0) // è¯é¦–ç©ºæ ¼é‡æ–°æ”¾åˆ°è¯å°¾ + { + sbRep.Remove(0, sbN.Length); + for (int iSpace = sbN.Length - 1; iSpace >= 0; --iSpace) // 空格也è¦å–å + { + sbRep.Append(sbN[iSpace]); + } + } + + sbFinal.Replace(sbFinal[n].ToString(), sbRep.ToString(), n, 1); + break; + } + } + } + return sbFinal.ToString(); + } + + + private static string _Reverse(string source) + { + sbReverse.Length = 0; + int len = source.Length; + int i = len - 1; + while (i >= 0) + { + char ch = source[i]; + if (ch == '\r' && i != len - 1 && source[i + 1] == '\n') + { + i--; + continue; + } + + if (char.IsLowSurrogate(ch)) //ä¸è¦åå‘高低代ç†å¯¹ + { + sbReverse.Append(source[i - 1]); + sbReverse.Append(ch); + i--; + } + else + sbReverse.Append(ch); + i--; + } + + return sbReverse.ToString(); + } + + private static void InitChars() + { + // {isolated,final,lead,middle} [2018/11/27 16:04:18 --By aq_1000] + mapping.Add(0x621, new char[4] { (char)0xFE80, (char)0xFE8A, (char)0xFE8B, (char)0xFE8C }); // Hamza + mapping.Add(0x627, new char[4] { (char)0xFE8D, (char)0xFE8E, (char)0xFE8D, (char)0xFE8E }); // Alef + mapping.Add(0x623, new char[4] { (char)0xFE83, (char)0xFE84, (char)0xFE83, (char)0xFE84 }); // AlefHamza + mapping.Add(0x624, new char[4] { (char)0xFE85, (char)0xFE85, (char)0xFE85, (char)0xFE85 }); // WawHamza + mapping.Add(0x625, new char[4] { (char)0xFE87, (char)0xFE87, (char)0xFE87, (char)0xFE87 }); // AlefMaksoor + mapping.Add(0x649, new char[4] { (char)0xFBFC, (char)0xFBFD, (char)0xFBFE, (char)0xFBFF }); // AlefMagsora + mapping.Add(0x626, new char[4] { (char)0xFE89, (char)0xFE8A, (char)0xFE8B, (char)0xFE8C }); // HamzaNabera + mapping.Add(0x628, new char[4] { (char)0xFE8F, (char)0xFE90, (char)0xFE91, (char)0xFE92 }); // Ba + mapping.Add(0x62A, new char[4] { (char)0xFE95, (char)0xFE96, (char)0xFE97, (char)0xFE98 }); // Ta + mapping.Add(0x62B, new char[4] { (char)0xFE99, (char)0xFE9A, (char)0xFE9B, (char)0xFE9C }); // Tha2 + mapping.Add(0x62C, new char[4] { (char)0xFE9D, (char)0xFE9E, (char)0xFE9F, (char)0xFEA0 }); // Jeem + mapping.Add(0x62D, new char[4] { (char)0xFEA1, (char)0xFEA2, (char)0xFEA3, (char)0xFEA4 }); // H7aa + mapping.Add(0x62E, new char[4] { (char)0xFEA5, (char)0xFEA6, (char)0xFEA7, (char)0xFEA8 }); // Khaa2 + mapping.Add(0x62F, new char[4] { (char)0xFEA9, (char)0xFEAA, (char)0xFEA9, (char)0xFEAA }); // Dal + mapping.Add(0x630, new char[4] { (char)0xFEAB, (char)0xFEAC, (char)0xFEAB, (char)0xFEAC }); // Thal + mapping.Add(0x631, new char[4] { (char)0xFEAD, (char)0xFEAE, (char)0xFEAD, (char)0xFEAD }); // Ra2 + mapping.Add(0x632, new char[4] { (char)0xFEAF, (char)0xFEB0, (char)0xFEAF, (char)0xFEB0 }); // Zeen + mapping.Add(0x633, new char[4] { (char)0xFEB1, (char)0xFEB2, (char)0xFEB3, (char)0xFEB4 }); // Seen + mapping.Add(0x634, new char[4] { (char)0xFEB5, (char)0xFEB6, (char)0xFEB7, (char)0xFEB8 }); // Sheen + mapping.Add(0x635, new char[4] { (char)0xFEB9, (char)0xFEBA, (char)0xFEBB, (char)0xFEBC }); // S9a + mapping.Add(0x636, new char[4] { (char)0xFEBD, (char)0xFEBE, (char)0xFEBF, (char)0xFEC0 }); // Dha + mapping.Add(0x637, new char[4] { (char)0xFEC1, (char)0xFEC2, (char)0xFEC3, (char)0xFEC4 }); // T6a + mapping.Add(0x638, new char[4] { (char)0xFEC5, (char)0xFEC6, (char)0xFEC7, (char)0xFEC8 }); // T6ha + mapping.Add(0x639, new char[4] { (char)0xFEC9, (char)0xFECA, (char)0xFECB, (char)0xFECC }); // Ain + mapping.Add(0x63A, new char[4] { (char)0xFECD, (char)0xFECE, (char)0xFECF, (char)0xFED0 }); // Gain + mapping.Add(0x641, new char[4] { (char)0xFED1, (char)0xFED2, (char)0xFED3, (char)0xFED4 }); // Fa + mapping.Add(0x642, new char[4] { (char)0xFED5, (char)0xFED6, (char)0xFED7, (char)0xFED8 }); // Gaf + mapping.Add(0x643, new char[4] { (char)0xFED9, (char)0xFEDA, (char)0xFEDB, (char)0xFEDC }); // Kaf + mapping.Add(0x644, new char[4] { (char)0xFEDD, (char)0xFEDE, (char)0xFEDF, (char)0xFEE0 }); // Lam + mapping.Add(0x645, new char[4] { (char)0xFEE1, (char)0xFEE2, (char)0xFEE3, (char)0xFEE4 }); // Meem + mapping.Add(0x646, new char[4] { (char)0xFEE5, (char)0xFEE6, (char)0xFEE7, (char)0xFEE8 }); // Noon + mapping.Add(0x647, new char[4] { (char)0xFEE9, (char)0xFEEA, (char)0xFEEB, (char)0xFEEC }); // Ha + mapping.Add(0x648, new char[4] { (char)0xFEED, (char)0xFEEE, (char)0xFEED, (char)0xFEEE }); // Waw + mapping.Add(0x64A, new char[4] { (char)0xFEF1, (char)0xFEF2, (char)0xFEF3, (char)0xFEF4 }); // Ya + mapping.Add(0x622, new char[4] { (char)0xFE81, (char)0xFE81, (char)0xFE81, (char)0xFE81 }); // AlefMad + mapping.Add(0x629, new char[4] { (char)0xFE93, (char)0xFE94, (char)0xFE94, (char)0xFE94 }); // TaMarboota // 该字符åªä¼šå‡ºçŽ°åœ¨æœ«å°¾ [2018/4/10 16:04:18 --By aq_1000] + mapping.Add(0x67E, new char[4] { (char)0xFB56, (char)0xFB57, (char)0xFB58, (char)0xFB59 }); // PersianPe + mapping.Add(0x686, new char[4] { (char)0xFB7A, (char)0xFB7B, (char)0xFB7C, (char)0xFB7D }); // PersianChe + mapping.Add(0x698, new char[4] { (char)0xFB8A, (char)0xFB8B, (char)0xFB8A, (char)0xFB8B }); // PersianZe + mapping.Add(0x6AF, new char[4] { (char)0xFB92, (char)0xFB93, (char)0xFB94, (char)0xFB95 }); // PersianGaf + mapping.Add(0x6A9, new char[4] { (char)0xFB8E, (char)0xFB8F, (char)0xFB90, (char)0xFB91 }); // PersianGaf2 + + mapping.Add(0x6BE, new char[4] { (char)0xFEE9, (char)0xFEEA, (char)0xFEEB, (char)0xFEEC }); + mapping.Add(0x6CC, new char[4] { (char)0xFBFC, (char)0xFBFD, (char)0xFBFE, (char)0xFBFF }); + } + + // 是å¦ä¸­ç«‹æ–¹å‘字符 + private static bool _IsNeutrality(char uc) + { + return (uc == ':' || uc == ':' || uc == ' ' || /*uc == '%' ||*/ /*uc == '+' ||*/ /*uc == '-' ||*/ uc == '\n' || uc == '\r' || uc == '\t' || uc == '@' || + (uc >= 0x2600 && uc <= 0x27BF)); // è¡¨æƒ…ç¬¦å· + } + + // 是å¦å¥æœ«æ ‡ç‚¹ç¬¦å· + private static bool _IsEndPunctuation(char uc, char nextChar) + { + if (uc == '.') + return _IsNeutrality(nextChar); + return (uc == '!' || uc == 'ï¼' || uc == '。' || uc == 'ØŒ' || uc == '?' || uc == 'ØŸ'); + } + + // åˆ¤æ–­å­—ç¬¦æ–¹å‘ + private static DirectionType _GetDirection(char uc, char nextChar, DirectionType ePre, DirectionType eBase) + { + DirectionType eCType = ePre; + int uni = uc; + + if (_IsBracket(uc) || _IsEndPunctuation(uc, nextChar)) + { + eCType = eBase; // 括å·å’Œå¥æœ«æ ‡ç‚¹ç¬¦å·ï¼Œæ–¹å‘æ ¹æ®ä¸Šä¸ªå­—符为准 [2018/12/26/ 15:56:24 by aq_1000] + } + else if ((uni >= 0x660) && (uni <= 0x66D)) + { + eCType = DirectionType.LTR; + } + else if (IsArabicLetter(uc) || uc == '+' /*|| uc == '-'*/ || uc == '%') + { + eCType = DirectionType.RTL; + } + else if (uc == '-') + { + if (char.IsNumber(nextChar)) + eCType = DirectionType.LTR; + else + eCType = DirectionType.RTL; + } + else if (_IsNeutrality(uc)) // 中立方å‘字符,方å‘就和上一个字符一样 [2018/3/24 16:03:27 --By aq_1000] + { + if (ePre == DirectionType.UNKNOW || ePre == DirectionType.NEUTRAL) + { + if (char.IsNumber(nextChar)) // 数字都是弱LTRæ–¹å‘符,开头中立字符åŽé¢ç´§è·Ÿç€æ•°å­—çš„è¯ï¼Œä¸­ç«‹å­—符方å‘ç®—æ–‡æœ¬ä¸»æ–¹å‘ [IsDigit()åªæ˜¯0-9] [2018/12/20/ 16:32:32 by aq_1000] + { + eCType = BaseDirection; + } + else + eCType = DirectionType.NEUTRAL; + } + else + eCType = ePre; + } + else + eCType = DirectionType.LTR; + + return eCType; + } + + // æ˜¯å¦æ‹¬å· + private static bool _IsBracket(char uc) + { + return (uc == ')' || uc == '(' || uc == ')' || uc == '(' || + uc == ']' || uc == '[' || uc == '】' || uc == 'ã€' || + uc == '}' || uc == '{' || + // uc == '≥' || uc == '≤' || uc == '>' || uc == '<' || + uc == '》' || uc == '《' || uc == '“' || uc == 'â€' || uc == '"'); + } + + // 这些é…对符,在从å³è‡³å·¦æŽ’åˆ—ä¸­åº”è¯¥é€†åºæ˜¾ç¤º + private static char _ProcessBracket(char uc) + { + if (uc == '[') return ']'; + else if (uc == ']') return '['; + else if (uc == 'ã€') return '】'; + else if (uc == '】') return 'ã€'; + else if (uc == '{') return '}'; + else if (uc == '}') return '{'; + else if (uc == '(') return ')'; + else if (uc == ')') return '('; + else if (uc == '(') return ')'; + else if (uc == ')') return '('; + else if (uc == '<') return '>'; + else if (uc == '>') return '<'; + else if (uc == '《') return '》'; + else if (uc == '》') return '《'; + else if (uc == '≤') return '≥'; + else if (uc == '≥') return '≤'; + else if (uc == 'â€') return '“'; + else if (uc == 'â€') return '“'; + else return uc; + } + } +} + diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs.meta new file mode 100644 index 00000000..6210e7ee --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RTLSupport.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 575b3af943ee8a04bb4d8feb568b1d2e +timeCreated: 1521600498 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs new file mode 100644 index 00000000..1603ee67 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs @@ -0,0 +1,216 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class RichTextField : Container + { + /// + /// + /// + public IHtmlPageContext htmlPageContext { get; set; } + + /// + /// + /// + public HtmlParseOptions htmlParseOptions { get; private set; } + + /// + /// + /// + public Dictionary emojies { get; set; } + + /// + /// + /// + public TextField textField { get; private set; } + + public RichTextField() + { + gameObject.name = "RichTextField"; + this.opaque = true; + + htmlPageContext = HtmlPageContext.inst; + htmlParseOptions = new HtmlParseOptions(); + + this.textField = new TextField(); + textField.EnableRichSupport(this); + AddChild(textField); + } + + /// + /// + /// + virtual public string text + { + get { return textField.text; } + set { textField.text = value; } + } + + /// + /// + /// + virtual public string htmlText + { + get { return textField.htmlText; } + set { textField.htmlText = value; } + } + + /// + /// + /// + virtual public TextFormat textFormat + { + get { return textField.textFormat; } + set { textField.textFormat = value; } + } + + /// + /// + /// + /// + /// + public HtmlElement GetHtmlElement(string name) + { + List elements = textField.htmlElements; + int count = elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = elements[i]; + if (name.Equals(element.name, System.StringComparison.OrdinalIgnoreCase)) + return element; + } + + return null; + } + + /// + /// + /// + /// + /// + public HtmlElement GetHtmlElementAt(int index) + { + return textField.htmlElements[index]; + } + + /// + /// + /// + public int htmlElementCount + { + get { return textField.htmlElements.Count; } + } + + /// + /// + /// + /// + /// + public void ShowHtmlObject(int index, bool show) + { + HtmlElement element = textField.htmlElements[index]; + if (element.htmlObject != null && element.type != HtmlElementType.Link) + { + //set hidden flag + if (show) + element.status &= 253; //~(1<<1) + else + element.status |= 2; + + if ((element.status & 3) == 0) //not (hidden and clipped) + { + if ((element.status & 4) == 0) //not added + { + element.status |= 4; + element.htmlObject.Add(); + } + } + else + { + if ((element.status & 4) != 0) //added + { + element.status &= 251; + element.htmlObject.Remove(); + } + } + } + } + + public override void EnsureSizeCorrect() + { + textField.EnsureSizeCorrect(); + } + + override protected void OnSizeChanged() + { + textField.size = _contentRect.size; //åƒä¸‡ä¸å¯ä»¥è°ƒç”¨this.size,åŽè€…会触å‘EnsureSizeCorrect + + base.OnSizeChanged(); + } + + public override void Update(UpdateContext context) + { + textField.Redraw(); + + base.Update(context); + } + + public override void Dispose() + { + if ((_flags & Flags.Disposed) != 0) + return; + + CleanupObjects(); + + base.Dispose(); + } + + internal void CleanupObjects() + { + List elements = textField.htmlElements; + int count = elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = elements[i]; + if (element.htmlObject != null) + { + element.htmlObject.Remove(); + htmlPageContext.FreeObject(element.htmlObject); + } + } + } + + virtual internal void RefreshObjects() + { + List elements = textField.htmlElements; + int count = elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = elements[i]; + if (element.htmlObject != null) + { + if ((element.status & 3) == 0) //not (hidden and clipped) + { + if ((element.status & 4) == 0) //not added + { + element.status |= 4; + element.htmlObject.Add(); + } + } + else + { + if ((element.status & 4) != 0) //added + { + element.status &= 251; + element.htmlObject.Remove(); + } + } + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs.meta new file mode 100644 index 00000000..251300a9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/RichTextField.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 87b472f7ce488fa4bbd8942342458ccf +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs new file mode 100644 index 00000000..90b8548a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs @@ -0,0 +1,94 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class SelectionShape : DisplayObject, IMeshFactory + { + public readonly List rects; + + public SelectionShape() + { + CreateGameObject("SelectionShape"); + graphics = new NGraphics(gameObject); + graphics.texture = NTexture.Empty; + graphics.meshFactory = this; + + rects = new List(); + } + + /// + /// + /// + public Color color + { + get + { + return graphics.color; + } + set + { + graphics.color = value; + graphics.Tint(); + } + } + + public void Refresh() + { + int count = rects.Count; + if (count > 0) + { + Rect rect = new Rect(); + rect = rects[0]; + Rect tmp; + for (int i = 1; i < count; i++) + { + tmp = rects[i]; + rect = ToolSet.Union(ref rect, ref tmp); + } + SetSize(rect.xMax, rect.yMax); + } + else + SetSize(0, 0); + graphics.SetMeshDirty(); + } + + public void Clear() + { + rects.Clear(); + graphics.SetMeshDirty(); + } + + public void OnPopulateMesh(VertexBuffer vb) + { + int count = rects.Count; + if (count == 0 || this.color == Color.clear) + return; + + for (int i = 0; i < count; i++) + vb.AddQuad(rects[i]); + vb.AddTriangles(); + } + + protected override DisplayObject HitTest() + { + Vector2 localPoint = WorldToLocal(HitTestContext.worldPoint, HitTestContext.direction); + + if (_contentRect.Contains(localPoint)) + { + int count = rects.Count; + for (int i = 0; i < count; i++) + { + if (rects[i].Contains(localPoint)) + return this; + } + } + + return null; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs.meta new file mode 100644 index 00000000..359b947f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/SelectionShape.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7f1920b8ccf9c8b4ca5f2794991735d9 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs new file mode 100644 index 00000000..59e44e3a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs @@ -0,0 +1,1701 @@ +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class TextField : DisplayObject, IMeshFactory + { + VertAlignType _verticalAlign; + TextFormat _textFormat; + bool _input; + string _text; + AutoSizeType _autoSize; + bool _wordWrap; + bool _singleLine; + bool _html; + RTLSupport.DirectionType _textDirection; + int _maxWidth; + + List _elements; + List _lines; + List _charPositions; + + BaseFont _font; + float _textWidth; + float _textHeight; + bool _textChanged; + float _yOffset; + float _fontSizeScale; + float _renderScale; + int _fontVersion; + string _parsedText; + int _ellipsisCharIndex; + + RichTextField _richTextField; + + const int GUTTER_X = 2; + const int GUTTER_Y = 2; + const float IMAGE_BASELINE = 0.8f; + const int ELLIPSIS_LENGTH = 2; + static float[] STROKE_OFFSET = new float[] + { + -1, 0, 1, 0, + 0, -1, 0, 1, + -1, -1, 1, -1, + -1, 1, 1, 1 + }; + static List sLineChars = new List(); + + public TextField() + { + _flags |= Flags.TouchDisabled; + + _textFormat = new TextFormat(); + _fontSizeScale = 1; + _renderScale = UIContentScaler.scaleFactor; + + _wordWrap = false; + _text = string.Empty; + _parsedText = string.Empty; + + _elements = new List(0); + _lines = new List(1); + + CreateGameObject("TextField"); + graphics = new NGraphics(gameObject); + graphics.meshFactory = this; + } + + internal void EnableRichSupport(RichTextField richTextField) + { + _richTextField = richTextField; + if (richTextField is InputTextField) + { + _input = true; + EnableCharPositionSupport(); + } + } + + public void EnableCharPositionSupport() + { + if (_charPositions == null) + { + _charPositions = new List(); + _textChanged = true; + } + } + + /// + /// + /// + public TextFormat textFormat + { + get { return _textFormat; } + set + { + _textFormat = value; + ApplyFormat(); + } + } + + /// + /// + /// + public void ApplyFormat() + { + string fontName = _textFormat.font; + if (string.IsNullOrEmpty(fontName)) + fontName = UIConfig.defaultFont; + BaseFont newFont = FontManager.GetFont(fontName); + if (_font != newFont) + { + _font = newFont; + _fontVersion = _font.version; + graphics.SetShaderAndTexture(_font.shader, _font.mainTexture); + } + + if (!string.IsNullOrEmpty(_text)) + _textChanged = true; + } + + /// + /// + /// + public AlignType align + { + get { return _textFormat.align; } + set + { + if (_textFormat.align != value) + { + _textFormat.align = value; + if (!string.IsNullOrEmpty(_text)) + _textChanged = true; + } + } + } + + /// + /// + /// + public VertAlignType verticalAlign + { + get + { + return _verticalAlign; + } + set + { + if (_verticalAlign != value) + { + _verticalAlign = value; + if (!_textChanged) + ApplyVertAlign(); + } + } + } + + /// + /// + /// + public string text + { + get { return _text; } + set + { + if (_text == value && !_html) + return; + + _text = value; + _textChanged = true; + _html = false; + } + } + + /// + /// + /// + public string htmlText + { + get { return _text; } + set + { + if (_text == value && _html) + return; + + _text = value; + _textChanged = true; + _html = true; + } + } + + public string parsedText + { + get { return _parsedText; } + } + + /// + /// + /// + public AutoSizeType autoSize + { + get { return _autoSize; } + set + { + if (_autoSize != value) + { + _autoSize = value; + _textChanged = true; + } + } + } + + /// + /// + /// + public bool wordWrap + { + get { return _wordWrap; } + set + { + if (_wordWrap != value) + { + _wordWrap = value; + _textChanged = true; + } + } + } + + /// + /// + /// + public bool singleLine + { + get { return _singleLine; } + set + { + if (_singleLine != value) + { + _singleLine = value; + _textChanged = true; + } + } + } + + /// + /// + /// + public float stroke + { + get + { + return _textFormat.outline; + } + set + { + if (_textFormat.outline != value) + { + _textFormat.outline = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public Color strokeColor + { + get + { + return _textFormat.outlineColor; + } + set + { + if (_textFormat.outlineColor != value) + { + _textFormat.outlineColor = value; + graphics.SetMeshDirty(); + } + } + } + + /// + /// + /// + public Vector2 shadowOffset + { + get + { + return _textFormat.shadowOffset; + } + set + { + _textFormat.shadowOffset = value; + graphics.SetMeshDirty(); + } + } + + /// + /// + /// + public float textWidth + { + get + { + if (_textChanged) + BuildLines(); + + return _textWidth; + } + } + + /// + /// + /// + public float textHeight + { + get + { + if (_textChanged) + BuildLines(); + + return _textHeight; + } + } + + /// + /// + /// + public int maxWidth + { + get { return _maxWidth; } + set + { + if (_maxWidth != value) + { + _maxWidth = value; + _textChanged = true; + } + } + } + + /// + /// + /// + public List htmlElements + { + get + { + if (_textChanged) + BuildLines(); + + return _elements; + } + } + + /// + /// + /// + public List lines + { + get + { + if (_textChanged) + BuildLines(); + + return _lines; + } + } + + /// + /// + /// + public List charPositions + { + get + { + if (_textChanged) + BuildLines(); + + graphics.UpdateMesh(); + + return _charPositions; + } + } + + /// + /// + /// + public RichTextField richTextField + { + get { return _richTextField; } + } + + /// + /// + /// + public bool Redraw() + { + if (_font == null) + { + _font = FontManager.GetFont(UIConfig.defaultFont); + graphics.SetShaderAndTexture(_font.shader, _font.mainTexture); + _fontVersion = _font.version; + _textChanged = true; + } + + if (_font.keepCrisp && _renderScale != UIContentScaler.scaleFactor) + _textChanged = true; + + if (_font.version != _fontVersion) + { + _fontVersion = _font.version; + if (_font.mainTexture != graphics.texture) + { + graphics.SetShaderAndTexture(_font.shader, _font.mainTexture); + InvalidateBatchingState(); + } + + _textChanged = true; + } + + if (_textChanged) + BuildLines(); + + return graphics.UpdateMesh(); + } + + /// + /// + /// + public bool HasCharacter(char ch) + { + return _font.HasCharacter(ch); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void GetLinesShape(int startLine, float startCharX, int endLine, float endCharX, + bool clipped, + List resultRects) + { + LineInfo line1 = _lines[startLine]; + LineInfo line2 = _lines[endLine]; + bool leftAlign = _textFormat.align == AlignType.Left; + if (startLine == endLine) + { + Rect r = Rect.MinMaxRect(startCharX, line1.y, endCharX, line1.y + line1.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + } + else if (startLine == endLine - 1) + { + Rect r = Rect.MinMaxRect(startCharX, line1.y, leftAlign ? (GUTTER_X + line1.width) : _contentRect.xMax, line1.y + line1.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + r = Rect.MinMaxRect(GUTTER_X, line1.y + line1.height, endCharX, line2.y + line2.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + } + else + { + Rect r = Rect.MinMaxRect(startCharX, line1.y, leftAlign ? (GUTTER_X + line1.width) : _contentRect.xMax, line1.y + line1.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + for (int i = startLine + 1; i < endLine; i++) + { + LineInfo line = _lines[i]; + r = Rect.MinMaxRect(GUTTER_X, r.yMax, leftAlign ? (GUTTER_X + line.width) : _contentRect.xMax, line.y + line.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + } + r = Rect.MinMaxRect(GUTTER_X, r.yMax, endCharX, line2.y + line2.height); + if (clipped) + resultRects.Add(ToolSet.Intersection(ref r, ref _contentRect)); + else + resultRects.Add(r); + } + } + + override protected void OnSizeChanged() + { + if ((_flags & Flags.UpdatingSize) == 0) + { + if (_autoSize == AutoSizeType.Shrink || _autoSize == AutoSizeType.Ellipsis || _wordWrap && (_flags & Flags.WidthChanged) != 0) + _textChanged = true; + else if (_autoSize != AutoSizeType.None) + graphics.SetMeshDirty(); + + if (_verticalAlign != VertAlignType.Top) + ApplyVertAlign(); + } + + base.OnSizeChanged(); + } + + public override void EnsureSizeCorrect() + { + if (_textChanged && _autoSize != AutoSizeType.None) + BuildLines(); + } + + public override void Update(UpdateContext context) + { + if (_richTextField == null) //如果是richTextField,会在updateå‰ä¸»åŠ¨è°ƒç”¨äº†Redraw + Redraw(); + + base.Update(context); + } + + /// + /// å‡†å¤‡å­—ä½“çº¹ç† + /// + void RequestText() + { + if (!_html) + { + _font.SetFormat(_textFormat, _fontSizeScale); + _font.PrepareCharacters(_parsedText); + if (_autoSize == AutoSizeType.Ellipsis) + _font.PrepareCharacters("…"); + } + else + { + int count = _elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = _elements[i]; + if (element.type == HtmlElementType.Text) + { + _font.SetFormat(element.format, _fontSizeScale); + _font.PrepareCharacters(element.text); + if (_autoSize == AutoSizeType.Ellipsis) + _font.PrepareCharacters("…"); + } + } + } + } + + void BuildLines() + { + if (_font == null) + { + _font = FontManager.GetFont(UIConfig.defaultFont); + _fontVersion = _font.version; + graphics.SetShaderAndTexture(_font.shader, _font.mainTexture); + } + + _textChanged = false; + graphics.SetMeshDirty(); + _renderScale = UIContentScaler.scaleFactor; + _fontSizeScale = 1; + _ellipsisCharIndex = -1; + + Cleanup(); + + if (_text.Length == 0) + { + LineInfo emptyLine = LineInfo.Borrow(); + emptyLine.width = 0; + emptyLine.height = _font.GetLineHeight(_textFormat.size); + emptyLine.charIndex = emptyLine.charCount = 0; + emptyLine.y = emptyLine.y2 = GUTTER_Y; + _lines.Add(emptyLine); + + _textWidth = _textHeight = 0; + } + else + { + ParseText(); + BuildLines2(); + + if (_autoSize == AutoSizeType.Shrink) + DoShrink(); + } + + if (_autoSize == AutoSizeType.Both) + { + _flags |= Flags.UpdatingSize; + if (_richTextField != null) + { + if (_input) + { + float w = Mathf.Max(_textFormat.size, _textWidth); + float h = Mathf.Max(_font.GetLineHeight(_textFormat.size) + GUTTER_Y * 2, _textHeight); + _richTextField.SetSize(w, h); + } + else + _richTextField.SetSize(_textWidth, _textHeight); + } + else + SetSize(_textWidth, _textHeight); + InvalidateBatchingState(); + _flags &= ~Flags.UpdatingSize; + } + else if (_autoSize == AutoSizeType.Height) + { + _flags |= Flags.UpdatingSize; + if (_richTextField != null) + { + if (_input) + _richTextField.height = Mathf.Max(_font.GetLineHeight(_textFormat.size) + GUTTER_Y * 2, _textHeight); + else + _richTextField.height = _textHeight; + } + else + this.height = _textHeight; + InvalidateBatchingState(); + _flags &= ~Flags.UpdatingSize; + } + + _yOffset = 0; + ApplyVertAlign(); + } + + void ParseText() + { +#if RTL_TEXT_SUPPORT + _textDirection = RTLSupport.DetectTextDirection(_text); +#endif + if (_html) + { + HtmlParser.inst.Parse(_text, _textFormat, _elements, + _richTextField != null ? _richTextField.htmlParseOptions : null); + + _parsedText = string.Empty; + } + else + _parsedText = _text; + + int elementCount = _elements.Count; + if (elementCount == 0) + { + if (_textDirection != RTLSupport.DirectionType.UNKNOW) + _parsedText = RTLSupport.DoMapping(_parsedText); + + bool flag = _input || _richTextField != null && _richTextField.emojies != null; + if (!flag) + { + //æ£€æŸ¥æ–‡æœ¬ä¸­æ˜¯å¦æœ‰éœ€è¦è½¬æ¢çš„字符,如果没有,节çœä¸€ä¸ªnew StringBuilderçš„æ“作。 + int cnt = _parsedText.Length; + for (int i = 0; i < cnt; i++) + { + char ch = _parsedText[i]; + if (ch == '\r' || char.IsHighSurrogate(ch)) + { + flag = true; + break; + } + } + } + + if (flag) + { + StringBuilder buffer = new StringBuilder(); + ParseText(buffer, _parsedText, -1); + elementCount = _elements.Count; + _parsedText = buffer.ToString(); + } + } + else + { + StringBuilder buffer = new StringBuilder(); + int i = 0; + while (i < elementCount) + { + HtmlElement element = _elements[i]; + element.charIndex = buffer.Length; + if (element.type == HtmlElementType.Text) + { + if (_textDirection != RTLSupport.DirectionType.UNKNOW) + element.text = RTLSupport.DoMapping(element.text); + + i = ParseText(buffer, element.text, i); + elementCount = _elements.Count; + } + else if (element.isEntity) + buffer.Append(' '); + i++; + } + _parsedText = buffer.ToString(); + +#if RTL_TEXT_SUPPORT + // element.text拼接完åŽå†è¿›è¡Œä¸€æ¬¡åˆ¤æ–­æ–‡æœ¬ä¸»è¯­åºï¼Œé¿å…htmlæ ‡ç­¾å­˜åœ¨æŠŠæ–‡æœ¬å˜æˆæ··åˆæ–‡æœ¬ [2018/12/12/ 16:47:42 by aq_1000] + _textDirection = RTLSupport.DetectTextDirection(_parsedText); +#endif + } + } + + void BuildLines2() + { + float letterSpacing = _textFormat.letterSpacing * _fontSizeScale; + float lineSpacing = (_textFormat.lineSpacing - 1) * _fontSizeScale; + float rectWidth = _contentRect.width - GUTTER_X * 2; + float rectHeight = _contentRect.height > 0 ? Mathf.Max(_contentRect.height, _font.GetLineHeight(_textFormat.size)) : 0; + float glyphWidth = 0, glyphHeight = 0, baseline = 0; + short wordLen = 0; + bool wordPossible = false; + float posx = 0; + bool checkEdge = _autoSize == AutoSizeType.Ellipsis; + + TextFormat format = _textFormat; + _font.SetFormat(format, _fontSizeScale); + bool wrap = _wordWrap && !_singleLine; + if (_maxWidth > 0) + { + wrap = true; + rectWidth = _maxWidth - GUTTER_X * 2; + } + _textWidth = _textHeight = 0; + + RequestText(); + + int elementCount = _elements.Count; + int elementIndex = 0; + HtmlElement element = null; + if (elementCount > 0) + element = _elements[elementIndex]; + int textLength = _parsedText.Length; + + LineInfo line = LineInfo.Borrow(); + _lines.Add(line); + line.y = line.y2 = GUTTER_Y; + sLineChars.Clear(); + + for (int charIndex = 0; charIndex < textLength; charIndex++) + { + char ch = _parsedText[charIndex]; + + glyphWidth = glyphHeight = baseline = 0; + + while (element != null && element.charIndex == charIndex) + { + if (element.type == HtmlElementType.Text) + { + format = element.format; + _font.SetFormat(format, _fontSizeScale); + } + else + { + IHtmlObject htmlObject = element.htmlObject; + if (_richTextField != null && htmlObject == null) + { + element.space = (int)(rectWidth - line.width - 4); + htmlObject = _richTextField.htmlPageContext.CreateObject(_richTextField, element); + element.htmlObject = htmlObject; + } + if (htmlObject != null) + { + glyphWidth = htmlObject.width + 2; + glyphHeight = htmlObject.height; + baseline = glyphHeight * IMAGE_BASELINE; + } + + if (element.isEntity) + ch = '\0'; //indicate it is a place holder + } + + elementIndex++; + if (elementIndex < elementCount) + element = _elements[elementIndex]; + else + element = null; + } + + if (ch == '\0' || ch == '\n') + { + wordPossible = false; + } + else if (_font.GetGlyph(ch == '\t' ? ' ' : ch, out glyphWidth, out glyphHeight, out baseline)) + { + if (ch == '\t') + glyphWidth *= 4; + + if (wordPossible) + { + if (char.IsWhiteSpace(ch)) + { + wordLen = 0; + } + else if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' + || ch >= '0' && ch <= '9' + || ch == '.' || ch == '"' || ch == '\'' + || format.specialStyle == TextFormat.SpecialStyle.Subscript + || format.specialStyle == TextFormat.SpecialStyle.Superscript + || _textDirection != RTLSupport.DirectionType.UNKNOW && RTLSupport.IsArabicLetter(ch)) + { + wordLen++; + } + else + wordPossible = false; + } + else if (char.IsWhiteSpace(ch)) + { + wordLen = 0; + wordPossible = true; + } + else if (format.specialStyle == TextFormat.SpecialStyle.Subscript + || format.specialStyle == TextFormat.SpecialStyle.Superscript) + { + if (sLineChars.Count > 0) + { + wordLen = 2; //é¿å…上标和下标折到下一行 + wordPossible = true; + } + } + else + wordPossible = false; + } + else + wordPossible = false; + + sLineChars.Add(new LineCharInfo() { width = glyphWidth, height = glyphHeight, baseline = baseline }); + if (glyphWidth != 0) + { + if (posx != 0) + posx += letterSpacing; + posx += glyphWidth; + } + + if (ch == '\n' && !_singleLine) + { + UpdateLineInfo(line, letterSpacing, sLineChars.Count); + + LineInfo newLine = LineInfo.Borrow(); + _lines.Add(newLine); + newLine.y = line.y + (line.height + lineSpacing); + if (newLine.y < GUTTER_Y) //lineSpacing maybe negative + newLine.y = GUTTER_Y; + newLine.y2 = newLine.y; + newLine.charIndex = line.charIndex + line.charCount; + + if (checkEdge && line.y + line.height < rectHeight) + _ellipsisCharIndex = line.charIndex + Math.Max(0, line.charCount - ELLIPSIS_LENGTH); + + sLineChars.Clear(); + wordPossible = false; + posx = 0; + line = newLine; + } + else if (posx > rectWidth) + { + if (wrap) + { + int lineCharCount = sLineChars.Count; + int toMoveChars; + + if (wordPossible && wordLen < 20 && lineCharCount > 2) //if word had broken, move word to new line + { + toMoveChars = wordLen; + //we caculate the line width WITHOUT the tailing space + UpdateLineInfo(line, letterSpacing, lineCharCount - (toMoveChars + 1)); + line.charCount++; //but keep it in this line. + } + else + { + toMoveChars = lineCharCount > 1 ? 1 : 0; //if only one char here, we cant move it to new line + UpdateLineInfo(line, letterSpacing, lineCharCount - toMoveChars); + } + + LineInfo newLine = LineInfo.Borrow(); + _lines.Add(newLine); + newLine.y = line.y + (line.height + lineSpacing); + if (newLine.y < GUTTER_Y) + newLine.y = GUTTER_Y; + newLine.y2 = newLine.y; + newLine.charIndex = line.charIndex + line.charCount; + + posx = 0; + if (toMoveChars != 0) + { + for (int i = line.charCount; i < lineCharCount; i++) + { + LineCharInfo ci = sLineChars[i]; + if (posx != 0) + posx += letterSpacing; + posx += ci.width; + } + + sLineChars.RemoveRange(0, line.charCount); + } + else + sLineChars.Clear(); + + if (checkEdge && line.y + line.height < rectHeight) + _ellipsisCharIndex = line.charIndex + Math.Max(0, line.charCount - ELLIPSIS_LENGTH); + + wordPossible = false; + line = newLine; + } + else if (checkEdge && _ellipsisCharIndex == -1) + _ellipsisCharIndex = line.charIndex + Math.Max(0, line.charCount - ELLIPSIS_LENGTH); + } + } + + UpdateLineInfo(line, letterSpacing, sLineChars.Count); + + if (_textWidth > 0) + _textWidth += GUTTER_X * 2; + _textHeight = line.y + line.height + GUTTER_Y; + + if (checkEdge && _textWidth <= _contentRect.width && _textHeight <= _contentRect.height + GUTTER_Y) + _ellipsisCharIndex = -1; + + _textWidth = Mathf.RoundToInt(_textWidth); + _textHeight = Mathf.RoundToInt(_textHeight); + } + + void UpdateLineInfo(LineInfo line, float letterSpacing, int cnt) + { + for (int i = 0; i < cnt; i++) + { + LineCharInfo ci = sLineChars[i]; + if (ci.baseline > line.baseline) + { + line.height += (ci.baseline - line.baseline); + line.baseline = ci.baseline; + } + + if (ci.height - ci.baseline > line.height - line.baseline) + line.height += (ci.height - ci.baseline - (line.height - line.baseline)); + + if (ci.width > 0) + { + if (line.width != 0) + line.width += letterSpacing; + line.width += ci.width; + } + } + + if (line.height == 0) + { + if (_lines.Count == 1) + line.height = _textFormat.size; + else + line.height = _lines[_lines.Count - 2].height; + } + + if (line.width > _textWidth) + _textWidth = line.width; + + line.charCount = (short)cnt; + } + + void DoShrink() + { + if (_lines.Count > 1 && _textHeight > _contentRect.height) + { + //多行的情况,涉åŠåˆ°è‡ªåЍæ¢è¡Œï¼Œå¾—用二分法查找最åˆé€‚çš„æ¯”ä¾‹ï¼Œä¼šæ¶ˆè€—å¤šä¸€ç‚¹è®¡ç®—èµ„æº + int low = 0; + int high = _textFormat.size; + + //å…ˆå°è¯•猜测一个比例 + _fontSizeScale = Mathf.Sqrt(_contentRect.height / _textHeight); + int cur = Mathf.FloorToInt(_fontSizeScale * _textFormat.size); + + while (true) + { + LineInfo.Return(_lines); + BuildLines2(); + + if (_textWidth > _contentRect.width || _textHeight > _contentRect.height) + high = cur; + else + low = cur; + if (high - low > 1 || high != low && cur == high) + { + cur = low + (high - low) / 2; + _fontSizeScale = (float)cur / _textFormat.size; + } + else + break; + } + } + else if (_textWidth > _contentRect.width) + { + _fontSizeScale = _contentRect.width / _textWidth; + + LineInfo.Return(_lines); + BuildLines2(); + + if (_textWidth > _contentRect.width) //如果还超出,缩å°ä¸€ç‚¹å†æ¥ä¸€æ¬¡ + { + int size = Mathf.FloorToInt(_textFormat.size * _fontSizeScale); + size--; + _fontSizeScale = (float)size / _textFormat.size; + + LineInfo.Return(_lines); + BuildLines2(); + } + } + } + + int ParseText(StringBuilder buffer, string source, int elementIndex) + { + int textLength = source.Length; + int j = 0; + int appendPos = 0; + bool hasEmojies = _richTextField != null && _richTextField.emojies != null; + while (j < textLength) + { + char ch = source[j]; + if (ch == '\r') + { + buffer.Append(source, appendPos, j - appendPos); + if (j != textLength - 1 && source[j + 1] == '\n') + j++; + appendPos = j + 1; + buffer.Append('\n'); + } + else + { + bool highSurrogate = char.IsHighSurrogate(ch); + if (hasEmojies) + { + uint emojiKey = 0; + Emoji emoji; + if (highSurrogate) + emojiKey = ((uint)source[j + 1] & 0x03FF) + ((((uint)ch & 0x03FF) + 0x40) << 10); + else + emojiKey = ch; + if (_richTextField.emojies.TryGetValue(emojiKey, out emoji)) + { + HtmlElement imageElement = HtmlElement.GetElement(HtmlElementType.Image); + imageElement.Set("src", emoji.url); + if (emoji.width != 0) + imageElement.Set("width", emoji.width); + if (emoji.height != 0) + imageElement.Set("height", emoji.height); + if (highSurrogate) + imageElement.text = source.Substring(j, 2); + else + imageElement.text = source.Substring(j, 1); + imageElement.format.align = _textFormat.align; + _elements.Insert(++elementIndex, imageElement); + + buffer.Append(source, appendPos, j - appendPos); + appendPos = j; + imageElement.charIndex = buffer.Length; + } + } + + if (highSurrogate) + { + buffer.Append(source, appendPos, j - appendPos); + appendPos = j + 2; + j++;//跳过lowSurrogate + buffer.Append(' '); + } + } + j++; + } + if (appendPos < textLength) + buffer.Append(source, appendPos, j - appendPos); + + return elementIndex; + } + + public void OnPopulateMesh(VertexBuffer vb) + { + if (_textWidth == 0 && _lines.Count == 1) + { + if (_charPositions != null) + { + _charPositions.Clear(); + _charPositions.Add(new CharPosition()); + } + + if (_richTextField != null) + _richTextField.RefreshObjects(); + + return; + } + + float letterSpacing = _textFormat.letterSpacing * _fontSizeScale; + TextFormat format = _textFormat; + _font.SetFormat(format, _fontSizeScale); + _font.UpdateGraphics(graphics); + + float rectWidth = _contentRect.width > 0 ? (_contentRect.width - GUTTER_X * 2) : 0; + float rectHeight = _contentRect.height > 0 ? Mathf.Max(_contentRect.height, _font.GetLineHeight(format.size)) : 0; + + if (_charPositions != null) + _charPositions.Clear(); + + List vertList = vb.vertices; + List uvList = vb.uvs; + List uv2List = vb.uvs2; + List colList = vb.colors; + + HtmlLink currentLink = null; + float linkStartX = 0; + int linkStartLine = 0; + + float posx = 0; + float indent_x; + bool clipping = !_input && (_autoSize == AutoSizeType.None || _autoSize == AutoSizeType.Ellipsis); + bool lineClipped; + AlignType lineAlign; + float glyphWidth, glyphHeight, baseline; + short vertCount; + float underlineStart; + float strikethroughStart; + int minFontSize; + int maxFontSize; + string rtlLine = null; + + int elementIndex = 0; + int elementCount = _elements.Count; + HtmlElement element = null; + if (elementCount > 0) + element = _elements[elementIndex]; + + int lineCount = _lines.Count; + for (int i = 0; i < lineCount; ++i) + { + LineInfo line = _lines[i]; + if (line.charCount == 0) + continue; + + lineClipped = clipping && i != 0 && line.y + line.height > rectHeight; + lineAlign = format.align; + if (element != null && element.charIndex == line.charIndex) + lineAlign = element.format.align; + else + lineAlign = format.align; + + if (_textDirection == RTLSupport.DirectionType.RTL) + { + if (lineAlign == AlignType.Center) + indent_x = (int)((rectWidth + line.width) / 2); + else if (lineAlign == AlignType.Right) + indent_x = rectWidth; + else + indent_x = line.width + GUTTER_X * 2; + + if (indent_x > rectWidth) + indent_x = rectWidth; + + posx = indent_x - GUTTER_X; + } + else + { + if (lineAlign == AlignType.Center) + indent_x = (int)((rectWidth - line.width) / 2); + else if (lineAlign == AlignType.Right) + indent_x = rectWidth - line.width; + else + indent_x = 0; + + if (indent_x < 0) + indent_x = 0; + + posx = GUTTER_X + indent_x; + } + + int lineCharCount = line.charCount; + underlineStart = posx; + strikethroughStart = posx; + minFontSize = maxFontSize = format.size; + + if (_textDirection != RTLSupport.DirectionType.UNKNOW) + { + rtlLine = _parsedText.Substring(line.charIndex, lineCharCount); + if (_textDirection == RTLSupport.DirectionType.RTL) + rtlLine = RTLSupport.ConvertLineR(rtlLine); + else + rtlLine = RTLSupport.ConvertLineL(rtlLine); + lineCharCount = rtlLine.Length; + } + + for (int j = 0; j < lineCharCount; j++) + { + int charIndex = line.charIndex + j; + char ch = rtlLine != null ? rtlLine[j] : _parsedText[charIndex]; + bool isEllipsis = charIndex == _ellipsisCharIndex; + + while (element != null && charIndex == element.charIndex) + { + if (element.type == HtmlElementType.Text) + { + vertCount = 0; + if (format.underline != element.format.underline) + { + if (format.underline) + { + if (!lineClipped) + { + float lineWidth; + if (_textDirection == RTLSupport.DirectionType.UNKNOW) + lineWidth = (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx) - underlineStart; + else + lineWidth = underlineStart - (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx); + if (lineWidth > 0) + vertCount += (short)_font.DrawLine(underlineStart < posx ? underlineStart : posx, -(line.y + line.baseline), lineWidth, + maxFontSize, 0, vertList, uvList, uv2List, colList); + } + maxFontSize = 0; + } + else + underlineStart = posx; + } + + if (format.strikethrough != element.format.strikethrough) + { + if (format.strikethrough) + { + if (!lineClipped) + { + float lineWidth; + if (_textDirection == RTLSupport.DirectionType.UNKNOW) + lineWidth = (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx) - strikethroughStart; + else + lineWidth = strikethroughStart - (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx); + if (lineWidth > 0) + vertCount += (short)_font.DrawLine(strikethroughStart < posx ? strikethroughStart : posx, -(line.y + line.baseline), lineWidth, + minFontSize, 1, vertList, uvList, uv2List, colList); + } + minFontSize = int.MaxValue; + } + else + strikethroughStart = posx; + } + + if (vertCount > 0 && _charPositions != null) + { + CharPosition cp = _charPositions[_charPositions.Count - 1]; + cp.vertCount += vertCount; + _charPositions[_charPositions.Count - 1] = cp; + } + + format = element.format; + minFontSize = Math.Min(minFontSize, format.size); + maxFontSize = Math.Max(maxFontSize, format.size); + _font.SetFormat(format, _fontSizeScale); + } + else if (element.type == HtmlElementType.Link) + { + currentLink = (HtmlLink)element.htmlObject; + if (currentLink != null) + { + element.position = Vector2.zero; + currentLink.SetPosition(0, 0); + linkStartX = posx; + linkStartLine = i; + } + } + else if (element.type == HtmlElementType.LinkEnd) + { + if (currentLink != null) + { + currentLink.SetArea(linkStartLine, linkStartX, i, posx); + currentLink = null; + } + } + else + { + IHtmlObject htmlObj = element.htmlObject; + if (htmlObj != null) + { + if (_textDirection == RTLSupport.DirectionType.RTL) + posx -= htmlObj.width - 2; + + if (_charPositions != null) + { + CharPosition cp = new CharPosition(); + cp.lineIndex = (short)i; + cp.charIndex = _charPositions.Count; + cp.imgIndex = (short)(elementIndex + 1); + cp.offsetX = posx; + cp.width = (short)htmlObj.width; + _charPositions.Add(cp); + } + + if (isEllipsis || lineClipped || clipping && (posx < GUTTER_X || posx > GUTTER_X && posx + htmlObj.width > _contentRect.width - GUTTER_X)) + element.status |= 1; + else + element.status &= 254; + + element.position = new Vector2(posx + 1, line.y + line.baseline - htmlObj.height * IMAGE_BASELINE); + htmlObj.SetPosition(element.position.x, element.position.y); + + if (_textDirection == RTLSupport.DirectionType.RTL) + posx -= letterSpacing; + else + posx += htmlObj.width + letterSpacing + 2; + } + } + + if (element.isEntity) + ch = '\0'; + + elementIndex++; + if (elementIndex < elementCount) + element = _elements[elementIndex]; + else + element = null; + } + + if (isEllipsis) + ch = '…'; + else if (ch == '\0') + continue; + + if (_font.GetGlyph(ch == '\t' ? ' ' : ch, out glyphWidth, out glyphHeight, out baseline)) + { + if (ch == '\t') + glyphWidth *= 4; + + if (!isEllipsis) + { + if (_textDirection == RTLSupport.DirectionType.RTL) + { + if (lineClipped || clipping && (rectWidth < 7 || posx != (indent_x - GUTTER_X)) && posx < GUTTER_X - 0.5f) //è¶…å‡ºåŒºåŸŸï¼Œå‰ªè£ + { + posx -= (letterSpacing + glyphWidth); + continue; + } + + posx -= glyphWidth; + } + else + { + if (lineClipped || clipping && (rectWidth < 7 || posx != (GUTTER_X + indent_x)) && posx + glyphWidth > _contentRect.width - GUTTER_X + 0.5f) //è¶…å‡ºåŒºåŸŸï¼Œå‰ªè£ + { + posx += letterSpacing + glyphWidth; + continue; + } + } + } + + vertCount = (short)_font.DrawGlyph(posx, -(line.y + line.baseline), vertList, uvList, uv2List, colList); + + if (_charPositions != null) + { + CharPosition cp = new CharPosition(); + cp.lineIndex = (short)i; + cp.charIndex = _charPositions.Count; + cp.vertCount = vertCount; + cp.offsetX = posx; + cp.width = (short)glyphWidth; + _charPositions.Add(cp); + } + + if (_textDirection == RTLSupport.DirectionType.RTL) + posx -= letterSpacing; + else + posx += letterSpacing + glyphWidth; + } + else //if GetGlyph failed + { + if (_charPositions != null) + { + CharPosition cp = new CharPosition(); + cp.lineIndex = (short)i; + cp.charIndex = _charPositions.Count; + cp.offsetX = posx; + _charPositions.Add(cp); + } + + if (_textDirection == RTLSupport.DirectionType.RTL) + posx -= letterSpacing; + else + posx += letterSpacing; + } + + if (isEllipsis) + lineClipped = true; + }//text loop + + if (!lineClipped) + { + vertCount = 0; + if (format.underline) + { + float lineWidth; + if (_textDirection == RTLSupport.DirectionType.UNKNOW) + lineWidth = (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx) - underlineStart; + else + lineWidth = underlineStart - (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx); + if (lineWidth > 0) + vertCount += (short)_font.DrawLine(underlineStart < posx ? underlineStart : posx, -(line.y + line.baseline), lineWidth, + maxFontSize, 0, vertList, uvList, uv2List, colList); + } + + if (format.strikethrough) + { + float lineWidth; + if (_textDirection == RTLSupport.DirectionType.UNKNOW) + lineWidth = (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx) - strikethroughStart; + else + lineWidth = strikethroughStart - (clipping ? Mathf.Clamp(posx, GUTTER_X, GUTTER_X + rectWidth) : posx); + if (lineWidth > 0) + vertCount += (short)_font.DrawLine(strikethroughStart < posx ? strikethroughStart : posx, -(line.y + line.baseline), lineWidth, + minFontSize, 1, vertList, uvList, uv2List, colList); + } + + if (vertCount > 0 && _charPositions != null) + { + CharPosition cp = _charPositions[_charPositions.Count - 1]; + cp.vertCount += vertCount; + _charPositions[_charPositions.Count - 1] = cp; + } + } + + }//line loop + + if (element != null && element.type == HtmlElementType.LinkEnd && currentLink != null) + currentLink.SetArea(linkStartLine, linkStartX, lineCount - 1, posx); + + if (_charPositions != null) + { + CharPosition cp = new CharPosition(); + cp.lineIndex = (short)(lineCount - 1); + cp.charIndex = _charPositions.Count; + cp.offsetX = posx; + _charPositions.Add(cp); + } + + int count = vertList.Count; + if (count > 65000) + { + Debug.LogWarning("Text is too large. A mesh may not have more than 65000 vertices."); + vertList.RemoveRange(65000, count - 65000); + colList.RemoveRange(65000, count - 65000); + uvList.RemoveRange(65000, count - 65000); + if (uv2List.Count > 0) + uv2List.RemoveRange(65000, count - 65000); + count = 65000; + } + + if (_font.customOutline) + { + bool hasShadow = _textFormat.shadowOffset.x != 0 || _textFormat.shadowOffset.y != 0; + int allocCount = count; + int drawDirs = 0; + if (_textFormat.outline != 0) + { + drawDirs = UIConfig.enhancedTextOutlineEffect ? 8 : 4; + allocCount += count * drawDirs; + } + if (hasShadow) + allocCount += count; + if (allocCount > 65000) + { + Debug.LogWarning("Text is too large. Outline/shadow effect cannot be completed."); + allocCount = count; + } + + if (allocCount != count) + { + VertexBuffer vb2 = VertexBuffer.Begin(); + List vertList2 = vb2.vertices; + List colList2 = vb2.colors; + + Color32 col = _textFormat.outlineColor; + float outline = _textFormat.outline; + if (outline != 0) + { + for (int j = 0; j < drawDirs; j++) + { + for (int i = 0; i < count; i++) + { + Vector3 vert = vertList[i]; + vertList2.Add(new Vector3(vert.x + STROKE_OFFSET[j * 2] * outline, vert.y + STROKE_OFFSET[j * 2 + 1] * outline, 0)); + colList2.Add(col); + } + + vb2.uvs.AddRange(uvList); + if (uv2List.Count > 0) + vb2.uvs2.AddRange(uv2List); + } + } + + if (hasShadow) + { + col = _textFormat.shadowColor; + Vector2 offset = _textFormat.shadowOffset; + for (int i = 0; i < count; i++) + { + Vector3 vert = vertList[i]; + vertList2.Add(new Vector3(vert.x + offset.x, vert.y - offset.y, 0)); + colList2.Add(col); + } + + vb2.uvs.AddRange(uvList); + if (uv2List.Count > 0) + vb2.uvs2.AddRange(uv2List); + } + + vb.Insert(vb2); + vb2.End(); + } + } + + vb.AddTriangles(); + + if (_richTextField != null) + _richTextField.RefreshObjects(); + } + + void Cleanup() + { + if (_richTextField != null) + _richTextField.CleanupObjects(); + + HtmlElement.ReturnElements(_elements); + LineInfo.Return(_lines); + _textWidth = 0; + _textHeight = 0; + _parsedText = string.Empty; + _textDirection = RTLSupport.DirectionType.UNKNOW; + + if (_charPositions != null) + _charPositions.Clear(); + } + + void ApplyVertAlign() + { + float oldOffset = _yOffset; + if (_autoSize == AutoSizeType.Both || _autoSize == AutoSizeType.Height + || _verticalAlign == VertAlignType.Top) + _yOffset = 0; + else + { + float dh; + if (_textHeight == 0 && _lines.Count > 0) + dh = _contentRect.height - _lines[0].height; + else + dh = _contentRect.height - _textHeight; + if (dh < 0) + dh = 0; + if (_verticalAlign == VertAlignType.Middle) + _yOffset = (int)(dh / 2); + else + _yOffset = dh; + } + + if (oldOffset != _yOffset) + { + int cnt = _lines.Count; + for (int i = 0; i < cnt; i++) + _lines[i].y = _lines[i].y2 + _yOffset; + + graphics.SetMeshDirty(); + } + } + + /// + /// + /// + public class LineInfo + { + /// + /// 行的宽度 + /// + public float width; + + /// + /// 行的高度 + /// + public float height; + + /// + /// 文字渲染基线 + /// + public float baseline; + + /// + /// 行首的字符索引 + /// + public int charIndex; + + /// + /// 行包括的字符个数 + /// + public short charCount; + + /// + /// 行的yè½´ä½ç½® + /// + public float y; + + /// + /// 行的yè½´ä½ç½®çš„备份 + /// + internal float y2; + + static Stack pool = new Stack(); + + /// + /// + /// + /// + public static LineInfo Borrow() + { + if (pool.Count > 0) + { + LineInfo ret = pool.Pop(); + ret.width = ret.height = ret.baseline = 0; + ret.y = ret.y2 = 0; + ret.charIndex = ret.charCount = 0; + return ret; + } + else + return new LineInfo(); + } + + /// + /// + /// + /// + public static void Return(LineInfo value) + { + pool.Push(value); + } + + /// + /// + /// + /// + public static void Return(List values) + { + int cnt = values.Count; + for (int i = 0; i < cnt; i++) + pool.Push(values[i]); + + values.Clear(); + } + } + + /// + /// + /// + public struct LineCharInfo + { + public float width; + public float height; + public float baseline; + } + + /// + /// + /// + public struct CharPosition + { + /// + /// 字符索引 + /// + public int charIndex; + + /// + /// 字符所在的行索引 + /// + public short lineIndex; + + /// + /// 字符的xåç§» + /// + public float offsetX; + + /// + /// 字符å ç”¨çš„顶点数é‡ã€‚ + /// + public short vertCount; + + /// + /// 字符的宽度 + /// + public short width; + + /// + /// 大于0表示图片索引。 + /// + public short imgIndex; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs.meta new file mode 100644 index 00000000..79887150 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextField.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d8a05d6d82201104cb6b5156ca294f54 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs new file mode 100644 index 00000000..a61a4aab --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs @@ -0,0 +1,175 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public partial class TextFormat + { + public enum SpecialStyle + { + None, + Superscript, + Subscript + } + + /// + /// + /// + public int size; + + /// + /// + /// + public string font; + + /// + /// + /// + public Color color; + + /// + /// + /// + public int lineSpacing; + + /// + /// + /// + public int letterSpacing; + + /// + /// + /// + public bool bold; + + /// + /// + /// + public bool underline; + + /// + /// + /// + public bool italic; + + /// + /// + /// + public bool strikethrough; + + /// + /// + /// + public Color32[] gradientColor; + + /// + /// + /// + public AlignType align; + + /// + /// + /// + public SpecialStyle specialStyle; + + /// + /// + /// + public float outline; + + /// + /// + /// + public Color outlineColor; + + /// + /// + /// + public Vector2 shadowOffset; + + /// + /// + /// + public Color shadowColor; + + public TextFormat() + { + color = Color.black; + size = 12; + lineSpacing = 3; + outlineColor = shadowColor = Color.black; + } + + /// + /// + /// + /// + public void SetColor(uint value) + { + uint rr = (value >> 16) & 0x0000ff; + uint gg = (value >> 8) & 0x0000ff; + uint bb = value & 0x0000ff; + float r = rr / 255.0f; + float g = gg / 255.0f; + float b = bb / 255.0f; + color = new Color(r, g, b, 1); + } + + /// + /// + /// + /// + /// + public bool EqualStyle(TextFormat aFormat) + { + return size == aFormat.size && color == aFormat.color + && bold == aFormat.bold && underline == aFormat.underline + && italic == aFormat.italic + && strikethrough == aFormat.strikethrough + && gradientColor == aFormat.gradientColor + && align == aFormat.align + && specialStyle == aFormat.specialStyle; + } + + /// + /// Only base NOT all formats will be copied + /// + /// + public void CopyFrom(TextFormat source) + { + this.size = source.size; + this.font = source.font; + this.color = source.color; + this.lineSpacing = source.lineSpacing; + this.letterSpacing = source.letterSpacing; + this.bold = source.bold; + this.underline = source.underline; + this.italic = source.italic; + this.strikethrough = source.strikethrough; + if (source.gradientColor != null) + { + this.gradientColor = new Color32[4]; + source.gradientColor.CopyTo(this.gradientColor, 0); + } + else + this.gradientColor = null; + this.align = source.align; + this.specialStyle = source.specialStyle; + } + + public void FillVertexColors(Color32[] vertexColors) + { + if (gradientColor == null) + vertexColors[0] = vertexColors[1] = vertexColors[2] = vertexColors[3] = color; + else + { + vertexColors[0] = gradientColor[1]; + vertexColors[1] = gradientColor[0]; + vertexColors[2] = gradientColor[2]; + vertexColors[3] = gradientColor[3]; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs.meta new file mode 100644 index 00000000..3966372f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TextFormat.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ecffbe294c108da4ab8a1c573e3d4dfd +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs new file mode 100644 index 00000000..dd637ab2 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs @@ -0,0 +1,65 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class TouchScreenKeyboard : IKeyboard + { + UnityEngine.TouchScreenKeyboard _keyboard; + + public bool done + { +#if UNITY_2017_2_OR_NEWER + get + { + return _keyboard == null + || _keyboard.status == UnityEngine.TouchScreenKeyboard.Status.Done + || _keyboard.status == UnityEngine.TouchScreenKeyboard.Status.Canceled + || _keyboard.status == UnityEngine.TouchScreenKeyboard.Status.LostFocus; + } +#else + get { return _keyboard == null || _keyboard.done || _keyboard.wasCanceled; } +#endif + } + + public bool supportsCaret + { + get { return false; } + } + + public string GetInput() + { + if (_keyboard != null) + { + string s = _keyboard.text; + + if (this.done) + _keyboard = null; + + return s; + } + else + return null; + } + + public void Open(string text, bool autocorrection, bool multiline, bool secure, bool alert, string textPlaceholder, int keyboardType, bool hideInput) + { + if (_keyboard != null) + return; + + UnityEngine.TouchScreenKeyboard.hideInput = hideInput; + _keyboard = UnityEngine.TouchScreenKeyboard.Open(text, (TouchScreenKeyboardType)keyboardType, autocorrection, multiline, secure, alert, textPlaceholder); + } + + public void Close() + { + if (_keyboard != null) + { + _keyboard.active = false; + _keyboard = null; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs.meta new file mode 100644 index 00000000..b7bebfb1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TouchScreenKeyboard.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cb24d1c92a1114a4f9db5688cc3fa35b +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs new file mode 100644 index 00000000..b4b3a154 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs @@ -0,0 +1,248 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// 文字打字效果。先调用Start,然åŽPrint。 + /// + public class TypingEffect + { + protected TextField _textField; + protected Vector3[] _backupVerts; + protected Vector3[] _vertices; + + protected bool _stroke; + protected bool _shadow; + + protected int _printIndex; + protected int _mainLayerStart; + protected int _strokeLayerStart; + protected int _strokeDrawDirs; + protected int _vertIndex; + protected int _mainLayerVertCount; + + protected bool _started; + + /// + /// + /// + /// + public TypingEffect(TextField textField) + { + _textField = textField; + _textField.EnableCharPositionSupport(); + } + + /// + /// + /// + /// + public TypingEffect(GTextField textField) + { + if (textField is GRichTextField) + _textField = ((RichTextField)textField.displayObject).textField; + else + _textField = (TextField)textField.displayObject; + _textField.EnableCharPositionSupport(); + } + + /// + /// 总输出次数 + /// + public int totalTimes + { + get + { + int times = 0; + List charPositions = _textField.charPositions; + for (int i = 0; i < charPositions.Count - 1; i++) + { + if (charPositions[i].imgIndex > 0) //这是一个图片 + times++; + else if (!char.IsWhiteSpace(_textField.parsedText[i])) + times++; + } + return times; + } + } + + /// + /// 开始打字效果。å¯ä»¥é‡å¤è°ƒç”¨é‡å¤å¯åŠ¨ã€‚ + /// + public void Start() + { + _textField.graphics.meshModifier -= OnMeshModified; + _textField.Redraw(); + _textField.graphics.meshModifier += OnMeshModified; + + _stroke = false; + _shadow = false; + _strokeDrawDirs = 4; + _mainLayerStart = 0; + _mainLayerVertCount = 0; + _printIndex = 0; + _vertIndex = 0; + _started = true; + + int vertCount = _textField.graphics.mesh.vertexCount; + _backupVerts = _textField.graphics.mesh.vertices; + if (_vertices == null || _vertices.Length != vertCount) + _vertices = new Vector3[vertCount]; + Vector3 zero = Vector3.zero; + for (int i = 0; i < vertCount; i++) + _vertices[i] = zero; + _textField.graphics.mesh.vertices = _vertices; + + //éšè—所有混排的对象 + if (_textField.richTextField != null) + { + int ec = _textField.richTextField.htmlElementCount; + for (int i = 0; i < ec; i++) + _textField.richTextField.ShowHtmlObject(i, false); + } + + int charCount = _textField.charPositions.Count; + for (int i = 0; i < charCount; i++) + { + TextField.CharPosition cp = _textField.charPositions[i]; + _mainLayerVertCount += cp.vertCount; + } + + if (_mainLayerVertCount < vertCount) //说明有æè¾¹æˆ–者阴影 + { + int repeat = vertCount / _mainLayerVertCount; + _stroke = repeat > 2; + _shadow = repeat % 2 == 0; + _mainLayerStart = vertCount - vertCount / repeat; + _strokeLayerStart = _shadow ? (vertCount / repeat) : 0; + _strokeDrawDirs = repeat > 8 ? 8 : 4; + } + } + + /// + /// è¾“å‡ºä¸€ä¸ªå­—ç¬¦ã€‚å¦‚æžœå·²ç»æ²¡æœ‰å‰©ä½™çš„字符,返回false。 + /// + /// + public bool Print() + { + if (!_started) + return false; + + TextField.CharPosition cp; + List charPositions = _textField.charPositions; + int listCnt = charPositions.Count; + + while (_printIndex < listCnt - 1) //最åŽä¸€ä¸ªæ˜¯å ä½çš„,无效的,所以-1 + { + cp = charPositions[_printIndex++]; + if (cp.vertCount > 0) + output(cp.vertCount); + if (cp.imgIndex > 0) //这是一个图片 + { + _textField.richTextField.ShowHtmlObject(cp.imgIndex - 1, true); + return true; + } + else if (!char.IsWhiteSpace(_textField.parsedText[_printIndex - 1])) + return true; + } + + Cancel(); + return false; + } + + private void output(int vertCount) + { + int start, end; + + start = _mainLayerStart + _vertIndex; + end = start + vertCount; + for (int i = start; i < end; i++) + _vertices[i] = _backupVerts[i]; + + if (_stroke) + { + start = _strokeLayerStart + _vertIndex; + end = start + vertCount; + for (int i = start; i < end; i++) + { + for (int j = 0; j < _strokeDrawDirs; j++) + { + int k = i + _mainLayerVertCount * j; + _vertices[k] = _backupVerts[k]; + } + } + } + + if (_shadow) + { + start = _vertIndex; + end = start + vertCount; + for (int i = start; i < end; i++) + { + _vertices[i] = _backupVerts[i]; + } + } + + _textField.graphics.mesh.vertices = _vertices; + + _vertIndex += vertCount; + } + + /// + /// 打å°çš„å程。 + /// + /// æ¯ä¸ªå­—符输出的时间间隔 + /// + public IEnumerator Print(float interval) + { + while (Print()) + yield return new WaitForSeconds(interval); + } + + /// + /// ä½¿ç”¨å›ºå®šæ—¶é—´é—´éš”å®Œæˆæ•´ä¸ªæ‰“å°è¿‡ç¨‹ã€‚ + /// + /// + public void PrintAll(float interval) + { + Timers.inst.StartCoroutine(Print(interval)); + } + + public void Cancel() + { + if (!_started) + return; + + _started = false; + _textField.graphics.meshModifier -= OnMeshModified; + _textField.graphics.SetMeshDirty(); + } + + /// + /// 当打字过程中,文本å¯èƒ½ä¼šç”±äºŽå­—ä½“çº¹ç†æ›´æ”¹è€Œå‘生字体é‡å»ºï¼Œè¦å¤„ç†è¿™ç§æƒ…况。 + /// 图片对象ä¸éœ€è¦å¤„ç†ï¼Œå› ä¸ºHtmlElement.status里设定的éšè—标志ä¸ä¼šå› ä¸ºMesh更新而被冲掉。 + /// + void OnMeshModified() + { + if (_textField.graphics.mesh.vertexCount != _backupVerts.Length) //å¯èƒ½æ–‡å­—都改了 + { + Cancel(); + return; + } + + _backupVerts = _textField.graphics.mesh.vertices; + + int vertCount = _vertices.Length; + Vector3 zero = Vector3.zero; + for (int i = 0; i < vertCount; i++) + { + if (_vertices[i] != zero) + _vertices[i] = _backupVerts[i]; + } + + _textField.graphics.mesh.vertices = _vertices; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs.meta new file mode 100644 index 00000000..de2f1ac9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/Text/TypingEffect.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 213be0a4bfae47c4ebf643f5ee856399 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs new file mode 100644 index 00000000..b00c886e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs @@ -0,0 +1,310 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// UpdateContext is for internal use. + /// + public class UpdateContext + { + public struct ClipInfo + { + public Rect rect; + public Vector4 clipBox; + public bool soft; + public Vector4 softness;//left-top-right-bottom + public uint clipId; + public int rectMaskDepth; + public int referenceValue; + public bool reversed; + } + + Stack _clipStack; + + public bool clipped; + public ClipInfo clipInfo; + + public int renderingOrder; + public int batchingDepth; + public int rectMaskDepth; + public int stencilReferenceValue; + public int stencilCompareValue; + + public float alpha; + public bool grayed; + + public static UpdateContext current; + public static bool working; + + public static event Action OnBegin; + public static event Action OnEnd; + + static Action _tmpBegin; + + public UpdateContext() + { + _clipStack = new Stack(); + } + + /// + /// + /// + public void Begin() + { + current = this; + + renderingOrder = 0; + batchingDepth = 0; + rectMaskDepth = 0; + stencilReferenceValue = 0; + alpha = 1; + grayed = false; + + clipped = false; + _clipStack.Clear(); + + Stats.ObjectCount = 0; + Stats.GraphicsCount = 0; + + _tmpBegin = OnBegin; + OnBegin = null; + + //å…许OnBeginé‡Œå†æ¬¡Addï¼Œè¿™é‡Œæ²¡æœ‰åšæ­»é”检查 + while (_tmpBegin != null) + { + _tmpBegin.Invoke(); + _tmpBegin = OnBegin; + OnBegin = null; + } + + working = true; + } + + /// + /// + /// + public void End() + { + working = false; + + if (OnEnd != null) + OnEnd.Invoke(); + + OnEnd = null; + } + + /// + /// + /// + /// + /// + /// + public void EnterClipping(uint clipId, Rect clipRect, Vector4? softness) + { + _clipStack.Push(clipInfo); + + if (rectMaskDepth > 0) + clipRect = ToolSet.Intersection(ref clipInfo.rect, ref clipRect); + + clipped = true; + clipInfo.rectMaskDepth = ++rectMaskDepth; + /* clipPos = xy * clipBox.zw + clipBox.xy + * 利用这个公å¼ï¼Œä½¿clipPoså˜ä¸ºå½“å‰é¡¶ç‚¹è·ç¦»å‰ªåˆ‡åŒºåŸŸä¸­å¿ƒçš„è·ç¦»å€¼ï¼Œå‰ªåˆ‡åŒºåŸŸçš„大å°ä¸º2x2 + * 那么abs(clipPos)>1的都是在剪切区域外 + */ + clipInfo.rect = clipRect; + clipRect.x = clipRect.x + clipRect.width * 0.5f; + clipRect.y = clipRect.y + clipRect.height * 0.5f; + clipRect.width *= 0.5f; + clipRect.height *= 0.5f; + if (clipRect.width == 0 || clipRect.height == 0) + clipInfo.clipBox = new Vector4(-2, -2, 0, 0); + else + clipInfo.clipBox = new Vector4(-clipRect.x / clipRect.width, -clipRect.y / clipRect.height, + 1.0f / clipRect.width, 1.0f / clipRect.height); + clipInfo.clipId = clipId; + clipInfo.soft = softness != null; + if (clipInfo.soft) + { + clipInfo.softness = (Vector4)softness; + float vx = clipInfo.rect.width * Screen.height * 0.25f; + float vy = clipInfo.rect.height * Screen.height * 0.25f; + + if (clipInfo.softness.x > 0) + clipInfo.softness.x = vx / clipInfo.softness.x; + else + clipInfo.softness.x = 10000f; + + if (clipInfo.softness.y > 0) + clipInfo.softness.y = vy / clipInfo.softness.y; + else + clipInfo.softness.y = 10000f; + + if (clipInfo.softness.z > 0) + clipInfo.softness.z = vx / clipInfo.softness.z; + else + clipInfo.softness.z = 10000f; + + if (clipInfo.softness.w > 0) + clipInfo.softness.w = vy / clipInfo.softness.w; + else + clipInfo.softness.w = 10000f; + } + } + + /// + /// + /// + /// + /// + public void EnterClipping(uint clipId, bool reversedMask) + { + _clipStack.Push(clipInfo); + + if (stencilReferenceValue == 0) + stencilReferenceValue = 1; + else + stencilReferenceValue = stencilReferenceValue << 1; + + if (reversedMask) + { + if (clipInfo.reversed) + stencilCompareValue = (stencilReferenceValue >> 1) - 1; + else + stencilCompareValue = stencilReferenceValue - 1; + } + else + stencilCompareValue = (stencilReferenceValue << 1) - 1; + + clipInfo.clipId = clipId; + clipInfo.referenceValue = stencilReferenceValue; + clipInfo.reversed = reversedMask; + clipped = true; + } + + /// + /// + /// + public void LeaveClipping() + { + clipInfo = _clipStack.Pop(); + stencilReferenceValue = clipInfo.referenceValue; + rectMaskDepth = clipInfo.rectMaskDepth; + clipped = stencilReferenceValue != 0 || rectMaskDepth != 0; + } + + public void EnterPaintingMode() + { + //Reset clipping + _clipStack.Push(clipInfo); + + clipInfo.rectMaskDepth = 0; + clipInfo.referenceValue = 0; + clipInfo.reversed = false; + clipped = false; + } + + public void LeavePaintingMode() + { + clipInfo = _clipStack.Pop(); + stencilReferenceValue = clipInfo.referenceValue; + rectMaskDepth = clipInfo.rectMaskDepth; + clipped = stencilReferenceValue != 0 || rectMaskDepth != 0; + } + + public void ApplyClippingProperties(Material mat, bool isStdMaterial) + { + if (rectMaskDepth > 0) //在矩形剪è£ä¸‹ï¼Œä¸”䏿˜¯é®ç½©å¯¹è±¡ + { + mat.SetVector(ShaderConfig.ID_ClipBox, clipInfo.clipBox); + if (clipInfo.soft) + mat.SetVector(ShaderConfig.ID_ClipSoftness, clipInfo.softness); + } + + if (stencilReferenceValue > 0) + { + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Equal); + mat.SetInt(ShaderConfig.ID_Stencil, stencilCompareValue); + mat.SetInt(ShaderConfig.ID_Stencil2, stencilCompareValue); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Keep); + mat.SetInt(ShaderConfig.ID_StencilReadMask, stencilReferenceValue | (stencilReferenceValue - 1)); + mat.SetInt(ShaderConfig.ID_ColorMask, 15); + } + else + { + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Always); + mat.SetInt(ShaderConfig.ID_Stencil, 0); + mat.SetInt(ShaderConfig.ID_Stencil2, 0); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Keep); + mat.SetInt(ShaderConfig.ID_StencilReadMask, 255); + mat.SetInt(ShaderConfig.ID_ColorMask, 15); + } + + if (!isStdMaterial) + { + if (rectMaskDepth > 0) + { + if (clipInfo.soft) + mat.EnableKeyword("SOFT_CLIPPED"); + else + mat.EnableKeyword("CLIPPED"); + } + else + { + mat.DisableKeyword("CLIPPED"); + mat.DisableKeyword("SOFT_CLIPPED"); + } + } + } + + public void ApplyAlphaMaskProperties(Material mat, bool erasing) + { + if (!erasing) + { + if (stencilReferenceValue == 1) + { + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Always); + mat.SetInt(ShaderConfig.ID_Stencil, 1); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Replace); + mat.SetInt(ShaderConfig.ID_StencilReadMask, 255); + mat.SetInt(ShaderConfig.ID_ColorMask, 0); + } + else + { + if (stencilReferenceValue != 0 & _clipStack.Peek().reversed) + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.NotEqual); + else + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Equal); + mat.SetInt(ShaderConfig.ID_Stencil, stencilReferenceValue | (stencilReferenceValue - 1)); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Replace); + mat.SetInt(ShaderConfig.ID_StencilReadMask, stencilReferenceValue - 1); + mat.SetInt(ShaderConfig.ID_ColorMask, 0); + } + } + else + { + if (stencilReferenceValue != 0 & _clipStack.Peek().reversed) + { + int refValue = stencilReferenceValue | (stencilReferenceValue - 1); + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Equal); + mat.SetInt(ShaderConfig.ID_Stencil, refValue); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Zero); + mat.SetInt(ShaderConfig.ID_StencilReadMask, refValue); + mat.SetInt(ShaderConfig.ID_ColorMask, 0); + } + else + { + int refValue = stencilReferenceValue - 1; + mat.SetInt(ShaderConfig.ID_StencilComp, (int)UnityEngine.Rendering.CompareFunction.Equal); + mat.SetInt(ShaderConfig.ID_Stencil, refValue); + mat.SetInt(ShaderConfig.ID_StencilOp, (int)UnityEngine.Rendering.StencilOp.Replace); + mat.SetInt(ShaderConfig.ID_StencilReadMask, refValue); + mat.SetInt(ShaderConfig.ID_ColorMask, 0); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs.meta new file mode 100644 index 00000000..033daaf6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Core/UpdateContext.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fa81e163380612a4a9591fe57a5b442c +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event.meta new file mode 100644 index 00000000..04f508c5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: faa71f0e576742d46865b6bb7422b7f0 +folderAsset: yes +timeCreated: 1460480287 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs new file mode 100644 index 00000000..843e6040 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs @@ -0,0 +1,198 @@ +using System.Timers; +#if FAIRYGUI_TOLUA +using System; +using LuaInterface; +#endif + +namespace FairyGUI +{ + /// + /// + /// + class EventBridge + { + public EventDispatcher owner; + + EventCallback0 _callback0; + EventCallback1 _callback1; + EventCallback1 _captureCallback; + internal bool _dispatching; + private float _intervalTime = 0; + private bool _isOnCall = true; + public EventBridge(EventDispatcher owner) + { + this.owner = owner; + } + + public void AddCapture(EventCallback1 callback) + { + _captureCallback -= callback; + _captureCallback += callback; + } + + public void RemoveCapture(EventCallback1 callback) + { + _captureCallback -= callback; + } + + public void Add(EventCallback1 callback) + { + _callback1 -= callback; + _callback1 += callback; + } + + public void Remove(EventCallback1 callback) + { + _callback1 -= callback; + } + + public void Add(EventCallback0 callback) + { + _callback0 -= callback; + _callback0 += callback; + } + + public void SetInterval(float timer) + { + _intervalTime = timer; + } + + public void Remove(EventCallback0 callback) + { + _callback0 -= callback; + } + +#if FAIRYGUI_TOLUA + public void Add(LuaFunction func, LuaTable self) + { + EventCallback1 callback; + if(self != null) + callback = (EventCallback1)DelegateTraits.Create(func, self); + else + callback = (EventCallback1)DelegateTraits.Create(func); + _callback1 -= callback; + _callback1 += callback; + } + + public void Add(LuaFunction func, GComponent self) + { + if (self._peerTable == null) + throw new Exception("self is not connected to lua."); + + Add(func, self._peerTable); + } + + public void Remove(LuaFunction func, LuaTable self) + { + LuaState state = func.GetLuaState(); + LuaDelegate target; + if (self != null) + target = state.GetLuaDelegate(func, self); + else + target = state.GetLuaDelegate(func); + + Delegate[] ds = _callback1.GetInvocationList(); + + for (int i = 0; i < ds.Length; i++) + { + LuaDelegate ld = ds[i].Target as LuaDelegate; + if (ld != null && ld.Equals(target)) + { + _callback1 = (EventCallback1)Delegate.Remove(_callback1, ds[i]); + //DelayDispose will cause problem + //state.DelayDispose(ld.func); + //if (ld.self != null) + // state.DelayDispose(ld.self); + break; + } + } + } + + public void Remove(LuaFunction func, GComponent self) + { + if (self._peerTable == null) + throw new Exception("self is not connected to lua."); + + Remove(func, self._peerTable); + } +#endif + + public bool isEmpty + { + get { return _callback1 == null && _callback0 == null && _captureCallback == null; } + } + + public void Clear() + { +#if FAIRYGUI_TOLUA + //if (_callback1 != null) + //{ + // Delegate[] ds = _callback1.GetInvocationList(); + // for (int i = 0; i < ds.Length; i++) + // { + // LuaDelegate ld = ds[i].Target as LuaDelegate; + // if (ld != null) + // { + // LuaState state = ld.func.GetLuaState(); + // state.DelayDispose(ld.func); + // if (ld.self != null) + // state.DelayDispose(ld.self); + // } + // } + //} +#endif + _callback1 = null; + _callback0 = null; + _captureCallback = null; + } + + public void CallInternal(EventContext context) + { + if (_isOnCall) + { + if (_intervalTime > 0) + { + _isOnCall = false; + Timers.inst.Add(_intervalTime, 0, (object context)=> + { + _isOnCall = true; + }); + } + } + else + { + return; + } + _dispatching = true; + context.sender = owner; + try + { + if (_callback1 != null) + _callback1(context); + if (_callback0 != null) + _callback0(); + } + finally + { + _dispatching = false; + } + } + + public void CallCaptureInternal(EventContext context) + { + if (_captureCallback == null) + return; + + _dispatching = true; + context.sender = owner; + try + { + _captureCallback(context); + } + finally + { + _dispatching = false; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs.meta new file mode 100644 index 00000000..98fb222a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventBridge.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e9712bee5e6977647989e012a6a332a6 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs new file mode 100644 index 00000000..0750dc3f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs @@ -0,0 +1,94 @@ +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + public class EventContext + { + /// + /// + /// + public EventDispatcher sender { get; internal set; } + + /// + /// / + /// + public object initiator { get; internal set; } + + /// + /// / + /// + public InputEvent inputEvent { get; internal set; } + + /// + /// + /// + public string type; + + /// + /// + /// + public object data; + + internal bool _defaultPrevented; + internal bool _stopsPropagation; + internal bool _touchCapture; + + internal List callChain = new List(); + + /// + /// + /// + public void StopPropagation() + { + _stopsPropagation = true; + } + + /// + /// + /// + public void PreventDefault() + { + _defaultPrevented = true; + } + + /// + /// + /// + public void CaptureTouch() + { + _touchCapture = true; + } + + /// + /// + /// + public bool isDefaultPrevented + { + get { return _defaultPrevented; } + } + + static Stack pool = new Stack(); + internal static EventContext Get() + { + if (pool.Count > 0) + { + EventContext context = pool.Pop(); + context._stopsPropagation = false; + context._defaultPrevented = false; + context._touchCapture = false; + return context; + } + else + return new EventContext(); + } + + internal static void Return(EventContext value) + { + pool.Push(value); + } + } + +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs.meta new file mode 100644 index 00000000..a956a27d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventContext.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3391a1fa2fc33b7448dfdf3e7c48880d +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs new file mode 100644 index 00000000..916db4ab --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs @@ -0,0 +1,515 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + public delegate void EventCallback0(); + public delegate void EventCallback1(EventContext context); + + /// + /// + /// + public class EventDispatcher : IEventDispatcher + { + Dictionary _dic; + + public EventDispatcher() + { + } + + /// + /// + /// + /// + /// + public void AddEventListener(string strType, EventCallback1 callback) + { + GetBridge(strType).Add(callback); + } + + /// + /// + /// + /// + /// + public void AddEventListener(string strType, EventCallback0 callback) + { + GetBridge(strType).Add(callback); + } + + /// + /// + /// + /// + /// + public void RemoveEventListener(string strType, EventCallback1 callback) + { + if (_dic == null) + return; + + EventBridge bridge = null; + if (_dic.TryGetValue(strType, out bridge)) + bridge.Remove(callback); + } + + /// + /// + /// + /// + /// + public void RemoveEventListener(string strType, EventCallback0 callback) + { + if (_dic == null) + return; + + EventBridge bridge = null; + if (_dic.TryGetValue(strType, out bridge)) + bridge.Remove(callback); + } + + /// + /// + /// + /// + /// + public void AddCapture(string strType, EventCallback1 callback) + { + GetBridge(strType).AddCapture(callback); + } + + /// + /// + /// + /// + /// + public void RemoveCapture(string strType, EventCallback1 callback) + { + if (_dic == null) + return; + + EventBridge bridge = null; + if (_dic.TryGetValue(strType, out bridge)) + bridge.RemoveCapture(callback); + } + + /// + /// + /// + public void RemoveEventListeners() + { + RemoveEventListeners(null); + } + + /// + /// + /// + /// + public void RemoveEventListeners(string strType) + { + if (_dic == null) + return; + + if (strType != null) + { + EventBridge bridge; + if (_dic.TryGetValue(strType, out bridge)) + bridge.Clear(); + } + else + { + foreach (KeyValuePair kv in _dic) + kv.Value.Clear(); + } + } + + /// + /// + /// + /// + /// + public bool hasEventListeners(string strType) + { + EventBridge bridge = TryGetEventBridge(strType); + if (bridge == null) + return false; + + return !bridge.isEmpty; + } + + /// + /// + /// + /// + /// + public bool isDispatching(string strType) + { + EventBridge bridge = TryGetEventBridge(strType); + if (bridge == null) + return false; + + return bridge._dispatching; + } + + internal EventBridge TryGetEventBridge(string strType) + { + if (_dic == null) + return null; + + EventBridge bridge = null; + _dic.TryGetValue(strType, out bridge); + return bridge; + } + + internal EventBridge GetEventBridge(string strType) + { + if (_dic == null) + _dic = new Dictionary(); + + EventBridge bridge = null; + if (!_dic.TryGetValue(strType, out bridge)) + { + bridge = new EventBridge(this); + _dic[strType] = bridge; + } + return bridge; + } + + /// + /// + /// + /// + /// + public bool DispatchEvent(string strType) + { + return DispatchEvent(strType, null); + } + + /// + /// + /// + /// + /// + /// + public bool DispatchEvent(string strType, object data) + { + return InternalDispatchEvent(strType, null, data, null); + } + + public bool DispatchEvent(string strType, object data, object initiator) + { + return InternalDispatchEvent(strType, null, data, initiator); + } + + static InputEvent sCurrentInputEvent = new InputEvent(); + + internal bool InternalDispatchEvent(string strType, EventBridge bridge, object data, object initiator) + { + if (bridge == null) + bridge = TryGetEventBridge(strType); + + EventBridge gBridge = null; + if ((this is DisplayObject) && ((DisplayObject)this).gOwner != null) + gBridge = ((DisplayObject)this).gOwner.TryGetEventBridge(strType); + + bool b1 = bridge != null && !bridge.isEmpty; + bool b2 = gBridge != null && !gBridge.isEmpty; + if (b1 || b2) + { + EventContext context = EventContext.Get(); + context.initiator = initiator != null ? initiator : this; + context.type = strType; + context.data = data; + if (data is InputEvent) + sCurrentInputEvent = (InputEvent)data; + context.inputEvent = sCurrentInputEvent; + + if (b1) + { + bridge.CallCaptureInternal(context); + bridge.CallInternal(context); + } + + if (b2) + { + gBridge.CallCaptureInternal(context); + gBridge.CallInternal(context); + } + + EventContext.Return(context); + context.initiator = null; + context.sender = null; + context.data = null; + + return context._defaultPrevented; + } + else + return false; + } + + /// + /// + /// + /// + /// + public bool DispatchEvent(EventContext context) + { + EventBridge bridge = TryGetEventBridge(context.type); + EventBridge gBridge = null; + if ((this is DisplayObject) && ((DisplayObject)this).gOwner != null) + gBridge = ((DisplayObject)this).gOwner.TryGetEventBridge(context.type); + + EventDispatcher savedSender = context.sender; + + if (bridge != null && !bridge.isEmpty) + { + bridge.CallCaptureInternal(context); + bridge.CallInternal(context); + } + + if (gBridge != null && !gBridge.isEmpty) + { + gBridge.CallCaptureInternal(context); + gBridge.CallInternal(context); + } + + context.sender = savedSender; + return context._defaultPrevented; + } + + /// + /// + /// + /// + /// + /// + /// + internal bool BubbleEvent(string strType, object data, List addChain) + { + EventContext context = EventContext.Get(); + context.initiator = this; + + context.type = strType; + context.data = data; + if (data is InputEvent) + sCurrentInputEvent = (InputEvent)data; + context.inputEvent = sCurrentInputEvent; + List bubbleChain = context.callChain; + bubbleChain.Clear(); + + GetChainBridges(strType, bubbleChain, true); + + int length = bubbleChain.Count; + for (int i = length - 1; i >= 0; i--) + { + bubbleChain[i].CallCaptureInternal(context); + if (context._touchCapture) + { + context._touchCapture = false; + if (strType == "onTouchBegin") + Stage.inst.AddTouchMonitor(context.inputEvent.touchId, bubbleChain[i].owner); + } + } + + if (!context._stopsPropagation) + { + for (int i = 0; i < length; ++i) + { + bubbleChain[i].CallInternal(context); + + if (context._touchCapture) + { + context._touchCapture = false; + if (strType == "onTouchBegin") + Stage.inst.AddTouchMonitor(context.inputEvent.touchId, bubbleChain[i].owner); + } + + if (context._stopsPropagation) + break; + } + + if (addChain != null) + { + length = addChain.Count; + for (int i = 0; i < length; ++i) + { + EventBridge bridge = addChain[i]; + if (bubbleChain.IndexOf(bridge) == -1) + { + bridge.CallCaptureInternal(context); + bridge.CallInternal(context); + } + } + } + } + + EventContext.Return(context); + context.initiator = null; + context.sender = null; + context.data = null; + return context._defaultPrevented; + } + + /// + /// + /// + /// + /// + /// + public bool BubbleEvent(string strType, object data) + { + return BubbleEvent(strType, data, null); + } + + /// + /// + /// + /// + /// + /// + public bool BroadcastEvent(string strType, object data) + { + EventContext context = EventContext.Get(); + context.initiator = this; + context.type = strType; + context.data = data; + if (data is InputEvent) + sCurrentInputEvent = (InputEvent)data; + context.inputEvent = sCurrentInputEvent; + List bubbleChain = context.callChain; + bubbleChain.Clear(); + + if (this is Container) + GetChildEventBridges(strType, (Container)this, bubbleChain); + else if (this is GComponent) + GetChildEventBridges(strType, (GComponent)this, bubbleChain); + + int length = bubbleChain.Count; + for (int i = 0; i < length; ++i) + bubbleChain[i].CallInternal(context); + + EventContext.Return(context); + context.initiator = null; + context.sender = null; + context.data = null; + return context._defaultPrevented; + } + + EventBridge GetBridge(string strType) + { + if (strType == null) + throw new Exception("event type cant be null"); + + if (_dic == null) + _dic = new Dictionary(); + + EventBridge bridge = null; + if (!_dic.TryGetValue(strType, out bridge)) + { + bridge = new EventBridge(this); + _dic[strType] = bridge; + } + + return bridge; + } + + static void GetChildEventBridges(string strType, Container container, List bridges) + { + EventBridge bridge = container.TryGetEventBridge(strType); + if (bridge != null) + bridges.Add(bridge); + if (container.gOwner != null) + { + bridge = container.gOwner.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + bridges.Add(bridge); + } + + int count = container.numChildren; + for (int i = 0; i < count; ++i) + { + DisplayObject obj = container.GetChildAt(i); + if (obj is Container) + GetChildEventBridges(strType, (Container)obj, bridges); + else + { + bridge = obj.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + bridges.Add(bridge); + + if (obj.gOwner != null) + { + bridge = obj.gOwner.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + bridges.Add(bridge); + } + } + } + } + + static void GetChildEventBridges(string strType, GComponent container, List bridges) + { + EventBridge bridge = container.TryGetEventBridge(strType); + if (bridge != null) + bridges.Add(bridge); + + int count = container.numChildren; + for (int i = 0; i < count; ++i) + { + GObject obj = container.GetChildAt(i); + if (obj is GComponent) + GetChildEventBridges(strType, (GComponent)obj, bridges); + else + { + bridge = obj.TryGetEventBridge(strType); + if (bridge != null) + bridges.Add(bridge); + } + } + } + + internal void GetChainBridges(string strType, List chain, bool bubble) + { + EventBridge bridge = TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + chain.Add(bridge); + + if ((this is DisplayObject) && ((DisplayObject)this).gOwner != null) + { + bridge = ((DisplayObject)this).gOwner.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + chain.Add(bridge); + } + + if (!bubble) + return; + + if (this is DisplayObject) + { + DisplayObject element = (DisplayObject)this; + while ((element = element.parent) != null) + { + bridge = element.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + chain.Add(bridge); + + if (element.gOwner != null) + { + bridge = element.gOwner.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + chain.Add(bridge); + } + } + } + else if (this is GObject) + { + GObject element = (GObject)this; + while ((element = element.parent) != null) + { + bridge = element.TryGetEventBridge(strType); + if (bridge != null && !bridge.isEmpty) + chain.Add(bridge); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs.meta new file mode 100644 index 00000000..d64c8773 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventDispatcher.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7f31d18fa6488bb469504c7128522d21 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs new file mode 100644 index 00000000..c63da09f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs @@ -0,0 +1,284 @@ +#if FAIRYGUI_TOLUA +using LuaInterface; +#endif + +namespace FairyGUI +{ + /// + /// + /// + public class EventListener + { + EventBridge _bridge; + string _type; + private const float DefualtIntervalTime = 0.5f; + private EventDispatcher Owner; + + public EventListener(EventDispatcher owner, string type) + { + Owner = owner; + _bridge = owner.GetEventBridge(type); + _type = type; + } + + /// + /// + /// + public string type + { + get { return _type; } + } + + /// + /// + /// + /// + public void AddCapture(EventCallback1 callback) + { + _bridge.AddCapture(callback); + } + + /// + /// + /// + /// + public void RemoveCapture(EventCallback1 callback) + { + _bridge.RemoveCapture(callback); + } + + /// + /// + /// + /// + public void Add(EventCallback1 callback, bool isInterval = true) + { + _bridge.Add(callback); + if (isInterval && Owner is GButton) + { + SetInterval(DefualtIntervalTime); + } + } + + /// + /// + /// + /// + public void Remove(EventCallback1 callback) + { + _bridge.Remove(callback); + } + + /// + /// + /// + /// + /// 是å¦å¼€å¯ç‚¹å‡»å»¶è¿Ÿ é»˜è®¤å¼€å¯ +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public void Add(EventCallback0 callback, bool isInterval = true) + { + _bridge.Add(callback); + if (isInterval && Owner is GButton) + { + SetInterval(DefualtIntervalTime); + } + } + + /// + /// + /// + /// +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public void Remove(EventCallback0 callback) + { + _bridge.Remove(callback); + } + + /// + /// + /// + /// + public void Set(EventCallback1 callback) + { + _bridge.Clear(); + if (callback != null) + _bridge.Add(callback); + } + + /// + /// + /// + /// +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public void Set(EventCallback0 callback) + { + _bridge.Clear(); + if (callback != null) + _bridge.Add(callback); + } + +#if FAIRYGUI_TOLUA + /// + /// + /// + /// + /// + public void Add(LuaFunction func, LuaTable self) + { + _bridge.Add(func, self); + } + + /// + /// + /// + /// + /// + public void Add(LuaFunction func, GComponent self) + { + _bridge.Add(func, self); + } + + /// + /// + /// + /// + /// + public void Remove(LuaFunction func, LuaTable self) + { + _bridge.Remove(func, self); + } + + /// + /// + /// + /// + /// + public void Remove(LuaFunction func, GComponent self) + { + _bridge.Remove(func, self); + } + + /// + /// + /// + /// + /// + public void Set(LuaFunction func, LuaTable self) + { + _bridge.Clear(); + if (func != null) + Add(func, self); + } + + /// + /// + /// + /// + /// + public void Set(LuaFunction func, GComponent self) + { + _bridge.Clear(); + if (func != null) + Add(func, self); + } +#endif + + /// + /// + /// + public bool isEmpty + { + get + { + return !_bridge.owner.hasEventListeners(_type); + } + } + + /// + /// + /// + public bool isDispatching + { + get + { + return _bridge.owner.isDispatching(_type); + } + } + + /// + /// + /// + public void Clear() + { + _bridge.Clear(); + } + + /// + /// + /// + /// + public bool Call() + { + return _bridge.owner.InternalDispatchEvent(_type, _bridge, null, null); + } + + /// + /// + /// + /// + /// + public bool Call(object data) + { + return _bridge.owner.InternalDispatchEvent(_type, _bridge, data, null); + } + + /// + /// + /// + /// + /// + public bool BubbleCall(object data) + { + return _bridge.owner.BubbleEvent(_type, data); + } + + /// + /// + /// + /// + public bool BubbleCall() + { + return _bridge.owner.BubbleEvent(_type, null); + } + + /// + /// + /// + /// + /// + public bool BroadcastCall(object data) + { + return _bridge.owner.BroadcastEvent(_type, data); + } + + /// + /// + /// + /// + public bool BroadcastCall() + { + return _bridge.owner.BroadcastEvent(_type, null); + } + + public void SetInterval(float timer) + { + _bridge.SetInterval(timer); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs.meta new file mode 100644 index 00000000..dfe84282 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/EventListener.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8747c4706bc8c864786f691555eaa2fb +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs new file mode 100644 index 00000000..21854447 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + public interface IEventDispatcher + { + void AddEventListener(string strType, EventCallback0 callback); + void AddEventListener(string strType, EventCallback1 callback); + void RemoveEventListener(string strType, EventCallback0 callback); + void RemoveEventListener(string strType, EventCallback1 callback); + bool DispatchEvent(EventContext context); + bool DispatchEvent(string strType); + bool DispatchEvent(string strType, object data); + bool DispatchEvent(string strType, object data, object initiator); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs.meta new file mode 100644 index 00000000..4c7ea9ba --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/IEventDispatcher.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a8dfc3c6bb6a91445b52cee1e916c398 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs new file mode 100644 index 00000000..4d86de9e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs @@ -0,0 +1,149 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class InputEvent + { + /// + /// x position in stage coordinates. + /// + public float x { get; internal set; } + + /// + /// y position in stage coordinates. + /// + public float y { get; internal set; } + + /// + /// + /// + public KeyCode keyCode { get; internal set; } + + /// + /// + /// + public char character { get; internal set; } + + /// + /// + /// + public EventModifiers modifiers { get; internal set; } + + /// + /// + /// + public float mouseWheelDelta { get; internal set; } + + /// + /// + /// + public int touchId { get; internal set; } + + /// + /// -1-none,0-left,1-right,2-middle + /// + public int button { get; internal set; } + + /// + /// + /// + /// + public int clickCount { get; internal set; } + + /// + /// Duraion of holding the button. You can read this in touchEnd or click event. + /// + /// + public float holdTime { get; internal set; } + + public InputEvent() + { + touchId = -1; + x = 0; + y = 0; + clickCount = 0; + keyCode = KeyCode.None; + character = '\0'; + modifiers = 0; + mouseWheelDelta = 0; + } + + /// + /// + /// + public Vector2 position + { + get { return new Vector2(x, y); } + } + + /// + /// + /// + public bool isDoubleClick + { + get { return clickCount > 1 && button == 0; } + } + + /// + /// + /// + public bool ctrlOrCmd + { + get + { + return ctrl || command; + } + } + + /// + /// + /// + public bool ctrl + { + get + { + return Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl); + } + } + + /// + /// + /// + public bool shift + { + get + { + return Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift); + } + } + + /// + /// + /// + public bool alt + { + get + { + return Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt); + } + } + + /// + /// + /// + public bool command + { + get + { + //In win, as long as the win key and other keys are pressed at the same time, the getKey will continue to return true. So it can only be shielded. + if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor) + return Input.GetKey(KeyCode.LeftCommand) || Input.GetKey(KeyCode.RightCommand); + else + return false; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs.meta new file mode 100644 index 00000000..87cb7095 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Event/InputEvent.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cc16eca0c17d9344882b6e63f26ecc9e +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter.meta new file mode 100644 index 00000000..685e4ee8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 433dd68fcd8eedd489b1c789a3bdd726 +folderAsset: yes +timeCreated: 1464768258 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs new file mode 100644 index 00000000..b1c1ae2a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class BlurFilter : IFilter + { + //ref http://blog.csdn.net/u011047171/article/details/47947397 + + /// + /// + /// + public float blurSize; + + DisplayObject _target; + Material _blitMaterial; + + public BlurFilter() + { + blurSize = 1f; + } + + public DisplayObject target + { + get { return _target; } + set + { + _target = value; + _target.EnterPaintingMode(1, null); + _target.onPaint += OnRenderImage; + + _blitMaterial = new Material(ShaderConfig.GetShader("FairyGUI/BlurFilter")); + _blitMaterial.hideFlags = DisplayObject.hideFlags; + } + } + + public void Dispose() + { + _target.LeavePaintingMode(1); + _target.onPaint -= OnRenderImage; + _target = null; + + if (Application.isPlaying) + Material.Destroy(_blitMaterial); + else + Material.DestroyImmediate(_blitMaterial); + } + + public void Update() + { + } + + void FourTapCone(RenderTexture source, RenderTexture dest, int iteration) + { + float off = blurSize * iteration + 0.5f; + Graphics.BlitMultiTap(source, dest, _blitMaterial, + new Vector2(-off, -off), + new Vector2(-off, off), + new Vector2(off, off), + new Vector2(off, -off) + ); + } + + void DownSample4x(RenderTexture source, RenderTexture dest) + { + float off = 1.0f; + Graphics.BlitMultiTap(source, dest, _blitMaterial, + new Vector2(off, off), + new Vector2(-off, off), + new Vector2(off, off), + new Vector2(off, -off) + ); + } + + void OnRenderImage() + { + if (blurSize < 0.01) + return; + + RenderTexture sourceTexture = (RenderTexture)_target.paintingGraphics.texture.nativeTexture; + int rtW = sourceTexture.width / 8; + int rtH = sourceTexture.height / 8; + RenderTexture buffer = RenderTexture.GetTemporary(rtW, rtH, 0); + + DownSample4x(sourceTexture, buffer); + + for (int i = 0; i < 2; i++) + { + RenderTexture buffer2 = RenderTexture.GetTemporary(rtW, rtH, 0); + FourTapCone(buffer, buffer2, i); + RenderTexture.ReleaseTemporary(buffer); + buffer = buffer2; + } + Graphics.Blit(buffer, sourceTexture); + + RenderTexture.ReleaseTemporary(buffer); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs.meta new file mode 100644 index 00000000..3513f24b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/BlurFilter.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 93a10729ff0ced14c97c9ae9d4771c4c +timeCreated: 1464768262 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs new file mode 100644 index 00000000..c48bf2e3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class ColorFilter : IFilter + { + // Most of the color transformation math was taken from the excellent ColorMatrixFilter class in Starling Framework + + DisplayObject _target; + float[] _matrix; + + const float LUMA_R = 0.299f; + const float LUMA_G = 0.587f; + const float LUMA_B = 0.114f; + + static float[] IDENTITY = new float[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0 }; + static float[] tmp = new float[20]; + + public ColorFilter() + { + _matrix = new float[20]; + Array.Copy(IDENTITY, _matrix, _matrix.Length); + } + + public DisplayObject target + { + get { return _target; } + set + { + _target = value; + + //这里åšä¸€ä¸ªä¼˜åŒ–,如果对象是图片或者动画,则通过直接修改目标的æè´¨å®Œæˆæ»¤é•œåŠŸèƒ½ + if ((_target is Image) || (_target is MovieClip)) + _target.graphics.ToggleKeyword("COLOR_FILTER", true); + else //å¦åˆ™é€šè¿‡ç»˜ç”»æ¨¡å¼ï¼Œéœ€è¦å»ºç«‹ä¸€å¼ RT,所以会有一定消耗 + { + _target.EnterPaintingMode(1, null); + _target.paintingGraphics.ToggleKeyword("COLOR_FILTER", true); + } + + UpdateMatrix(); + } + } + + public void Dispose() + { + if (!_target.isDisposed) + { + if ((_target is Image) || (_target is MovieClip)) + _target.graphics.ToggleKeyword("COLOR_FILTER", false); + else + { + _target.paintingGraphics.ToggleKeyword("COLOR_FILTER", false); + _target.LeavePaintingMode(1); + } + } + + _target = null; + } + + public void Update() + { + } + + public void Invert() + { + _ConcatValues(0, -1, 0, 0, 0, 1); + _ConcatValues(1, 0, -1, 0, 0, 1); + _ConcatValues(2, 0, 0, -1, 0, 1); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + /// Changes the saturation. Typical values are in the range (-1, 1). + /// Values above zero will raise, values below zero will reduce the saturation. + /// '-1' will produce a grayscale image. + /// + /// + public void AdjustSaturation(float sat) + { + sat += 1; + + float invSat = 1 - sat; + float invLumR = invSat * LUMA_R; + float invLumG = invSat * LUMA_G; + float invLumB = invSat * LUMA_B; + + _ConcatValues(0, (invLumR + sat), invLumG, invLumB, 0, 0); + _ConcatValues(1, invLumR, (invLumG + sat), invLumB, 0, 0); + _ConcatValues(2, invLumR, invLumG, (invLumB + sat), 0, 0); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + /// Changes the contrast. Typical values are in the range (-1, 1). + /// Values above zero will raise, values below zero will reduce the contrast. + /// + /// + public void AdjustContrast(float value) + { + float s = value + 1; + float o = 128f / 255 * (1 - s); + + _ConcatValues(0, s, 0, 0, 0, o); + _ConcatValues(1, 0, s, 0, 0, o); + _ConcatValues(2, 0, 0, s, 0, o); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + /// Changes the brightness. Typical values are in the range (-1, 1). + /// Values above zero will make the image brighter, values below zero will make it darker. + /// + /// + public void AdjustBrightness(float value) + { + _ConcatValues(0, 1, 0, 0, 0, value); + _ConcatValues(1, 0, 1, 0, 0, value); + _ConcatValues(2, 0, 0, 1, 0, value); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + ///Changes the hue of the image. Typical values are in the range (-1, 1). + /// + /// + public void AdjustHue(float value) + { + value *= Mathf.PI; + + float cos = Mathf.Cos(value); + float sin = Mathf.Sin(value); + + _ConcatValues(0, ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))), ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))), 0, 0); + _ConcatValues(1, ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143f)), ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14f)), ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283f)), 0, 0); + _ConcatValues(2, ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)), ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)), 0, 0); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + /// Tints the image in a certain color, analog to what can be done in Adobe Animate. + /// + /// the RGB color with which the image should be tinted. + /// the intensity with which tinting should be applied. Range (0, 1). + public void Tint(Color color, float amount = 1.0f) + { + float q = 1 - amount; + + float rA = amount * color.r; + float gA = amount * color.g; + float bA = amount * color.b; + + _ConcatValues(0, q + rA * LUMA_R, rA * LUMA_G, rA * LUMA_B, 0, 0); + _ConcatValues(1, gA * LUMA_R, q + gA * LUMA_G, gA * LUMA_B, 0, 0); + _ConcatValues(2, bA * LUMA_R, bA * LUMA_G, q + bA * LUMA_B, 0, 0); + _ConcatValues(3, 0, 0, 0, 1, 0); + } + + /// + /// Changes the filter matrix back to the identity matrix + /// + public void Reset() + { + Array.Copy(IDENTITY, _matrix, _matrix.Length); + + UpdateMatrix(); + } + + void _ConcatValues(int index, float f0, float f1, float f2, float f3, float f4) + { + int i = index * 5; + for (int x = 0; x < 5; ++x) + { + tmp[i + x] = f0 * _matrix[x] + f1 * _matrix[x + 5] + f2 * _matrix[x + 10] + f3 * _matrix[x + 15] + (x == 4 ? f4 : 0); + } + + if (index == 3) + { + Array.Copy(tmp, _matrix, tmp.Length); + + UpdateMatrix(); + } + } + + /// + /// + /// + /// + public void ConcatValues(params float[] values) + { + int i = 0; + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 5; ++x) + { + tmp[i + x] = values[i] * _matrix[x] + + values[i + 1] * _matrix[x + 5] + + values[i + 2] * _matrix[x + 10] + + values[i + 3] * _matrix[x + 15] + + (x == 4 ? values[i + 4] : 0); + } + i += 5; + } + Array.Copy(tmp, _matrix, tmp.Length); + + UpdateMatrix(); + } + + void UpdateMatrix() + { + if (_target == null) + return; + + Matrix4x4 matrix = new Matrix4x4(); + matrix.SetRow(0, new Vector4(_matrix[0], _matrix[1], _matrix[2], _matrix[3])); + matrix.SetRow(1, new Vector4(_matrix[5], _matrix[6], _matrix[7], _matrix[8])); + matrix.SetRow(2, new Vector4(_matrix[10], _matrix[11], _matrix[12], _matrix[13])); + matrix.SetRow(3, new Vector4(_matrix[15], _matrix[16], _matrix[17], _matrix[18])); + + Vector4 offset = new Vector4(_matrix[4], _matrix[9], _matrix[14], _matrix[19]); + + MaterialPropertyBlock block; + if ((_target is Image) || (_target is MovieClip)) + block = _target.graphics.materialPropertyBlock; + else + block = _target.paintingGraphics.materialPropertyBlock; + + block.SetMatrix(ShaderConfig.ID_ColorMatrix, matrix); + block.SetVector(ShaderConfig.ID_ColorOffset, offset); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs.meta new file mode 100644 index 00000000..cb6c5d77 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/ColorFilter.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f03204401ceeb6d4dad6b55e0889c0ae +timeCreated: 1464768266 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs new file mode 100644 index 00000000..f4a6392f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + public interface IFilter + { + /// + /// + /// + DisplayObject target { get; set; } + + /// + /// + /// + void Update(); + + /// + /// + /// + void Dispose(); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs.meta new file mode 100644 index 00000000..04b6ff6f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Filter/IFilter.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5c508023e115ed34a94f92161160ef24 +timeCreated: 1464768262 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture.meta new file mode 100644 index 00000000..e888e0f8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1208c6212379851499f0b304870357dd +folderAsset: yes +timeCreated: 1464244762 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs new file mode 100644 index 00000000..15edb4b9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// 长按手势。当按下一定时间åŽ(duration),派å‘onAction,如果once为false,则间隔durationæ—¶é—´æŒç»­æ´¾å‘onAction,直到手指释放。 + /// + public class LongPressGesture : EventDispatcher + { + /// + /// + /// + public GObject host { get; private set; } + + /// + /// 当手指按下时派å‘该事件。 + /// + public EventListener onBegin { get; private set; } + /// + /// 手指离开å±å¹•æ—¶æ´¾å‘该事件。 + /// + public EventListener onEnd { get; private set; } + /// + /// 当手指按下åŽä¸€æ®µæ—¶é—´åŽæ´¾å‘è¯¥äº‹ä»¶ã€‚å¹¶ä¸”åœ¨æ‰‹æŒ‡ç¦»å¼€å‰æŒ‰ä¸€å®šå‘¨æœŸæ´¾å‘该事件。 + /// + public EventListener onAction { get; private set; } + + /// + /// 第一次派å‘äº‹ä»¶çš„è§¦å‘æ—¶é—´ã€‚å•ä½ç§’ + /// + public float trigger; + + /// + /// æ´¾å‘onAction事件的时间间隔。å•ä½ç§’。 + /// + public float interval; + + /// + /// 如果为真,则onActionå†ä¸€æ¬¡æŒ‰ä¸‹é‡Šæ”¾è¿‡ç¨‹åªæ´¾å‘一次。如果为å‡ï¼Œåˆ™æ¯éš”durationæ—¶é—´æ´¾å‘一次。 + /// + public bool once; + + /// + /// 手指按ä½åŽï¼Œç§»åŠ¨è¶…å‡ºæ­¤åŠå¾„èŒƒå›´åˆ™æ‰‹åŠ¿åœæ­¢ã€‚ + /// + public int holdRangeRadius; + + Vector2 _startPoint; + bool _started; + int _touchId; + + public static float TRIGGER = 1.5f; + public static float INTERVAL = 1f; + + public LongPressGesture(GObject host) + { + this.host = host; + trigger = TRIGGER; + interval = INTERVAL; + holdRangeRadius = 50; + Enable(true); + + onBegin = new EventListener(this, "onLongPressBegin"); + onEnd = new EventListener(this, "onLongPressEnd"); + onAction = new EventListener(this, "onLongPressAction"); + } + + public void Dispose() + { + Enable(false); + host = null; + } + + public void Enable(bool value) + { + if (value) + { + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Add(__touchBegin); + Stage.inst.onTouchEnd.Add(__touchEnd); + } + else + { + host.onTouchBegin.Add(__touchBegin); + host.onTouchEnd.Add(__touchEnd); + } + } + else + { + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Remove(__touchBegin); + Stage.inst.onTouchEnd.Remove(__touchEnd); + } + else + { + host.onTouchBegin.Remove(__touchBegin); + host.onTouchEnd.Remove(__touchEnd); + } + Timers.inst.Remove(__timer); + } + } + + public void Cancel() + { + Timers.inst.Remove(__timer); + _started = false; + } + + void __touchBegin(EventContext context) + { + InputEvent evt = context.inputEvent; + _startPoint = host.GlobalToLocal(new Vector2(evt.x, evt.y)); + _started = false; + _touchId = evt.touchId; + + Timers.inst.Add(trigger, 1, __timer); + context.CaptureTouch(); + } + + void __timer(object param) + { + Vector2 pt = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touchId)); + if (Mathf.Pow(pt.x - _startPoint.x, 2) + Mathf.Pow(pt.y - _startPoint.y, 2) > Mathf.Pow(holdRangeRadius, 2)) + { + Timers.inst.Remove(__timer); + return; + } + if (!_started) + { + _started = true; + onBegin.Call(); + + if (!once) + Timers.inst.Add(interval, 0, __timer); + } + + onAction.Call(); + } + + void __touchEnd(EventContext context) + { + Timers.inst.Remove(__timer); + + if (_started) + { + _started = false; + onEnd.Call(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs.meta new file mode 100644 index 00000000..4d0abe87 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/LongPressGesture.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 036b702098f47c24ea9cda6c2948507d +timeCreated: 1464244762 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs new file mode 100644 index 00000000..53cddc9b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// ä¸¤ä¸ªæŒ‡å¤´ææˆ–者放的手势。 + /// + public class PinchGesture : EventDispatcher + { + /// + /// + /// + public GObject host { get; private set; } + + /// + /// å½“ä¸¤ä¸ªæ‰‹æŒ‡å¼€å§‹å‘ˆææ‰‹åŠ¿æ—¶æ´¾å‘该事件。 + /// + public EventListener onBegin { get; private set; } + /// + /// 当其中一个手指离开å±å¹•æ—¶æ´¾å‘该事件。 + /// + public EventListener onEnd { get; private set; } + /// + /// 当手势动作时派å‘该事件。 + /// + public EventListener onAction { get; private set; } + + /// + /// 总共缩放的é‡ã€‚ + /// + public float scale; + + /// + /// 从上次通知åŽçš„æ”¹å˜é‡ã€‚ + /// + public float delta; + + float _startDistance; + float _lastScale; + int[] _touches; + bool _started; + bool _touchBegan; + + public PinchGesture(GObject host) + { + this.host = host; + Enable(true); + + _touches = new int[2]; + + onBegin = new EventListener(this, "onPinchBegin"); + onEnd = new EventListener(this, "onPinchEnd"); + onAction = new EventListener(this, "onPinchAction"); + } + + public void Dispose() + { + Enable(false); + host = null; + } + + public void Enable(bool value) + { + if (value) + { + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Add(__touchBegin); + Stage.inst.onTouchMove.Add(__touchMove); + Stage.inst.onTouchEnd.Add(__touchEnd); + } + else + { + host.onTouchBegin.Add(__touchBegin); + host.onTouchMove.Add(__touchMove); + host.onTouchEnd.Add(__touchEnd); + } + } + else + { + _started = false; + _touchBegan = false; + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Remove(__touchBegin); + Stage.inst.onTouchMove.Remove(__touchMove); + Stage.inst.onTouchEnd.Remove(__touchEnd); + } + else + { + host.onTouchBegin.Remove(__touchBegin); + host.onTouchMove.Remove(__touchMove); + host.onTouchEnd.Remove(__touchEnd); + } + } + } + + void __touchBegin(EventContext context) + { + if (Stage.inst.touchCount == 2) + { + if (!_started && !_touchBegan) + { + _touchBegan = true; + Stage.inst.GetAllTouch(_touches); + Vector2 pt1 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[0])); + Vector2 pt2 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[1])); + _startDistance = Vector2.Distance(pt1, pt2); + + context.CaptureTouch(); + } + } + } + + void __touchMove(EventContext context) + { + if (!_touchBegan || Stage.inst.touchCount != 2) + return; + + InputEvent evt = context.inputEvent; + Vector2 pt1 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[0])); + Vector2 pt2 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[1])); + float dist = Vector2.Distance(pt1, pt2); + + if (!_started && Mathf.Abs(dist - _startDistance) > UIConfig.touchDragSensitivity) + { + _started = true; + scale = 1; + _lastScale = 1; + + onBegin.Call(evt); + } + + if (_started) + { + float ss = dist / _startDistance; + delta = ss - _lastScale; + _lastScale = ss; + this.scale += delta; + onAction.Call(evt); + } + } + + void __touchEnd(EventContext context) + { + _touchBegan = false; + if (_started) + { + _started = false; + onEnd.Call(context.inputEvent); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs.meta new file mode 100644 index 00000000..04672827 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/PinchGesture.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: dc85a819551042448a16308b82054c89 +timeCreated: 1464244766 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs new file mode 100644 index 00000000..173fe14c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// 手指å呿“作的手势。 + /// + public class RotationGesture : EventDispatcher + { + /// + /// + /// + public GObject host { get; private set; } + + /// + /// 当两个手指开始呈å呿“作时派å‘该事件。 + /// + public EventListener onBegin { get; private set; } + /// + /// 当其中一个手指离开å±å¹•æ—¶æ´¾å‘该事件。 + /// + public EventListener onEnd { get; private set; } + /// + /// 当手势动作时派å‘该事件。 + /// + public EventListener onAction { get; private set; } + + /// + /// 总共旋转的角度。 + /// + public float rotation; + + /// + /// 从上次通知åŽçš„æ”¹å˜é‡ã€‚ + /// + public float delta; + + /// + /// æ˜¯å¦æŠŠå˜åŒ–é‡å¼ºåˆ¶ä¸ºæ•´æ•°ã€‚默认true。 + /// + public bool snapping; + + Vector2 _startVector; + float _lastRotation; + int[] _touches; + bool _started; + bool _touchBegan; + + public RotationGesture(GObject host) + { + this.host = host; + Enable(true); + + _touches = new int[2]; + snapping = true; + + onBegin = new EventListener(this, "onRotationBegin"); + onEnd = new EventListener(this, "onRotationEnd"); + onAction = new EventListener(this, "onRotationAction"); + } + + public void Dispose() + { + Enable(false); + host = null; + } + + public void Enable(bool value) + { + if (value) + { + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Add(__touchBegin); + Stage.inst.onTouchMove.Add(__touchMove); + Stage.inst.onTouchEnd.Add(__touchEnd); + } + else + { + host.onTouchBegin.Add(__touchBegin); + host.onTouchMove.Add(__touchMove); + host.onTouchEnd.Add(__touchEnd); + } + } + else + { + _started = false; + _touchBegan = false; + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Remove(__touchBegin); + Stage.inst.onTouchMove.Remove(__touchMove); + Stage.inst.onTouchEnd.Remove(__touchEnd); + } + else + { + host.onTouchBegin.Remove(__touchBegin); + host.onTouchMove.Remove(__touchMove); + host.onTouchEnd.Remove(__touchEnd); + } + } + } + + void __touchBegin(EventContext context) + { + if (Stage.inst.touchCount == 2) + { + if (!_started && !_touchBegan) + { + _touchBegan = true; + Stage.inst.GetAllTouch(_touches); + Vector2 pt1 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[0])); + Vector2 pt2 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[1])); + _startVector = pt1 - pt2; + + context.CaptureTouch(); + } + } + } + + void __touchMove(EventContext context) + { + if (!_touchBegan || Stage.inst.touchCount != 2) + return; + + InputEvent evt = context.inputEvent; + Vector2 pt1 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[0])); + Vector2 pt2 = host.GlobalToLocal(Stage.inst.GetTouchPosition(_touches[1])); + Vector2 vec = pt1 - pt2; + + float rot = Mathf.Rad2Deg * ((Mathf.Atan2(vec.y, vec.x) - Mathf.Atan2(_startVector.y, _startVector.x))); + if (snapping) + { + rot = Mathf.Round(rot); + if (rot == 0) + return; + } + + if (!_started && rot > 5) + { + _started = true; + rotation = 0; + _lastRotation = 0; + + onBegin.Call(evt); + } + + if (_started) + { + delta = rot - _lastRotation; + _lastRotation = rot; + this.rotation += delta; + onAction.Call(evt); + } + } + + void __touchEnd(EventContext context) + { + _touchBegan = false; + if (_started) + { + _started = false; + onEnd.Call(context.inputEvent); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs.meta new file mode 100644 index 00000000..ad202718 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/RotationGesture.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 155eda39968f1194d9b4b7bbd63596ee +timeCreated: 1464244762 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs new file mode 100644 index 00000000..96ef55aa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// 滑动手势。你å¯ä»¥é€šè¿‡onBegin+onMove+onEnd关心整个滑动过程,也å¯ä»¥åªä½¿ç”¨onAction关注最åŽçš„æ»‘动结果。滑动结果包括方å‘和加速度,å¯ä»¥ä»Žpositionå’Œvelocity获得。 + /// 注æ„onAction仅当滑动超过一定è·ç¦»(actionDistance)æ—¶æ‰è§¦å‘。 + /// + public class SwipeGesture : EventDispatcher + { + /// + /// + /// + public GObject host { get; private set; } + + /// + /// 当手指开始扫动时派å‘该事件。 + /// + public EventListener onBegin { get; private set; } + /// + /// 手指离开å±å¹•æ—¶æ´¾å‘该事件。 + /// + public EventListener onEnd { get; private set; } + /// + /// 手指在滑动时派å‘该事件。 + /// + public EventListener onMove { get; private set; } + /// + /// 当手指从按下到离开ç»è¿‡çš„è·ç¦»å¤§äºŽactionDistanceæ—¶æ´¾å‘该事件。 + /// + public EventListener onAction { get; private set; } + + /// + /// 手指离开时的加速度 + /// + public Vector2 velocity; + + /// + /// ä½ å¯ä»¥åœ¨onBegin事件中设置这个值,那个åŽç»­å°†æ ¹æ®æ‰‹æŒ‡ç§»åŠ¨çš„è·ç¦»ä¿®æ”¹è¿™ä¸ªå€¼ã€‚如果ä¸è®¾ç½®ï¼Œé‚£positionåˆå§‹ä¸º(0,0)ï¼Œåæ˜ æ‰‹æŒ‡æ‰«è¿‡çš„è·ç¦»ã€‚ + /// + public Vector2 position; + + /// + /// 移动的å˜åŒ–值 + /// + public Vector2 delta; + + /// + /// The min distance to fire onAction event + /// æ´¾å‘onAction事件的最å°è·ç¦»ã€‚如果手指扫过的è·ç¦»å°‘于此值,onActionä¸ä¼šè§¦å‘(但onEndä»ç„¶ä¼šæ´¾å‘) + /// + public int actionDistance; + + /// + /// æ˜¯å¦æŠŠå˜åŒ–é‡å¼ºåˆ¶ä¸ºæ•´æ•°ã€‚默认true。 + /// + public bool snapping; + + Vector2 _startPoint; + Vector2 _lastPoint; + float _time; + bool _started; + bool _touchBegan; + + public static int ACTION_DISTANCE = 200; + + public SwipeGesture(GObject host) + { + this.host = host; + actionDistance = ACTION_DISTANCE; + snapping = true; + Enable(true); + + onBegin = new EventListener(this, "onSwipeBegin"); + onEnd = new EventListener(this, "onSwipeEnd"); + onMove = new EventListener(this, "onSwipeMove"); + onAction = new EventListener(this, "onnSwipeAction"); + } + + public void Dispose() + { + Enable(false); + host = null; + } + + public void Enable(bool value) + { + if (value) + { + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Add(__touchBegin); + Stage.inst.onTouchMove.Add(__touchMove); + Stage.inst.onTouchEnd.Add(__touchEnd); + } + else + { + host.onTouchBegin.Add(__touchBegin); + host.onTouchMove.Add(__touchMove); + host.onTouchEnd.Add(__touchEnd); + } + } + else + { + _started = false; + _touchBegan = false; + if (host == GRoot.inst) + { + Stage.inst.onTouchBegin.Remove(__touchBegin); + Stage.inst.onTouchMove.Remove(__touchMove); + Stage.inst.onTouchEnd.Remove(__touchEnd); + } + else + { + host.onTouchBegin.Remove(__touchBegin); + host.onTouchMove.Remove(__touchMove); + host.onTouchEnd.Remove(__touchEnd); + } + } + } + + void __touchBegin(EventContext context) + { + if (Stage.inst.touchCount > 1) + { + _touchBegan = false; + if (_started) + { + _started = false; + onEnd.Call(context.inputEvent); + } + return; + } + + InputEvent evt = context.inputEvent; + _startPoint = _lastPoint = host.GlobalToLocal(new Vector2(evt.x, evt.y)); + _lastPoint = _startPoint; + + _time = Time.unscaledTime; + _started = false; + velocity = Vector2.zero; + position = Vector2.zero; + _touchBegan = true; + + context.CaptureTouch(); + } + + void __touchMove(EventContext context) + { + if (!_touchBegan || Stage.inst.touchCount > 1) + return; + + InputEvent evt = context.inputEvent; + Vector2 pt = host.GlobalToLocal(new Vector2(evt.x, evt.y)); + delta = pt - _lastPoint; + if (snapping) + { + delta.x = Mathf.Round(delta.x); + delta.y = Mathf.Round(delta.y); + if (delta.x == 0 && delta.y == 0) + return; + } + + float deltaTime = Time.unscaledDeltaTime; + float elapsed = (Time.unscaledTime - _time) * 60 - 1; + if (elapsed > 1) //é€Ÿåº¦è¡°å‡ + velocity = velocity * Mathf.Pow(0.833f, elapsed); + velocity = Vector3.Lerp(velocity, delta / deltaTime, deltaTime * 10); + _time = Time.unscaledTime; + position += delta; + _lastPoint = pt; + + if (!_started) + { //çµæ•度检查,为了和点击区分 + int sensitivity; + if (Stage.touchScreen) + sensitivity = UIConfig.touchDragSensitivity; + else + sensitivity = 5; + + if (Mathf.Abs(delta.x) < sensitivity && Mathf.Abs(delta.y) < sensitivity) + return; + + _started = true; + onBegin.Call(evt); + } + + onMove.Call(evt); + } + + void __touchEnd(EventContext context) + { + _touchBegan = false; + + if (!_started) + return; + + _started = false; + + InputEvent evt = context.inputEvent; + Vector2 pt = host.GlobalToLocal(new Vector2(evt.x, evt.y)); + delta = pt - _lastPoint; + if (snapping) + { + delta.x = Mathf.Round(delta.x); + delta.y = Mathf.Round(delta.y); + } + position += delta; + + //更新速度 + float elapsed = (Time.unscaledTime - _time) * 60 - 1; + if (elapsed > 1) + velocity = velocity * Mathf.Pow(0.833f, elapsed); + if (snapping) + { + velocity.x = Mathf.Round(velocity.x); + velocity.y = Mathf.Round(velocity.y); + } + onEnd.Call(evt); + + pt -= _startPoint; + if (Mathf.Abs(pt.x) > actionDistance || Mathf.Abs(pt.y) > actionDistance) + onAction.Call(evt); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs.meta new file mode 100644 index 00000000..81976325 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Gesture/SwipeGesture.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7bed3df24eb979345a4d3ed9cd34ca0e +timeCreated: 1464244762 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween.meta new file mode 100644 index 00000000..86980808 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: af2102ef32b55854c993041a6940127e +folderAsset: yes +timeCreated: 1531222519 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs new file mode 100644 index 00000000..4bd5f154 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs @@ -0,0 +1,248 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2014/07/19 14:11 +// +// License Copyright (c) Daniele Giardini. +// This work is subject to the terms at http://dotween.demigiant.com/license.php +// +// ============================================================= +// Contains Daniele Giardini's C# port of the easing equations created by Robert Penner +// (all easing equations except for Flash, InFlash, OutFlash, InOutFlash, +// which use some parts of Robert Penner's equations but were created by Daniele Giardini) +// http://robertpenner.com/easing, see license below: +// ============================================================= +// +// TERMS OF USE - EASING EQUATIONS +// +// Open source under the BSD License. +// +// Copyright ? 2001 Robert Penner +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +// - Neither the name of the author nor the names of contributors may be used to endorse +// or promote products derived from this software without specific prior written permission. +// - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using UnityEngine; + +#pragma warning disable 1591 +namespace FairyGUI +{ + public static class EaseManager + { + const float _PiOver2 = Mathf.PI * 0.5f; + const float _TwoPi = Mathf.PI * 2; + + /// + /// Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected + /// + public static float Evaluate(EaseType easeType, float time, float duration, + float overshootOrAmplitude = 1.70158f, + float period = 0, + CustomEase customEase = null) + { + if (duration <= 0) + return 1; + + switch (easeType) + { + case EaseType.Linear: + return time / duration; + case EaseType.SineIn: + return -(float)Math.Cos(time / duration * _PiOver2) + 1; + case EaseType.SineOut: + return (float)Math.Sin(time / duration * _PiOver2); + case EaseType.SineInOut: + return -0.5f * ((float)Math.Cos(Mathf.PI * time / duration) - 1); + case EaseType.QuadIn: + return (time /= duration) * time; + case EaseType.QuadOut: + return -(time /= duration) * (time - 2); + case EaseType.QuadInOut: + if ((time /= duration * 0.5f) < 1) return 0.5f * time * time; + return -0.5f * ((--time) * (time - 2) - 1); + case EaseType.CubicIn: + return (time /= duration) * time * time; + case EaseType.CubicOut: + return ((time = time / duration - 1) * time * time + 1); + case EaseType.CubicInOut: + if ((time /= duration * 0.5f) < 1) return 0.5f * time * time * time; + return 0.5f * ((time -= 2) * time * time + 2); + case EaseType.QuartIn: + return (time /= duration) * time * time * time; + case EaseType.QuartOut: + return -((time = time / duration - 1) * time * time * time - 1); + case EaseType.QuartInOut: + if ((time /= duration * 0.5f) < 1) return 0.5f * time * time * time * time; + return -0.5f * ((time -= 2) * time * time * time - 2); + case EaseType.QuintIn: + return (time /= duration) * time * time * time * time; + case EaseType.QuintOut: + return ((time = time / duration - 1) * time * time * time * time + 1); + case EaseType.QuintInOut: + if ((time /= duration * 0.5f) < 1) return 0.5f * time * time * time * time * time; + return 0.5f * ((time -= 2) * time * time * time * time + 2); + case EaseType.ExpoIn: + return (time == 0) ? 0 : (float)Math.Pow(2, 10 * (time / duration - 1)); + case EaseType.ExpoOut: + if (time == duration) return 1; + return (-(float)Math.Pow(2, -10 * time / duration) + 1); + case EaseType.ExpoInOut: + if (time == 0) return 0; + if (time == duration) return 1; + if ((time /= duration * 0.5f) < 1) return 0.5f * (float)Math.Pow(2, 10 * (time - 1)); + return 0.5f * (-(float)Math.Pow(2, -10 * --time) + 2); + case EaseType.CircIn: + return -((float)Math.Sqrt(1 - (time /= duration) * time) - 1); + case EaseType.CircOut: + return (float)Math.Sqrt(1 - (time = time / duration - 1) * time); + case EaseType.CircInOut: + if ((time /= duration * 0.5f) < 1) return -0.5f * ((float)Math.Sqrt(1 - time * time) - 1); + return 0.5f * ((float)Math.Sqrt(1 - (time -= 2) * time) + 1); + case EaseType.ElasticIn: + float s0; + if (time == 0) return 0; + if ((time /= duration) == 1) return 1; + if (period == 0) period = duration * 0.3f; + if (overshootOrAmplitude < 1) + { + overshootOrAmplitude = 1; + s0 = period / 4; + } + else s0 = period / _TwoPi * (float)Math.Asin(1 / overshootOrAmplitude); + return -(overshootOrAmplitude * (float)Math.Pow(2, 10 * (time -= 1)) * (float)Math.Sin((time * duration - s0) * _TwoPi / period)); + case EaseType.ElasticOut: + float s1; + if (time == 0) return 0; + if ((time /= duration) == 1) return 1; + if (period == 0) period = duration * 0.3f; + if (overshootOrAmplitude < 1) + { + overshootOrAmplitude = 1; + s1 = period / 4; + } + else s1 = period / _TwoPi * (float)Math.Asin(1 / overshootOrAmplitude); + return (overshootOrAmplitude * (float)Math.Pow(2, -10 * time) * (float)Math.Sin((time * duration - s1) * _TwoPi / period) + 1); + case EaseType.ElasticInOut: + float s; + if (time == 0) return 0; + if ((time /= duration * 0.5f) == 2) return 1; + if (period == 0) period = duration * (0.3f * 1.5f); + if (overshootOrAmplitude < 1) + { + overshootOrAmplitude = 1; + s = period / 4; + } + else s = period / _TwoPi * (float)Math.Asin(1 / overshootOrAmplitude); + if (time < 1) return -0.5f * (overshootOrAmplitude * (float)Math.Pow(2, 10 * (time -= 1)) * (float)Math.Sin((time * duration - s) * _TwoPi / period)); + return overshootOrAmplitude * (float)Math.Pow(2, -10 * (time -= 1)) * (float)Math.Sin((time * duration - s) * _TwoPi / period) * 0.5f + 1; + case EaseType.BackIn: + return (time /= duration) * time * ((overshootOrAmplitude + 1) * time - overshootOrAmplitude); + case EaseType.BackOut: + return ((time = time / duration - 1) * time * ((overshootOrAmplitude + 1) * time + overshootOrAmplitude) + 1); + case EaseType.BackInOut: + if ((time /= duration * 0.5f) < 1) return 0.5f * (time * time * (((overshootOrAmplitude *= (1.525f)) + 1) * time - overshootOrAmplitude)); + return 0.5f * ((time -= 2) * time * (((overshootOrAmplitude *= (1.525f)) + 1) * time + overshootOrAmplitude) + 2); + case EaseType.BounceIn: + return Bounce.EaseIn(time, duration); + case EaseType.BounceOut: + return Bounce.EaseOut(time, duration); + case EaseType.BounceInOut: + return Bounce.EaseInOut(time, duration); + + case EaseType.Custom: + return customEase != null ? customEase.Evaluate(time / duration) : (time / duration); + + default: + return -(time /= duration) * (time - 2); + } + } + + /// + /// This class contains a C# port of the easing equations created by Robert Penner (http://robertpenner.com/easing). + /// + static class Bounce + { + /// + /// Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. + /// + /// + /// Current time (in frames or seconds). + /// + /// + /// Expected easing duration (in frames or seconds). + /// + /// + /// The eased value. + /// + public static float EaseIn(float time, float duration) + { + return 1 - EaseOut(duration - time, duration); + } + + /// + /// Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. + /// + /// + /// Current time (in frames or seconds). + /// + /// + /// Expected easing duration (in frames or seconds). + /// + /// + /// The eased value. + /// + public static float EaseOut(float time, float duration) + { + if ((time /= duration) < (1 / 2.75f)) + { + return (7.5625f * time * time); + } + if (time < (2 / 2.75f)) + { + return (7.5625f * (time -= (1.5f / 2.75f)) * time + 0.75f); + } + if (time < (2.5f / 2.75f)) + { + return (7.5625f * (time -= (2.25f / 2.75f)) * time + 0.9375f); + } + return (7.5625f * (time -= (2.625f / 2.75f)) * time + 0.984375f); + } + + /// + /// Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. + /// + /// + /// Current time (in frames or seconds). + /// + /// + /// Expected easing duration (in frames or seconds). + /// + /// + /// The eased value. + /// + public static float EaseInOut(float time, float duration) + { + if (time < duration * 0.5f) + { + return EaseIn(time * 2, duration) * 0.5f; + } + return EaseOut(time * 2 - duration, duration) * 0.5f + 0.5f; + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs.meta new file mode 100644 index 00000000..dc6b102e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseManager.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 080d1dce1c76e154c9c8f50151e6d69e +timeCreated: 1531473796 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs new file mode 100644 index 00000000..e64c7e01 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public enum EaseType + { + Linear, + SineIn, + SineOut, + SineInOut, + QuadIn, + QuadOut, + QuadInOut, + CubicIn, + CubicOut, + CubicInOut, + QuartIn, + QuartOut, + QuartInOut, + QuintIn, + QuintOut, + QuintInOut, + ExpoIn, + ExpoOut, + ExpoInOut, + CircIn, + CircOut, + CircInOut, + ElasticIn, + ElasticOut, + ElasticInOut, + BackIn, + BackOut, + BackInOut, + BounceIn, + BounceOut, + BounceInOut, + Custom + } + + /// + /// + /// + public class CustomEase + { + Vector2[] _points; + int _pointDensity; + + static GPath helperPath = new GPath(); + + /// + /// + /// + /// + public CustomEase(int pointDensity = 200) + { + _points = new Vector2[pointDensity + 1]; + _pointDensity = pointDensity; + } + + /// + /// + /// + /// + public void Create(IEnumerable pathPoints) + { + helperPath.Create(pathPoints); + for (int i = 0; i <= _pointDensity; i++) + { + Vector3 pt = helperPath.GetPointAt(i / (float)_pointDensity); + _points[i] = pt; + } + _points[0] = Vector2.zero; + _points[_pointDensity] = Vector2.one; + + Array.Sort(_points, (Vector2 p1, Vector2 p2) => + { + return p1.x.CompareTo(p2.x); + }); + } + + /// + /// + /// + /// + /// + public float Evaluate(float time) + { + if (time <= 0) + return 0; + else if (time >= 1) + return 1; + + int low = 0; + int high = _pointDensity; + int cur = 0; + while (low != high) + { + cur = low + (int)((high - low) / 2f); + float x = _points[cur].x; + if (time == x) + break; + else if (time > x) + { + if (low == cur) + { + cur = high; + break; + } + low = cur; + } + else + { + if (high == cur) + { + cur = low; + break; + } + high = cur; + } + } + + Vector2 v0 = _points[cur]; + Vector2 v1; + if (cur == _pointDensity) + v1 = Vector2.one; + else + v1 = _points[cur + 1]; + float k = (v1.y - v0.y) / (v1.x - v0.x); + if (float.IsNaN(k)) + k = 0; + + return v0.y + (time - v0.x) * k; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs.meta new file mode 100644 index 00000000..11b99cfd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/EaseType.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b3faa49ad96d1cb45acf0a5534094d09 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs new file mode 100644 index 00000000..daefedfc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs @@ -0,0 +1,475 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + [System.Serializable] + public struct GPathPoint + { + /// + /// + /// + public Vector3 pos; + + /// + /// + /// + public Vector3 control1; + + /// + /// + /// + public Vector3 control2; + + /// + /// + /// + public CurveType curveType; + + /// + /// + /// + public bool smooth; + + /// + /// + /// + public enum CurveType + { + CRSpline, + Bezier, + CubicBezier, + Straight + } + + /// + /// + /// + /// + public GPathPoint(Vector3 pos) + { + this.pos = pos; + this.control1 = Vector3.zero; + this.control2 = Vector3.zero; + this.curveType = CurveType.CRSpline; + this.smooth = true; + } + + /// + /// + /// + /// + /// + public GPathPoint(Vector3 pos, Vector3 control) + { + this.pos = pos; + this.control1 = control; + this.control2 = Vector3.zero; + this.curveType = CurveType.Bezier; + this.smooth = true; + } + + /// + /// + /// + /// + /// + /// + public GPathPoint(Vector3 pos, Vector3 control1, Vector3 control2) + { + this.pos = pos; + this.control1 = control1; + this.control2 = control2; + this.curveType = CurveType.CubicBezier; + this.smooth = true; + } + + /// + /// + /// + /// + /// + public GPathPoint(Vector3 pos, CurveType curveType) + { + this.pos = pos; + this.control1 = Vector3.zero; + this.control2 = Vector3.zero; + this.curveType = curveType; + this.smooth = true; + } + } + + /// + /// + /// + public class GPath + { + protected struct Segment + { + public GPathPoint.CurveType type; + public float length; + public int ptStart; + public int ptCount; + } + + protected List _segments; + protected List _points; + protected float _fullLength; + + static List helperList = new List(); + static List splinePoints = new List(); + + public GPath() + { + _segments = new List(); + _points = new List(); + } + + /// + /// + /// + public float length + { + get { return _fullLength; } + } + + /// + /// + /// + /// + /// + public void Create(GPathPoint pt1, GPathPoint pt2) + { + helperList.Clear(); + helperList.Add(pt1); + helperList.Add(pt2); + Create(helperList); + } + + /// + /// + /// + /// + /// + /// + public void Create(GPathPoint pt1, GPathPoint pt2, GPathPoint pt3) + { + helperList.Clear(); + helperList.Add(pt1); + helperList.Add(pt2); + helperList.Add(pt3); + Create(helperList); + } + + /// + /// + /// + /// + /// + /// + /// + public void Create(GPathPoint pt1, GPathPoint pt2, GPathPoint pt3, GPathPoint pt4) + { + helperList.Clear(); + helperList.Add(pt1); + helperList.Add(pt2); + helperList.Add(pt3); + helperList.Add(pt4); + Create(helperList); + } + + /// + /// + /// + /// + public void Create(IEnumerable points) + { + _segments.Clear(); + _points.Clear(); + splinePoints.Clear(); + _fullLength = 0; + + var et = points.GetEnumerator(); + if (!et.MoveNext()) + return; + + GPathPoint prev = et.Current; + if (prev.curveType == GPathPoint.CurveType.CRSpline) + splinePoints.Add(prev.pos); + + while (et.MoveNext()) + { + GPathPoint current = et.Current; + + if (prev.curveType != GPathPoint.CurveType.CRSpline) + { + Segment seg = new Segment(); + seg.type = prev.curveType; + seg.ptStart = _points.Count; + if (prev.curveType == GPathPoint.CurveType.Straight) + { + seg.ptCount = 2; + _points.Add(prev.pos); + _points.Add(current.pos); + } + else if (prev.curveType == GPathPoint.CurveType.Bezier) + { + seg.ptCount = 3; + _points.Add(prev.pos); + _points.Add(current.pos); + _points.Add(prev.control1); + } + else if (prev.curveType == GPathPoint.CurveType.CubicBezier) + { + seg.ptCount = 4; + _points.Add(prev.pos); + _points.Add(current.pos); + _points.Add(prev.control1); + _points.Add(prev.control2); + } + seg.length = Vector3.Distance(prev.pos, current.pos); + _fullLength += seg.length; + _segments.Add(seg); + } + + if (current.curveType != GPathPoint.CurveType.CRSpline) + { + if (splinePoints.Count > 0) + { + splinePoints.Add(current.pos); + CreateSplineSegment(); + } + } + else + splinePoints.Add(current.pos); + + prev = current; + } + + if (splinePoints.Count > 1) + CreateSplineSegment(); + } + + void CreateSplineSegment() + { + int cnt = splinePoints.Count; + splinePoints.Insert(0, splinePoints[0]); + splinePoints.Add(splinePoints[cnt]); + splinePoints.Add(splinePoints[cnt]); + cnt += 3; + + Segment seg = new Segment(); + seg.type = GPathPoint.CurveType.CRSpline; + seg.ptStart = _points.Count; + seg.ptCount = cnt; + _points.AddRange(splinePoints); + + seg.length = 0; + for (int i = 1; i < cnt; i++) + seg.length += Vector3.Distance(splinePoints[i - 1], splinePoints[i]); + _fullLength += seg.length; + _segments.Add(seg); + splinePoints.Clear(); + } + + /// + /// + /// + public void Clear() + { + _segments.Clear(); + _points.Clear(); + } + + /// + /// + /// + /// + /// + public Vector3 GetPointAt(float t) + { + t = Mathf.Clamp01(t); + int cnt = _segments.Count; + if (cnt == 0) + return Vector3.zero; + + Segment seg; + if (t == 1) + { + seg = _segments[cnt - 1]; + + if (seg.type == GPathPoint.CurveType.Straight) + return Vector3.Lerp(_points[seg.ptStart], _points[seg.ptStart + 1], t); + else if (seg.type == GPathPoint.CurveType.Bezier || seg.type == GPathPoint.CurveType.CubicBezier) + return onBezierCurve(seg.ptStart, seg.ptCount, t); + else + return onCRSplineCurve(seg.ptStart, seg.ptCount, t); + } + + float len = t * _fullLength; + Vector3 pt = new Vector3(); + for (int i = 0; i < cnt; i++) + { + seg = _segments[i]; + + len -= seg.length; + if (len < 0) + { + t = 1 + len / seg.length; + + if (seg.type == GPathPoint.CurveType.Straight) + pt = Vector3.Lerp(_points[seg.ptStart], _points[seg.ptStart + 1], t); + else if (seg.type == GPathPoint.CurveType.Bezier || seg.type == GPathPoint.CurveType.CubicBezier) + pt = onBezierCurve(seg.ptStart, seg.ptCount, t); + else + pt = onCRSplineCurve(seg.ptStart, seg.ptCount, t); + + break; + } + } + + return pt; + } + + /// + /// + /// + public int segmentCount + { + get { return _segments.Count; } + } + + /// + /// + /// + /// + /// + public float GetSegmentLength(int segmentIndex) + { + return _segments[segmentIndex].length; + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void GetPointsInSegment(int segmentIndex, float t0, float t1, List points, List ts = null, float pointDensity = 0.1f) + { + if (points == null) + points = new List(); + + if (ts != null) + ts.Add(t0); + Segment seg = _segments[segmentIndex]; + if (seg.type == GPathPoint.CurveType.Straight) + { + points.Add(Vector3.Lerp(_points[seg.ptStart], _points[seg.ptStart + 1], t0)); + points.Add(Vector3.Lerp(_points[seg.ptStart], _points[seg.ptStart + 1], t1)); + } + else if (seg.type == GPathPoint.CurveType.Bezier || seg.type == GPathPoint.CurveType.CubicBezier) + { + points.Add(onBezierCurve(seg.ptStart, seg.ptCount, t0)); + int SmoothAmount = (int)Mathf.Min(seg.length * pointDensity, 50); + for (int j = 0; j <= SmoothAmount; j++) + { + float t = (float)j / SmoothAmount; + if (t > t0 && t < t1) + { + points.Add(onBezierCurve(seg.ptStart, seg.ptCount, t)); + if (ts != null) + ts.Add(t); + } + } + points.Add(onBezierCurve(seg.ptStart, seg.ptCount, t1)); + } + else + { + points.Add(onCRSplineCurve(seg.ptStart, seg.ptCount, t0)); + int SmoothAmount = (int)Mathf.Min(seg.length * pointDensity, 50); + for (int j = 0; j <= SmoothAmount; j++) + { + float t = (float)j / SmoothAmount; + if (t > t0 && t < t1) + { + points.Add(onCRSplineCurve(seg.ptStart, seg.ptCount, t)); + if (ts != null) + ts.Add(t); + } + } + points.Add(onCRSplineCurve(seg.ptStart, seg.ptCount, t1)); + } + + if (ts != null) + ts.Add(t1); + } + + /// + /// + /// + /// + public void GetAllPoints(List points, float pointDensity = 0.1f) + { + int cnt = _segments.Count; + for (int i = 0; i < cnt; i++) + GetPointsInSegment(i, 0, 1, points, null, pointDensity); + } + + /// + /// Catmull rom spline implementation + /// by Stéphane Drouot, laei - http://games.laei.org + /// + /// Actual translation of math gebrish to C# credit is due to + /// Boon Cotter - http://www.booncotter.com/waypoints-catmull-rom-splines/ + /// + /// This takes a list of vector3 (or an array) and gives a function called .onCurve(t) + /// returning a value on a Catmull-Rom spline for 0 <= t <= 1 + /// + Vector3 onCRSplineCurve(int ptStart, int ptCount, float t) + { + int adjustedIndex = Mathf.FloorToInt(t * (ptCount - 4)) + ptStart; //Since the equation works with 4 points, we adjust the starting point depending on t to return a point on the specific segment + + Vector3 result = new Vector3(); + + Vector3 p0 = _points[adjustedIndex]; + Vector3 p1 = _points[adjustedIndex + 1]; + Vector3 p2 = _points[adjustedIndex + 2]; + Vector3 p3 = _points[adjustedIndex + 3]; + + float adjustedT = (t == 1f) ? 1f : Mathf.Repeat(t * (ptCount - 4), 1f); // Then we adjust t to be that value on that new piece of segment... for t == 1f don't use repeat (that would return 0f); + + float t0 = ((-adjustedT + 2f) * adjustedT - 1f) * adjustedT * 0.5f; + float t1 = (((3f * adjustedT - 5f) * adjustedT) * adjustedT + 2f) * 0.5f; + float t2 = ((-3f * adjustedT + 4f) * adjustedT + 1f) * adjustedT * 0.5f; + float t3 = ((adjustedT - 1f) * adjustedT * adjustedT) * 0.5f; + + result.x = p0.x * t0 + p1.x * t1 + p2.x * t2 + p3.x * t3; + result.y = p0.y * t0 + p1.y * t1 + p2.y * t2 + p3.y * t3; + result.z = p0.z * t0 + p1.z * t1 + p2.z * t2 + p3.z * t3; + + return result; + } + + Vector3 onBezierCurve(int ptStart, int ptCount, float t) + { + float t2 = 1f - t; + Vector3 p0 = _points[ptStart]; + Vector3 p1 = _points[ptStart + 1]; + Vector3 cp0 = _points[ptStart + 2]; + + if (ptCount == 4) + { + Vector3 cp1 = _points[ptStart + 3]; + return t2 * t2 * t2 * p0 + 3f * t2 * t2 * t * cp0 + 3f * t2 * t * t * cp1 + t * t * t * p1; + } + else + return t2 * t2 * p0 + 2f * t2 * t * cp0 + t * t * p1; + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs.meta new file mode 100644 index 00000000..14d2f86b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GPath.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3755f976b6dd17c408731fa87b3cb006 +timeCreated: 1546592349 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs new file mode 100644 index 00000000..b2d985d3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs @@ -0,0 +1,189 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class GTween + { + /// + /// + /// + public static bool catchCallbackExceptions = false; + + /// + /// + /// + /// + /// + /// + /// + public static GTweener To(float startValue, float endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener To(Vector2 startValue, Vector2 endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener To(Vector3 startValue, Vector3 endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener To(Vector4 startValue, Vector4 endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener To(Color startValue, Color endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener ToDouble(double startValue, double endValue, float duration) + { + return TweenManager.CreateTween()._To(startValue, endValue, duration); + } + + /// + /// + /// + /// + /// + public static GTweener DelayedCall(float delay) + { + return TweenManager.CreateTween().SetDelay(delay); + } + + /// + /// + /// + /// + /// + /// + /// + public static GTweener Shake(Vector3 startValue, float amplitude, float duration) + { + return TweenManager.CreateTween()._Shake(startValue, amplitude, duration); + } + + /// + /// + /// + /// + /// + public static bool IsTweening(object target) + { + return TweenManager.IsTweening(target, TweenPropType.None); + } + + /// + /// + /// + /// + /// + /// + public static bool IsTweening(object target, TweenPropType propType) + { + return TweenManager.IsTweening(target, propType); + } + + /// + /// + /// + /// + public static void Kill(object target) + { + TweenManager.KillTweens(target, TweenPropType.None, false); + } + + /// + /// + /// + /// + /// + public static void Kill(object target, bool complete) + { + TweenManager.KillTweens(target, TweenPropType.None, complete); + } + + /// + /// + /// + /// + /// + /// + public static void Kill(object target, TweenPropType propType, bool complete) + { + TweenManager.KillTweens(target, propType, complete); + } + + /// + /// + /// + /// + /// + public static GTweener GetTween(object target) + { + return TweenManager.GetTween(target, TweenPropType.None); + } + + /// + /// + /// + /// + /// + /// + public static GTweener GetTween(object target, TweenPropType propType) + { + return TweenManager.GetTween(target, propType); + } + + /// + /// + /// + public static void Clean() + { + TweenManager.Clean(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs.meta new file mode 100644 index 00000000..533f9598 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTween.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 613566965c56f6e4e9a95936b8128f90 +timeCreated: 1531222519 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs new file mode 100644 index 00000000..33e98b6d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs @@ -0,0 +1,859 @@ +using System; +using UnityEngine; +#if FAIRYGUI_TOLUA +using LuaInterface; +#endif + +namespace FairyGUI +{ + /// + /// + /// + public delegate void GTweenCallback(); + + /// + /// + /// + /// + public delegate void GTweenCallback1(GTweener tweener); + + /// + /// + /// + public interface ITweenListener + { + /// + /// + /// + /// + void OnTweenStart(GTweener tweener); + + /// + /// + /// + /// + void OnTweenUpdate(GTweener tweener); + + /// + /// + /// + /// + void OnTweenComplete(GTweener tweener); + } + + /// + /// + /// + public class GTweener + { + internal object _target; + internal TweenPropType _propType; + internal bool _killed; + internal bool _paused; + + float _delay; + float _duration; + float _breakpoint; + EaseType _easeType; + float _easeOvershootOrAmplitude; + float _easePeriod; + int _repeat; + bool _yoyo; + float _timeScale; + bool _ignoreEngineTimeScale; + bool _snapping; + object _userData; + GPath _path; + CustomEase _customEase; + + GTweenCallback _onUpdate; + GTweenCallback _onStart; + GTweenCallback _onComplete; + GTweenCallback1 _onUpdate1; + GTweenCallback1 _onStart1; + GTweenCallback1 _onComplete1; + ITweenListener _listener; + + TweenValue _startValue; + TweenValue _endValue; + TweenValue _value; + TweenValue _deltaValue; + int _valueSize; + + bool _started; + int _ended; + float _elapsedTime; + float _normalizedTime; + int _smoothStart; + + public GTweener() + { + _startValue = new TweenValue(); + _endValue = new TweenValue(); + _value = new TweenValue(); + _deltaValue = new TweenValue(); + } + + /// + /// + /// + /// + /// + public GTweener SetDelay(float value) + { + _delay = value; + return this; + } + + /// + /// + /// + public float delay + { + get { return _delay; } + } + + /// + /// + /// + /// + /// + public GTweener SetDuration(float value) + { + _duration = value; + return this; + } + + /// + /// + /// + public float duration + { + get { return _duration; } + } + + /// + /// + /// + /// + /// + public GTweener SetBreakpoint(float value) + { + _breakpoint = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetEase(EaseType value) + { + _easeType = value; + return this; + } + + /// + /// + /// + /// + /// + /// + public GTweener SetEase(EaseType value, CustomEase customEase) + { + _easeType = value; + _customEase = customEase; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetEasePeriod(float value) + { + _easePeriod = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetEaseOvershootOrAmplitude(float value) + { + _easeOvershootOrAmplitude = value; + return this; + } + + /// + /// + /// + /// + /// + /// + public GTweener SetRepeat(int times, bool yoyo = false) + { + _repeat = times; + _yoyo = yoyo; + return this; + } + + /// + /// + /// + public int repeat + { + get { return _repeat; } + } + + /// + /// + /// + /// + /// + public GTweener SetTimeScale(float value) + { + _timeScale = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetIgnoreEngineTimeScale(bool value) + { + _ignoreEngineTimeScale = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetSnapping(bool value) + { + _snapping = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetPath(GPath value) + { + _path = value; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetTarget(object value) + { + _target = value; + _propType = TweenPropType.None; + return this; + } + + /// + /// + /// + /// + /// + /// + public GTweener SetTarget(object value, TweenPropType propType) + { + _target = value; + _propType = propType; + return this; + } + + /// + /// + /// + public object target + { + get { return _target; } + } + + /// + /// + /// + /// + /// + public GTweener SetUserData(object value) + { + _userData = value; + return this; + } + + /// + /// + /// + public object userData + { + get { return _userData; } + } + + /// + /// + /// + /// + /// +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public GTweener OnUpdate(GTweenCallback callback) + { + _onUpdate = callback; + return this; + } + + /// + /// + /// + /// + /// +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public GTweener OnStart(GTweenCallback callback) + { + _onStart = callback; + return this; + } + + /// + /// + /// + /// + /// +#if FAIRYGUI_TOLUA + [NoToLua] +#endif + public GTweener OnComplete(GTweenCallback callback) + { + _onComplete = callback; + return this; + } + + /// + /// + /// + /// + /// + public GTweener OnUpdate(GTweenCallback1 callback) + { + _onUpdate1 = callback; + return this; + } + + /// + /// + /// + /// + /// + public GTweener OnStart(GTweenCallback1 callback) + { + _onStart1 = callback; + return this; + } + + /// + /// + /// + /// + /// + public GTweener OnComplete(GTweenCallback1 callback) + { + _onComplete1 = callback; + return this; + } + + /// + /// + /// + /// + /// + public GTweener SetListener(ITweenListener value) + { + _listener = value; + return this; + } + + /// + /// + /// + public TweenValue startValue + { + get { return _startValue; } + } + + /// + /// + /// + public TweenValue endValue + { + get { return _endValue; } + } + + /// + /// + /// + public TweenValue value + { + get { return _value; } + } + + /// + /// + /// + public TweenValue deltaValue + { + get { return _deltaValue; } + } + + /// + /// + /// + public float normalizedTime + { + get { return _normalizedTime; } + } + + /// + /// + /// + public bool completed + { + get { return _ended != 0; } + } + + /// + /// + /// + public bool allCompleted + { + get { return _ended == 1; } + } + + /// + /// + /// + /// + /// + public GTweener SetPaused(bool paused) + { + _paused = paused; + if (_paused) + _smoothStart = 0; + return this; + } + + /// + /// + /// + /// + public void Seek(float time) + { + if (_killed) + return; + + _elapsedTime = time; + if (_elapsedTime < _delay) + { + if (_started) + _elapsedTime = _delay; + else + return; + } + + Update(); + } + + /// + /// + /// + /// + public void Kill(bool complete = false) + { + if (_killed) + return; + + if (complete) + { + if (_ended == 0) + { + if (_breakpoint >= 0) + _elapsedTime = _delay + _breakpoint; + else if (_repeat >= 0) + _elapsedTime = _delay + _duration * (_repeat + 1); + else + _elapsedTime = _delay + _duration * 2; + Update(); + } + + CallCompleteCallback(); + } + + _killed = true; + } + + internal GTweener _To(float start, float end, float duration) + { + _valueSize = 1; + _startValue.x = start; + _endValue.x = end; + _value.x = start; + _duration = duration; + return this; + } + + internal GTweener _To(Vector2 start, Vector2 end, float duration) + { + _valueSize = 2; + _startValue.vec2 = start; + _endValue.vec2 = end; + _value.vec2 = start; + _duration = duration; + return this; + } + + internal GTweener _To(Vector3 start, Vector3 end, float duration) + { + _valueSize = 3; + _startValue.vec3 = start; + _endValue.vec3 = end; + _value.vec3 = start; + _duration = duration; + return this; + } + + internal GTweener _To(Vector4 start, Vector4 end, float duration) + { + _valueSize = 4; + _startValue.vec4 = start; + _endValue.vec4 = end; + _value.vec4 = start; + _duration = duration; + return this; + } + + internal GTweener _To(Color start, Color end, float duration) + { + _valueSize = 4; + _startValue.color = start; + _endValue.color = end; + _value.color = start; + _duration = duration; + return this; + } + + internal GTweener _To(double start, double end, float duration) + { + _valueSize = 5; + _startValue.d = start; + _endValue.d = end; + _value.d = start; + _duration = duration; + return this; + } + + internal GTweener _Shake(Vector3 start, float amplitude, float duration) + { + _valueSize = 6; + _startValue.vec3 = start; + _startValue.w = amplitude; + _duration = duration; + _easeType = EaseType.Linear; + return this; + } + + internal void _Init() + { + _delay = 0; + _duration = 0; + _breakpoint = -1; + _easeType = EaseType.QuadOut; + _timeScale = 1; + _ignoreEngineTimeScale = false; + _easePeriod = 0; + _easeOvershootOrAmplitude = 1.70158f; + _snapping = false; + _repeat = 0; + _yoyo = false; + _valueSize = 0; + _started = false; + _paused = false; + _killed = false; + _elapsedTime = 0; + _normalizedTime = 0; + _ended = 0; + _path = null; + _customEase = null; + _smoothStart = Time.frameCount == 1 ? 3 : 1;//刚å¯åŠ¨æ—¶ä¼šæœ‰å¤šå¸§çš„è¶…æ—¶ + } + + internal void _Reset() + { + _target = null; + _listener = null; + _userData = null; + _onStart = _onUpdate = _onComplete = null; + _onStart1 = _onUpdate1 = _onComplete1 = null; + } + + internal void _Update() + { + if (_ended != 0) //Maybe completed by seek + { + CallCompleteCallback(); + _killed = true; + return; + } + + float dt; + if (_smoothStart > 0) + { + _smoothStart--; + dt = Mathf.Clamp(Time.unscaledDeltaTime, 0, Application.targetFrameRate > 0 ? (1.0f / Application.targetFrameRate) : 0.016f); + if (!_ignoreEngineTimeScale) + dt *= Time.timeScale; + } + else if (_ignoreEngineTimeScale) + dt = Time.unscaledDeltaTime; + else + dt = Time.deltaTime; + if (_timeScale != 1) + dt *= _timeScale; + if (dt == 0) + return; + + _elapsedTime += dt; + Update(); + + if (_ended != 0) + { + if (!_killed) + { + CallCompleteCallback(); + _killed = true; + } + } + } + + void Update() + { + _ended = 0; + + if (_valueSize == 0) //DelayedCall + { + if (_elapsedTime >= _delay + _duration) + _ended = 1; + + return; + } + + if (!_started) + { + if (_elapsedTime < _delay) + return; + + _started = true; + CallStartCallback(); + if (_killed) + return; + } + + bool reversed = false; + float tt = _elapsedTime - _delay; + if (_breakpoint >= 0 && tt >= _breakpoint) + { + tt = _breakpoint; + _ended = 2; + } + + if (_repeat != 0) + { + int round = Mathf.FloorToInt(tt / _duration); + tt -= _duration * round; + if (_yoyo) + reversed = round % 2 == 1; + + if (_repeat > 0 && _repeat - round < 0) + { + if (_yoyo) + reversed = _repeat % 2 == 1; + tt = _duration; + _ended = 1; + } + } + else if (tt >= _duration) + { + tt = _duration; + _ended = 1; + } + + _normalizedTime = EaseManager.Evaluate(_easeType, reversed ? (_duration - tt) : tt, _duration, + _easeOvershootOrAmplitude, _easePeriod, _customEase); + + _value.SetZero(); + _deltaValue.SetZero(); + + if (_valueSize == 5) + { + double d = _startValue.d + (_endValue.d - _startValue.d) * _normalizedTime; + if (_snapping) + d = Math.Round(d); + _deltaValue.d = d - _value.d; + _value.d = d; + _value.x = (float)d; + } + else if (_valueSize == 6) + { + if (_ended == 0) + { + Vector3 r = UnityEngine.Random.insideUnitSphere; + r.x = r.x > 0 ? 1 : -1; + r.y = r.y > 0 ? 1 : -1; + r.z = r.z > 0 ? 1 : -1; + r *= _startValue.w * (1 - _normalizedTime); + + _deltaValue.vec3 = r; + _value.vec3 = _startValue.vec3 + r; + } + else + _value.vec3 = _startValue.vec3; + } + else if (_path != null) + { + Vector3 vec3 = _path.GetPointAt(_normalizedTime); + if (_snapping) + { + vec3.x = Mathf.Round(vec3.x); + vec3.y = Mathf.Round(vec3.y); + vec3.z = Mathf.Round(vec3.z); + } + _deltaValue.vec3 = vec3 - _value.vec3; + _value.vec3 = vec3; + } + else + { + for (int i = 0; i < _valueSize; i++) + { + float n1 = _startValue[i]; + float n2 = _endValue[i]; + float f = n1 + (n2 - n1) * _normalizedTime; + if (_snapping) + f = Mathf.Round(f); + _deltaValue[i] = f - _value[i]; + _value[i] = f; + } + _value.d = _value.x; + } + + if (_target != null && _propType != TweenPropType.None) + TweenPropTypeUtils.SetProps(_target, _propType, _value); + + CallUpdateCallback(); + } + + void CallStartCallback() + { + if (GTween.catchCallbackExceptions) + { + try + { + if (_onStart1 != null) + _onStart1(this); + if (_onStart != null) + _onStart(); + if (_listener != null) + _listener.OnTweenStart(this); + } + catch (Exception e) + { + Debug.LogWarning("FairyGUI: error in start callback > " + e.Message); + } + } + else + { + if (_onStart1 != null) + _onStart1(this); + if (_onStart != null) + _onStart(); + if (_listener != null) + _listener.OnTweenStart(this); + } + } + + void CallUpdateCallback() + { + if (GTween.catchCallbackExceptions) + { + try + { + if (_onUpdate1 != null) + _onUpdate1(this); + if (_onUpdate != null) + _onUpdate(); + if (_listener != null) + _listener.OnTweenUpdate(this); + } + catch (Exception e) + { + Debug.LogWarning("FairyGUI: error in update callback > " + e.Message); + } + } + else + { + if (_onUpdate1 != null) + _onUpdate1(this); + if (_onUpdate != null) + _onUpdate(); + if (_listener != null) + _listener.OnTweenUpdate(this); + } + } + + void CallCompleteCallback() + { + if (GTween.catchCallbackExceptions) + { + try + { + if (_onComplete1 != null) + _onComplete1(this); + if (_onComplete != null) + _onComplete(); + if (_listener != null) + _listener.OnTweenComplete(this); + } + catch (Exception e) + { + Debug.LogWarning("FairyGUI: error in complete callback > " + e.Message); + } + } + else + { + if (_onComplete1 != null) + _onComplete1(this); + if (_onComplete != null) + _onComplete(); + if (_listener != null) + _listener.OnTweenComplete(this); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs.meta new file mode 100644 index 00000000..2532e360 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/GTweener.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 48e1b5ac4a90a5649962a3e75fd666c2 +timeCreated: 1531222519 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs new file mode 100644 index 00000000..456e5a4f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs @@ -0,0 +1,180 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + internal static class TweenManager + { + static GTweener[] _activeTweens = new GTweener[30]; + static List _tweenerPool = new List(30); + static int _totalActiveTweens = 0; + static bool _inited = false; + + internal static GTweener CreateTween() + { + if (!_inited) + Init(); + + GTweener tweener; + int cnt = _tweenerPool.Count; + if (cnt > 0) + { + tweener = _tweenerPool[cnt - 1]; + _tweenerPool.RemoveAt(cnt - 1); + } + else + tweener = new GTweener(); + tweener._Init(); + _activeTweens[_totalActiveTweens++] = tweener; + + if (_totalActiveTweens == _activeTweens.Length) + { + GTweener[] newArray = new GTweener[_activeTweens.Length + Mathf.CeilToInt(_activeTweens.Length * 0.5f)]; + _activeTweens.CopyTo(newArray, 0); + _activeTweens = newArray; + } + + return tweener; + } + + internal static bool IsTweening(object target, TweenPropType propType) + { + if (target == null) + return false; + + bool anyType = propType == TweenPropType.None; + for (int i = 0; i < _totalActiveTweens; i++) + { + GTweener tweener = _activeTweens[i]; + if (tweener != null && tweener.target == target && !tweener._killed + && (anyType || tweener._propType == propType)) + return true; + } + + return false; + } + + internal static bool KillTweens(object target, TweenPropType propType, bool completed) + { + if (target == null) + return false; + + bool flag = false; + int cnt = _totalActiveTweens; + bool anyType = propType == TweenPropType.None; + for (int i = 0; i < cnt; i++) + { + GTweener tweener = _activeTweens[i]; + if (tweener != null && tweener.target == target && !tweener._killed + && (anyType || tweener._propType == propType)) + { + tweener.Kill(completed); + flag = true; + } + } + + return flag; + } + + internal static GTweener GetTween(object target, TweenPropType propType) + { + if (target == null) + return null; + + int cnt = _totalActiveTweens; + bool anyType = propType == TweenPropType.None; + for (int i = 0; i < cnt; i++) + { + GTweener tweener = _activeTweens[i]; + if (tweener != null && tweener.target == target && !tweener._killed + && (anyType || tweener._propType == propType)) + { + return tweener; + } + } + + return null; + } + + internal static void Update() + { + int cnt = _totalActiveTweens; + int freePosStart = -1; + for (int i = 0; i < cnt; i++) + { + GTweener tweener = _activeTweens[i]; + if (tweener == null) + { + if (freePosStart == -1) + freePosStart = i; + } + else if (tweener._killed) + { + tweener._Reset(); + _tweenerPool.Add(tweener); + _activeTweens[i] = null; + + if (freePosStart == -1) + freePosStart = i; + } + else + { + if ((tweener._target is GObject) && ((GObject)tweener._target)._disposed) + tweener._killed = true; + else if (!tweener._paused) + tweener._Update(); + + if (freePosStart != -1) + { + _activeTweens[freePosStart] = tweener; + _activeTweens[i] = null; + freePosStart++; + } + } + } + + if (freePosStart >= 0) + { + if (_totalActiveTweens != cnt) //new tweens added + { + int j = cnt; + cnt = _totalActiveTweens - cnt; + for (int i = 0; i < cnt; i++) + { + _activeTweens[freePosStart++] = _activeTweens[j]; + _activeTweens[j] = null; + j++; + } + } + _totalActiveTweens = freePosStart; + } + } + + internal static void Clean() + { + _tweenerPool.Clear(); + } + + static void Init() + { + _inited = true; + if (Application.isPlaying) + { + GameObject gameObject = new GameObject("[FairyGUI.TweenManager]"); + gameObject.hideFlags = HideFlags.HideInHierarchy; + gameObject.SetActive(true); + Object.DontDestroyOnLoad(gameObject); + + gameObject.AddComponent(); + } + } + + class TweenEngine : MonoBehaviour + { + void Update() + { + TweenManager.Update(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs.meta new file mode 100644 index 00000000..566d2688 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenManager.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3048174c9aaf2e840953e3cab497a426 +timeCreated: 1531222519 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs new file mode 100644 index 00000000..1842267a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs @@ -0,0 +1,103 @@ +namespace FairyGUI +{ + /// + /// + /// + public enum TweenPropType + { + None, + X, + Y, + Z, + XY, + Position, + Width, + Height, + Size, + ScaleX, + ScaleY, + Scale, + Rotation, + RotationX, + RotationY, + Alpha, + Progress + } + + internal class TweenPropTypeUtils + { + internal static void SetProps(object target, TweenPropType propType, TweenValue value) + { + GObject g = target as GObject; + if (g == null) + return; + + switch (propType) + { + case TweenPropType.X: + g.x = value.x; + break; + + case TweenPropType.Y: + g.y = value.x; + break; + + case TweenPropType.Z: + g.z = value.x; + break; + + case TweenPropType.XY: + g.xy = value.vec2; + break; + + case TweenPropType.Position: + g.position = value.vec3; + break; + + case TweenPropType.Width: + g.width = value.x; + break; + + case TweenPropType.Height: + g.height = value.x; + break; + + case TweenPropType.Size: + g.size = value.vec2; + break; + + case TweenPropType.ScaleX: + g.scaleX = value.x; + break; + + case TweenPropType.ScaleY: + g.scaleY = value.x; + break; + + case TweenPropType.Scale: + g.scale = value.vec2; + break; + + case TweenPropType.Rotation: + g.rotation = value.x; + break; + + case TweenPropType.RotationX: + g.rotationX = value.x; + break; + + case TweenPropType.RotationY: + g.rotationY = value.x; + break; + + case TweenPropType.Alpha: + g.alpha = value.x; + break; + + case TweenPropType.Progress: + g.asProgress.Update(value.d); + break; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs.meta new file mode 100644 index 00000000..d23e7798 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenPropType.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7000822d8123b4344b21dcfb230f8938 +timeCreated: 1531473796 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs new file mode 100644 index 00000000..0b18d055 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs @@ -0,0 +1,151 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class TweenValue + { + /// + /// + /// + public float x; + + /// + /// + /// + public float y; + + /// + /// + /// + public float z; + + /// + /// + /// + public float w; + + /// + /// + /// + public double d; + + public TweenValue() + { + } + + /// + /// + /// + public Vector2 vec2 + { + get { return new Vector2(x, y); } + set + { + x = value.x; + y = value.y; + } + } + + /// + /// + /// + public Vector3 vec3 + { + get { return new Vector3(x, y, z); } + set + { + x = value.x; + y = value.y; + z = value.z; + } + } + + /// + /// + /// + public Vector4 vec4 + { + get { return new Vector4(x, y, z, w); } + set + { + x = value.x; + y = value.y; + z = value.z; + w = value.w; + } + } + + /// + /// + /// + public Color color + { + get { return new Color(x, y, z, w); } + set + { + x = value.r; + y = value.g; + z = value.b; + w = value.a; + } + } + + /// + /// + /// + /// + /// + public float this[int index] + { + get + { + switch (index) + { + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + default: + throw new System.Exception("Index out of bounds: " + index); + } + } + + set + { + switch (index) + { + case 0: + x = value; + break; + case 1: + y = value; + break; + case 2: + z = value; + break; + case 3: + w = value; + break; + default: + throw new System.Exception("Index out of bounds: " + index); + } + } + } + + /// + /// + /// + public void SetZero() + { + x = y = z = w = 0; + d = 0; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs.meta new file mode 100644 index 00000000..50ca413c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Tween/TweenValue.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 97e8a1ca496b4d34cad5f2420a9f8809 +timeCreated: 1531473796 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI.meta new file mode 100644 index 00000000..1d37c695 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 929603a3379395146b898542bc37d31b +folderAsset: yes +timeCreated: 1460480287 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action.meta new file mode 100644 index 00000000..70db1b52 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 76c9ac9d39933da4e833eddb1a96581a +folderAsset: yes +timeCreated: 1500559678 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs new file mode 100644 index 00000000..a22d5a2a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs @@ -0,0 +1,52 @@ +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class ChangePageAction : ControllerAction + { + public string objectId; + public string controllerName; + public string targetPage; + + public ChangePageAction() + { + } + + override protected void Enter(Controller controller) + { + if (string.IsNullOrEmpty(controllerName)) + return; + + GComponent gcom; + if (!string.IsNullOrEmpty(objectId)) + gcom = controller.parent.GetChildById(objectId) as GComponent; + else + gcom = controller.parent; + if (gcom != null) + { + Controller cc = gcom.GetController(controllerName); + if (cc != null && cc != controller && !cc.changing) + { + if (this.targetPage == "~1") + { + if (controller.selectedIndex < cc.pageCount) + cc.selectedIndex = controller.selectedIndex; + } + else if (this.targetPage == "~2") + cc.selectedPage = controller.selectedPage; + else + cc.selectedPageId = this.targetPage; + } + } + } + + override public void Setup(ByteBuffer buffer) + { + base.Setup(buffer); + + objectId = buffer.ReadS(); + controllerName = buffer.ReadS(); + targetPage = buffer.ReadS(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs.meta new file mode 100644 index 00000000..bd80731f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ChangePageAction.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 625a0a9a670984b47a4b170a801c850e +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs new file mode 100644 index 00000000..b713a010 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs @@ -0,0 +1,68 @@ +using System; +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class ControllerAction + { + public enum ActionType + { + PlayTransition, + ChangePage + } + + public string[] fromPage; + public string[] toPage; + + public static ControllerAction CreateAction(ActionType type) + { + switch (type) + { + case ActionType.PlayTransition: + return new PlayTransitionAction(); + + case ActionType.ChangePage: + return new ChangePageAction(); + } + return null; + } + + public ControllerAction() + { + } + + public void Run(Controller controller, string prevPage, string curPage) + { + if ((fromPage == null || fromPage.Length == 0 || Array.IndexOf(fromPage, prevPage) != -1) + && (toPage == null || toPage.Length == 0 || Array.IndexOf(toPage, curPage) != -1)) + Enter(controller); + else + Leave(controller); + } + + virtual protected void Enter(Controller controller) + { + + } + + virtual protected void Leave(Controller controller) + { + + } + + virtual public void Setup(ByteBuffer buffer) + { + int cnt; + + cnt = buffer.ReadShort(); + fromPage = new string[cnt]; + for (int i = 0; i < cnt; i++) + fromPage[i] = buffer.ReadS(); + + cnt = buffer.ReadShort(); + toPage = new string[cnt]; + for (int i = 0; i < cnt; i++) + toPage[i] = buffer.ReadS(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs.meta new file mode 100644 index 00000000..0b7159ab --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/ControllerAction.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d6fb1eb3d57827b4bb09eddfa5c76137 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs new file mode 100644 index 00000000..cf156610 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs @@ -0,0 +1,52 @@ +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class PlayTransitionAction : ControllerAction + { + public string transitionName; + public int playTimes; + public float delay; + public bool stopOnExit; + + private Transition _currentTransition; + + public PlayTransitionAction() + { + playTimes = 1; + delay = 0; + } + + override protected void Enter(Controller controller) + { + Transition trans = controller.parent.GetTransition(transitionName); + if (trans != null) + { + if (_currentTransition != null && _currentTransition.playing) + trans.ChangePlayTimes(playTimes); + else + trans.Play(playTimes, delay, null); + _currentTransition = trans; + } + } + + override protected void Leave(Controller controller) + { + if (stopOnExit && _currentTransition != null) + { + _currentTransition.Stop(); + _currentTransition = null; + } + } + + override public void Setup(ByteBuffer buffer) + { + base.Setup(buffer); + + transitionName = buffer.ReadS(); + playTimes = buffer.ReadInt(); + delay = buffer.ReadFloat(); + stopOnExit = buffer.ReadBool(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs.meta new file mode 100644 index 00000000..85e34053 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Action/PlayTransitionAction.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: eac7f8de0d09f17439fb3c8e4a06090e +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs new file mode 100644 index 00000000..c415aff9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs @@ -0,0 +1,189 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class AsyncCreationHelper + { + public static void CreateObject(PackageItem item, UIPackage.CreateObjectCallback callback) + { + Timers.inst.StartCoroutine(_CreateObject(item, callback)); + } + + static IEnumerator _CreateObject(PackageItem item, UIPackage.CreateObjectCallback callback) + { + Stats.LatestObjectCreation = 0; + Stats.LatestGraphicsCreation = 0; + + float frameTime = UIConfig.frameTimeForAsyncUIConstruction; + + List itemList = new List(); + DisplayListItem di = new DisplayListItem(item, ObjectType.Component); + di.childCount = CollectComponentChildren(item, itemList); + itemList.Add(di); + + int cnt = itemList.Count; + List objectPool = new List(cnt); + GObject obj; + float t = Time.realtimeSinceStartup; + bool alreadyNextFrame = false; + + for (int i = 0; i < cnt; i++) + { + di = itemList[i]; + if (di.packageItem != null) + { + obj = UIObjectFactory.NewObject(di.packageItem); + objectPool.Add(obj); + + UIPackage._constructing++; + if (di.packageItem.type == PackageItemType.Component) + { + int poolStart = objectPool.Count - di.childCount - 1; + + ((GComponent)obj).ConstructFromResource(objectPool, poolStart); + + objectPool.RemoveRange(poolStart, di.childCount); + } + else + { + obj.ConstructFromResource(); + } + UIPackage._constructing--; + } + else + { + obj = UIObjectFactory.NewObject(di.type); + objectPool.Add(obj); + + if (di.type == ObjectType.List && di.listItemCount > 0) + { + int poolStart = objectPool.Count - di.listItemCount - 1; + for (int k = 0; k < di.listItemCount; k++) //把他们都放到pool里,这样GList在创建时就ä¸éœ€è¦åˆ›å»ºå¯¹è±¡äº† + ((GList)obj).itemPool.ReturnObject(objectPool[k + poolStart]); + objectPool.RemoveRange(poolStart, di.listItemCount); + } + } + + if ((i % 5 == 0) && Time.realtimeSinceStartup - t >= frameTime) + { + yield return null; + t = Time.realtimeSinceStartup; + alreadyNextFrame = true; + } + } + + if (!alreadyNextFrame) //强制至至少下一帧æ‰è°ƒç”¨callback,é¿å…调用者逻辑出错 + yield return null; + + callback(objectPool[0]); + } + + /// + /// æ”¶é›†åˆ›å»ºç›®æ ‡å¯¹è±¡æ‰€éœ€çš„æ‰€æœ‰ç±»åž‹ä¿¡æ¯ + /// + /// + /// + static int CollectComponentChildren(PackageItem item, List list) + { + ByteBuffer buffer = item.rawData; + buffer.Seek(0, 2); + + int dcnt = buffer.ReadShort(); + DisplayListItem di; + PackageItem pi; + for (int i = 0; i < dcnt; i++) + { + int dataLen = buffer.ReadShort(); + int curPos = buffer.position; + + buffer.Seek(curPos, 0); + + ObjectType type = (ObjectType)buffer.ReadByte(); + string src = buffer.ReadS(); + string pkgId = buffer.ReadS(); + + buffer.position = curPos; + + if (src != null) + { + UIPackage pkg; + if (pkgId != null) + pkg = UIPackage.GetById(pkgId); + else + pkg = item.owner; + + pi = pkg != null ? pkg.GetItem(src) : null; + di = new DisplayListItem(pi, type); + + if (pi != null && pi.type == PackageItemType.Component) + di.childCount = CollectComponentChildren(pi, list); + } + else + { + di = new DisplayListItem(null, type); + if (type == ObjectType.List) //list + di.listItemCount = CollectListChildren(buffer, list); + } + + list.Add(di); + buffer.position = curPos + dataLen; + } + + return dcnt; + } + + static int CollectListChildren(ByteBuffer buffer, List list) + { + buffer.Seek(buffer.position, 8); + + string defaultItem = buffer.ReadS(); + int listItemCount = 0; + int itemCount = buffer.ReadShort(); + for (int i = 0; i < itemCount; i++) + { + int nextPos = buffer.ReadShort(); + nextPos += buffer.position; + + string url = buffer.ReadS(); + if (url == null) + url = defaultItem; + if (!string.IsNullOrEmpty(url)) + { + PackageItem pi = UIPackage.GetItemByURL(url); + if (pi != null) + { + DisplayListItem di = new DisplayListItem(pi, pi.objectType); + if (pi.type == PackageItemType.Component) + di.childCount = CollectComponentChildren(pi, list); + + list.Add(di); + listItemCount++; + } + } + buffer.position = nextPos; + } + + return listItemCount; + } + + /// + /// + /// + class DisplayListItem + { + public PackageItem packageItem; + public ObjectType type; + public int childCount; + public int listItemCount; + + public DisplayListItem(PackageItem pi, ObjectType type) + { + this.packageItem = pi; + this.type = type; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs.meta new file mode 100644 index 00000000..bfdca46c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/AsyncCreationHelper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 99d38995f0d185d4eb694a7728219c01 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs new file mode 100644 index 00000000..a1c1b18e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs @@ -0,0 +1,434 @@ +using System.Collections.Generic; +using FairyGUI.Utils; +using System; + +namespace FairyGUI +{ + /// + /// Controller class. + /// 控制器类。控制器的创建和设计需通过编辑器完æˆï¼Œä¸å»ºè®®ä½¿ç”¨ä»£ç åˆ›å»ºã€‚ + /// 最常用的方法是通过selectedIndexèŽ·å¾—æˆ–æ”¹å˜æŽ§åˆ¶å™¨çš„æ´»åŠ¨é¡µé¢ã€‚如果è¦èŽ·å¾—æŽ§åˆ¶å™¨é¡µé¢æ”¹å˜çš„通知,使用onChanged事件。 + /// + public class Controller : EventDispatcher + { + /// + /// Name of the controller + /// 控制器å称。 + /// + public string name; + + internal GComponent parent; + internal bool autoRadioGroupDepth; + internal bool changing; + + int _selectedIndex; + int _previousIndex; + List _pageIds; + List _pageNames; + List _actions; + + EventListener _onChanged; + + static uint _nextPageId; + + public Controller() + { + _pageIds = new List(); + _pageNames = new List(); + _selectedIndex = -1; + _previousIndex = -1; + } + + public void Dispose() + { + RemoveEventListeners(); + } + + + /// + /// When controller page changed. + /// å½“æŽ§åˆ¶å™¨æ´»åŠ¨é¡µé¢æ”¹å˜æ—¶ï¼Œæ­¤äº‹ä»¶è¢«è§¦å‘。 + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// Current page index. + /// èŽ·å¾—æˆ–è®¾ç½®å½“å‰æ´»åЍ页é¢ç´¢å¼•。 + /// + public int selectedIndex + { + get + { + return _selectedIndex; + } + set + { + if (_selectedIndex != value) + { + if (value > _pageIds.Count - 1) + throw new IndexOutOfRangeException("" + value); + + changing = true; + + _previousIndex = _selectedIndex; + _selectedIndex = value; + parent.ApplyController(this); + + DispatchEvent("onChanged", null); + + changing = false; + } + } + } + + /// + /// Set current page index, no onChanged event. + /// é€šè¿‡ç´¢å¼•è®¾ç½®å½“å‰æ´»åЍ页é¢ï¼Œå’ŒselectedIndex的区别在于,这个方法ä¸ä¼šè§¦å‘onChanged事件。 + /// + /// Page index + public void SetSelectedIndex(int value) + { + if (_selectedIndex != value) + { + if (value > _pageIds.Count - 1) + throw new IndexOutOfRangeException("" + value); + + changing = true; + _previousIndex = _selectedIndex; + _selectedIndex = value; + parent.ApplyController(this); + changing = false; + } + } + + /// + /// Set current page by name, no onChanged event. + /// 通过页é¢åç§°è®¾ç½®å½“å‰æ´»åЍ页é¢ï¼Œå’ŒselectedPage的区别在于,这个方法ä¸ä¼šè§¦å‘onChanged事件。 + /// + /// Page name + public void SetSelectedPage(string value) + { + int i = _pageNames.IndexOf(value); + if (i == -1) + i = 0; + this.SetSelectedIndex(i); + } + + /// + /// Current page name. + /// èŽ·å¾—å½“å‰æ´»åЍ页é¢åç§° + /// + public string selectedPage + { + get + { + if (_selectedIndex == -1) + return null; + else + return _pageNames[_selectedIndex]; + } + set + { + int i = _pageNames.IndexOf(value); + if (i == -1) + i = 0; + this.selectedIndex = i; + } + } + + /// + /// Previouse page index. + /// 获得上次活动页é¢ç´¢å¼• + /// + public int previsousIndex + { + get { return _previousIndex; } + } + + /// + /// Previous page name. + /// 获得上次活动页é¢å称。 + /// + public string previousPage + { + get + { + if (_previousIndex == -1) + return null; + else + return _pageNames[_previousIndex]; + } + } + + /// + /// Page count of this controller. + /// èŽ·å¾—é¡µé¢æ•°é‡ã€‚ + /// + public int pageCount + { + get { return _pageIds.Count; } + } + + /// + /// Get page name by an index. + /// 通过页é¢ç´¢å¼•获得页é¢å称。 + /// + /// Page index + /// Page Name + public string GetPageName(int index) + { + return _pageNames[index]; + } + + /// + /// Get page id by an index. + /// 通过页é¢ç´¢å¼•获得页é¢id。 + /// + /// Page index + /// Page Id + public string GetPageId(int index) + { + return _pageIds[index]; + } + + /// + /// Get page id by name + /// + /// + /// + public string GetPageIdByName(string aName) + { + int i = _pageNames.IndexOf(aName); + if (i != -1) + return _pageIds[i]; + else + return null; + } + + /// + /// Add a new page to this controller. + /// + /// Page name + public void AddPage(string name) + { + if (name == null) + name = string.Empty; + + AddPageAt(name, _pageIds.Count); + } + + /// + /// Add a new page to this controller at a certain index. + /// + /// Page name + /// Insert position + public void AddPageAt(string name, int index) + { + string nid = "_" + (_nextPageId++); + if (index == _pageIds.Count) + { + _pageIds.Add(nid); + _pageNames.Add(name); + } + else + { + _pageIds.Insert(index, nid); + _pageNames.Insert(index, name); + } + } + + /// + /// Remove a page. + /// + /// Page name + public void RemovePage(string name) + { + int i = _pageNames.IndexOf(name); + if (i != -1) + { + _pageIds.RemoveAt(i); + _pageNames.RemoveAt(i); + if (_selectedIndex >= _pageIds.Count) + this.selectedIndex = _selectedIndex - 1; + else + parent.ApplyController(this); + } + } + + /// + /// Removes a page at a certain index. + /// + /// + public void RemovePageAt(int index) + { + _pageIds.RemoveAt(index); + _pageNames.RemoveAt(index); + if (_selectedIndex >= _pageIds.Count) + this.selectedIndex = _selectedIndex - 1; + else + parent.ApplyController(this); + } + + /// + /// Remove all pages. + /// + public void ClearPages() + { + _pageIds.Clear(); + _pageNames.Clear(); + if (_selectedIndex != -1) + this.selectedIndex = -1; + else + parent.ApplyController(this); + } + + /// + /// Check if the controller has a page. + /// + /// Page name. + /// + public bool HasPage(string aName) + { + return _pageNames.IndexOf(aName) != -1; + } + + internal int GetPageIndexById(string aId) + { + return _pageIds.IndexOf(aId); + } + + internal string GetPageNameById(string aId) + { + int i = _pageIds.IndexOf(aId); + if (i != -1) + return _pageNames[i]; + else + return null; + } + + internal string selectedPageId + { + get + { + if (_selectedIndex == -1) + return string.Empty; + else + return _pageIds[_selectedIndex]; + } + set + { + int i = _pageIds.IndexOf(value); + if (i != -1) + this.selectedIndex = i; + } + } + + internal string oppositePageId + { + set + { + int i = _pageIds.IndexOf(value); + if (i > 0) + this.selectedIndex = 0; + else if (_pageIds.Count > 1) + this.selectedIndex = 1; + } + } + + internal string previousPageId + { + get + { + if (_previousIndex == -1) + return null; + else + return _pageIds[_previousIndex]; + } + } + + public void RunActions() + { + if (_actions != null) + { + int cnt = _actions.Count; + for (int i = 0; i < cnt; i++) + { + _actions[i].Run(this, previousPageId, selectedPageId); + } + } + } + + public void Setup(ByteBuffer buffer) + { + int beginPos = buffer.position; + buffer.Seek(beginPos, 0); + + name = buffer.ReadS(); + autoRadioGroupDepth = buffer.ReadBool(); + + buffer.Seek(beginPos, 1); + + int cnt = buffer.ReadShort(); + _pageIds.Capacity = cnt; + _pageNames.Capacity = cnt; + for (int i = 0; i < cnt; i++) + { + _pageIds.Add(buffer.ReadS()); + _pageNames.Add(buffer.ReadS()); + } + + int homePageIndex = 0; + if (buffer.version >= 2) + { + int homePageType = buffer.ReadByte(); + switch (homePageType) + { + case 1: + homePageIndex = buffer.ReadShort(); + break; + + case 2: + homePageIndex = _pageNames.IndexOf(UIPackage.branch); + if (homePageIndex == -1) + homePageIndex = 0; + break; + + case 3: + homePageIndex = _pageNames.IndexOf(UIPackage.GetVar(buffer.ReadS())); + if (homePageIndex == -1) + homePageIndex = 0; + break; + } + } + + buffer.Seek(beginPos, 2); + + cnt = buffer.ReadShort(); + if (cnt > 0) + { + if (_actions == null) + _actions = new List(cnt); + + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + ControllerAction action = ControllerAction.CreateAction((ControllerAction.ActionType)buffer.ReadByte()); + action.Setup(buffer); + _actions.Add(action); + + buffer.position = nextPos; + } + } + + if (parent != null && _pageIds.Count > 0) + _selectedIndex = homePageIndex; + else + _selectedIndex = -1; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs.meta new file mode 100644 index 00000000..1a14d9cc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Controller.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7a032426f9564db4a95c1c5a513bcd12 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs new file mode 100644 index 00000000..0cc0df98 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Helper for drag and drop. + /// 这是一个æä¾›ç‰¹æ®Šæ‹–放功能的功能类。与GObject.draggableä¸åŒï¼Œæ‹–动开始åŽï¼Œä»–使用一个替代的图标作为拖动对象。 + /// 当玩家释放鼠标/手指,目标组件会å‘出一个onDrop事件。 + /// + public class DragDropManager + { + private GLoader _agent; + private object _sourceData; + private GObject _source; + + private static DragDropManager _inst; + public static DragDropManager inst + { + get + { + if (_inst == null) + _inst = new DragDropManager(); + return _inst; + } + } + + public DragDropManager() + { + _agent = (GLoader)UIObjectFactory.NewObject(ObjectType.Loader); + _agent.gameObjectName = "DragDropAgent"; + _agent.SetHome(GRoot.inst); + _agent.touchable = false;//important + _agent.draggable = true; + _agent.SetSize(100, 100); + _agent.SetPivot(0.5f, 0.5f, true); + _agent.align = AlignType.Center; + _agent.verticalAlign = VertAlignType.Middle; + _agent.sortingOrder = int.MaxValue; + _agent.onDragEnd.Add(__dragEnd); + } + + /// + /// Loader object for real dragging. + /// 用于实际拖动的Loader对象。你å¯ä»¥æ ¹æ®å®žé™…情况设置loader的大å°ï¼Œå¯¹é½ç­‰ã€‚ + /// + public GLoader dragAgent + { + get { return _agent; } + } + + /// + /// Is dragging? + /// è¿”å›žå½“å‰æ˜¯å¦æ­£åœ¨æ‹–动。 + /// + public bool dragging + { + get { return _agent.parent != null; } + } + + /// + /// Start dragging. + /// 开始拖动。 + /// + /// Source object. This is the object which initiated the dragging. + /// Icon to be used as the dragging sign. + /// Custom data. You can get it in the onDrop event data. + /// Copy the touchId from InputEvent to here, if has one. + public void StartDrag(GObject source, string icon, object sourceData, int touchPointID = -1) + { + if (_agent.parent != null) + return; + + _sourceData = sourceData; + _source = source; + _agent.url = icon; + GRoot.inst.AddChild(_agent); + _agent.xy = GRoot.inst.GlobalToLocal(Stage.inst.GetTouchPosition(touchPointID)); + _agent.StartDrag(touchPointID); + } + + /// + /// Cancel dragging. + /// å–æ¶ˆæ‹–动。 + /// + public void Cancel() + { + if (_agent.parent != null) + { + _agent.StopDrag(); + GRoot.inst.RemoveChild(_agent); + _sourceData = null; + } + } + + private void __dragEnd(EventContext evt) + { + if (_agent.parent == null) //cancelled + return; + + GRoot.inst.RemoveChild(_agent); + + object sourceData = _sourceData; + GObject source = _source; + _sourceData = null; + _source = null; + + GObject obj = GRoot.inst.touchTarget; + while (obj != null) + { + if (obj.hasEventListeners("onDrop")) + { + obj.RequestFocus(); + obj.DispatchEvent("onDrop", sourceData, source); + return; + } + obj = obj.parent; + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs.meta new file mode 100644 index 00000000..5f6468bb --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/DragDropManager.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fb013a6e64663c34694529d92a620777 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs new file mode 100644 index 00000000..ae92925a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public interface EMRenderTarget + { + int EM_sortingOrder { get; } + + void EM_BeforeUpdate(); + void EM_Update(UpdateContext context); + void EM_Reload(); + } + + /// + /// 这是一个在编辑状æ€ä¸‹æ¸²æŸ“UI的功能类。EM=Edit Mode + /// + public class EMRenderSupport + { + /// + /// + /// + public static bool orderChanged; + + static UpdateContext _updateContext; + static List _targets = new List(); + + /// + /// + /// + public static bool packageListReady { get; private set; } + + /// + /// + /// + public static bool hasTarget + { + get { return _targets.Count > 0; } + } + + /// + /// + /// + /// + public static void Add(EMRenderTarget value) + { + if (!_targets.Contains(value)) + _targets.Add(value); + orderChanged = true; + } + + /// + /// + /// + /// + public static void Remove(EMRenderTarget value) + { + _targets.Remove(value); + } + + /// + /// ç”±StageCamera调用 + /// + public static void Update() + { + if (Application.isPlaying) + return; + + if (_updateContext == null) + _updateContext = new UpdateContext(); + + if (orderChanged) + { + _targets.Sort(CompareDepth); + orderChanged = false; + } + + int cnt = _targets.Count; + for (int i = 0; i < cnt; i++) + { + EMRenderTarget panel = _targets[i]; + panel.EM_BeforeUpdate(); + } + + if (packageListReady) + { + _updateContext.Begin(); + for (int i = 0; i < cnt; i++) + { + EMRenderTarget panel = _targets[i]; + panel.EM_Update(_updateContext); + } + _updateContext.End(); + } + } + + /// + /// 当å‘生二进制é‡è½½æ—¶ï¼Œæˆ–用户点击刷新èœå• + /// + public static void Reload() + { + if (Application.isPlaying) + return; + + UIConfig.ClearResourceRefs(); + UIConfig[] configs = GameObject.FindObjectsOfType(); + foreach (UIConfig config in configs) + config.Load(); + + packageListReady = true; + + int cnt = _targets.Count; + for (int i = 0; i < cnt; i++) + { + EMRenderTarget panel = _targets[i]; + panel.EM_Reload(); + } + } + + static int CompareDepth(EMRenderTarget c1, EMRenderTarget c2) + { + return c1.EM_sortingOrder - c2.EM_sortingOrder; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs.meta new file mode 100644 index 00000000..442be752 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/EMRenderSupport.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0ea7d5d9d5c232d4f9a312870329cbd2 +timeCreated: 1464535178 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs new file mode 100644 index 00000000..629a44e8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs @@ -0,0 +1,304 @@ +namespace FairyGUI +{ + public enum PackageItemType + { + Image, + MovieClip, + Sound, + Component, + Atlas, + Font, + Swf, + Misc, + Unknown, + Spine, + DragoneBones + } + + public enum ObjectType + { + Image, + MovieClip, + Swf, + Graph, + Loader, + Group, + Text, + RichText, + InputText, + Component, + List, + Label, + Button, + ComboBox, + ProgressBar, + Slider, + ScrollBar, + Tree, + Loader3D + } + + public enum AlignType + { + Left, + Center, + Right + } + + public enum VertAlignType + { + Top, + Middle, + Bottom + } + + public enum OverflowType + { + Visible, + Hidden, + Scroll + } + + public enum FillType + { + None, + Scale, + ScaleMatchHeight, + ScaleMatchWidth, + ScaleFree, + ScaleNoBorder + } + + public enum AutoSizeType + { + None, + Both, + Height, + Shrink, + Ellipsis + } + + public enum ScrollType + { + Horizontal, + Vertical, + Both + } + + public enum ScrollBarDisplayType + { + Default, + Visible, + Auto, + Hidden + } + + public enum RelationType + { + Left_Left, + Left_Center, + Left_Right, + Center_Center, + Right_Left, + Right_Center, + Right_Right, + + Top_Top, + Top_Middle, + Top_Bottom, + Middle_Middle, + Bottom_Top, + Bottom_Middle, + Bottom_Bottom, + + Width, + Height, + + LeftExt_Left, + LeftExt_Right, + RightExt_Left, + RightExt_Right, + TopExt_Top, + TopExt_Bottom, + BottomExt_Top, + BottomExt_Bottom, + + Size + } + + public enum ListLayoutType + { + SingleColumn, + SingleRow, + FlowHorizontal, + FlowVertical, + Pagination + } + + public enum ListSelectionMode + { + Single, + Multiple, + Multiple_SingleClick, + None + } + + public enum ProgressTitleType + { + Percent, + ValueAndMax, + Value, + Max + } + + public enum ButtonMode + { + Common, + Check, + Radio + } + + public enum TransitionActionType + { + XY, + Size, + Scale, + Pivot, + Alpha, + Rotation, + Color, + Animation, + Visible, + Sound, + Transition, + Shake, + ColorFilter, + Skew, + Text, + Icon, + Unknown + } + + public enum GroupLayoutType + { + None, + Horizontal, + Vertical + } + + public enum ChildrenRenderOrder + { + Ascent, + Descent, + Arch, + } + + public enum PopupDirection + { + Auto, + Up, + Down + } + + /// + /// + /// + public enum FlipType + { + None, + Horizontal, + Vertical, + Both + } + + /// + /// + /// + public enum FillMethod + { + None = 0, + + /// + /// The Image will be filled Horizontally + /// + Horizontal = 1, + + /// + /// The Image will be filled Vertically. + /// + Vertical = 2, + + /// + /// The Image will be filled Radially with the radial center in one of the corners. + /// + Radial90 = 3, + + /// + /// The Image will be filled Radially with the radial center in one of the edges. + /// + Radial180 = 4, + + /// + /// The Image will be filled Radially with the radial center at the center. + /// + Radial360 = 5, + } + + /// + /// + /// + public enum OriginHorizontal + { + Left, + Right, + } + + /// + /// + /// + public enum OriginVertical + { + Top, + Bottom + } + + /// + /// + /// + public enum Origin90 + { + TopLeft, + TopRight, + BottomLeft, + BottomRight + } + + /// + /// + /// + public enum Origin180 + { + Top, + Bottom, + Left, + Right + } + + /// + /// + /// + public enum Origin360 + { + Top, + Bottom, + Left, + Right + } + + public enum FocusRule + { + NotFocusable, + Focusable, + NavigationBase + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs.meta new file mode 100644 index 00000000..67410c3f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/FieldTypes.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1d03a824e0fdd8a48a0ad6173b4593e0 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs new file mode 100644 index 00000000..1401912b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs @@ -0,0 +1,657 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GButton class. + /// + public class GButton : GComponent, IColorGear + { + /// + /// Play sound when button is clicked. + /// + public NAudioClip sound; + + /// + /// Volume of the click sound. (0-1) + /// + public float soundVolumeScale; + + /// + /// For radio or checkbox. if false, the button will not change selected status on click. Default is true. + /// 如果为true,对于å•选和多选按钮,当玩家点击时,按钮会自动切æ¢çжæ€ã€‚设置为false,则ä¸ä¼šã€‚默认为true。 + /// + public bool changeStateOnClick; + + /// + /// Show a popup on click. + /// å¯ä»¥ä¸ºæŒ‰é’®è®¾ç½®ä¸€ä¸ªå…³è”的组件,当按钮被点击时,此组件被自动弹出。 + /// + public GObject linkedPopup; + + protected GObject _titleObject; + protected GObject _iconObject; + protected Controller _relatedController; + protected string _relatedPageId; + + ButtonMode _mode; + bool _selected; + string _title; + string _icon; + string _selectedTitle; + string _selectedIcon; + Controller _buttonController; + int _downEffect; + float _downEffectValue; + bool _downScaled; + + bool _down; + bool _over; + + EventListener _onChanged; + + public const string UP = "up"; + public const string DOWN = "down"; + public const string OVER = "over"; + public const string SELECTED_OVER = "selectedOver"; + public const string DISABLED = "disabled"; + public const string SELECTED_DISABLED = "selectedDisabled"; + + public GButton() + { + sound = UIConfig.buttonSound; + soundVolumeScale = UIConfig.buttonSoundVolumeScale; + changeStateOnClick = true; + _downEffectValue = 0.8f; + _title = string.Empty; + } + + /// + /// Dispatched when the button status was changed. + /// 如果为å•选或多选按钮,当按钮的选中状æ€å‘ç”Ÿæ”¹å˜æ—¶ï¼Œæ­¤äº‹ä»¶è§¦å‘。 + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// Icon of the button. + /// + override public string icon + { + get + { + return _icon; + } + set + { + _icon = value; + value = (_selected && _selectedIcon != null) ? _selectedIcon : _icon; + if (_iconObject != null) + _iconObject.icon = value; + UpdateGear(7); + } + } + + /// + /// Title of the button + /// + public string title + { + get + { + return _title; + } + set + { + _title = value; + if (_titleObject != null) + _titleObject.text = (_selected && _selectedTitle != null) ? _selectedTitle : _title; + UpdateGear(6); + } + } + + /// + /// Same of the title. + /// + override public string text + { + get { return this.title; } + set { this.title = value; } + } + + /// + /// Icon value on selected status. + /// + public string selectedIcon + { + get + { + return _selectedIcon; + } + set + { + _selectedIcon = value; + value = (_selected && _selectedIcon != null) ? _selectedIcon : _icon; + if (_iconObject != null) + _iconObject.icon = value; + } + } + + /// + /// Title value on selected status. + /// + public string selectedTitle + { + get + { + return _selectedTitle; + } + set + { + _selectedTitle = value; + if (_titleObject != null) + _titleObject.text = (_selected && _selectedTitle != null) ? _selectedTitle : _title; + } + } + + /// + /// Title color. + /// + public Color titleColor + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.color; + else + return Color.black; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + { + tf.color = value; + UpdateGear(4); + } + } + } + + /// + /// + /// + public Color color + { + get { return this.titleColor; } + set { this.titleColor = value; } + } + + /// + /// + /// + public int titleFontSize + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.textFormat.size; + else + return 0; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + { + TextFormat format = tf.textFormat; + format.size = value; + tf.textFormat = format; + } + } + } + + /// + /// If the button is in selected status. + /// + public bool selected + { + get + { + return _selected; + } + + set + { + if (_mode == ButtonMode.Common) + return; + + if (_selected != value) + { + _selected = value; + SetCurrentState(); + if (_selectedTitle != null && _titleObject != null) + _titleObject.text = _selected ? _selectedTitle : _title; + if (_selectedIcon != null) + { + string str = _selected ? _selectedIcon : _icon; + if (_iconObject != null) + _iconObject.icon = str; + } + if (_relatedController != null + && parent != null + && !parent._buildingDisplayList) + { + if (_selected) + { + _relatedController.selectedPageId = _relatedPageId; + if (_relatedController.autoRadioGroupDepth) + parent.AdjustRadioGroupDepth(this, _relatedController); + } + else if (_mode == ButtonMode.Check && _relatedController.selectedPageId == _relatedPageId) + _relatedController.oppositePageId = _relatedPageId; + } + } + + } + } + + /// + /// Button mode. + /// + /// + public ButtonMode mode + { + get + { + return _mode; + } + set + { + if (_mode != value) + { + if (value == ButtonMode.Common) + this.selected = false; + _mode = value; + } + } + } + + /// + /// A controller is connected to this button, the activate page of this controller will change while the button status changed. + /// 对应编辑器中的å•选控制器。 + /// + public Controller relatedController + { + get + { + return _relatedController; + } + set + { + if (value != _relatedController) + { + _relatedController = value; + _relatedPageId = null; + } + } + } + + /// + /// + /// + public string relatedPageId + { + get + { + return _relatedPageId; + } + set + { + _relatedPageId = value; + } + } + + /// + /// Simulates a click on this button. + /// 模拟点击这个按钮。 + /// + /// If the down effect will simulate too. + public void FireClick(bool downEffect, bool clickCall = false) + { + if (downEffect && _mode == ButtonMode.Common) + { + SetState(OVER); + + Timers.inst.Add(0.1f, 1, (object param) => { SetState(DOWN); }); + Timers.inst.Add(0.2f, 1, + (object param) => + { + SetState(UP); + if (clickCall) + { + onClick.Call(); + } + } + ); + } + else + { + if (clickCall) + { + onClick.Call(); + } + } + __click(); + } + + /// + /// + /// + /// + public GTextField GetTextField() + { + if (_titleObject is GTextField) + return (GTextField)_titleObject; + else if (_titleObject is GLabel) + return ((GLabel)_titleObject).GetTextField(); + else if (_titleObject is GButton) + return ((GButton)_titleObject).GetTextField(); + else + return null; + } + + protected void SetState(string val) + { + if (_buttonController != null) + _buttonController.selectedPage = val; + + if (_downEffect == 1) + { + int cnt = this.numChildren; + if (val == DOWN || val == SELECTED_OVER || val == SELECTED_DISABLED) + { + Color color = new Color(_downEffectValue, _downEffectValue, _downEffectValue); + for (int i = 0; i < cnt; i++) + { + GObject obj = this.GetChildAt(i); + if ((obj is IColorGear) && !(obj is GTextField)) + ((IColorGear)obj).color = color; + } + } + else + { + for (int i = 0; i < cnt; i++) + { + GObject obj = this.GetChildAt(i); + if ((obj is IColorGear) && !(obj is GTextField)) + ((IColorGear)obj).color = Color.white; + } + } + } + else if (_downEffect == 2) + { + if (val == DOWN || val == SELECTED_OVER || val == SELECTED_DISABLED) + { + if (!_downScaled) + { + _downScaled = true; + SetScale(this.scaleX * _downEffectValue, this.scaleY * _downEffectValue); + } + } + else + { + if (_downScaled) + { + _downScaled = false; + SetScale(this.scaleX / _downEffectValue, this.scaleY / _downEffectValue); + } + } + } + } + + protected void SetCurrentState() + { + if (this.grayed && _buttonController != null && _buttonController.HasPage(DISABLED)) + { + if (_selected) + SetState(SELECTED_DISABLED); + else + SetState(DISABLED); + } + else + { + if (_selected) + SetState(_over ? SELECTED_OVER : DOWN); + else + SetState(_over ? OVER : UP); + } + } + + override public void HandleControllerChanged(Controller c) + { + base.HandleControllerChanged(c); + + if (_relatedController == c) + this.selected = _relatedPageId == c.selectedPageId; + } + + override protected void HandleGrayedChanged() + { + if (_buttonController != null && _buttonController.HasPage(DISABLED)) + { + if (this.grayed) + { + if (_selected) + SetState(SELECTED_DISABLED); + else + SetState(DISABLED); + } + else + { + if (_selected) + SetState(DOWN); + else + SetState(UP); + } + } + else + base.HandleGrayedChanged(); + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + buffer.Seek(0, 6); + + _mode = (ButtonMode)buffer.ReadByte(); + string str = buffer.ReadS(); + if (str != null) + sound = UIPackage.GetItemAssetByURL(str) as NAudioClip; + soundVolumeScale = buffer.ReadFloat(); + _downEffect = buffer.ReadByte(); + _downEffectValue = buffer.ReadFloat(); + if (_downEffect == 2) + SetPivot(0.5f, 0.5f, this.pivotAsAnchor); + + _buttonController = GetController("button"); + _titleObject = GetChild("title"); + _iconObject = GetChild("icon"); + if (_titleObject != null) + _title = _titleObject.text; + if (_iconObject != null) + _icon = _iconObject.icon; + + if (_mode == ButtonMode.Common) + SetState(UP); + + displayObject.onRollOver.Add(__rollover); + displayObject.onRollOut.Add(__rollout); + displayObject.onTouchBegin.Add(__touchBegin); + displayObject.onTouchEnd.Add(__touchEnd); + displayObject.onRemovedFromStage.Add(__removedFromStage); + displayObject.onClick.Add(__click); + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!buffer.Seek(beginPos, 6)) + return; + + if ((ObjectType)buffer.ReadByte() != packageItem.objectType) + return; + + string str; + + str = buffer.ReadS(); + if (str != null) + this.title = str; + str = buffer.ReadS(); + if (str != null) + this.selectedTitle = str; + str = buffer.ReadS(); + if (str != null) + this.icon = str; + str = buffer.ReadS(); + if (str != null) + this.selectedIcon = str; + if (buffer.ReadBool()) + this.titleColor = buffer.ReadColor(); + int iv = buffer.ReadInt(); + if (iv != 0) + this.titleFontSize = iv; + iv = buffer.ReadShort(); + if (iv >= 0) + _relatedController = parent.GetControllerAt(iv); + _relatedPageId = buffer.ReadS(); + + str = buffer.ReadS(); + if (str != null) + sound = UIPackage.GetItemAssetByURL(str) as NAudioClip; + if (buffer.ReadBool()) + soundVolumeScale = buffer.ReadFloat(); + + this.selected = buffer.ReadBool(); + } + + private void __rollover() + { + if (_buttonController == null || !_buttonController.HasPage(OVER)) + return; + + _over = true; + if (_down) + return; + + if (this.grayed && _buttonController.HasPage(DISABLED)) + return; + + SetState(_selected ? SELECTED_OVER : OVER); + } + + private void __rollout() + { + if (_buttonController == null || !_buttonController.HasPage(OVER)) + return; + + _over = false; + if (_down) + return; + + if (this.grayed && _buttonController.HasPage(DISABLED)) + return; + + SetState(_selected ? DOWN : UP); + } + + private void __touchBegin(EventContext context) + { + if (context.inputEvent.button != 0) + return; + + _down = true; + context.CaptureTouch(); + + if (_mode == ButtonMode.Common) + { + if (this.grayed && _buttonController != null && _buttonController.HasPage(DISABLED)) + SetState(SELECTED_DISABLED); + else + SetState(DOWN); + } + + if (linkedPopup != null) + { + if (linkedPopup is Window) + ((Window)linkedPopup).ToggleStatus(); + else + this.root.TogglePopup(linkedPopup, this); + } + } + + private void __touchEnd() + { + if (_down) + { + _down = false; + if (_mode == ButtonMode.Common) + { + if (this.grayed && _buttonController != null && _buttonController.HasPage(DISABLED)) + SetState(DISABLED); + else if (_over) + SetState(OVER); + else + SetState(UP); + } + else + { + if (!_over + && _buttonController != null + && (_buttonController.selectedPage == OVER || _buttonController.selectedPage == SELECTED_OVER)) + { + SetCurrentState(); + } + } + } + } + + private void __removedFromStage() + { + if (_over) + __rollout(); + } + + private void __click() + { + if (sound != null && sound.nativeClip != null) + Stage.inst.PlayOneShotSound(sound.nativeClip, soundVolumeScale); + + if (_mode == ButtonMode.Check) + { + if (changeStateOnClick) + { + this.selected = !_selected; + DispatchEvent("onChanged", null); + } + } + else if (_mode == ButtonMode.Radio) + { + if (changeStateOnClick && !_selected) + { + this.selected = true; + DispatchEvent("onChanged", null); + } + } + else + { + if (_relatedController != null) + _relatedController.selectedPageId = _relatedPageId; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs.meta new file mode 100644 index 00000000..16e50aed --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GButton.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4e5e996dd06bc77458af09a2465efb6d +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs new file mode 100644 index 00000000..40b9fdda --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs @@ -0,0 +1,629 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GComboBox class. + /// + public class GComboBox : GComponent + { + /// + /// Visible item count of the drop down list. + /// + public int visibleItemCount; + + /// + /// + /// + public GComponent dropdown; + + /// + /// Play sound when button is clicked. + /// + public NAudioClip sound; + + /// + /// Volume of the click sound. (0-1) + /// + public float soundVolumeScale; + + protected GObject _titleObject; + protected GObject _iconObject; + protected GList _list; + + protected List _items; + protected List _icons; + protected List _values; + protected PopupDirection _popupDirection; + protected Controller _selectionController; + + bool _itemsUpdated; + int _selectedIndex; + Controller _buttonController; + + bool _down; + bool _over; + + EventListener _onChanged; + + public GComboBox() + { + visibleItemCount = UIConfig.defaultComboBoxVisibleItemCount; + _itemsUpdated = true; + _selectedIndex = -1; + _items = new List(); + _values = new List(); + _popupDirection = PopupDirection.Auto; + soundVolumeScale = 1; + } + + /// + /// Dispatched when selection was changed. + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// Icon of the combobox. + /// + override public string icon + { + get + { + if (_iconObject != null) + return _iconObject.icon; + else + return null; + } + + set + { + if (_iconObject != null) + _iconObject.icon = value; + UpdateGear(7); + } + } + + /// + /// Title of the combobox. + /// + public string title + { + get + { + if (_titleObject != null) + return _titleObject.text; + else + return null; + } + set + { + if (_titleObject != null) + _titleObject.text = value; + UpdateGear(6); + } + } + + /// + /// Same of the title. + /// + override public string text + { + get { return this.title; } + set { this.title = value; } + } + + /// + /// Text color + /// + public Color titleColor + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.color; + else + return Color.black; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + tf.color = value; + } + } + + /// + /// + /// + public int titleFontSize + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.textFormat.size; + else + return 0; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + { + TextFormat format = tf.textFormat; + format.size = value; + tf.textFormat = format; + } + } + } + + /// + /// Items to build up drop down list. + /// + public string[] items + { + get + { + return _items.ToArray(); + } + set + { + _items.Clear(); + if (value != null) + _items.AddRange(value); + ApplyListChange(); + } + } + + /// + /// + /// + public string[] icons + { + get { return _icons != null ? _icons.ToArray() : null; } + set + { + this.iconList.Clear(); + if (value != null) + _icons.AddRange(value); + ApplyListChange(); + } + } + + /// + /// Values, should be same size of the items. + /// + public string[] values + { + get { return _values.ToArray(); } + set + { + _values.Clear(); + if (value != null) + _values.AddRange(value); + } + } + + /// + /// + /// + public List itemList + { + get { return _items; } + } + + /// + /// + /// + public List valueList + { + get { return _values; } + } + + /// + /// + /// + public List iconList + { + get { return _icons ?? (_icons = new List()); } + } + + /// + /// Call this method after you made changes on itemList or iconList + /// + public void ApplyListChange() + { + if (_items.Count > 0) + { + if (_selectedIndex >= _items.Count) + _selectedIndex = _items.Count - 1; + else if (_selectedIndex == -1) + _selectedIndex = 0; + + this.text = _items[_selectedIndex]; + if (_icons != null && _selectedIndex < _icons.Count) + this.icon = _icons[_selectedIndex]; + } + else + { + this.text = string.Empty; + if (_icons != null) + this.icon = null; + _selectedIndex = -1; + } + + _itemsUpdated = true; + } + + /// + /// Selected index. + /// + public int selectedIndex + { + get + { + return _selectedIndex; + } + set + { + if (_selectedIndex == value) + return; + + _selectedIndex = value; + if (_selectedIndex >= 0 && _selectedIndex < _items.Count) + { + this.text = (string)_items[_selectedIndex]; + if (_icons != null && _selectedIndex < _icons.Count) + this.icon = _icons[_selectedIndex]; + } + else + { + this.text = string.Empty; + if (_icons != null) + this.icon = null; + } + + UpdateSelectionController(); + } + } + + /// + /// + /// + public Controller selectionController + { + get { return _selectionController; } + set { _selectionController = value; } + } + + /// + /// Selected value. + /// + public string value + { + get + { + if (_selectedIndex >= 0 && _selectedIndex < _values.Count) + return _values[_selectedIndex]; + else + return null; + } + set + { + int index = _values.IndexOf(value); + if (index == -1 && value == null) + index = _values.IndexOf(string.Empty); + if (index == -1) + index = 0; + this.selectedIndex = index; + } + } + + /// + /// + /// + public PopupDirection popupDirection + { + get { return _popupDirection; } + set { _popupDirection = value; } + } + + /// + /// + /// + /// + public GTextField GetTextField() + { + if (_titleObject is GTextField) + return (GTextField)_titleObject; + else if (_titleObject is GLabel) + return ((GLabel)_titleObject).GetTextField(); + else if (_titleObject is GButton) + return ((GButton)_titleObject).GetTextField(); + else + return null; + } + + protected void SetState(string value) + { + if (_buttonController != null) + _buttonController.selectedPage = value; + } + + protected void SetCurrentState() + { + if (this.grayed && _buttonController != null && _buttonController.HasPage(GButton.DISABLED)) + SetState(GButton.DISABLED); + else if (dropdown != null && dropdown.parent != null) + SetState(GButton.DOWN); + else + SetState(_over ? GButton.OVER : GButton.UP); + } + + override protected void HandleGrayedChanged() + { + if (_buttonController != null && _buttonController.HasPage(GButton.DISABLED)) + { + if (this.grayed) + SetState(GButton.DISABLED); + else + SetState(GButton.UP); + } + else + base.HandleGrayedChanged(); + } + + override public void HandleControllerChanged(Controller c) + { + base.HandleControllerChanged(c); + + if (_selectionController == c) + this.selectedIndex = c.selectedIndex; + } + + void UpdateSelectionController() + { + if (_selectionController != null && !_selectionController.changing + && _selectedIndex < _selectionController.pageCount) + { + Controller c = _selectionController; + _selectionController = null; + c.selectedIndex = _selectedIndex; + _selectionController = c; + } + } + + public override void Dispose() + { + if (dropdown != null) + { + dropdown.Dispose(); + dropdown = null; + } + _selectionController = null; + + base.Dispose(); + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + buffer.Seek(0, 6); + + _buttonController = GetController("button"); + _titleObject = GetChild("title"); + _iconObject = GetChild("icon"); + + string str = buffer.ReadS(); + if (str != null) + { + dropdown = UIPackage.CreateObjectFromURL(str) as GComponent; + if (dropdown == null) + { + Debug.LogWarning("FairyGUI: " + this.resourceURL + " should be a component."); + return; + } + + _list = dropdown.GetChild("list") as GList; + if (_list == null) + { + Debug.LogWarning("FairyGUI: " + this.resourceURL + ": should container a list component named list."); + return; + } + _list.onClickItem.Add(__clickItem); + + _list.AddRelation(dropdown, RelationType.Width); + _list.RemoveRelation(dropdown, RelationType.Height); + + dropdown.AddRelation(_list, RelationType.Height); + dropdown.RemoveRelation(_list, RelationType.Width); + + dropdown.SetHome(this); + } + + displayObject.onRollOver.Add(__rollover); + displayObject.onRollOut.Add(__rollout); + displayObject.onTouchBegin.Add(__touchBegin); + displayObject.onTouchEnd.Add(__touchEnd); + displayObject.onClick.Add(__click); + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!buffer.Seek(beginPos, 6)) + return; + + if ((ObjectType)buffer.ReadByte() != packageItem.objectType) + return; + + string str; + int itemCount = buffer.ReadShort(); + for (int i = 0; i < itemCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + _items.Add(buffer.ReadS()); + _values.Add(buffer.ReadS()); + str = buffer.ReadS(); + if (str != null) + { + if (_icons == null) + _icons = new List(); + _icons.Add(str); + } + + buffer.position = nextPos; + } + + str = buffer.ReadS(); + if (str != null) + { + this.text = str; + _selectedIndex = _items.IndexOf(str); + } + else if (_items.Count > 0) + { + _selectedIndex = 0; + this.text = _items[0]; + } + else + _selectedIndex = -1; + + str = buffer.ReadS(); + if (str != null) + this.icon = str; + + if (buffer.ReadBool()) + this.titleColor = buffer.ReadColor(); + int iv = buffer.ReadInt(); + if (iv > 0) + visibleItemCount = iv; + _popupDirection = (PopupDirection)buffer.ReadByte(); + + iv = buffer.ReadShort(); + if (iv >= 0) + _selectionController = parent.GetControllerAt(iv); + + if (buffer.version >= 5) + { + str = buffer.ReadS(); + if (str != null) + sound = UIPackage.GetItemAssetByURL(str) as NAudioClip; + soundVolumeScale = buffer.ReadFloat(); + } + } + + public void UpdateDropdownList() + { + if (_itemsUpdated) + { + _itemsUpdated = false; + RenderDropdownList(); + _list.ResizeToFit(visibleItemCount); + } + } + + protected void ShowDropdown() + { + UpdateDropdownList(); + if (_list.selectionMode == ListSelectionMode.Single) + _list.selectedIndex = -1; + dropdown.width = this.width; + _list.EnsureBoundsCorrect(); //avoid flicker + + this.root.TogglePopup(dropdown, this, _popupDirection); + if (dropdown.parent != null) + { + dropdown.displayObject.onRemovedFromStage.Add(__popupWinClosed); + SetState(GButton.DOWN); + } + } + + virtual protected void RenderDropdownList() + { + _list.RemoveChildrenToPool(); + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + GObject item = _list.AddItemFromPool(); + item.text = _items[i]; + item.icon = (_icons != null && i < _icons.Count) ? _icons[i] : null; + item.name = i < _values.Count ? _values[i] : string.Empty; + } + } + + private void __popupWinClosed(object obj) + { + dropdown.displayObject.onRemovedFromStage.Remove(__popupWinClosed); + SetCurrentState(); + + RequestFocus(); + } + + private void __clickItem(EventContext context) + { + if (dropdown.parent is GRoot) + ((GRoot)dropdown.parent).HidePopup(dropdown); + _selectedIndex = int.MinValue; + this.selectedIndex = _list.GetChildIndex((GObject)context.data); + + DispatchEvent("onChanged", null); + } + + private void __rollover() + { + _over = true; + if (_down || dropdown != null && dropdown.parent != null) + return; + + SetCurrentState(); + } + + private void __rollout() + { + _over = false; + if (_down || dropdown != null && dropdown.parent != null) + return; + + SetCurrentState(); + } + + private void __touchBegin(EventContext context) + { + if (context.initiator is InputTextField) + return; + + _down = true; + + if (dropdown != null) + ShowDropdown(); + + context.CaptureTouch(); + } + + private void __touchEnd(EventContext context) + { + if (_down) + { + _down = false; + if (dropdown != null && dropdown.parent != null) + SetCurrentState(); + } + } + + private void __click() + { + if (sound != null && sound.nativeClip != null) + Stage.inst.PlayOneShotSound(sound.nativeClip, soundVolumeScale); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs.meta new file mode 100644 index 00000000..1ecaece0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComboBox.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 65b819211c4a7ec4eb1cf17cda579377 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs new file mode 100644 index 00000000..7176e374 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs @@ -0,0 +1,1726 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; +#if FAIRYGUI_TOLUA +using LuaInterface; +#endif + +namespace FairyGUI +{ + /// + /// Component + /// + public class GComponent : GObject + { + /// + /// Root container. + /// + public Container rootContainer { get; private set; } + /// + /// Content container. If the component is not clipped, then container==rootContainer. + /// + public Container container { get; protected set; } + /// + /// ScrollPane of the component. If the component is not scrollable, the value is null. + /// + public ScrollPane scrollPane { get; private set; } + + internal List _children; + internal List _controllers; + internal List _transitions; + internal bool _buildingDisplayList; + + protected Margin _margin; + protected bool _trackBounds; + protected bool _boundsChanged; + protected ChildrenRenderOrder _childrenRenderOrder; + protected int _apexIndex; + internal Vector2 _alignOffset; + + Vector2 _clipSoftness; + int _sortingChildCount; + Action _buildDelegate; + Controller _applyingController; + + EventListener _onDrop; + + public GComponent() + { + _children = new List(); + _controllers = new List(); + _transitions = new List(); + _margin = new Margin(); + _buildDelegate = BuildNativeDisplayList; + } + + override protected void CreateDisplayObject() + { + rootContainer = new Container("GComponent"); + rootContainer.gOwner = this; + rootContainer.onUpdate += OnUpdate; + container = rootContainer; + + displayObject = rootContainer; + } + + override public void Dispose() + { + int cnt = _transitions.Count; + for (int i = 0; i < cnt; ++i) + { + Transition trans = _transitions[i]; + trans.Dispose(); + } + + cnt = _controllers.Count; + for (int i = 0; i < cnt; ++i) + { + Controller c = _controllers[i]; + c.Dispose(); + } + + if (scrollPane != null) + scrollPane.Dispose(); + + base.Dispose(); //Dispose native tree first, avoid DisplayObject.RemoveFromParent call + + cnt = _children.Count; + for (int i = cnt - 1; i >= 0; --i) + { + GObject obj = _children[i]; + obj.InternalSetParent(null); //Avoid GObject.RemoveParent call + obj.Dispose(); + } + +#if FAIRYGUI_TOLUA + if (_peerTable != null) + { + _peerTable.Dispose(); + _peerTable = null; + } +#endif + +#if FAIRYGUI_PUERTS + if (__onDispose != null) + __onDispose(); + __onConstruct = null; + __onDispose = null; +#endif + } + + /// + /// Dispatched when an object was dragged and dropped to this component. + /// + public EventListener onDrop + { + get { return _onDrop ?? (_onDrop = new EventListener(this, "onDrop")); } + } + + /// + /// Draw call optimization switch. + /// + public bool fairyBatching + { + get { return rootContainer.fairyBatching; } + set { rootContainer.fairyBatching = value; } + } + + /// + /// + /// + /// + public void InvalidateBatchingState(bool childChanged) + { + if (childChanged) + container.InvalidateBatchingState(childChanged); + else + rootContainer.InvalidateBatchingState(); + } + + /// + /// If true, mouse/touch events cannot pass through the empty area of the component. Default is true. + /// + public bool opaque + { + get { return rootContainer.opaque; } + set { rootContainer.opaque = value; } + } + + /// + /// + /// + /// + public Margin margin + { + get { return _margin; } + set + { + _margin = value; + if (rootContainer.clipRect != null && scrollPane == null) //如果scrollPaneä¸ä¸ºç©ºï¼Œåˆ™HandleSizeChanged里é¢çš„处ç†ä¼šä¿ƒä½¿ScrollPaneå¤„ç† + container.SetXY(_margin.left + _alignOffset.x, _margin.top + _alignOffset.y); + HandleSizeChanged(); + } + } + + /// + /// + /// + public ChildrenRenderOrder childrenRenderOrder + { + get { return _childrenRenderOrder; } + set + { + if (_childrenRenderOrder != value) + { + _childrenRenderOrder = value; + BuildNativeDisplayList(); + } + } + } + + /// + /// + /// + public int apexIndex + { + get { return _apexIndex; } + set + { + if (_apexIndex != value) + { + _apexIndex = value; + + if (_childrenRenderOrder == ChildrenRenderOrder.Arch) + BuildNativeDisplayList(); + } + } + } + + /// + /// If true, children can be navigated by TAB from first to last, and repeat + /// + public bool tabStopChildren + { + get { return rootContainer.tabStopChildren; } + set { rootContainer.tabStopChildren = value; } + } + + /// + /// Add a child to the component. It will be at the frontmost position. + /// + /// A child object + /// GObject + public GObject AddChild(GObject child) + { + AddChildAt(child, _children.Count); + return child; + } + + /// + /// Adds a child to the component at a certain index. + /// + /// A child object + /// Index + /// GObject + virtual public GObject AddChildAt(GObject child, int index) + { + if (index >= 0 && index <= _children.Count) + { + if (child.parent == this) + { + SetChildIndex(child, index); + } + else + { + child.RemoveFromParent(); + child.InternalSetParent(this); + + int cnt = _children.Count; + if (child.sortingOrder != 0) + { + _sortingChildCount++; + index = GetInsertPosForSortingChild(child); + } + else if (_sortingChildCount > 0) + { + if (index > (cnt - _sortingChildCount)) + index = cnt - _sortingChildCount; + } + + if (index == cnt) + _children.Add(child); + else + _children.Insert(index, child); + + ChildStateChanged(child); + SetBoundsChangedFlag(); + } + return child; + } + else + { + throw new Exception("Invalid child index: " + index + ">" + _children.Count); + } + } + + int GetInsertPosForSortingChild(GObject target) + { + int cnt = _children.Count; + int i; + for (i = 0; i < cnt; i++) + { + GObject child = _children[i]; + if (child == target) + continue; + + if (target.sortingOrder < child.sortingOrder) + break; + } + return i; + } + + /// + /// Removes a child from the component. If the object is not a child, nothing happens. + /// + /// A child object + /// GObject + public GObject RemoveChild(GObject child) + { + return RemoveChild(child, false); + } + + /// + /// Removes a child from the component. If the object is not a child, nothing happens. + /// + /// A child object + /// If true, the child will be disposed right away. + /// GObject + public GObject RemoveChild(GObject child, bool dispose) + { + int childIndex = _children.IndexOf(child); + if (childIndex != -1) + { + RemoveChildAt(childIndex, dispose); + } + return child; + } + + /// + /// Removes a child at a certain index. Children above the child will move down. + /// + /// Index + /// GObject + public GObject RemoveChildAt(int index) + { + return RemoveChildAt(index, false); + } + + /// + /// Removes a child at a certain index. Children above the child will move down. + /// + /// Index + /// If true, the child will be disposed right away. + /// GObject + virtual public GObject RemoveChildAt(int index, bool dispose) + { + if (index >= 0 && index < numChildren) + { + GObject child = _children[index]; + + child.InternalSetParent(null); + + if (child.sortingOrder != 0) + _sortingChildCount--; + + _children.RemoveAt(index); + child.group = null; + if (child.inContainer) + { + container.RemoveChild(child.displayObject); + if (_childrenRenderOrder == ChildrenRenderOrder.Arch) + { + UpdateContext.OnBegin -= _buildDelegate; + UpdateContext.OnBegin += _buildDelegate; + } + } + + if (dispose) + child.Dispose(); + + SetBoundsChangedFlag(); + return child; + } + else + throw new Exception("Invalid child index: " + index + ">" + numChildren); + } + + /// + /// Remove all children. + /// + public void RemoveChildren() + { + RemoveChildren(0, -1, false); + } + + /// + /// Removes a range of children from the container (endIndex included). + /// + /// Begin index. + /// End index.(Included). + /// If true, the child will be disposed right away. + public void RemoveChildren(int beginIndex, int endIndex, bool dispose) + { + if (endIndex < 0 || endIndex >= numChildren) + endIndex = numChildren - 1; + + for (int i = beginIndex; i <= endIndex; ++i) + RemoveChildAt(beginIndex, dispose); + } + + /// + /// Returns a child object at a certain index. If index out of bounds, exception raised. + /// + /// Index + /// A child object. + public GObject GetChildAt(int index) + { + if (index >= 0 && index < numChildren) + return _children[index]; + else + throw new Exception("Invalid child index: " + index + ">" + numChildren); + } + + /// + /// Returns a child object with a certain name. + /// + /// Name + /// A child object. Null if not found. + public GObject GetChild(string name) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + if (_children[i].name == name) + return _children[i]; + } + + return null; + } + + public GObject GetChildByPath(string path) + { + string[] arr = path.Split('.'); + int cnt = arr.Length; + GComponent gcom = this; + GObject obj = null; + for (int i = 0; i < cnt; ++i) + { + obj = gcom.GetChild(arr[i]); + if (obj == null) + break; + + if (i != cnt - 1) + { + if (!(obj is GComponent)) + { + obj = null; + break; + } + else + gcom = (GComponent)obj; + } + } + + return obj; + } + + /// + /// Returns a visible child object with a certain name. + /// + /// Name + /// A child object. Null if not found. + public GObject GetVisibleChild(string name) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + if (child.internalVisible && child.internalVisible2 && child.name == name) + return child; + } + + return null; + } + + /// + /// Returns a child object belong to a group with a certain name. + /// + /// A group object + /// Name + /// A child object. Null if not found. + public GObject GetChildInGroup(GGroup group, string name) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + if (child.group == group && child.name == name) + return child; + } + + return null; + } + + internal GObject GetChildById(string id) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + if (_children[i].id == id) + return _children[i]; + } + + return null; + } + + /// + /// Returns a copy of all children with an array. + /// + /// An array contains all children + public GObject[] GetChildren() + { + return _children.ToArray(); + } + + /// + /// Returns the index of a child within the container, or "-1" if it is not found. + /// + /// A child object + /// Index of the child. -1 If not found. + public int GetChildIndex(GObject child) + { + return _children.IndexOf(child); + } + + /// + /// Moves a child to a certain index. Children at and after the replaced position move up. + /// + /// A Child + /// Index + public void SetChildIndex(GObject child, int index) + { + int oldIndex = _children.IndexOf(child); + if (oldIndex == -1) + throw new ArgumentException("Not a child of this container"); + + if (child.sortingOrder != 0) //no effect + return; + + if (_sortingChildCount > 0) + { + int cnt = _children.Count; + if (index > (cnt - _sortingChildCount - 1)) + index = cnt - _sortingChildCount - 1; + } + + _SetChildIndex(child, oldIndex, index); + } + + /// + /// Moves a child to a certain position which is in front of the child previously at given index. + /// 与SetChildIndexä¸åŒçš„æ˜¯ï¼Œå¦‚æžœchild原æ¥åœ¨indexçš„å‰é¢ï¼Œé‚£ä¹ˆchildæ’入的ä½ç½®æ˜¯index-1,å³ä¿è¯æŽ’在原æ¥å æ®index的对象的å‰é¢ã€‚ + /// + /// + /// + public int SetChildIndexBefore(GObject child, int index) + { + int oldIndex = _children.IndexOf(child); + if (oldIndex == -1) + throw new ArgumentException("Not a child of this container"); + + if (child.sortingOrder != 0) //no effect + return oldIndex; + + int cnt = _children.Count; + if (_sortingChildCount > 0) + { + if (index > (cnt - _sortingChildCount - 1)) + index = cnt - _sortingChildCount - 1; + } + + if (oldIndex < index) + return _SetChildIndex(child, oldIndex, index - 1); + else + return _SetChildIndex(child, oldIndex, index); + } + + int _SetChildIndex(GObject child, int oldIndex, int index) + { + int cnt = _children.Count; + if (index > cnt) + index = cnt; + + if (oldIndex == index) + return oldIndex; + + _children.RemoveAt(oldIndex); + if (index >= cnt) + _children.Add(child); + else + _children.Insert(index, child); + + if (child.inContainer) + { + int displayIndex = 0; + if (_childrenRenderOrder == ChildrenRenderOrder.Ascent) + { + for (int i = 0; i < index; i++) + { + GObject g = _children[i]; + if (g.inContainer) + displayIndex++; + } + container.SetChildIndex(child.displayObject, displayIndex); + } + else if (_childrenRenderOrder == ChildrenRenderOrder.Descent) + { + for (int i = cnt - 1; i > index; i--) + { + GObject g = _children[i]; + if (g.inContainer) + displayIndex++; + } + container.SetChildIndex(child.displayObject, displayIndex); + } + else + { + UpdateContext.OnBegin -= _buildDelegate; + UpdateContext.OnBegin += _buildDelegate; + } + + SetBoundsChangedFlag(); + } + + return index; + } + + /// + /// Swaps the indexes of two children. + /// + /// A child object + /// A child object + public void SwapChildren(GObject child1, GObject child2) + { + int index1 = _children.IndexOf(child1); + int index2 = _children.IndexOf(child2); + if (index1 == -1 || index2 == -1) + throw new Exception("Not a child of this container"); + SwapChildrenAt(index1, index2); + } + + /// + /// Swaps the indexes of two children. + /// + /// index of first child + /// index of second child + public void SwapChildrenAt(int index1, int index2) + { + GObject child1 = _children[index1]; + GObject child2 = _children[index2]; + + SetChildIndex(child1, index2); + SetChildIndex(child2, index1); + } + + /// + /// The number of children of this component. + /// + public int numChildren + { + get { return _children.Count; } + } + + /// + /// + /// + /// + /// + public bool IsAncestorOf(GObject obj) + { + if (obj == null) + return false; + + GComponent p = obj.parent; + while (p != null) + { + if (p == this) + return true; + + p = p.parent; + } + return false; + } + + + /// + /// + /// + /// + public void ChangeChildrenOrder(IList objs) + { + int cnt = objs.Count; + for (int i = 0; i < cnt; i++) + { + GObject obj = objs[i]; + if (obj.parent != this) + throw new Exception("Not a child of this container"); + + _children[i] = obj; + } + BuildNativeDisplayList(); + SetBoundsChangedFlag(); + } + + /// + /// Adds a controller to the container. + /// + /// Controller object + public void AddController(Controller controller) + { + _controllers.Add(controller); + controller.parent = this; + ApplyController(controller); + } + + /// + /// Returns a controller object at a certain index. + /// + /// Index + /// Controller object. + public Controller GetControllerAt(int index) + { + return _controllers[index]; + } + + /// + /// Returns a controller object with a certain name. + /// + /// Name + /// Controller object. Null if not found. + public Controller GetController(string name) + { + int cnt = _controllers.Count; + for (int i = 0; i < cnt; ++i) + { + Controller c = _controllers[i]; + if (c.name == name) + return c; + } + + return null; + } + + /// + /// Removes a controller from the container. + /// + /// Controller object. + public void RemoveController(Controller c) + { + int index = _controllers.IndexOf(c); + if (index == -1) + throw new Exception("controller not exists: " + c.name); + + c.parent = null; + _controllers.RemoveAt(index); + + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + child.HandleControllerChanged(c); + } + } + + /// + /// Returns controller list. + /// + /// Controller list + public List Controllers + { + get { return _controllers; } + } + + /// + /// Returns a transition object at a certain index. + /// + /// Index + /// transition object. + public Transition GetTransitionAt(int index) + { + return _transitions[index]; + } + + /// + /// Returns a transition object at a certain name. + /// + /// Name + /// Transition Object + public Transition GetTransition(string name) + { + int cnt = _transitions.Count; + for (int i = 0; i < cnt; ++i) + { + Transition trans = _transitions[i]; + if (trans.name == name) + return trans; + } + + return null; + } + + /// + /// Returns transition list. + /// + /// Transition list + public List Transitions + { + get { return _transitions; } + } + + internal void ChildStateChanged(GObject child) + { + if (_buildingDisplayList) + return; + + int cnt = _children.Count; + + if (child is GGroup) + { + for (int i = 0; i < cnt; ++i) + { + GObject g = _children[i]; + if (g.group == child) + ChildStateChanged(g); + } + return; + } + + if (child.displayObject == null) + return; + + if (child.internalVisible) + { + if (child.displayObject.parent == null) + { + if (_childrenRenderOrder == ChildrenRenderOrder.Ascent) + { + int index = 0; + for (int i = 0; i < cnt; i++) + { + GObject g = _children[i]; + if (g == child) + break; + + if (g.displayObject != null && g.displayObject.parent != null) + index++; + } + container.AddChildAt(child.displayObject, index); + } + else if (_childrenRenderOrder == ChildrenRenderOrder.Descent) + { + int index = 0; + for (int i = cnt - 1; i >= 0; i--) + { + GObject g = _children[i]; + if (g == child) + break; + + if (g.displayObject != null && g.displayObject.parent != null) + index++; + } + container.AddChildAt(child.displayObject, index); + } + else + { + container.AddChild(child.displayObject); + + UpdateContext.OnBegin -= _buildDelegate; + UpdateContext.OnBegin += _buildDelegate; + } + } + } + else + { + if (child.displayObject.parent != null) + { + container.RemoveChild(child.displayObject); + if (_childrenRenderOrder == ChildrenRenderOrder.Arch) + { + UpdateContext.OnBegin -= _buildDelegate; + UpdateContext.OnBegin += _buildDelegate; + } + } + } + } + + void BuildNativeDisplayList() + { + if (displayObject == null || displayObject.isDisposed) + return; + + int cnt = _children.Count; + if (cnt == 0) + return; + + switch (_childrenRenderOrder) + { + case ChildrenRenderOrder.Ascent: + { + for (int i = 0; i < cnt; i++) + { + GObject child = _children[i]; + if (child.displayObject != null && child.internalVisible) + container.AddChild(child.displayObject); + } + } + break; + case ChildrenRenderOrder.Descent: + { + for (int i = cnt - 1; i >= 0; i--) + { + GObject child = _children[i]; + if (child.displayObject != null && child.internalVisible) + container.AddChild(child.displayObject); + } + } + break; + + case ChildrenRenderOrder.Arch: + { + int apex = Mathf.Clamp(_apexIndex, 0, cnt); + for (int i = 0; i < apex; i++) + { + GObject child = _children[i]; + if (child.displayObject != null && child.internalVisible) + container.AddChild(child.displayObject); + } + for (int i = cnt - 1; i >= apex; i--) + { + GObject child = _children[i]; + if (child.displayObject != null && child.internalVisible) + container.AddChild(child.displayObject); + } + } + break; + } + } + + internal void ApplyController(Controller c) + { + _applyingController = c; + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + child.HandleControllerChanged(c); + } + _applyingController = null; + + c.RunActions(); + } + + void ApplyAllControllers() + { + int cnt = _controllers.Count; + for (int i = 0; i < cnt; ++i) + { + Controller controller = _controllers[i]; + ApplyController(controller); + } + } + + internal void AdjustRadioGroupDepth(GObject obj, Controller c) + { + int cnt = _children.Count; + int i; + GObject child; + int myIndex = -1, maxIndex = -1; + for (i = 0; i < cnt; i++) + { + child = _children[i]; + if (child == obj) + { + myIndex = i; + } + else if ((child is GButton) + && ((GButton)child).relatedController == c) + { + if (i > maxIndex) + maxIndex = i; + } + } + if (myIndex < maxIndex) + { + if (_applyingController != null) + _children[maxIndex].HandleControllerChanged(_applyingController); + this.SwapChildrenAt(myIndex, maxIndex); + } + } + + /// + /// If clipping softness is set, clipped containers will have soft border effect. + /// + public Vector2 clipSoftness + { + get { return _clipSoftness; } + set + { + _clipSoftness = value; + if (scrollPane != null) + scrollPane.UpdateClipSoft(); + else if (_clipSoftness.x > 0 || _clipSoftness.y > 0) + rootContainer.clipSoftness = new Vector4(value.x, value.y, value.x, value.y); + else + rootContainer.clipSoftness = null; + } + } + + /// + /// The mask of the component. + /// + public DisplayObject mask + { + get { return container.mask; } + set + { + container.mask = value; + if (value != null && value.parent != container) + container.AddChild(value); + } + } + + /// + /// + /// + public bool reversedMask + { + get { return container.reversedMask; } + set { container.reversedMask = value; } + } + + /// + /// + /// + public string baseUserData + { + get + { + ByteBuffer buffer = packageItem.rawData; + buffer.Seek(0, 4); + return buffer.ReadS(); + } + } + + /// + /// Test if a child is in view. + /// + /// A child object + /// True if in view + public bool IsChildInView(GObject child) + { + if (scrollPane != null) + { + return scrollPane.IsChildInView(child); + } + else if (rootContainer.clipRect != null) + { + return child.x + child.width >= 0 && child.x <= this.width + && child.y + child.height >= 0 && child.y <= this.height; + } + else + return true; + } + + virtual public int GetFirstChildInView() + { + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + if (IsChildInView(child)) + return i; + } + return -1; + } + + protected void SetupScroll(ByteBuffer buffer) + { + if (rootContainer == container) + { + container = new Container(); + rootContainer.AddChild(container); + } + + scrollPane = new ScrollPane(this); + scrollPane.Setup(buffer); + } + + protected void SetupOverflow(OverflowType overflow) + { + if (overflow == OverflowType.Hidden) + { + if (rootContainer == container) + { + container = new Container(); + rootContainer.AddChild(container); + } + + UpdateClipRect(); + container.SetXY(_margin.left, _margin.top); + } + else if (_margin.left != 0 || _margin.top != 0) + { + if (rootContainer == container) + { + container = new Container(); + rootContainer.AddChild(container); + } + + container.SetXY(_margin.left, _margin.top); + } + } + + void UpdateClipRect() + { + if (scrollPane == null) + { + float w = this.width - (_margin.left + _margin.right); + float h = this.height - (_margin.top + _margin.bottom); + rootContainer.clipRect = new Rect(_margin.left, _margin.top, w, h); + } + else + rootContainer.clipRect = new Rect(0, 0, this.width, this.height); + } + + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + if (scrollPane != null) + scrollPane.OnOwnerSizeChanged(); + if (rootContainer.clipRect != null) + UpdateClipRect(); + } + + override protected void HandleGrayedChanged() + { + Controller cc = GetController("grayed"); + if (cc != null) + cc.selectedIndex = this.grayed ? 1 : 0; + else + base.HandleGrayedChanged(); + } + + override public void HandleControllerChanged(Controller c) + { + base.HandleControllerChanged(c); + + if (scrollPane != null) + scrollPane.HandleControllerChanged(c); + } + + /// + /// Notify the component the bounds should recaculate. + /// + public void SetBoundsChangedFlag() + { + if (scrollPane == null && !_trackBounds) + return; + + _boundsChanged = true; + } + + /// + /// Make sure the bounds of the component is correct. + /// Bounds of the component is not updated on every changed. For example, you add a new child to the list, children in the list will be rearranged in next frame. + /// If you want to access the correct child position immediatelly, call this function first. + /// + public void EnsureBoundsCorrect() + { + if (_boundsChanged) + UpdateBounds(); + } + + virtual protected void UpdateBounds() + { + float ax, ay, aw, ah; + if (_children.Count > 0) + { + ax = int.MaxValue; + ay = int.MaxValue; + float ar = int.MinValue, ab = int.MinValue; + float tmp; + + int cnt = _children.Count; + for (int i = 0; i < cnt; ++i) + { + GObject child = _children[i]; + tmp = child.x; + if (tmp < ax) + ax = tmp; + tmp = child.y; + if (tmp < ay) + ay = tmp; + tmp = child.x + child.actualWidth; + if (tmp > ar) + ar = tmp; + tmp = child.y + child.actualHeight; + if (tmp > ab) + ab = tmp; + } + aw = ar - ax; + ah = ab - ay; + } + else + { + ax = 0; + ay = 0; + aw = 0; + ah = 0; + } + + SetBounds(ax, ay, aw, ah); + } + + protected void SetBounds(float ax, float ay, float aw, float ah) + { + _boundsChanged = false; + if (scrollPane != null) + scrollPane.SetContentSize(Mathf.RoundToInt(ax + aw), Mathf.RoundToInt(ay + ah)); + } + + /// + /// Viwe port width of the container. + /// + public float viewWidth + { + get + { + if (scrollPane != null) + return scrollPane.viewWidth; + else + return this.width - _margin.left - _margin.right; + } + + set + { + if (scrollPane != null) + scrollPane.viewWidth = value; + else + this.width = value + _margin.left + _margin.right; + } + } + + /// + /// View port height of the container. + /// + public float viewHeight + { + get + { + if (scrollPane != null) + return scrollPane.viewHeight; + else + return this.height - _margin.top - _margin.bottom; + } + + set + { + if (scrollPane != null) + scrollPane.viewHeight = value; + else + this.height = value + _margin.top + _margin.bottom; + } + } + + public void GetSnappingPosition(ref float xValue, ref float yValue) + { + GetSnappingPositionWithDir(ref xValue, ref yValue, 0, 0); + } + + protected bool ShouldSnapToNext(float dir, float delta, float size) + { + return dir < 0 && delta > UIConfig.defaultScrollSnappingThreshold * size + || dir > 0 && delta > (1 - UIConfig.defaultScrollSnappingThreshold) * size + || dir == 0 && delta > size / 2; + } + + /** + * dir正数表示å³ç§»æˆ–者下移,负数表示左移或者上移 + */ + virtual public void GetSnappingPositionWithDir(ref float xValue, ref float yValue, float xDir, float yDir) + { + int cnt = _children.Count; + if (cnt == 0) + return; + + EnsureBoundsCorrect(); + + GObject obj = null; + + int i = 0; + if (yValue != 0) + { + for (; i < cnt; i++) + { + obj = _children[i]; + if (yValue < obj.y) + { + if (i == 0) + { + yValue = 0; + break; + } + else + { + GObject prev = _children[i - 1]; + if (ShouldSnapToNext(yDir, yValue - prev.y, prev.height)) + yValue = obj.y; + else + yValue = prev.y; + break; + } + } + } + + if (i == cnt) + yValue = obj.y; + } + + if (xValue != 0) + { + if (i > 0) + i--; + for (; i < cnt; i++) + { + obj = _children[i]; + if (xValue < obj.x) + { + if (i == 0) + { + xValue = 0; + break; + } + else + { + GObject prev = _children[i - 1]; + if (ShouldSnapToNext(xDir, xValue - prev.x, prev.width)) + xValue = obj.x; + else + xValue = prev.x; + break; + } + } + } + if (i == cnt) + xValue = obj.x; + } + } + + internal void ChildSortingOrderChanged(GObject child, int oldValue, int newValue) + { + if (newValue == 0) + { + _sortingChildCount--; + SetChildIndex(child, _children.Count); + } + else + { + if (oldValue == 0) + _sortingChildCount++; + + int oldIndex = _children.IndexOf(child); + int index = GetInsertPosForSortingChild(child); + if (oldIndex < index) + _SetChildIndex(child, oldIndex, index - 1); + else + _SetChildIndex(child, oldIndex, index); + } + } + + /// + /// æ¯å¸§è°ƒç”¨çš„一个回调。如果你è¦override,请记ä½ä»¥ä¸‹ä¸¤ç‚¹ï¼š + /// 1ã€è®°å¾—调用base.onUpdate; + /// 2ã€ä¸è¦åœ¨æ–¹æ³•里进行任何会更改显示列表的æ“作,例如AddChildã€RemoveChildã€visible等。 + /// + virtual protected void OnUpdate() + { + if (_boundsChanged) + UpdateBounds(); + } + + override public void ConstructFromResource() + { + ConstructFromResource(null, 0); + } + + internal void ConstructFromResource(List objectPool, int poolIndex) + { + this.gameObjectName = packageItem.name; + + PackageItem contentItem = packageItem.getBranch(); + + if (!contentItem.translated) + { + contentItem.translated = true; + TranslationHelper.TranslateComponent(contentItem); + } + + ByteBuffer buffer = contentItem.rawData; + buffer.Seek(0, 0); + + underConstruct = true; + + sourceWidth = buffer.ReadInt(); + sourceHeight = buffer.ReadInt(); + initWidth = sourceWidth; + initHeight = sourceHeight; + + SetSize(sourceWidth, sourceHeight); + + if (buffer.ReadBool()) + { + minWidth = buffer.ReadInt(); + maxWidth = buffer.ReadInt(); + minHeight = buffer.ReadInt(); + maxHeight = buffer.ReadInt(); + } + + if (buffer.ReadBool()) + { + float f1 = buffer.ReadFloat(); + float f2 = buffer.ReadFloat(); + SetPivot(f1, f2, buffer.ReadBool()); + } + + if (buffer.ReadBool()) + { + _margin.top = buffer.ReadInt(); + _margin.bottom = buffer.ReadInt(); + _margin.left = buffer.ReadInt(); + _margin.right = buffer.ReadInt(); + } + + OverflowType overflow = (OverflowType)buffer.ReadByte(); + if (overflow == OverflowType.Scroll) + { + int savedPos = buffer.position; + buffer.Seek(0, 7); + SetupScroll(buffer); + buffer.position = savedPos; + } + else + SetupOverflow(overflow); + + if (buffer.ReadBool()) + { + int i1 = buffer.ReadInt(); + int i2 = buffer.ReadInt(); + this.clipSoftness = new Vector2(i1, i2); + } + + _buildingDisplayList = true; + + buffer.Seek(0, 1); + + int controllerCount = buffer.ReadShort(); + for (int i = 0; i < controllerCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + Controller controller = new Controller(); + _controllers.Add(controller); + controller.parent = this; + controller.Setup(buffer); + + buffer.position = nextPos; + } + + buffer.Seek(0, 2); + + GObject child; + int childCount = buffer.ReadShort(); + for (int i = 0; i < childCount; i++) + { + int dataLen = buffer.ReadShort(); + int curPos = buffer.position; + + if (objectPool != null) + child = objectPool[poolIndex + i]; + else + { + buffer.Seek(curPos, 0); + + ObjectType type = (ObjectType)buffer.ReadByte(); + string src = buffer.ReadS(); + string pkgId = buffer.ReadS(); + + PackageItem pi = null; + if (src != null) + { + UIPackage pkg; + if (pkgId != null) + pkg = UIPackage.GetById(pkgId); + else + pkg = contentItem.owner; + + pi = pkg != null ? pkg.GetItem(src) : null; + } + + if (pi != null) + { + child = UIObjectFactory.NewObject(pi); + child.ConstructFromResource(); + } + else + child = UIObjectFactory.NewObject(type); + } + + child.underConstruct = true; + child.Setup_BeforeAdd(buffer, curPos); + child.InternalSetParent(this); + _children.Add(child); + + buffer.position = curPos + dataLen; + } + + buffer.Seek(0, 3); + this.relations.Setup(buffer, true); + + buffer.Seek(0, 2); + buffer.Skip(2); + + for (int i = 0; i < childCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + buffer.Seek(buffer.position, 3); + _children[i].relations.Setup(buffer, false); + + buffer.position = nextPos; + } + + buffer.Seek(0, 2); + buffer.Skip(2); + + for (int i = 0; i < childCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + child = _children[i]; + child.Setup_AfterAdd(buffer, buffer.position); + child.underConstruct = false; + if (child.displayObject != null) + child.displayObject.cachedTransform.SetParent(this.displayObject.cachedTransform, false); + + buffer.position = nextPos; + } + + buffer.Seek(0, 4); + + buffer.Skip(2); //customData + this.opaque = buffer.ReadBool(); + int maskId = buffer.ReadShort(); + if (maskId != -1) + { + container.mask = GetChildAt(maskId).displayObject; + if (buffer.ReadBool()) + container.reversedMask = true; + } + + { + string hitTestId = buffer.ReadS(); + int i1 = buffer.ReadInt(); + int i2 = buffer.ReadInt(); + if (hitTestId != null) + { + PackageItem pi = contentItem.owner.GetItem(hitTestId); + if (pi != null && pi.pixelHitTestData != null) + rootContainer.hitArea = new PixelHitTest(pi.pixelHitTestData, i1, i2, sourceWidth, sourceHeight); + } + else if (i1 != 0 && i2 != -1) + { + rootContainer.hitArea = new ShapeHitTest(this.GetChildAt(i2).displayObject); + } + } + + if (buffer.version >= 5) + { + string str = buffer.ReadS(); + if (!string.IsNullOrEmpty(str)) + this.onAddedToStage.Add(() => __playSound(str, 1)); + + string str2 = buffer.ReadS(); + if (!string.IsNullOrEmpty(str2)) + this.onRemovedFromStage.Add(() => __playSound(str2, 1)); + } + + buffer.Seek(0, 5); + + int transitionCount = buffer.ReadShort(); + for (int i = 0; i < transitionCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + Transition trans = new Transition(this); + trans.Setup(buffer); + _transitions.Add(trans); + + buffer.position = nextPos; + } + + if (_transitions.Count > 0) + { + this.onAddedToStage.Add(__addedToStage); + this.onRemovedFromStage.Add(__removedFromStage); + } + + ApplyAllControllers(); + + _buildingDisplayList = false; + underConstruct = false; + + BuildNativeDisplayList(); + SetBoundsChangedFlag(); + + if (contentItem.objectType != ObjectType.Component) + ConstructExtension(buffer); + + ConstructFromXML(null); + +#if FAIRYGUI_TOLUA + CallLua("ctor"); +#endif +#if FAIRYGUI_PUERTS + if (__onConstruct != null) + __onConstruct(); +#endif + } + + virtual protected void ConstructExtension(ByteBuffer buffer) + { + } + + /// + /// Method for extensions to override + /// + /// + virtual public void ConstructFromXML(XML xml) + { + } + + public override void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + buffer.Seek(beginPos, 4); + + int pageController = buffer.ReadShort(); + if (pageController != -1 && scrollPane != null && scrollPane.pageMode) + scrollPane.pageController = parent.GetControllerAt(pageController); + + int cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + Controller cc = GetController(buffer.ReadS()); + string pageId = buffer.ReadS(); + if (cc != null) + cc.selectedPageId = pageId; + } + + if (buffer.version >= 2) + { + cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + string target = buffer.ReadS(); + int propertyId = buffer.ReadShort(); + string value = buffer.ReadS(); + GObject obj = this.GetChildByPath(target); + if (obj != null) + { + if (propertyId == 0) + obj.text = value; + else if (propertyId == 1) + obj.icon = value; + } + } + } + } + + void __playSound(string soundRes, float volumeScale) + { + NAudioClip sound = UIPackage.GetItemAssetByURL(soundRes) as NAudioClip; + if (sound != null && sound.nativeClip != null) + Stage.inst.PlayOneShotSound(sound.nativeClip, volumeScale); + } + + void __addedToStage() + { + int cnt = _transitions.Count; + for (int i = 0; i < cnt; ++i) + _transitions[i].OnOwnerAddedToStage(); + } + + void __removedFromStage() + { + int cnt = _transitions.Count; + for (int i = 0; i < cnt; ++i) + _transitions[i].OnOwnerRemovedFromStage(); + } + +#if FAIRYGUI_TOLUA + internal LuaTable _peerTable; + + public void SetLuaPeer(LuaTable peerTable) + { + _peerTable = peerTable; + } + + [NoToLua] + public bool CallLua(string funcName) + { + if (_peerTable != null) + { + LuaFunction ctor = _peerTable.GetLuaFunction(funcName); + if (ctor != null) + { + try + { + ctor.Call(this); + } + catch (Exception err) + { + Debug.LogError(err); + } + + ctor.Dispose(); + return true; + } + } + + return false; + } +#endif + +#if FAIRYGUI_PUERTS + public Action __onConstruct; + public Action __onDispose; +#endif + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs.meta new file mode 100644 index 00000000..36b33609 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GComponent.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a21ec486dca945f459590f80e1e6f699 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs new file mode 100644 index 00000000..62cab969 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GGraph class. + /// å¯¹åº”ç¼–è¾‘å™¨é‡Œçš„å›¾å½¢å¯¹è±¡ã€‚å›¾å½¢æœ‰ä¸¤ä¸ªç”¨é€”ï¼Œä¸€æ˜¯ç”¨æ¥æ˜¾ç¤ºç®€å•的图形,例如矩形等;二是作为一个å ä½çš„用途, + /// å¯ä»¥å°†æœ¬å¯¹è±¡æ›¿æ¢ä¸ºå…¶ä»–对象,或者在它的å‰åŽæ·»åŠ å…¶ä»–å¯¹è±¡ï¼Œç›¸å½“äºŽä¸€ä¸ªä½ç½®å’Œæ·±åº¦çš„å ä½ï¼›è¿˜å¯ä»¥ç›´æŽ¥å°†å†…容设置 + /// 为原生对象。 + /// + public class GGraph : GObject, IColorGear + { + Shape _shape; + + public GGraph() + { + } + + override protected void CreateDisplayObject() + { + _shape = new Shape(); + _shape.gOwner = this; + displayObject = _shape; + } + + /// + /// Replace this object to another object in the display list. + /// 在显示列表中,将指定对象å–代这个图形对象。这个图形对象相当于一个å ä½çš„用途。 + /// + /// Target object. + public void ReplaceMe(GObject target) + { + if (parent == null) + throw new Exception("parent not set"); + + target.name = this.name; + target.alpha = this.alpha; + target.rotation = this.rotation; + target.visible = this.visible; + target.touchable = this.touchable; + target.grayed = this.grayed; + target.SetXY(this.x, this.y); + target.SetSize(this.width, this.height); + + int index = parent.GetChildIndex(this); + parent.AddChildAt(target, index); + target.relations.CopyFrom(this.relations); + + parent.RemoveChild(this, true); + } + + /// + /// Add another object before this object. + /// 在显示列表中,将å¦ä¸€ä¸ªå¯¹è±¡æ’入到这个对象的å‰é¢ã€‚ + /// + /// Target object. + public void AddBeforeMe(GObject target) + { + if (parent == null) + throw new Exception("parent not set"); + + int index = parent.GetChildIndex(this); + parent.AddChildAt(target, index); + } + + /// + /// Add another object after this object. + /// 在显示列表中,将å¦ä¸€ä¸ªå¯¹è±¡æ’入到这个对象的åŽé¢ã€‚ + /// + /// Target object. + public void AddAfterMe(GObject target) + { + if (parent == null) + throw new Exception("parent not set"); + + int index = parent.GetChildIndex(this); + index++; + parent.AddChildAt(target, index); + } + + /// + /// 设置内容为一个原生对象。这个图形对象相当于一个å ä½çš„用途。 + /// + /// 原生对象 + public void SetNativeObject(DisplayObject obj) + { + if (displayObject == obj) + return; + + if (_shape != null) + { + if (_shape.parent != null) + _shape.parent.RemoveChild(displayObject, true); + else + _shape.Dispose(); + _shape.gOwner = null; + _shape = null; + } + + displayObject = obj; + + if (displayObject != null) + { + displayObject.alpha = this.alpha; + displayObject.rotation = this.rotation; + displayObject.visible = this.visible; + displayObject.touchable = this.touchable; + displayObject.gOwner = this; + } + + if (parent != null) + parent.ChildStateChanged(this); + HandlePositionChanged(); + } + + /// + /// + /// + public Color color + { + get + { + if (_shape != null) + return _shape.color; + else + return Color.clear; + } + set + { + if (_shape != null && _shape.color != value) + { + _shape.color = value; + UpdateGear(4); + } + } + } + + /// + /// Get the shape object. It can be used for drawing. + /// 获å–图形的原生对象,å¯ç”¨äºŽç»˜åˆ¶å›¾å½¢ã€‚ + /// + public Shape shape + { + get { return _shape; } + } + + /// + /// Draw a rectangle. + /// 画矩形。 + /// + /// Width + /// Height + /// Line size + /// Line color + /// Fill color + public void DrawRect(float aWidth, float aHeight, int lineSize, Color lineColor, Color fillColor) + { + this.SetSize(aWidth, aHeight); + _shape.DrawRect(lineSize, lineColor, fillColor); + } + + /// + /// + /// + /// + /// + /// + /// + public void DrawRoundRect(float aWidth, float aHeight, Color fillColor, float[] corner) + { + this.SetSize(aWidth, aHeight); + this.shape.DrawRoundRect(0, Color.white, fillColor, corner[0], corner[1], corner[2], corner[3]); + } + + /// + /// + /// + /// + /// + /// + public void DrawEllipse(float aWidth, float aHeight, Color fillColor) + { + this.SetSize(aWidth, aHeight); + _shape.DrawEllipse(fillColor); + } + + /// + /// + /// + /// + /// + /// + /// + public void DrawPolygon(float aWidth, float aHeight, IList points, Color fillColor) + { + this.SetSize(aWidth, aHeight); + _shape.DrawPolygon(points, fillColor); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void DrawPolygon(float aWidth, float aHeight, IList points, Color fillColor, float lineSize, Color lineColor) + { + this.SetSize(aWidth, aHeight); + _shape.DrawPolygon(points, fillColor, lineSize, lineColor); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + int type = buffer.ReadByte(); + if (type != 0) + { + int lineSize = buffer.ReadInt(); + Color lineColor = buffer.ReadColor(); + Color fillColor = buffer.ReadColor(); + bool roundedRect = buffer.ReadBool(); + Vector4 cornerRadius = new Vector4(); + if (roundedRect) + { + for (int i = 0; i < 4; i++) + cornerRadius[i] = buffer.ReadFloat(); + } + + if (type == 1) + { + if (roundedRect) + _shape.DrawRoundRect(lineSize, lineColor, fillColor, cornerRadius.x, cornerRadius.y, cornerRadius.z, cornerRadius.w); + else + _shape.DrawRect(lineSize, lineColor, fillColor); + } + else if (type == 2) + _shape.DrawEllipse(lineSize, fillColor, lineColor, fillColor, 0, 360); + else if (type == 3) + { + int cnt = buffer.ReadShort() / 2; + Vector2[] points = new Vector2[cnt]; + for (int i = 0; i < cnt; i++) + points[i].Set(buffer.ReadFloat(), buffer.ReadFloat()); + + _shape.DrawPolygon(points, fillColor, lineSize, lineColor); + } + else if (type == 4) + { + int sides = buffer.ReadShort(); + float startAngle = buffer.ReadFloat(); + int cnt = buffer.ReadShort(); + float[] distances = null; + if (cnt > 0) + { + distances = new float[cnt]; + for (int i = 0; i < cnt; i++) + distances[i] = buffer.ReadFloat(); + } + + _shape.DrawRegularPolygon(sides, lineSize, fillColor, lineColor, fillColor, startAngle, distances); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs.meta new file mode 100644 index 00000000..3f09cad6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGraph.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 913b7964e87194d4182c1ad388d94f19 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs new file mode 100644 index 00000000..8958c01c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs @@ -0,0 +1,538 @@ +using System; +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// GGroup class. + /// 组对象,对应编辑器里的高级组。 + /// + public class GGroup : GObject + { + GroupLayoutType _layout; + int _lineGap; + int _columnGap; + + bool _excludeInvisibles; + bool _autoSizeDisabled; + int _mainGridIndex; + int _mainGridMinSize; + + bool _percentReady; + bool _boundsChanged; + int _mainChildIndex; + float _totalSize; + int _numChildren; + internal int _updating; + + Action _refreshDelegate; + + public GGroup() + { + _mainGridIndex = -1; + _mainChildIndex = -1; + _mainGridMinSize = 50; + _refreshDelegate = EnsureBoundsCorrect; + } + + /// + /// Group layout type. + /// + public GroupLayoutType layout + { + get { return _layout; } + set + { + if (_layout != value) + { + _layout = value; + SetBoundsChangedFlag(); + } + } + } + + /// + /// + /// + public int lineGap + { + get { return _lineGap; } + set + { + if (_lineGap != value) + { + _lineGap = value; + SetBoundsChangedFlag(true); + } + } + } + + /// + /// + /// + public int columnGap + { + get { return _columnGap; } + set + { + if (_columnGap != value) + { + _columnGap = value; + SetBoundsChangedFlag(true); + } + } + } + + /// + /// + /// + public bool excludeInvisibles + { + get { return _excludeInvisibles; } + set + { + if (_excludeInvisibles != value) + { + _excludeInvisibles = value; + SetBoundsChangedFlag(); + } + } + } + + /// + /// + /// + public bool autoSizeDisabled + { + get { return _autoSizeDisabled; } + set + { + if (_autoSizeDisabled != value) + { + _autoSizeDisabled = value; + SetBoundsChangedFlag(); + } + } + } + + /// + /// + /// + public int mainGridMinSize + { + get { return _mainGridMinSize; } + set + { + if (_mainGridMinSize != value) + { + _mainGridMinSize = value; + SetBoundsChangedFlag(); + } + } + } + + /// + /// + /// + public int mainGridIndex + { + get { return _mainGridIndex; } + set + { + if (_mainGridIndex != value) + { + _mainGridIndex = value; + SetBoundsChangedFlag(); + } + } + } + + /// + /// Update group bounds. + /// 更新组的包围. + /// + public void SetBoundsChangedFlag(bool positionChangedOnly = false) + { + if (_updating == 0 && parent != null) + { + if (!positionChangedOnly) + _percentReady = false; + + if (!_boundsChanged) + { + _boundsChanged = true; + + if (_layout != GroupLayoutType.None) + { + UpdateContext.OnBegin -= _refreshDelegate; + UpdateContext.OnBegin += _refreshDelegate; + } + } + } + } + + public void EnsureBoundsCorrect() + { + if (parent == null || !_boundsChanged) + return; + + UpdateContext.OnBegin -= _refreshDelegate; + _boundsChanged = false; + + if (_autoSizeDisabled) + ResizeChildren(0, 0); + else + { + HandleLayout(); + UpdateBounds(); + } + } + + void UpdateBounds() + { + int cnt = parent.numChildren; + int i; + GObject child; + float ax = int.MaxValue, ay = int.MaxValue; + float ar = int.MinValue, ab = int.MinValue; + float tmp; + bool empty = true; + bool skipInvisibles = _layout != GroupLayoutType.None && _excludeInvisibles; + + for (i = 0; i < cnt; i++) + { + child = parent.GetChildAt(i); + if (child.group != this) + continue; + + if (skipInvisibles && !child.internalVisible3) + continue; + + tmp = child.xMin; + if (tmp < ax) + ax = tmp; + tmp = child.yMin; + if (tmp < ay) + ay = tmp; + tmp = child.xMin + child.width; + if (tmp > ar) + ar = tmp; + tmp = child.yMin + child.height; + if (tmp > ab) + ab = tmp; + + empty = false; + } + + float w; + float h; + if (!empty) + { + _updating |= 1; + SetXY(ax, ay); + _updating &= 2; + + w = ar - ax; + h = ab - ay; + } + else + w = h = 0; + + if ((_updating & 2) == 0) + { + _updating |= 2; + SetSize(w, h); + _updating &= 1; + } + else + { + _updating &= 1; + ResizeChildren(_width - w, _height - h); + } + } + + void HandleLayout() + { + _updating |= 1; + + if (_layout == GroupLayoutType.Horizontal) + { + float curX = this.x; + int cnt = parent.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + if (_excludeInvisibles && !child.internalVisible3) + continue; + + child.xMin = curX; + if (child.width != 0) + curX += child.width + _columnGap; + } + } + else if (_layout == GroupLayoutType.Vertical) + { + float curY = this.y; + int cnt = parent.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + if (_excludeInvisibles && !child.internalVisible3) + continue; + + child.yMin = curY; + if (child.height != 0) + curY += child.height + _lineGap; + } + } + + _updating &= 2; + } + + internal void MoveChildren(float dx, float dy) + { + if ((_updating & 1) != 0 || parent == null) + return; + + _updating |= 1; + + int cnt = parent.numChildren; + int i; + GObject child; + for (i = 0; i < cnt; i++) + { + child = parent.GetChildAt(i); + if (child.group == this) + { + child.SetXY(child.x + dx, child.y + dy); + } + } + + _updating &= 2; + } + + internal void ResizeChildren(float dw, float dh) + { + if (_layout == GroupLayoutType.None || (_updating & 2) != 0 || parent == null) + return; + + _updating |= 2; + + if (_boundsChanged) + { + _boundsChanged = false; + if (!_autoSizeDisabled) + { + UpdateBounds(); + return; + } + } + + int cnt = parent.numChildren; + + if (!_percentReady) + { + _percentReady = true; + _numChildren = 0; + _totalSize = 0; + _mainChildIndex = -1; + + int j = 0; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + + if (!_excludeInvisibles || child.internalVisible3) + { + if (j == _mainGridIndex) + _mainChildIndex = i; + + _numChildren++; + + if (_layout == GroupLayoutType.Horizontal) + _totalSize += child.width; + else + _totalSize += child.height; + } + + j++; + } + + if (_mainChildIndex != -1) + { + if (_layout == GroupLayoutType.Horizontal) + { + GObject child = parent.GetChildAt(_mainChildIndex); + _totalSize += _mainGridMinSize - child.width; + child._sizePercentInGroup = _mainGridMinSize / _totalSize; + } + else + { + GObject child = parent.GetChildAt(_mainChildIndex); + _totalSize += _mainGridMinSize - child.height; + child._sizePercentInGroup = _mainGridMinSize / _totalSize; + } + } + + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + + if (i == _mainChildIndex) + continue; + + if (_totalSize > 0) + child._sizePercentInGroup = (_layout == GroupLayoutType.Horizontal ? child.width : child.height) / _totalSize; + else + child._sizePercentInGroup = 0; + } + } + + float remainSize = 0; + float remainPercent = 1; + bool priorHandled = false; + + if (_layout == GroupLayoutType.Horizontal) + { + remainSize = this.width - (_numChildren - 1) * _columnGap; + if (_mainChildIndex != -1 && remainSize >= _totalSize) + { + GObject child = parent.GetChildAt(_mainChildIndex); + child.SetSize(remainSize - (_totalSize - _mainGridMinSize), child._rawHeight + dh, true); + remainSize -= child.width; + remainPercent -= child._sizePercentInGroup; + priorHandled = true; + } + + float curX = this.x; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + + if (_excludeInvisibles && !child.internalVisible3) + { + child.SetSize(child._rawWidth, child._rawHeight + dh, true); + continue; + } + + if (!priorHandled || i != _mainChildIndex) + { + child.SetSize(Mathf.Round(child._sizePercentInGroup / remainPercent * remainSize), child._rawHeight + dh, true); + remainPercent -= child._sizePercentInGroup; + remainSize -= child.width; + } + + child.xMin = curX; + if (child.width != 0) + curX += child.width + _columnGap; + } + } + else + { + remainSize = this.height - (_numChildren - 1) * _lineGap; + if (_mainChildIndex != -1 && remainSize >= _totalSize) + { + GObject child = parent.GetChildAt(_mainChildIndex); + child.SetSize(child._rawWidth + dw, remainSize - (_totalSize - _mainGridMinSize), true); + remainSize -= child.height; + remainPercent -= child._sizePercentInGroup; + priorHandled = true; + } + + float curY = this.y; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group != this) + continue; + + if (_excludeInvisibles && !child.internalVisible3) + { + child.SetSize(child._rawWidth + dw, child._rawHeight, true); + continue; + } + + if (!priorHandled || i != _mainChildIndex) + { + child.SetSize(child._rawWidth + dw, Mathf.Round(child._sizePercentInGroup / remainPercent * remainSize), true); + remainPercent -= child._sizePercentInGroup; + remainSize -= child.height; + } + + child.yMin = curY; + if (child.height != 0) + curY += child.height + _lineGap; + } + } + + _updating &= 1; + } + + override protected void HandleAlphaChanged() + { + base.HandleAlphaChanged(); + + if (this.underConstruct || parent == null) + return; + + int cnt = parent.numChildren; + float a = this.alpha; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group == this) + child.alpha = a; + } + } + + override internal protected void HandleVisibleChanged() + { + if (parent == null) + return; + + int cnt = parent.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject child = parent.GetChildAt(i); + if (child.group == this) + child.HandleVisibleChanged(); + } + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + _layout = (GroupLayoutType)buffer.ReadByte(); + _lineGap = buffer.ReadInt(); + _columnGap = buffer.ReadInt(); + if (buffer.version >= 2) + { + _excludeInvisibles = buffer.ReadBool(); + _autoSizeDisabled = buffer.ReadBool(); + _mainGridIndex = buffer.ReadShort(); + } + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!this.visible) + HandleVisibleChanged(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs.meta new file mode 100644 index 00000000..27954a00 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GGroup.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b8aac7740f89ffc409bfb6cd30d58fec +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs new file mode 100644 index 00000000..a477d2fb --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs @@ -0,0 +1,172 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GImage class. + /// + public class GImage : GObject, IColorGear + { + Image _content; + + public Image Content => _content; + + public GImage() + { + } + + override protected void CreateDisplayObject() + { + _content = new Image(); + _content.gOwner = this; + displayObject = _content; + } + + /// + /// Color of the image. + /// + public Color color + { + get { return _content.color; } + set + { + _content.color = value; + UpdateGear(4); + } + } + + /// + /// Flip type. + /// + /// + public FlipType flip + { + get { return _content.graphics.flip; } + set { _content.graphics.flip = value; } + } + + /// + /// Fill method. + /// + /// + public FillMethod fillMethod + { + get { return _content.fillMethod; } + set { _content.fillMethod = value; } + } + + /// + /// Fill origin. + /// + /// + /// + /// + /// + /// + public int fillOrigin + { + get { return _content.fillOrigin; } + set { _content.fillOrigin = value; } + } + + /// + /// Fill clockwise if true. + /// + public bool fillClockwise + { + get { return _content.fillClockwise; } + set { _content.fillClockwise = value; } + } + + /// + /// Fill amount. (0~1) + /// + public float fillAmount + { + get { return _content.fillAmount; } + set { _content.fillAmount = value; } + } + + /// + /// Set texture directly. The image wont own the texture. + /// + public NTexture texture + { + get { return _content.texture; } + set + { + if (value != null) + { + sourceWidth = value.width; + sourceHeight = value.height; + } + else + { + sourceWidth = 0; + sourceHeight = 0; + } + initWidth = sourceWidth; + initHeight = sourceHeight; + _content.texture = value; + } + } + + /// + /// Set material. + /// + public Material material + { + get { return _content.material; } + set { _content.material = value; } + } + + /// + /// Set shader. + /// + public string shader + { + get { return _content.shader; } + set { _content.shader = value; } + } + + override public void ConstructFromResource() + { + this.gameObjectName = packageItem.name; + + PackageItem contentItem = packageItem.getBranch(); + sourceWidth = contentItem.width; + sourceHeight = contentItem.height; + initWidth = sourceWidth; + initHeight = sourceHeight; + + contentItem = contentItem.getHighResolution(); + contentItem.Load(); + _content.scale9Grid = contentItem.scale9Grid; + _content.scaleByTile = contentItem.scaleByTile; + _content.tileGridIndice = contentItem.tileGridIndice; + _content.texture = contentItem.texture; + _content.textureScale = new Vector2(contentItem.width / (float)sourceWidth, contentItem.height / (float)sourceHeight); + + SetSize(sourceWidth, sourceHeight); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + if (buffer.ReadBool()) + _content.color = buffer.ReadColor(); + _content.graphics.flip = (FlipType)buffer.ReadByte(); + _content.fillMethod = (FillMethod)buffer.ReadByte(); + if (_content.fillMethod != FillMethod.None) + { + _content.fillOrigin = buffer.ReadByte(); + _content.fillClockwise = buffer.ReadBool(); + _content.fillAmount = buffer.ReadFloat(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs.meta new file mode 100644 index 00000000..d1038d10 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GImage.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 106156ac7c8773640af01f14fd396393 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs new file mode 100644 index 00000000..bc0a5b27 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs @@ -0,0 +1,235 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GLabel class. + /// + public class GLabel : GComponent, IColorGear + { + protected GObject _titleObject; + protected GObject _iconObject; + + public GLabel() + { + } + + /// + /// Icon of the label. + /// + override public string icon + { + get + { + if (_iconObject != null) + return _iconObject.icon; + else + return null; + } + + set + { + if (_iconObject != null) + _iconObject.icon = value; + UpdateGear(7); + } + } + + /// + /// Title of the label. + /// + public string title + { + get + { + if (_titleObject != null) + return _titleObject.text; + else + return null; + } + set + { + if (_titleObject != null) + _titleObject.text = value; + UpdateGear(6); + } + } + + /// + /// Same of the title. + /// + override public string text + { + get { return this.title; } + set { this.title = value; } + } + + /// + /// If title is input text. + /// + public bool editable + { + get + { + if (_titleObject is GTextInput) + return _titleObject.asTextInput.editable; + else + return false; + } + + set + { + if (_titleObject is GTextInput) + _titleObject.asTextInput.editable = value; + } + } + + /// + /// Title color of the label + /// + public Color titleColor + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.color; + else + return Color.black; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + { + tf.color = value; + UpdateGear(4); + } + } + } + + /// + /// + /// + public int titleFontSize + { + get + { + GTextField tf = GetTextField(); + if (tf != null) + return tf.textFormat.size; + else + return 0; + } + set + { + GTextField tf = GetTextField(); + if (tf != null) + { + TextFormat format = tf.textFormat; + format.size = value; + tf.textFormat = format; + } + } + } + + /// + /// + /// + public Color color + { + get { return this.titleColor; } + set { this.titleColor = value; } + } + + /// + /// + /// + /// + public GTextField GetTextField() + { + if (_titleObject is GTextField) + return (GTextField)_titleObject; + else if (_titleObject is GLabel) + return ((GLabel)_titleObject).GetTextField(); + else if (_titleObject is GButton) + return ((GButton)_titleObject).GetTextField(); + else + return null; + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + _titleObject = GetChild("title"); + _iconObject = GetChild("icon"); + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!buffer.Seek(beginPos, 6)) + return; + + if ((ObjectType)buffer.ReadByte() != packageItem.objectType) + return; + + string str; + str = buffer.ReadS(); + if (str != null) + this.title = str; + str = buffer.ReadS(); + if (str != null) + this.icon = str; + if (buffer.ReadBool()) + this.titleColor = buffer.ReadColor(); + int iv = buffer.ReadInt(); + if (iv != 0) + this.titleFontSize = iv; + + if (buffer.ReadBool()) + { + GTextInput input = GetTextField() as GTextInput; + if (input != null) + { + str = buffer.ReadS(); + if (str != null) + input.promptText = str; + + str = buffer.ReadS(); + if (str != null) + input.restrict = str; + + iv = buffer.ReadInt(); + if (iv != 0) + input.maxLength = iv; + iv = buffer.ReadInt(); + if (iv != 0) + input.keyboardType = iv; + if (buffer.ReadBool()) + input.displayAsPassword = true; + } + else + buffer.Skip(13); + } + + if (buffer.version >= 5) + { + string sound = buffer.ReadS(); + if (!string.IsNullOrEmpty(sound)) + { + float volumeScale = buffer.ReadFloat(); + displayObject.onClick.Add(() => + { + NAudioClip audioClip = UIPackage.GetItemAssetByURL(sound) as NAudioClip; + if (audioClip != null && audioClip.nativeClip != null) + Stage.inst.PlayOneShotSound(audioClip.nativeClip, volumeScale); + }); + } + else + buffer.Skip(4); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs.meta new file mode 100644 index 00000000..a455d7bf --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLabel.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bd9c62cc282bb9b4fa9e794317eedd30 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs new file mode 100644 index 00000000..8c18b61c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs @@ -0,0 +1,3071 @@ +using System; +using System.Collections.Generic; +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Callback function when an item is needed to update its look. + /// + /// Item index. + /// Item object. + public delegate void ListItemRenderer(int index, GObject item); + + /// + /// + /// + /// + /// + public delegate string ListItemProvider(int index); + + /// + /// GList class. + /// + public class GList : GComponent + { + /// + /// 如果true,当itemä¸å¯è§æ—¶è‡ªåŠ¨æŠ˜å ï¼Œå¦åˆ™ä¾ç„¶å ä½ + /// + public bool foldInvisibleItems = false; + + /// + /// List selection mode + /// + /// + public ListSelectionMode selectionMode; + + /// + /// Callback function when an item is needed to update its look. + /// + public ListItemRenderer itemRenderer; + + /// + /// Callback funtion to return item resource url. + /// + public ListItemProvider itemProvider; + + /// + /// + /// + public bool scrollItemToViewOnClick; + + string _defaultItem; + ListLayoutType _layout; + int _lineCount; + int _columnCount; + int _lineGap; + int _columnGap; + AlignType _align; + VertAlignType _verticalAlign; + bool _autoResizeItem; + Controller _selectionController; + + GObjectPool _pool; + int _lastSelectedIndex; + + EventListener _onClickItem; + EventListener _onRightClickItem; + + //Virtual List support + bool _virtual; + bool _loop; + int _numItems; + int _realNumItems; + int _firstIndex; //the top left index + int _curLineItemCount; //item count in one line + int _curLineItemCount2; //åªç”¨åœ¨é¡µé¢æ¨¡å¼ï¼Œè¡¨ç¤ºåž‚ç›´æ–¹å‘的项目数 + Vector2 _itemSize; + int _virtualListChanged; //1-content changed, 2-size changed + uint itemInfoVer; //ç”¨æ¥æ ‡å¿—item是å¦åœ¨æœ¬æ¬¡å¤„ç†ä¸­å·²ç»è¢«é‡ç”¨äº† + + int _miscFlags; //1-event locked, 2-focus events registered + + class ItemInfo + { + public Vector2 size; + public GObject obj; + public uint updateFlag; + public bool selected; + } + List _virtualItems; + + EventCallback1 _itemClickDelegate; + + public GList() + : base() + { + _trackBounds = true; + this.opaque = true; + scrollItemToViewOnClick = true; + + container = new Container(); + rootContainer.AddChild(container); + rootContainer.gameObject.name = "GList"; + + _pool = new GObjectPool(container.cachedTransform); + + _itemClickDelegate = __clickItem; + } + + public override void Dispose() + { + _pool.Clear(); + if (_virtualListChanged != 0) + Timers.inst.Remove(this.RefreshVirtualList); + + _selectionController = null; + scrollItemToViewOnClick = false; + itemRenderer = null; + itemProvider = null; + + base.Dispose(); + } + + /// + /// Dispatched when a list item being clicked. + /// + public EventListener onClickItem + { + get { return _onClickItem ?? (_onClickItem = new EventListener(this, "onClickItem")); } + } + + /// + /// Dispatched when a list item being clicked with right button. + /// + public EventListener onRightClickItem + { + get { return _onRightClickItem ?? (_onRightClickItem = new EventListener(this, "onRightClickItem")); } + } + + /// + /// Resource url of the default item. + /// + public string defaultItem + { + get { return _defaultItem; } + set + { + _defaultItem = UIPackage.NormalizeURL(value); + } + } + + /// + /// List layout type. + /// + public ListLayoutType layout + { + get { return _layout; } + set + { + if (_layout != value) + { + _layout = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + public int lineCount + { + get { return _lineCount; } + set + { + if (_lineCount != value) + { + _lineCount = value; + if (_layout == ListLayoutType.FlowVertical || _layout == ListLayoutType.Pagination) + { + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + } + + /// + /// + /// + public int columnCount + { + get { return _columnCount; } + set + { + if (_columnCount != value) + { + _columnCount = value; + if (_layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.Pagination) + { + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + } + + /// + /// + /// + public int lineGap + { + get { return _lineGap; } + set + { + if (_lineGap != value) + { + _lineGap = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + public int columnGap + { + get { return _columnGap; } + set + { + if (_columnGap != value) + { + _columnGap = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + public AlignType align + { + get { return _align; } + set + { + if (_align != value) + { + _align = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + public VertAlignType verticalAlign + { + get { return _verticalAlign; } + set + { + if (_verticalAlign != value) + { + _verticalAlign = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + /// + /// If the item will resize itself to fit the list width/height. + /// + public bool autoResizeItem + { + get { return _autoResizeItem; } + set + { + if (_autoResizeItem != value) + { + _autoResizeItem = value; + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + /// + public Vector2 defaultItemSize + { + get { return _itemSize; } + set + { + _itemSize = value; + if (_virtual) + { + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + this.scrollPane.scrollStep = _itemSize.y; + else + this.scrollPane.scrollStep = _itemSize.x; + SetVirtualListChangedFlag(true); + } + } + } + + /// + /// + /// + public GObjectPool itemPool + { + get { return _pool; } + } + + /// + /// + /// + /// + /// + public GObject GetFromPool(string url) + { + if (string.IsNullOrEmpty(url)) + url = _defaultItem; + + GObject ret = _pool.GetObject(url); + if (ret != null) + ret.visible = true; + return ret; + } + + void ReturnToPool(GObject obj) + { + _pool.ReturnObject(obj); + } + + /// + /// Add a item to list, same as GetFromPool+AddChild + /// + /// Item object + public GObject AddItemFromPool() + { + GObject obj = GetFromPool(null); + + return AddChild(obj); + } + + /// + /// Add a item to list, same as GetFromPool+AddChild + /// + /// Item resource url + /// Item object + public GObject AddItemFromPool(string url) + { + GObject obj = GetFromPool(url); + + return AddChild(obj); + } + + /// + /// + /// + /// + /// + /// + override public GObject AddChildAt(GObject child, int index) + { + base.AddChildAt(child, index); + if (child is GButton) + { + GButton button = (GButton)child; + button.selected = false; + button.changeStateOnClick = false; + } + + child.onClick.Add(_itemClickDelegate); + child.onRightClick.Add(_itemClickDelegate); + + return child; + } + + /// + /// + /// + /// + /// + /// + override public GObject RemoveChildAt(int index, bool dispose) + { + GObject child = base.RemoveChildAt(index, dispose); + child.onClick.Remove(_itemClickDelegate); + child.onRightClick.Remove(_itemClickDelegate); + + return child; + } + + /// + /// + /// + /// + public void RemoveChildToPoolAt(int index) + { + GObject child = base.RemoveChildAt(index); + ReturnToPool(child); + } + + /// + /// + /// + /// + public void RemoveChildToPool(GObject child) + { + base.RemoveChild(child); + ReturnToPool(child); + } + + /// + /// + /// + public void RemoveChildrenToPool() + { + RemoveChildrenToPool(0, -1); + } + + /// + /// + /// + /// + /// + public void RemoveChildrenToPool(int beginIndex, int endIndex) + { + if (endIndex < 0 || endIndex >= _children.Count) + endIndex = _children.Count - 1; + + for (int i = beginIndex; i <= endIndex; ++i) + RemoveChildToPoolAt(beginIndex); + } + + /// + /// + /// + public int selectedIndex + { + get + { + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if ((ii.obj is GButton) && ((GButton)ii.obj).selected + || ii.obj == null && ii.selected) + { + if (_loop) + return i % _numItems; + else + return i; + } + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null && obj.selected) + return i; + } + } + return -1; + } + + set + { + if (value >= 0 && value < this.numItems) + { + if (selectionMode != ListSelectionMode.Single) + ClearSelection(); + AddSelection(value, false); + } + else + ClearSelection(); + } + } + + /// + /// + /// + public Controller selectionController + { + get { return _selectionController; } + set { _selectionController = value; } + } + + /// + /// + /// + /// + public List GetSelection() + { + return GetSelection(null); + } + + /// + /// + /// + /// + public List GetSelection(List result) + { + if (result == null) + result = new List(); + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if ((ii.obj is GButton) && ((GButton)ii.obj).selected + || ii.obj == null && ii.selected) + { + int j = i; + if (_loop) + { + j = i % _numItems; + if (result.Contains(j)) + continue; + } + result.Add(j); + } + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null && obj.selected) + result.Add(i); + } + } + return result; + } + + /// + /// + /// + /// + /// + public void AddSelection(int index, bool scrollItToView) + { + if (selectionMode == ListSelectionMode.None) + return; + + CheckVirtualList(); + + if (selectionMode == ListSelectionMode.Single) + ClearSelection(); + + if (scrollItToView) + ScrollToView(index); + + _lastSelectedIndex = index; + GButton obj = null; + if (_virtual) + { + ItemInfo ii = _virtualItems[index]; + if (ii.obj != null) + obj = ii.obj.asButton; + ii.selected = true; + } + else + obj = GetChildAt(index).asButton; + + if (obj != null && !obj.selected) + { + obj.selected = true; + UpdateSelectionController(index); + } + } + + /// + /// + /// + /// + public void RemoveSelection(int index) + { + if (selectionMode == ListSelectionMode.None) + return; + + GButton obj = null; + if (_virtual) + { + ItemInfo ii = _virtualItems[index]; + if (ii.obj != null) + obj = ii.obj.asButton; + ii.selected = false; + } + else + obj = GetChildAt(index).asButton; + + if (obj != null) + obj.selected = false; + } + + /// + /// + /// + public void ClearSelection() + { + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if ((ii.obj is GButton)) + ((GButton)ii.obj).selected = false; + ii.selected = false; + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null) + obj.selected = false; + } + } + } + + void ClearSelectionExcept(GObject g) + { + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if (ii.obj != g) + { + if ((ii.obj is GButton)) + ((GButton)ii.obj).selected = false; + ii.selected = false; + } + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null && obj != g) + obj.selected = false; + } + } + } + + /// + /// + /// + public void SelectAll() + { + CheckVirtualList(); + + int last = -1; + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if ((ii.obj is GButton) && !((GButton)ii.obj).selected) + { + ((GButton)ii.obj).selected = true; + last = i; + } + ii.selected = true; + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null && !obj.selected) + { + obj.selected = true; + last = i; + } + } + } + + if (last != -1) + UpdateSelectionController(last); + } + + /// + /// + /// + public void SelectNone() + { + ClearSelection(); + } + + /// + /// + /// + public void SelectReverse() + { + CheckVirtualList(); + + int last = -1; + if (_virtual) + { + int cnt = _realNumItems; + for (int i = 0; i < cnt; i++) + { + ItemInfo ii = _virtualItems[i]; + if ((ii.obj is GButton)) + { + ((GButton)ii.obj).selected = !((GButton)ii.obj).selected; + if (((GButton)ii.obj).selected) + last = i; + } + ii.selected = !ii.selected; + } + } + else + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null) + { + obj.selected = !obj.selected; + if (obj.selected) + last = i; + } + } + } + + if (last != -1) + UpdateSelectionController(last); + } + + /// + /// + /// + /// + public void EnableSelectionFocusEvents(bool enabled) + { + if (((_miscFlags & 2) != 0) == enabled) + return; + + if (enabled) + { + _miscFlags |= 2; + this.tabStopChildren = true; + onFocusIn.Add(NotifySelection); + onFocusOut.Add(NotifySelection); + } + else + { + _miscFlags &= 0xFD; + onFocusIn.Remove(NotifySelection); + onFocusOut.Remove(NotifySelection); + } + } + + void NotifySelection(EventContext context) + { + string eventType = context.type == "onFocusIn" ? "onListFocusIn" : "onListFocusOut"; + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GButton obj = _children[i].asButton; + if (obj != null && obj.selected) + obj.DispatchEvent(eventType); + } + } + + /// + /// + /// + public void EnableArrowKeyNavigation(bool enabled) + { + if (enabled) + { + this.tabStopChildren = true; + onKeyDown.Add(__keydown); + } + else + { + this.tabStopChildren = false; + onKeyDown.Remove(__keydown); + } + } + + void __keydown(EventContext context) + { + int index = -1; + switch (context.inputEvent.keyCode) + { + case KeyCode.LeftArrow: + index = HandleArrowKey(7); + break; + + case KeyCode.RightArrow: + index = HandleArrowKey(3); + break; + + case KeyCode.UpArrow: + index = HandleArrowKey(1); + break; + + case KeyCode.DownArrow: + index = HandleArrowKey(5); + break; + } + + if (index != -1) + { + index = ItemIndexToChildIndex(index); + if (index != -1) + DispatchItemEvent(GetChildAt(index), context); + + context.StopPropagation(); + } + } + + /// + /// + /// + /// + public int HandleArrowKey(int dir) + { + int curIndex = this.selectedIndex; + if (curIndex == -1) + return -1; + + int index = curIndex; + switch (dir) + { + case 1://up + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowVertical) + { + index--; + } + else if (_layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.Pagination) + { + if (_virtual) + { + index -= _curLineItemCount; + } + else + { + GObject current = _children[index]; + int k = 0; + int i; + for (i = index - 1; i >= 0; i--) + { + GObject obj = _children[i]; + if (obj.y != current.y) + { + current = obj; + break; + } + k++; + } + for (; i >= 0; i--) + { + GObject obj = _children[i]; + if (obj.y != current.y) + { + index = i + k + 1; + break; + } + } + } + } + break; + + case 3://right + if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.Pagination) + { + index++; + } + else if (_layout == ListLayoutType.FlowVertical) + { + if (_virtual) + { + index += _curLineItemCount; + } + else + { + GObject current = _children[index]; + int k = 0; + int cnt = _children.Count; + int i; + for (i = index + 1; i < cnt; i++) + { + GObject obj = _children[i]; + if (obj.x != current.x) + { + current = obj; + break; + } + k++; + } + for (; i < cnt; i++) + { + GObject obj = _children[i]; + if (obj.x != current.x) + { + index = i - k - 1; + break; + } + } + } + } + break; + + case 5://down + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowVertical) + { + index++; + } + else if (_layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.Pagination) + { + if (_virtual) + { + index += _curLineItemCount; + } + else + { + GObject current = _children[index]; + int k = 0; + int cnt = _children.Count; + int i; + for (i = index + 1; i < cnt; i++) + { + GObject obj = _children[i]; + if (obj.y != current.y) + { + current = obj; + break; + } + k++; + } + for (; i < cnt; i++) + { + GObject obj = _children[i]; + if (obj.y != current.y) + { + index = i - k - 1; + break; + } + } + } + } + break; + + case 7://left + if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.Pagination) + { + index--; + } + else if (_layout == ListLayoutType.FlowVertical) + { + if (_virtual) + { + index -= _curLineItemCount; + } + else + { + GObject current = _children[index]; + int k = 0; + int i; + for (i = index - 1; i >= 0; i--) + { + GObject obj = _children[i]; + if (obj.x != current.x) + { + current = obj; + break; + } + k++; + } + for (; i >= 0; i--) + { + GObject obj = _children[i]; + if (obj.x != current.x) + { + index = i + k + 1; + break; + } + } + } + } + break; + } + + if (index != curIndex && index >= 0 && index < this.numItems) + { + ClearSelection(); + AddSelection(index, true); + return index; + } + else + return -1; + } + + void __clickItem(EventContext context) + { + GObject item = context.sender as GObject; + if ((item is GButton) && selectionMode != ListSelectionMode.None) + SetSelectionOnEvent(item, context.inputEvent); + + if (scrollPane != null && scrollItemToViewOnClick) + scrollPane.ScrollToView(item, true); + + DispatchItemEvent(item, context); + } + + virtual protected void DispatchItemEvent(GObject item, EventContext context) + { + if (context.type == item.onRightClick.type) + DispatchEvent("onRightClickItem", item); + else + DispatchEvent("onClickItem", item); + } + + void SetSelectionOnEvent(GObject item, InputEvent evt) + { + bool dontChangeLastIndex = false; + GButton button = (GButton)item; + int index = ChildIndexToItemIndex(GetChildIndex(item)); + + if (selectionMode == ListSelectionMode.Single) + { + if (!button.selected) + { + ClearSelectionExcept(button); + button.selected = true; + } + } + else + { + if (evt.shift) + { + if (!button.selected) + { + if (_lastSelectedIndex != -1) + { + int min = Math.Min(_lastSelectedIndex, index); + int max = Math.Max(_lastSelectedIndex, index); + max = Math.Min(max, this.numItems - 1); + if (_virtual) + { + for (int i = min; i <= max; i++) + { + ItemInfo ii = _virtualItems[i]; + if (ii.obj is GButton) + ((GButton)ii.obj).selected = true; + ii.selected = true; + } + } + else + { + for (int i = min; i <= max; i++) + { + GButton obj = GetChildAt(i).asButton; + if (obj != null && !obj.selected) + obj.selected = true; + } + } + + dontChangeLastIndex = true; + } + else + { + button.selected = true; + } + } + } + else if (evt.ctrlOrCmd || selectionMode == ListSelectionMode.Multiple_SingleClick) + { + button.selected = !button.selected; + } + else + { + if (!button.selected) + { + ClearSelectionExcept(button); + button.selected = true; + } + else if (evt.button == 0) + ClearSelectionExcept(button); + } + } + + if (!dontChangeLastIndex) + _lastSelectedIndex = index; + + if (button.selected) + UpdateSelectionController(index); + } + + /// + /// Resize to list size to fit specified item count. + /// If list layout is single column or flow horizontally, the height will change to fit. + /// If list layout is single row or flow vertically, the width will change to fit. + /// + public void ResizeToFit() + { + ResizeToFit(int.MaxValue, 0); + } + + /// + /// Resize to list size to fit specified item count. + /// If list layout is single column or flow horizontally, the height will change to fit. + /// If list layout is single row or flow vertically, the width will change to fit. + /// + /// Item count + public void ResizeToFit(int itemCount) + { + ResizeToFit(itemCount, 0); + } + + /// + /// Resize to list size to fit specified item count. + /// If list layout is single column or flow horizontally, the height will change to fit. + /// If list layout is single row or flow vertically, the width will change to fit. + /// + /// >Item count + /// If the result size if smaller than minSize, then use minSize. + public void ResizeToFit(int itemCount, int minSize) + { + EnsureBoundsCorrect(); + + int curCount = this.numItems; + if (itemCount > curCount) + itemCount = curCount; + + if (_virtual) + { + int lineCount = Mathf.CeilToInt((float)itemCount / _curLineItemCount); + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + this.viewHeight = lineCount * _itemSize.y + Math.Max(0, lineCount - 1) * _lineGap; + else + this.viewWidth = lineCount * _itemSize.x + Math.Max(0, lineCount - 1) * _columnGap; + } + else if (itemCount == 0) + { + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + this.viewHeight = minSize; + else + this.viewWidth = minSize; + } + else + { + int i = itemCount - 1; + GObject obj = null; + while (i >= 0) + { + obj = this.GetChildAt(i); + if (!foldInvisibleItems || obj.visible) + break; + i--; + } + if (i < 0) + { + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + this.viewHeight = minSize; + else + this.viewWidth = minSize; + } + else + { + float size; + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + size = obj.y + obj.height; + if (size < minSize) + size = minSize; + this.viewHeight = size; + } + else + { + size = obj.x + obj.width; + if (size < minSize) + size = minSize; + this.viewWidth = size; + } + } + } + } + + /// + /// + /// + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + SetBoundsChangedFlag(); + if (_virtual) + SetVirtualListChangedFlag(true); + } + + override public void HandleControllerChanged(Controller c) + { + base.HandleControllerChanged(c); + + if (_selectionController == c) + this.selectedIndex = c.selectedIndex; + } + + void UpdateSelectionController(int index) + { + if (_selectionController != null && !_selectionController.changing + && index < _selectionController.pageCount) + { + Controller c = _selectionController; + _selectionController = null; + c.selectedIndex = index; + _selectionController = c; + } + } + + /// + /// Scroll the list to make an item with certain index visible. + /// + /// Item index + public void ScrollToView(int index) + { + ScrollToView(index, false); + } + + /// + /// Scroll the list to make an item with certain index visible. + /// + /// Item index + /// True to scroll smoothly, othewise immdediately. + public void ScrollToView(int index, bool ani) + { + ScrollToView(index, ani, false); + } + + /// + /// Scroll the list to make an item with certain index visible. + /// + /// Item index + /// True to scroll smoothly, othewise immdediately. + /// If true, scroll to make the target on the top/left; If false, scroll to make the target any position in view. + public void ScrollToView(int index, bool ani, bool setFirst) + { + if (_virtual) + { + if (_numItems == 0) + return; + + CheckVirtualList(); + + if (index >= _virtualItems.Count) + throw new Exception("Invalid child index: " + index + ">" + _virtualItems.Count); + + if (_loop) + index = Mathf.FloorToInt((float)_firstIndex / _numItems) * _numItems + index; + + Rect rect; + ItemInfo ii = _virtualItems[index]; + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + float pos = 0; + for (int i = _curLineItemCount - 1; i < index; i += _curLineItemCount) + pos += _virtualItems[i].size.y + _lineGap; + rect = new Rect(0, pos, _itemSize.x, ii.size.y); + } + else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical) + { + float pos = 0; + for (int i = _curLineItemCount - 1; i < index; i += _curLineItemCount) + pos += _virtualItems[i].size.x + _columnGap; + rect = new Rect(pos, 0, ii.size.x, _itemSize.y); + } + else + { + int page = index / (_curLineItemCount * _curLineItemCount2); + rect = new Rect(page * viewWidth + (index % _curLineItemCount) * (ii.size.x + _columnGap), + (index / _curLineItemCount) % _curLineItemCount2 * (ii.size.y + _lineGap), + ii.size.x, ii.size.y); + } + + if (this.scrollPane != null) + scrollPane.ScrollToView(rect, ani, setFirst); + else if (parent != null && parent.scrollPane != null) + parent.scrollPane.ScrollToView(this.TransformRect(rect, parent), ani, setFirst); + } + else + { + GObject obj = GetChildAt(index); + if (this.scrollPane != null) + scrollPane.ScrollToView(obj, ani, setFirst); + else if (parent != null && parent.scrollPane != null) + parent.scrollPane.ScrollToView(obj, ani, setFirst); + } + } + + /// + /// 获å–当å‰ç‚¹å‡»å“ªä¸ªitem + /// + public GObject touchItem + { + get + { + //find out which item is under finger + //é€å±‚å¾€ä¸ŠçŸ¥é“æŸ¥åˆ°ç‚¹å‡»äº†é‚£ä¸ªitem + GObject obj = GRoot.inst.touchTarget; + GObject p = obj.parent; + while (p != null) + { + if (p == this) + return obj; + + obj = p; + p = p.parent; + } + + return null; + } + } + + /// + /// Get first child in view. + /// + /// + public override int GetFirstChildInView() + { + return ChildIndexToItemIndex(base.GetFirstChildInView()); + } + + public int ChildIndexToItemIndex(int index) + { + if (!_virtual) + return index; + + if (_layout == ListLayoutType.Pagination) + { + for (int i = _firstIndex; i < _realNumItems; i++) + { + if (_virtualItems[i].obj != null) + { + index--; + if (index < 0) + return i; + } + } + + return index; + } + else + { + index += _firstIndex; + if (_loop && _numItems > 0) + index = index % _numItems; + + return index; + } + } + + public int ItemIndexToChildIndex(int index) + { + if (!_virtual) + return index; + + if (_layout == ListLayoutType.Pagination) + { + return GetChildIndex(_virtualItems[index].obj); + } + else + { + if (_loop && _numItems > 0) + { + int j = _firstIndex % _numItems; + if (index >= j) + index = index - j; + else + index = _numItems - j + index; + } + else + index -= _firstIndex; + + return index; + } + } + + + /// + /// Set the list to be virtual list. + /// 设置列表为虚拟列表模å¼ã€‚在虚拟列表模å¼ä¸‹ï¼Œåˆ—表ä¸ä¼šä¸ºæ¯ä¸€æ¡åˆ—表数æ®åˆ›å»ºä¸€ä¸ªå®žä½“对象,而是根æ®è§†å£å¤§å°åˆ›å»ºæœ€å°é‡çš„æ˜¾ç¤ºå¯¹è±¡ï¼Œç„¶åŽé€šè¿‡itemRenderer指定的回调函数设置列表数æ®ã€‚ + /// 在虚拟模å¼ä¸‹ï¼Œä½ ä¸èƒ½é€šè¿‡AddChildã€RemoveChild等方å¼ç®¡ç†åˆ—表,åªèƒ½é€šè¿‡è®¾ç½®numItems设置列表数æ®çš„长度。 + /// 如果è¦åˆ·æ–°åˆ—表,å¯ä»¥é€šè¿‡é‡æ–°è®¾ç½®numItems,或者调用RefreshVirtualList完æˆã€‚ + /// ‘å•行’或者‘å•åˆ—â€™çš„åˆ—è¡¨å¸ƒå±€å¯æ”¯æŒä¸ç­‰é«˜çš„列表项目。 + /// 除了‘页é¢â€™çš„åˆ—è¡¨å¸ƒå±€ï¼Œå…¶ä»–å¸ƒå±€å‡æ”¯æŒä½¿ç”¨ä¸åŒèµ„æºæž„建列表项目,你å¯ä»¥åœ¨itemProvideré‡Œè¿”å›žã€‚å¦‚æžœä¸æä¾›ï¼Œé»˜è®¤ä½¿ç”¨defaultItem。 + /// + public void SetVirtual() + { + SetVirtual(false); + } + + public bool isVirtual + { + get { return _virtual; } + } + + /// + /// Set the list to be virtual list, and has loop behavior. + /// + public void SetVirtualAndLoop() + { + SetVirtual(true); + } + + void SetVirtual(bool loop) + { + if (!_virtual) + { + if (this.scrollPane == null) + Debug.LogError("FairyGUI: Virtual list must be scrollable!"); + + if (loop) + { + if (_layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.FlowVertical) + Debug.LogError("FairyGUI: Loop list is not supported for FlowHorizontal or FlowVertical layout!"); + + this.scrollPane.bouncebackEffect = false; + } + + _virtual = true; + _loop = loop; + _virtualItems = new List(); + RemoveChildrenToPool(); + + if (_itemSize.x == 0 || _itemSize.y == 0) + { + GObject obj = GetFromPool(null); + if (obj == null) + { + Debug.LogError("FairyGUI: Virtual List must have a default list item resource."); + _itemSize = new Vector2(100, 100); + } + else + { + _itemSize = obj.size; + _itemSize.x = Mathf.CeilToInt(_itemSize.x); + _itemSize.y = Mathf.CeilToInt(_itemSize.y); + ReturnToPool(obj); + } + } + + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + this.scrollPane.scrollStep = _itemSize.y; + if (_loop) + this.scrollPane._loop = 2; + } + else + { + this.scrollPane.scrollStep = _itemSize.x; + if (_loop) + this.scrollPane._loop = 1; + } + + this.scrollPane.onScroll.AddCapture(__scrolled); + SetVirtualListChangedFlag(true); + } + } + + /// + /// Set the list item count. + /// If the list is not virtual, specified number of items will be created. + /// If the list is virtual, only items in view will be created. + /// + public int numItems + { + get + { + if (_virtual) + return _numItems; + else + return _children.Count; + } + set + { + if (_virtual) + { + if (itemRenderer == null) + throw new Exception("FairyGUI: Set itemRenderer first!"); + + _numItems = value; + if (_loop) + _realNumItems = _numItems * 6;//设置6倿•°é‡ï¼Œç”¨äºŽå¾ªçŽ¯æ»šåŠ¨ + else + _realNumItems = _numItems; + + //_virtualItems的设计是åªå¢žä¸å‡çš„ + int oldCount = _virtualItems.Count; + if (_realNumItems > oldCount) + { + for (int i = oldCount; i < _realNumItems; i++) + { + ItemInfo ii = new ItemInfo(); + ii.size = _itemSize; + + _virtualItems.Add(ii); + } + } + else + { + for (int i = _realNumItems; i < oldCount; i++) + _virtualItems[i].selected = false; + } + + if (_virtualListChanged != 0) + Timers.inst.Remove(this.RefreshVirtualList); + //ç«‹å³åˆ·æ–° + this.RefreshVirtualList(null); + } + else + { + int cnt = _children.Count; + if (value > cnt) + { + for (int i = cnt; i < value; i++) + { + if (itemProvider == null) + AddItemFromPool(); + else + AddItemFromPool(itemProvider(i)); + } + } + else + { + RemoveChildrenToPool(value, cnt); + } + + if (itemRenderer != null) + { + for (int i = 0; i < value; i++) + itemRenderer(i, GetChildAt(i)); + } + } + } + } + + public void RefreshVirtualList() + { + if (!_virtual) + throw new Exception("FairyGUI: not virtual list"); + + SetVirtualListChangedFlag(false); + } + + void CheckVirtualList() + { + if (_virtualListChanged != 0) + { + this.RefreshVirtualList(null); + Timers.inst.Remove(this.RefreshVirtualList); + } + } + + void SetVirtualListChangedFlag(bool layoutChanged) + { + if (layoutChanged) + _virtualListChanged = 2; + else if (_virtualListChanged == 0) + _virtualListChanged = 1; + + Timers.inst.CallLater(RefreshVirtualList); + } + + void RefreshVirtualList(object param) + { + bool layoutChanged = _virtualListChanged == 2; + _virtualListChanged = 0; + _miscFlags |= 1; + + if (layoutChanged) + { + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.SingleRow) + _curLineItemCount = 1; + else if (_layout == ListLayoutType.FlowHorizontal) + { + if (_columnCount > 0) + _curLineItemCount = _columnCount; + else + { + _curLineItemCount = Mathf.FloorToInt((this.scrollPane.viewWidth + _columnGap) / (_itemSize.x + _columnGap)); + if (_curLineItemCount <= 0) + _curLineItemCount = 1; + } + } + else if (_layout == ListLayoutType.FlowVertical) + { + if (_lineCount > 0) + _curLineItemCount = _lineCount; + else + { + _curLineItemCount = Mathf.FloorToInt((this.scrollPane.viewHeight + _lineGap) / (_itemSize.y + _lineGap)); + if (_curLineItemCount <= 0) + _curLineItemCount = 1; + } + } + else //pagination + { + if (_columnCount > 0) + _curLineItemCount = _columnCount; + else + { + _curLineItemCount = Mathf.FloorToInt((this.scrollPane.viewWidth + _columnGap) / (_itemSize.x + _columnGap)); + if (_curLineItemCount <= 0) + _curLineItemCount = 1; + } + + if (_lineCount > 0) + _curLineItemCount2 = _lineCount; + else + { + _curLineItemCount2 = Mathf.FloorToInt((this.scrollPane.viewHeight + _lineGap) / (_itemSize.y + _lineGap)); + if (_curLineItemCount2 <= 0) + _curLineItemCount2 = 1; + } + } + } + + float ch = 0, cw = 0; + if (_realNumItems > 0) + { + int len = Mathf.CeilToInt((float)_realNumItems / _curLineItemCount) * _curLineItemCount; + int len2 = Math.Min(_curLineItemCount, _realNumItems); + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + for (int i = 0; i < len; i += _curLineItemCount) + ch += _virtualItems[i].size.y + _lineGap; + if (ch > 0) + ch -= _lineGap; + + if (_autoResizeItem) + cw = scrollPane.viewWidth; + else + { + for (int i = 0; i < len2; i++) + cw += _virtualItems[i].size.x + _columnGap; + if (cw > 0) + cw -= _columnGap; + } + } + else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical) + { + for (int i = 0; i < len; i += _curLineItemCount) + cw += _virtualItems[i].size.x + _columnGap; + if (cw > 0) + cw -= _columnGap; + + if (_autoResizeItem) + ch = this.scrollPane.viewHeight; + else + { + for (int i = 0; i < len2; i++) + ch += _virtualItems[i].size.y + _lineGap; + if (ch > 0) + ch -= _lineGap; + } + } + else + { + int pageCount = Mathf.CeilToInt((float)len / (_curLineItemCount * _curLineItemCount2)); + cw = pageCount * viewWidth; + ch = viewHeight; + } + } + + HandleAlign(cw, ch); + this.scrollPane.SetContentSize(cw, ch); + + _miscFlags &= 0xFE; + + HandleScroll(true); + } + + void __scrolled(EventContext context) + { + HandleScroll(false); + } + + int GetIndexOnPos1(ref float pos, bool forceUpdate) + { + if (_realNumItems < _curLineItemCount) + { + pos = 0; + return 0; + } + + if (numChildren > 0 && !forceUpdate) + { + float pos2 = this.GetChildAt(0).y; + if (pos2 + (_lineGap > 0 ? 0 : -_lineGap) > pos) + { + for (int i = _firstIndex - _curLineItemCount; i >= 0; i -= _curLineItemCount) + { + pos2 -= (_virtualItems[i].size.y + _lineGap); + if (pos2 <= pos) + { + pos = pos2; + return i; + } + } + + pos = 0; + return 0; + } + else + { + float testGap = _lineGap > 0 ? _lineGap : 0; + for (int i = _firstIndex; i < _realNumItems; i += _curLineItemCount) + { + float pos3 = pos2 + _virtualItems[i].size.y; + if (pos3 + testGap > pos) + { + pos = pos2; + return i; + } + pos2 = pos3 + _lineGap; + } + + pos = pos2; + return _realNumItems - _curLineItemCount; + } + } + else + { + float pos2 = 0; + float testGap = _lineGap > 0 ? _lineGap : 0; + for (int i = 0; i < _realNumItems; i += _curLineItemCount) + { + float pos3 = pos2 + _virtualItems[i].size.y; + if (pos3 + testGap > pos) + { + pos = pos2; + return i; + } + pos2 = pos3 + _lineGap; + } + + pos = pos2; + return _realNumItems - _curLineItemCount; + } + } + + int GetIndexOnPos2(ref float pos, bool forceUpdate) + { + if (_realNumItems < _curLineItemCount) + { + pos = 0; + return 0; + } + + if (numChildren > 0 && !forceUpdate) + { + float pos2 = this.GetChildAt(0).x; + if (pos2 + (_columnGap > 0 ? 0 : -_columnGap) > pos) + { + for (int i = _firstIndex - _curLineItemCount; i >= 0; i -= _curLineItemCount) + { + pos2 -= (_virtualItems[i].size.x + _columnGap); + if (pos2 <= pos) + { + pos = pos2; + return i; + } + } + + pos = 0; + return 0; + } + else + { + float testGap = _columnGap > 0 ? _columnGap : 0; + for (int i = _firstIndex; i < _realNumItems; i += _curLineItemCount) + { + float pos3 = pos2 + _virtualItems[i].size.x; + if (pos3 + testGap > pos) + { + pos = pos2; + return i; + } + pos2 = pos3 + _columnGap; + } + + pos = pos2; + return _realNumItems - _curLineItemCount; + } + } + else + { + float pos2 = 0; + float testGap = _columnGap > 0 ? _columnGap : 0; + for (int i = 0; i < _realNumItems; i += _curLineItemCount) + { + float pos3 = pos2 + _virtualItems[i].size.x; + if (pos3 + testGap > pos) + { + pos = pos2; + return i; + } + pos2 = pos3 + _columnGap; + } + + pos = pos2; + return _realNumItems - _curLineItemCount; + } + } + + int GetIndexOnPos3(ref float pos, bool forceUpdate) + { + if (_realNumItems < _curLineItemCount) + { + pos = 0; + return 0; + } + + float viewWidth = this.viewWidth; + int page = Mathf.FloorToInt(pos / viewWidth); + int startIndex = page * (_curLineItemCount * _curLineItemCount2); + float pos2 = page * viewWidth; + float testGap = _columnGap > 0 ? _columnGap : 0; + for (int i = 0; i < _curLineItemCount; i++) + { + float pos3 = pos2 + _virtualItems[startIndex + i].size.x; + if (pos3 + testGap > pos) + { + pos = pos2; + return startIndex + i; + } + pos2 = pos3 + _columnGap; + } + + pos = pos2; + return startIndex + _curLineItemCount - 1; + } + + void HandleScroll(bool forceUpdate) + { + if ((_miscFlags & 1) != 0) + return; + + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + int enterCounter = 0; + while (HandleScroll1(forceUpdate)) + { + //å¯èƒ½ä¼šå› ä¸ºITEMèµ„æºæ”¹å˜å¯¼è‡´ITEM大å°å‘生改å˜ï¼Œæ‰€æœ‰å‡ºçŽ°æœ€åŽä¸€é¡µå¡«ä¸æ»¡çš„æƒ…况,这时è¦åå¤å°è¯•填满。 + enterCounter++; + forceUpdate = false; + if (enterCounter > 20) + { + Debug.Log("FairyGUI: list will never be filled as the item renderer function always returns a different size."); + break; + } + } + + HandleArchOrder1(); + } + else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical) + { + int enterCounter = 0; + while (HandleScroll2(forceUpdate)) + { + enterCounter++; + forceUpdate = false; + if (enterCounter > 20) + { + Debug.Log("FairyGUI: list will never be filled as the item renderer function always returns a different size."); + break; + } + } + + HandleArchOrder2(); + } + else + { + HandleScroll3(forceUpdate); + } + + _boundsChanged = false; + } + + bool HandleScroll1(bool forceUpdate) + { + float pos = scrollPane.scrollingPosY; + float max = pos + scrollPane.viewHeight; + bool end = max == scrollPane.contentHeight;//这个标志表示当å‰éœ€è¦æ»šåŠ¨åˆ°æœ€æœ«ï¼Œæ— è®ºå†…å®¹å˜åŒ–å¤§å° + + //寻找当å‰ä½ç½®çš„第一æ¡é¡¹ç›® + int newFirstIndex = GetIndexOnPos1(ref pos, forceUpdate); + if (newFirstIndex == _firstIndex && !forceUpdate) + return false; + + int oldFirstIndex = _firstIndex; + _firstIndex = newFirstIndex; + int curIndex = newFirstIndex; + bool forward = oldFirstIndex > newFirstIndex; + int childCount = this.numChildren; + int lastIndex = oldFirstIndex + childCount - 1; + int reuseIndex = forward ? lastIndex : oldFirstIndex; + float curX = 0, curY = pos; + bool needRender; + float deltaSize = 0; + float firstItemDeltaSize = 0; + string url = _defaultItem; + int partSize = (int)((scrollPane.viewWidth - _columnGap * (_curLineItemCount - 1)) / _curLineItemCount); + + itemInfoVer++; + while (curIndex < _realNumItems && (end || curY < max)) + { + ItemInfo ii = _virtualItems[curIndex]; + + if (ii.obj == null || forceUpdate) + { + if (itemProvider != null) + { + url = itemProvider(curIndex % _numItems); + if (url == null) + url = _defaultItem; + url = UIPackage.NormalizeURL(url); + } + + if (ii.obj != null && ii.obj.resourceURL != url) + { + if (ii.obj is GButton) + ii.selected = ((GButton)ii.obj).selected; + RemoveChildToPool(ii.obj); + ii.obj = null; + } + } + + if (ii.obj == null) + { + //æœç´¢æœ€é€‚åˆçš„é‡ç”¨item,ä¿è¯æ¯æ¬¡åˆ·æ–°éœ€è¦æ–°å»ºæˆ–è€…é‡æ–°renderçš„item最少 + if (forward) + { + for (int j = reuseIndex; j >= oldFirstIndex; j--) + { + ItemInfo ii2 = _virtualItems[j]; + if (ii2.obj != null && ii2.updateFlag != itemInfoVer && ii2.obj.resourceURL == url) + { + if (ii2.obj is GButton) + ii2.selected = ((GButton)ii2.obj).selected; + ii.obj = ii2.obj; + ii2.obj = null; + if (j == reuseIndex) + reuseIndex--; + break; + } + } + } + else + { + for (int j = reuseIndex; j <= lastIndex; j++) + { + ItemInfo ii2 = _virtualItems[j]; + if (ii2.obj != null && ii2.updateFlag != itemInfoVer && ii2.obj.resourceURL == url) + { + if (ii2.obj is GButton) + ii2.selected = ((GButton)ii2.obj).selected; + ii.obj = ii2.obj; + ii2.obj = null; + if (j == reuseIndex) + reuseIndex++; + break; + } + } + } + + if (ii.obj != null) + { + SetChildIndex(ii.obj, forward ? curIndex - newFirstIndex : numChildren); + } + else + { + ii.obj = _pool.GetObject(url); + if (forward) + this.AddChildAt(ii.obj, curIndex - newFirstIndex); + else + this.AddChild(ii.obj); + } + if (ii.obj is GButton) + ((GButton)ii.obj).selected = ii.selected; + + needRender = true; + } + else + needRender = forceUpdate; + + if (needRender) + { + if (_autoResizeItem && (_layout == ListLayoutType.SingleColumn || _columnCount > 0)) + ii.obj.SetSize(partSize, ii.obj.height, true); + + itemRenderer(curIndex % _numItems, ii.obj); + if (curIndex % _curLineItemCount == 0) + { + deltaSize += Mathf.CeilToInt(ii.obj.size.y) - ii.size.y; + if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) + { + //当内容å‘下滚动时,如果新出现的项目大å°å‘生å˜åŒ–,需è¦åšä¸€ä¸ªä½ç½®è¡¥å¿ï¼Œæ‰ä¸ä¼šå¯¼è‡´æ»šåŠ¨è·³åŠ¨ + firstItemDeltaSize = Mathf.CeilToInt(ii.obj.size.y) - ii.size.y; + } + } + ii.size.x = Mathf.CeilToInt(ii.obj.size.x); + ii.size.y = Mathf.CeilToInt(ii.obj.size.y); + } + + ii.updateFlag = itemInfoVer; + ii.obj.SetXY(curX, curY); + if (curIndex == newFirstIndex) //è¦æ˜¾ç¤ºå¤šä¸€æ¡æ‰ä¸ä¼šç©¿å¸® + max += ii.size.y; + + curX += ii.size.x + _columnGap; + + if (curIndex % _curLineItemCount == _curLineItemCount - 1) + { + curX = 0; + curY += ii.size.y + _lineGap; + } + curIndex++; + } + + for (int i = 0; i < childCount; i++) + { + ItemInfo ii = _virtualItems[oldFirstIndex + i]; + if (ii.updateFlag != itemInfoVer && ii.obj != null) + { + if (ii.obj is GButton) + ii.selected = ((GButton)ii.obj).selected; + RemoveChildToPool(ii.obj); + ii.obj = null; + } + } + + childCount = _children.Count; + for (int i = 0; i < childCount; i++) + { + GObject obj = _virtualItems[newFirstIndex + i].obj; + if (_children[i] != obj) + SetChildIndex(obj, i); + } + + if (deltaSize != 0 || firstItemDeltaSize != 0) + this.scrollPane.ChangeContentSizeOnScrolling(0, deltaSize, 0, firstItemDeltaSize); + + if (curIndex > 0 && this.numChildren > 0 && this.container.y <= 0 && GetChildAt(0).y > -this.container.y)//最åŽä¸€é¡µæ²¡å¡«æ»¡ï¼ + return true; + else + return false; + } + + bool HandleScroll2(bool forceUpdate) + { + float pos = scrollPane.scrollingPosX; + float max = pos + scrollPane.viewWidth; + bool end = pos == scrollPane.contentWidth;//这个标志表示当å‰éœ€è¦æ»šåŠ¨åˆ°æœ€æœ«ï¼Œæ— è®ºå†…å®¹å˜åŒ–å¤§å° + + //寻找当å‰ä½ç½®çš„第一æ¡é¡¹ç›® + int newFirstIndex = GetIndexOnPos2(ref pos, forceUpdate); + if (newFirstIndex == _firstIndex && !forceUpdate) + return false; + + int oldFirstIndex = _firstIndex; + _firstIndex = newFirstIndex; + int curIndex = newFirstIndex; + bool forward = oldFirstIndex > newFirstIndex; + int childCount = this.numChildren; + int lastIndex = oldFirstIndex + childCount - 1; + int reuseIndex = forward ? lastIndex : oldFirstIndex; + float curX = pos, curY = 0; + bool needRender; + float deltaSize = 0; + float firstItemDeltaSize = 0; + string url = _defaultItem; + int partSize = (int)((scrollPane.viewHeight - _lineGap * (_curLineItemCount - 1)) / _curLineItemCount); + + itemInfoVer++; + while (curIndex < _realNumItems && (end || curX < max)) + { + ItemInfo ii = _virtualItems[curIndex]; + + if (ii.obj == null || forceUpdate) + { + if (itemProvider != null) + { + url = itemProvider(curIndex % _numItems); + if (url == null) + url = _defaultItem; + url = UIPackage.NormalizeURL(url); + } + + if (ii.obj != null && ii.obj.resourceURL != url) + { + if (ii.obj is GButton) + ii.selected = ((GButton)ii.obj).selected; + RemoveChildToPool(ii.obj); + ii.obj = null; + } + } + + if (ii.obj == null) + { + if (forward) + { + for (int j = reuseIndex; j >= oldFirstIndex; j--) + { + ItemInfo ii2 = _virtualItems[j]; + if (ii2.obj != null && ii2.updateFlag != itemInfoVer && ii2.obj.resourceURL == url) + { + if (ii2.obj is GButton) + ii2.selected = ((GButton)ii2.obj).selected; + ii.obj = ii2.obj; + ii2.obj = null; + if (j == reuseIndex) + reuseIndex--; + break; + } + } + } + else + { + for (int j = reuseIndex; j <= lastIndex; j++) + { + ItemInfo ii2 = _virtualItems[j]; + if (ii2.obj != null && ii2.updateFlag != itemInfoVer && ii2.obj.resourceURL == url) + { + if (ii2.obj is GButton) + ii2.selected = ((GButton)ii2.obj).selected; + ii.obj = ii2.obj; + ii2.obj = null; + if (j == reuseIndex) + reuseIndex++; + break; + } + } + } + + if (ii.obj != null) + { + SetChildIndex(ii.obj, forward ? curIndex - newFirstIndex : numChildren); + } + else + { + ii.obj = _pool.GetObject(url); + if (forward) + this.AddChildAt(ii.obj, curIndex - newFirstIndex); + else + this.AddChild(ii.obj); + } + if (ii.obj is GButton) + ((GButton)ii.obj).selected = ii.selected; + + needRender = true; + } + else + needRender = forceUpdate; + + if (needRender) + { + if (_autoResizeItem && (_layout == ListLayoutType.SingleRow || _lineCount > 0)) + ii.obj.SetSize(ii.obj.width, partSize, true); + + itemRenderer(curIndex % _numItems, ii.obj); + if (curIndex % _curLineItemCount == 0) + { + deltaSize += Mathf.CeilToInt(ii.obj.size.x) - ii.size.x; + if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) + { + //当内容å‘下滚动时,如果新出现的一个项目大å°å‘生å˜åŒ–,需è¦åšä¸€ä¸ªä½ç½®è¡¥å¿ï¼Œæ‰ä¸ä¼šå¯¼è‡´æ»šåŠ¨è·³åŠ¨ + firstItemDeltaSize = Mathf.CeilToInt(ii.obj.size.x) - ii.size.x; + } + } + ii.size.x = Mathf.CeilToInt(ii.obj.size.x); + ii.size.y = Mathf.CeilToInt(ii.obj.size.y); + } + + ii.updateFlag = itemInfoVer; + ii.obj.SetXY(curX, curY); + if (curIndex == newFirstIndex) //è¦æ˜¾ç¤ºå¤šä¸€æ¡æ‰ä¸ä¼šç©¿å¸® + max += ii.size.x; + + curY += ii.size.y + _lineGap; + + if (curIndex % _curLineItemCount == _curLineItemCount - 1) + { + curY = 0; + curX += ii.size.x + _columnGap; + } + curIndex++; + } + + for (int i = 0; i < childCount; i++) + { + ItemInfo ii = _virtualItems[oldFirstIndex + i]; + if (ii.updateFlag != itemInfoVer && ii.obj != null) + { + if (ii.obj is GButton) + ii.selected = ((GButton)ii.obj).selected; + RemoveChildToPool(ii.obj); + ii.obj = null; + } + } + + childCount = _children.Count; + for (int i = 0; i < childCount; i++) + { + GObject obj = _virtualItems[newFirstIndex + i].obj; + if (_children[i] != obj) + SetChildIndex(obj, i); + } + + if (deltaSize != 0 || firstItemDeltaSize != 0) + this.scrollPane.ChangeContentSizeOnScrolling(deltaSize, 0, firstItemDeltaSize, 0); + + if (curIndex > 0 && this.numChildren > 0 && this.container.x <= 0 && GetChildAt(0).x > -this.container.x)//最åŽä¸€é¡µæ²¡å¡«æ»¡ï¼ + return true; + else + return false; + } + + void HandleScroll3(bool forceUpdate) + { + float pos = scrollPane.scrollingPosX; + + //寻找当å‰ä½ç½®çš„第一æ¡é¡¹ç›® + int newFirstIndex = GetIndexOnPos3(ref pos, forceUpdate); + if (newFirstIndex == _firstIndex && !forceUpdate) + return; + + int oldFirstIndex = _firstIndex; + _firstIndex = newFirstIndex; + + //分页模å¼ä¸æ”¯æŒä¸ç­‰é«˜ï¼Œæ‰€ä»¥æ¸²æŸ“满一页就好了 + + int reuseIndex = oldFirstIndex; + int virtualItemCount = _virtualItems.Count; + int pageSize = _curLineItemCount * _curLineItemCount2; + int startCol = newFirstIndex % _curLineItemCount; + float viewWidth = this.viewWidth; + int page = (int)(newFirstIndex / pageSize); + int startIndex = page * pageSize; + int lastIndex = startIndex + pageSize * 2; //测试两页 + bool needRender; + string url = _defaultItem; + int partWidth = (int)((scrollPane.viewWidth - _columnGap * (_curLineItemCount - 1)) / _curLineItemCount); + int partHeight = (int)((scrollPane.viewHeight - _lineGap * (_curLineItemCount2 - 1)) / _curLineItemCount2); + itemInfoVer++; + + //先标记这次è¦ç”¨åˆ°çš„项目 + for (int i = startIndex; i < lastIndex; i++) + { + if (i >= _realNumItems) + continue; + + int col = i % _curLineItemCount; + if (i - startIndex < pageSize) + { + if (col < startCol) + continue; + } + else + { + if (col > startCol) + continue; + } + + ItemInfo ii = _virtualItems[i]; + ii.updateFlag = itemInfoVer; + } + + GObject lastObj = null; + int insertIndex = 0; + for (int i = startIndex; i < lastIndex; i++) + { + if (i >= _realNumItems) + continue; + + ItemInfo ii = _virtualItems[i]; + if (ii.updateFlag != itemInfoVer) + continue; + + if (ii.obj == null) + { + //寻找看有没有å¯é‡ç”¨çš„ + while (reuseIndex < virtualItemCount) + { + ItemInfo ii2 = _virtualItems[reuseIndex]; + if (ii2.obj != null && ii2.updateFlag != itemInfoVer) + { + if (ii2.obj is GButton) + ii2.selected = ((GButton)ii2.obj).selected; + ii.obj = ii2.obj; + ii2.obj = null; + break; + } + reuseIndex++; + } + + if (insertIndex == -1) + insertIndex = GetChildIndex(lastObj) + 1; + + if (ii.obj == null) + { + if (itemProvider != null) + { + url = itemProvider(i % _numItems); + if (url == null) + url = _defaultItem; + url = UIPackage.NormalizeURL(url); + } + + ii.obj = _pool.GetObject(url); + this.AddChildAt(ii.obj, insertIndex); + } + else + { + insertIndex = SetChildIndexBefore(ii.obj, insertIndex); + } + insertIndex++; + + if (ii.obj is GButton) + ((GButton)ii.obj).selected = ii.selected; + + needRender = true; + } + else + { + needRender = forceUpdate; + insertIndex = -1; + lastObj = ii.obj; + } + + if (needRender) + { + if (_autoResizeItem) + { + if (_curLineItemCount == _columnCount && _curLineItemCount2 == _lineCount) + ii.obj.SetSize(partWidth, partHeight, true); + else if (_curLineItemCount == _columnCount) + ii.obj.SetSize(partWidth, ii.obj.height, true); + else if (_curLineItemCount2 == _lineCount) + ii.obj.SetSize(ii.obj.width, partHeight, true); + } + + itemRenderer(i % _numItems, ii.obj); + ii.size.x = Mathf.CeilToInt(ii.obj.size.x); + ii.size.y = Mathf.CeilToInt(ii.obj.size.y); + } + } + + //排列item + float borderX = (startIndex / pageSize) * viewWidth; + float xx = borderX; + float yy = 0; + float lineHeight = 0; + for (int i = startIndex; i < lastIndex; i++) + { + if (i >= _realNumItems) + continue; + + ItemInfo ii = _virtualItems[i]; + if (ii.updateFlag == itemInfoVer) + ii.obj.SetXY(xx, yy); + + if (ii.size.y > lineHeight) + lineHeight = ii.size.y; + if (i % _curLineItemCount == _curLineItemCount - 1) + { + xx = borderX; + yy += lineHeight + _lineGap; + lineHeight = 0; + + if (i == startIndex + pageSize - 1) + { + borderX += viewWidth; + xx = borderX; + yy = 0; + } + } + else + xx += ii.size.x + _columnGap; + } + + //释放未使用的 + for (int i = reuseIndex; i < virtualItemCount; i++) + { + ItemInfo ii = _virtualItems[i]; + if (ii.updateFlag != itemInfoVer && ii.obj != null) + { + if (ii.obj is GButton) + ii.selected = ((GButton)ii.obj).selected; + RemoveChildToPool(ii.obj); + ii.obj = null; + } + } + } + + void HandleArchOrder1() + { + if (this.childrenRenderOrder == ChildrenRenderOrder.Arch) + { + float mid = this.scrollPane.posY + this.viewHeight / 2; + float minDist = int.MaxValue, dist; + int apexIndex = 0; + int cnt = this.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject obj = GetChildAt(i); + if (!foldInvisibleItems || obj.visible) + { + dist = Mathf.Abs(mid - obj.y - obj.height / 2); + if (dist < minDist) + { + minDist = dist; + apexIndex = i; + } + } + } + this.apexIndex = apexIndex; + } + } + + void HandleArchOrder2() + { + if (this.childrenRenderOrder == ChildrenRenderOrder.Arch) + { + float mid = this.scrollPane.posX + this.viewWidth / 2; + float minDist = int.MaxValue, dist; + int apexIndex = 0; + int cnt = this.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject obj = GetChildAt(i); + if (!foldInvisibleItems || obj.visible) + { + dist = Mathf.Abs(mid - obj.x - obj.width / 2); + if (dist < minDist) + { + minDist = dist; + apexIndex = i; + } + } + } + this.apexIndex = apexIndex; + } + } + + override public void GetSnappingPositionWithDir(ref float xValue, ref float yValue, float xDir, float yDir) + { + if (_virtual) + { + if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal) + { + float saved = yValue; + int index = GetIndexOnPos1(ref yValue, false); + if (index < _virtualItems.Count && index < _realNumItems) + { + float size = _virtualItems[index].size.y; + if (ShouldSnapToNext(yDir, saved - yValue, size)) + yValue += size + _lineGap; + } + } + else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical) + { + float saved = xValue; + int index = GetIndexOnPos2(ref xValue, false); + if (index < _virtualItems.Count && index < _realNumItems) + { + float size = _virtualItems[index].size.x; + if (ShouldSnapToNext(xDir, saved - xValue, size)) + xValue += size + _columnGap; + } + } + else + { + float saved = xValue; + int index = GetIndexOnPos3(ref xValue, false); + if (index < _virtualItems.Count && index < _realNumItems) + { + float size = _virtualItems[index].size.x; + if (ShouldSnapToNext(xDir, saved - xValue, size)) + xValue += size + _columnGap; + } + } + } + else + base.GetSnappingPositionWithDir(ref xValue, ref yValue, xDir, yDir); + } + + private void HandleAlign(float contentWidth, float contentHeight) + { + Vector2 newOffset = Vector2.zero; + + if (contentHeight < viewHeight) + { + if (_verticalAlign == VertAlignType.Middle) + newOffset.y = (int)((viewHeight - contentHeight) / 2); + else if (_verticalAlign == VertAlignType.Bottom) + newOffset.y = viewHeight - contentHeight; + } + + if (contentWidth < this.viewWidth) + { + if (_align == AlignType.Center) + newOffset.x = (int)((viewWidth - contentWidth) / 2); + else if (_align == AlignType.Right) + newOffset.x = viewWidth - contentWidth; + } + + if (newOffset != _alignOffset) + { + _alignOffset = newOffset; + if (scrollPane != null) + scrollPane.AdjustMaskContainer(); + else + container.SetXY(_margin.left + _alignOffset.x, _margin.top + _alignOffset.y); + } + } + + override protected void UpdateBounds() + { + if (_virtual) + return; + + int cnt = _children.Count; + int i; + int j = 0; + GObject child; + float curX = 0; + float curY = 0; + float cw, ch; + float maxWidth = 0; + float maxHeight = 0; + float viewWidth = this.viewWidth; + float viewHeight = this.viewHeight; + + if (_layout == ListLayoutType.SingleColumn) + { + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (curY != 0) + curY += _lineGap; + child.y = curY; + if (_autoResizeItem) + child.SetSize(viewWidth, child.height, true); + curY += Mathf.CeilToInt(child.height); + if (child.width > maxWidth) + maxWidth = child.width; + } + + ch = curY; + if (ch <= viewHeight && _autoResizeItem && scrollPane != null && scrollPane._displayInDemand && scrollPane.vtScrollBar != null) + { + viewWidth += scrollPane.vtScrollBar.width; + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + child.SetSize(viewWidth, child.height, true); + if (child.width > maxWidth) + maxWidth = child.width; + } + } + cw = Mathf.CeilToInt(maxWidth); + } + else if (_layout == ListLayoutType.SingleRow) + { + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (curX != 0) + curX += _columnGap; + child.x = curX; + if (_autoResizeItem) + child.SetSize(child.width, viewHeight, true); + curX += Mathf.CeilToInt(child.width); + if (child.height > maxHeight) + maxHeight = child.height; + } + + cw = curX; + if (cw <= viewWidth && _autoResizeItem && scrollPane != null && scrollPane._displayInDemand && scrollPane.hzScrollBar != null) + { + viewHeight += scrollPane.hzScrollBar.height; + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + child.SetSize(child.width, viewHeight, true); + if (child.height > maxHeight) + maxHeight = child.height; + } + } + ch = Mathf.CeilToInt(maxHeight); + } + else if (_layout == ListLayoutType.FlowHorizontal) + { + if (_autoResizeItem && _columnCount > 0) + { + float lineSize = 0; + int lineStart = 0; + float remainSize; + float remainPercent; + + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + lineSize += child.sourceWidth; + j++; + if (j == _columnCount || i == cnt - 1) + { + remainSize = viewWidth - (j - 1) * _columnGap; + remainPercent = 1; + curX = 0; + for (j = lineStart; j <= i; j++) + { + child = GetChildAt(j); + if (foldInvisibleItems && !child.visible) + continue; + + child.SetXY(curX, curY); + float perc = child.sourceWidth / lineSize; + child.SetSize(Mathf.Round(perc / remainPercent * remainSize), child.height, true); + remainSize -= child.width; + remainPercent -= perc; + curX += child.width + _columnGap; + + if (child.height > maxHeight) + maxHeight = child.height; + } + //new line + curY += Mathf.CeilToInt(maxHeight) + _lineGap; + maxHeight = 0; + j = 0; + lineStart = i + 1; + lineSize = 0; + } + } + ch = curY + Mathf.CeilToInt(maxHeight); + cw = viewWidth; + } + else + { + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (curX != 0) + curX += _columnGap; + + if (_columnCount != 0 && j >= _columnCount + || _columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) + { + //new line + curX = 0; + curY += Mathf.CeilToInt(maxHeight) + _lineGap; + maxHeight = 0; + j = 0; + } + child.SetXY(curX, curY); + curX += Mathf.CeilToInt(child.width); + if (curX > maxWidth) + maxWidth = curX; + if (child.height > maxHeight) + maxHeight = child.height; + j++; + } + ch = curY + Mathf.CeilToInt(maxHeight); + cw = Mathf.CeilToInt(maxWidth); + } + } + else if (_layout == ListLayoutType.FlowVertical) + { + if (_autoResizeItem && _lineCount > 0) + { + float lineSize = 0; + int lineStart = 0; + float remainSize; + float remainPercent; + + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + lineSize += child.sourceHeight; + j++; + if (j == _lineCount || i == cnt - 1) + { + remainSize = viewHeight - (j - 1) * _lineGap; + remainPercent = 1; + curY = 0; + for (j = lineStart; j <= i; j++) + { + child = GetChildAt(j); + if (foldInvisibleItems && !child.visible) + continue; + + child.SetXY(curX, curY); + float perc = child.sourceHeight / lineSize; + child.SetSize(child.width, Mathf.Round(perc / remainPercent * remainSize), true); + remainSize -= child.height; + remainPercent -= perc; + curY += child.height + _lineGap; + + if (child.width > maxWidth) + maxWidth = child.width; + } + //new line + curX += Mathf.CeilToInt(maxWidth) + _columnGap; + maxWidth = 0; + j = 0; + lineStart = i + 1; + lineSize = 0; + } + } + cw = curX + Mathf.CeilToInt(maxWidth); + ch = viewHeight; + } + else + { + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (curY != 0) + curY += _lineGap; + + if (_lineCount != 0 && j >= _lineCount + || _lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) + { + curY = 0; + curX += Mathf.CeilToInt(maxWidth) + _columnGap; + maxWidth = 0; + j = 0; + } + child.SetXY(curX, curY); + curY += child.height; + if (curY > maxHeight) + maxHeight = curY; + if (child.width > maxWidth) + maxWidth = child.width; + j++; + } + cw = curX + Mathf.CeilToInt(maxWidth); + ch = Mathf.CeilToInt(maxHeight); + } + } + else //pagination + { + int page = 0; + int k = 0; + float eachHeight = 0; + if (_autoResizeItem && _lineCount > 0) + eachHeight = Mathf.Floor((viewHeight - (_lineCount - 1) * _lineGap) / _lineCount); + + if (_autoResizeItem && _columnCount > 0) + { + float lineSize = 0; + int lineStart = 0; + float remainSize; + float remainPercent; + + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (j == 0 && (_lineCount != 0 && k >= _lineCount + || _lineCount == 0 && curY + (_lineCount > 0 ? eachHeight : child.height) > viewHeight)) + { + //new page + page++; + curY = 0; + k = 0; + } + + lineSize += child.sourceWidth; + j++; + if (j == _columnCount || i == cnt - 1) + { + remainSize = viewWidth - (j - 1) * _columnGap; + remainPercent = 1; + curX = 0; + for (j = lineStart; j <= i; j++) + { + child = GetChildAt(j); + if (foldInvisibleItems && !child.visible) + continue; + + child.SetXY(page * viewWidth + curX, curY); + float perc = child.sourceWidth / lineSize; + child.SetSize(Mathf.Round(perc / remainPercent * remainSize), _lineCount > 0 ? eachHeight : child.height, true); + remainSize -= child.width; + remainPercent -= perc; + curX += child.width + _columnGap; + + if (child.height > maxHeight) + maxHeight = child.height; + } + //new line + curY += Mathf.CeilToInt(maxHeight) + _lineGap; + maxHeight = 0; + j = 0; + lineStart = i + 1; + lineSize = 0; + + k++; + } + } + } + else + { + for (i = 0; i < cnt; i++) + { + child = GetChildAt(i); + if (foldInvisibleItems && !child.visible) + continue; + + if (curX != 0) + curX += _columnGap; + + if (_autoResizeItem && _lineCount > 0) + child.SetSize(child.width, eachHeight, true); + + if (_columnCount != 0 && j >= _columnCount + || _columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) + { + curX = 0; + curY += maxHeight + _lineGap; + maxHeight = 0; + j = 0; + k++; + + if (_lineCount != 0 && k >= _lineCount + || _lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0)//new page + { + page++; + curY = 0; + k = 0; + } + } + child.SetXY(page * viewWidth + curX, curY); + curX += Mathf.CeilToInt(child.width); + if (curX > maxWidth) + maxWidth = curX; + if (child.height > maxHeight) + maxHeight = child.height; + j++; + } + } + ch = page > 0 ? viewHeight : (curY + Mathf.CeilToInt(maxHeight)); + cw = (page + 1) * viewWidth; + } + + HandleAlign(cw, ch); + SetBounds(0, 0, cw, ch); + + InvalidateBatchingState(true); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + _layout = (ListLayoutType)buffer.ReadByte(); + selectionMode = (ListSelectionMode)buffer.ReadByte(); + _align = (AlignType)buffer.ReadByte(); + _verticalAlign = (VertAlignType)buffer.ReadByte(); + _lineGap = buffer.ReadShort(); + _columnGap = buffer.ReadShort(); + _lineCount = buffer.ReadShort(); + _columnCount = buffer.ReadShort(); + _autoResizeItem = buffer.ReadBool(); + _childrenRenderOrder = (ChildrenRenderOrder)buffer.ReadByte(); + _apexIndex = buffer.ReadShort(); + + if (buffer.ReadBool()) + { + _margin.top = buffer.ReadInt(); + _margin.bottom = buffer.ReadInt(); + _margin.left = buffer.ReadInt(); + _margin.right = buffer.ReadInt(); + } + + OverflowType overflow = (OverflowType)buffer.ReadByte(); + if (overflow == OverflowType.Scroll) + { + int savedPos = buffer.position; + buffer.Seek(beginPos, 7); + SetupScroll(buffer); + buffer.position = savedPos; + } + else + SetupOverflow(overflow); + + if (buffer.ReadBool()) + { + int i1 = buffer.ReadInt(); + int i2 = buffer.ReadInt(); + this.clipSoftness = new Vector2(i1, i2); + } + + if (buffer.version >= 2) + { + scrollItemToViewOnClick = buffer.ReadBool(); + foldInvisibleItems = buffer.ReadBool(); + } + + buffer.Seek(beginPos, 8); + + _defaultItem = buffer.ReadS(); + ReadItems(buffer); + } + + virtual protected void ReadItems(ByteBuffer buffer) + { + int itemCount = buffer.ReadShort(); + for (int i = 0; i < itemCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + string str = buffer.ReadS(); + if (str == null) + { + str = _defaultItem; + if (string.IsNullOrEmpty(str)) + { + buffer.position = nextPos; + continue; + } + } + + GObject obj = GetFromPool(str); + if (obj != null) + { + AddChild(obj); + SetupItem(buffer, obj); + } + + buffer.position = nextPos; + } + } + + protected void SetupItem(ByteBuffer buffer, GObject obj) + { + string str; + str = buffer.ReadS(); + if (str != null) + obj.text = str; + str = buffer.ReadS(); + if (str != null && (obj is GButton)) + (obj as GButton).selectedTitle = str; + str = buffer.ReadS(); + if (str != null) + obj.icon = str; + str = buffer.ReadS(); + if (str != null && (obj is GButton)) + (obj as GButton).selectedIcon = str; + str = buffer.ReadS(); + if (str != null) + obj.name = str; + + if (obj is GComponent) + { + int cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + Controller cc = ((GComponent)obj).GetController(buffer.ReadS()); + str = buffer.ReadS(); + if (cc != null) + cc.selectedPageId = str; + } + + if (buffer.version >= 2) + { + cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + string target = buffer.ReadS(); + int propertyId = buffer.ReadShort(); + string value = buffer.ReadS(); + GObject obj2 = ((GComponent)obj).GetChildByPath(target); + if (obj2 != null) + { + if (propertyId == 0) + obj2.text = value; + else if (propertyId == 1) + obj2.icon = value; + } + } + } + } + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + buffer.Seek(beginPos, 6); + + int i = buffer.ReadShort(); + if (i != -1) + _selectionController = parent.GetControllerAt(i); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs.meta new file mode 100644 index 00000000..71981287 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GList.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f5eda689519c51b42955139d2c6caba4 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs new file mode 100644 index 00000000..bd604c11 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs @@ -0,0 +1,701 @@ +using System; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GLoader class + /// + public class GLoader : GObject, IAnimationGear, IColorGear + { + /// + /// Display an error sign if the loader fails to load the content. + /// UIConfig.loaderErrorSign muse be set. + /// + public bool showErrorSign; + + string _url; + AlignType _align; + VertAlignType _verticalAlign; + bool _autoSize; + FillType _fill; + bool _shrinkOnly; + bool _updatingLayout; + PackageItem _contentItem; + Action _reloadDelegate; + + MovieClip _content; + GObject _errorSign; + GComponent _content2; + +#if FAIRYGUI_PUERTS + public Action __loadExternal; + public Action __freeExternal; +#endif + + public GLoader() + { + _url = string.Empty; + _align = AlignType.Left; + _verticalAlign = VertAlignType.Top; + showErrorSign = true; + _reloadDelegate = OnExternalReload; + } + + override protected void CreateDisplayObject() + { + displayObject = new Container("GLoader"); + displayObject.gOwner = this; + _content = new MovieClip(); + ((Container)displayObject).AddChild(_content); + ((Container)displayObject).opaque = true; + } + + override public void Dispose() + { + if (_disposed) return; + + if (_content.texture != null) + { + if (_contentItem == null) + { + _content.texture.onSizeChanged -= _reloadDelegate; + try + { + FreeExternal(_content.texture); + } + catch (Exception err) + { + Debug.LogWarning(err); + } + } + } + if (_errorSign != null) + _errorSign.Dispose(); + if (_content2 != null) + _content2.Dispose(); + _content.Dispose(); + + base.Dispose(); + } + + /// + /// + /// + public string url + { + get { return _url; } + set + { + if (_url == value) + return; + + ClearContent(); + _url = value; + LoadContent(); + UpdateGear(7); + } + } + + override public string icon + { + get { return _url; } + set { this.url = value; } + } + + /// + /// + /// + public AlignType align + { + get { return _align; } + set + { + if (_align != value) + { + _align = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public VertAlignType verticalAlign + { + get { return _verticalAlign; } + set + { + if (_verticalAlign != value) + { + _verticalAlign = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public FillType fill + { + get { return _fill; } + set + { + if (_fill != value) + { + _fill = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public bool shrinkOnly + { + get { return _shrinkOnly; } + set + { + if (_shrinkOnly != value) + { + _shrinkOnly = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public bool autoSize + { + get { return _autoSize; } + set + { + if (_autoSize != value) + { + _autoSize = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public bool playing + { + get { return _content.playing; } + set + { + _content.playing = value; + UpdateGear(5); + } + } + + /// + /// + /// + public int frame + { + get { return _content.frame; } + set + { + _content.frame = value; + UpdateGear(5); + } + } + + /// + /// + /// + public float timeScale + { + get { return _content.timeScale; } + set { _content.timeScale = value; } + } + + /// + /// + /// + public bool ignoreEngineTimeScale + { + get { return _content.ignoreEngineTimeScale; } + set { _content.ignoreEngineTimeScale = value; } + } + + /// + /// + /// + /// + public void Advance(float time) + { + _content.Advance(time); + } + + /// + /// + /// + public Material material + { + get { return _content.material; } + set { _content.material = value; } + } + + /// + /// + /// + public string shader + { + get { return _content.shader; } + set { _content.shader = value; } + } + + /// + /// + /// + public Color color + { + get { return _content.color; } + set + { + if (_content.color != value) + { + _content.color = value; + UpdateGear(4); + } + } + } + + /// + /// + /// + public FillMethod fillMethod + { + get { return _content.fillMethod; } + set { _content.fillMethod = value; } + } + + /// + /// + /// + public int fillOrigin + { + get { return _content.fillOrigin; } + set { _content.fillOrigin = value; } + } + + /// + /// + /// + public bool fillClockwise + { + get { return _content.fillClockwise; } + set { _content.fillClockwise = value; } + } + + /// + /// + /// + public float fillAmount + { + get { return _content.fillAmount; } + set { _content.fillAmount = value; } + } + + /// + /// + /// + public Image image + { + get { return _content; } + } + + /// + /// + /// + public MovieClip movieClip + { + get { return _content; } + } + + /// + /// + /// + public GComponent component + { + get { return _content2; } + } + + /// + /// + /// + public NTexture texture + { + get + { + return _content.texture; + } + + set + { + this.url = null; + + _content.texture = value; + if (value != null) + { + sourceWidth = value.width; + sourceHeight = value.height; + } + else + { + sourceWidth = sourceHeight = 0; + } + + UpdateLayout(); + } + } + + override public IFilter filter + { + get { return _content.filter; } + set { _content.filter = value; } + } + + override public BlendMode blendMode + { + get { return _content.blendMode; } + set { _content.blendMode = value; } + } + + /// + /// + /// + protected void LoadContent() + { + ClearContent(); + + if (string.IsNullOrEmpty(_url)) + return; + + if (_url.StartsWith(UIPackage.URL_PREFIX)) + LoadFromPackage(_url); + else + LoadExternal(); + } + + protected void LoadFromPackage(string itemURL) + { + _contentItem = UIPackage.GetItemByURL(itemURL); + + if (_contentItem != null) + { + _contentItem = _contentItem.getBranch(); + sourceWidth = _contentItem.width; + sourceHeight = _contentItem.height; + _contentItem = _contentItem.getHighResolution(); + _contentItem.Load(); + + if (_contentItem.type == PackageItemType.Image) + { + _content.texture = _contentItem.texture; + _content.textureScale = new Vector2(_contentItem.width / (float)sourceWidth, _contentItem.height / (float)sourceHeight); + _content.scale9Grid = _contentItem.scale9Grid; + _content.scaleByTile = _contentItem.scaleByTile; + _content.tileGridIndice = _contentItem.tileGridIndice; + + UpdateLayout(); + } + else if (_contentItem.type == PackageItemType.MovieClip) + { + _content.interval = _contentItem.interval; + _content.swing = _contentItem.swing; + _content.repeatDelay = _contentItem.repeatDelay; + _content.frames = _contentItem.frames; + + UpdateLayout(); + } + else if (_contentItem.type == PackageItemType.Component) + { + GObject obj = UIPackage.CreateObjectFromURL(itemURL); + if (obj == null) + SetErrorState(); + else if (!(obj is GComponent)) + { + obj.Dispose(); + SetErrorState(); + } + else + { + _content2 = (GComponent)obj; + ((Container)displayObject).AddChild(_content2.displayObject); + UpdateLayout(); + } + } + else + { + if (_autoSize) + this.SetSize(_contentItem.width, _contentItem.height); + + SetErrorState(); + + Debug.LogWarning("Unsupported type of GLoader: " + _contentItem.type); + } + } + else + SetErrorState(); + } + + virtual protected void LoadExternal() + { +#if FAIRYGUI_PUERTS + if (__loadExternal != null) { + __loadExternal(); + return; + } +#endif + Texture2D tex = (Texture2D)Resources.Load(_url, typeof(Texture2D)); + if (tex != null) + onExternalLoadSuccess(new NTexture(tex)); + else + onExternalLoadFailed(); + } + + virtual protected void FreeExternal(NTexture texture) + { +#if FAIRYGUI_PUERTS + if (__freeExternal != null) { + __freeExternal(texture); + return; + } +#endif + } + + public void onExternalLoadSuccess(NTexture texture) + { + _content.texture = texture; + sourceWidth = texture.width; + sourceHeight = texture.height; + _content.scale9Grid = null; + _content.scaleByTile = false; + texture.onSizeChanged += _reloadDelegate; + UpdateLayout(); + } + + public void onExternalLoadFailed() + { + SetErrorState(); + } + + void OnExternalReload(NTexture texture) + { + sourceWidth = texture.width; + sourceHeight = texture.height; + UpdateLayout(); + } + + private void SetErrorState() + { + if (!showErrorSign || !Application.isPlaying) + return; + + if (_errorSign == null) + { + if (UIConfig.loaderErrorSign != null) + _errorSign = UIPackage.CreateObjectFromURL(UIConfig.loaderErrorSign); + else + return; + } + + if (_errorSign != null) + { + _errorSign.SetSize(this.width, this.height); + ((Container)displayObject).AddChild(_errorSign.displayObject); + } + } + + protected void ClearErrorState() + { + if (_errorSign != null && _errorSign.displayObject.parent != null) + ((Container)displayObject).RemoveChild(_errorSign.displayObject); + } + + protected void UpdateLayout() + { + if (_content2 == null && _content.texture == null && _content.frames == null) + { + if (_autoSize) + { + _updatingLayout = true; + SetSize(50, 30); + _updatingLayout = false; + } + return; + } + + float contentWidth = sourceWidth; + float contentHeight = sourceHeight; + + if (_autoSize) + { + _updatingLayout = true; + if (contentWidth == 0) + contentWidth = 50; + if (contentHeight == 0) + contentHeight = 30; + SetSize(contentWidth, contentHeight); + + _updatingLayout = false; + + if (_width == contentWidth && _height == contentHeight) + { + if (_content2 != null) + { + _content2.SetXY(0, 0); + _content2.SetScale(1, 1); + } + else + { + _content.SetXY(0, 0); + _content.SetSize(contentWidth, contentHeight); + } + + InvalidateBatchingState(); + return; + } + //如果ä¸ç›¸ç­‰ï¼Œå¯èƒ½æ˜¯ç”±äºŽå¤§å°é™åˆ¶é€ æˆçš„,è¦åŽç»­å¤„ç† + } + + float sx = 1, sy = 1; + if (_fill != FillType.None) + { + sx = this.width / sourceWidth; + sy = this.height / sourceHeight; + + if (sx != 1 || sy != 1) + { + if (_fill == FillType.ScaleMatchHeight) + sx = sy; + else if (_fill == FillType.ScaleMatchWidth) + sy = sx; + else if (_fill == FillType.Scale) + { + if (sx > sy) + sx = sy; + else + sy = sx; + } + else if (_fill == FillType.ScaleNoBorder) + { + if (sx > sy) + sy = sx; + else + sx = sy; + } + + if (_shrinkOnly) + { + if (sx > 1) + sx = 1; + if (sy > 1) + sy = 1; + } + + contentWidth = sourceWidth * sx; + contentHeight = sourceHeight * sy; + } + } + + if (_content2 != null) + _content2.SetScale(sx, sy); + else + _content.size = new Vector2(contentWidth, contentHeight); + + float nx; + float ny; + if (_align == AlignType.Center) + nx = (this.width - contentWidth) / 2; + else if (_align == AlignType.Right) + nx = this.width - contentWidth; + else + nx = 0; + if (_verticalAlign == VertAlignType.Middle) + ny = (this.height - contentHeight) / 2; + else if (_verticalAlign == VertAlignType.Bottom) + ny = this.height - contentHeight; + else + ny = 0; + if (_content2 != null) + _content2.SetXY(nx, ny); + else + _content.SetXY(nx, ny); + + InvalidateBatchingState(); + } + + private void ClearContent() + { + ClearErrorState(); + + if (_content.texture != null) + { + if (_contentItem == null) + { + _content.texture.onSizeChanged -= _reloadDelegate; + FreeExternal(_content.texture); + } + _content.texture = null; + } + _content.frames = null; + + if (_content2 != null) + { + _content2.Dispose(); + _content2 = null; + } + _contentItem = null; + } + + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + if (!_updatingLayout) + UpdateLayout(); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + _url = buffer.ReadS(); + _align = (AlignType)buffer.ReadByte(); + _verticalAlign = (VertAlignType)buffer.ReadByte(); + _fill = (FillType)buffer.ReadByte(); + _shrinkOnly = buffer.ReadBool(); + _autoSize = buffer.ReadBool(); + showErrorSign = buffer.ReadBool(); + _content.playing = buffer.ReadBool(); + _content.frame = buffer.ReadInt(); + + if (buffer.ReadBool()) + _content.color = buffer.ReadColor(); + _content.fillMethod = (FillMethod)buffer.ReadByte(); + if (_content.fillMethod != FillMethod.None) + { + _content.fillOrigin = buffer.ReadByte(); + _content.fillClockwise = buffer.ReadBool(); + _content.fillAmount = buffer.ReadFloat(); + } + + if (!string.IsNullOrEmpty(_url)) + LoadContent(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs.meta new file mode 100644 index 00000000..15dc8f3e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 43ce591d02b49e8419c431df4af3da0b +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs new file mode 100644 index 00000000..fcd5eb43 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs @@ -0,0 +1,566 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public partial class GLoader3D : GObject, IAnimationGear, IColorGear + { + string _url; + AlignType _align; + VertAlignType _verticalAlign; + bool _autoSize; + FillType _fill; + bool _shrinkOnly; + string _animationName; + string _skinName; + bool _playing; + int _frame; + bool _loop; + bool _updatingLayout; + Color _color; + + protected PackageItem _contentItem; + protected GoWrapper _content; + + public GLoader3D() + { + _url = string.Empty; + _align = AlignType.Left; + _verticalAlign = VertAlignType.Top; + _playing = true; + _color = Color.white; + } + + override protected void CreateDisplayObject() + { + displayObject = new Container("GLoader3D"); + displayObject.gOwner = this; + + _content = new GoWrapper(); + _content.onUpdate += OnUpdateContent; + ((Container)displayObject).AddChild(_content); + ((Container)displayObject).opaque = true; + } + + override public void Dispose() + { + _content.Dispose(); + base.Dispose(); + } + + /// + /// + /// + public string url + { + get { return _url; } + set + { + if (_url == value) + return; + + ClearContent(); + _url = value; + LoadContent(); + UpdateGear(7); + } + } + + override public string icon + { + get { return _url; } + set { this.url = value; } + } + + /// + /// + /// + public AlignType align + { + get { return _align; } + set + { + if (_align != value) + { + _align = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public VertAlignType verticalAlign + { + get { return _verticalAlign; } + set + { + if (_verticalAlign != value) + { + _verticalAlign = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public FillType fill + { + get { return _fill; } + set + { + if (_fill != value) + { + _fill = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public bool shrinkOnly + { + get { return _shrinkOnly; } + set + { + if (_shrinkOnly != value) + { + _shrinkOnly = value; + UpdateLayout(); + } + } + } + + /// + /// + /// + public bool autoSize + { + get { return _autoSize; } + set + { + if (_autoSize != value) + { + _autoSize = value; + UpdateLayout(); + } + } + } + + public bool playing + { + get { return _playing; } + set + { + if (_playing != value) + { + _playing = value; + OnChange("playing"); + UpdateGear(5); + } + } + } + + public int frame + { + get { return _frame; } + set + { + + if (_frame != value) + { + _frame = value; + OnChange("frame"); + UpdateGear(5); + } + } + } + + /// + /// Not implemented + /// + public float timeScale + { + get; + set; + } + + /// + /// Not implemented + /// + public bool ignoreEngineTimeScale + { + get; + set; + } + + /// + /// Not implemented + /// + /// + public void Advance(float time) + { + } + + /// + /// + /// + public bool loop + { + get { return _loop; } + set + { + if (_loop != value) + { + _loop = value; + OnChange("loop"); + } + } + } + + /// + /// + /// + /// + public string animationName + { + get { return _animationName; } + set + { + _animationName = value; + OnChange("animationName"); + UpdateGear(5); + } + } + + /// + /// + /// + /// + public string skinName + { + get { return _skinName; } + set + { + _skinName = value; + OnChange("skinName"); + UpdateGear(5); + } + } + + /// + /// + /// + public Material material + { + get { return _content.material; } + set { _content.material = value; } + } + + /// + /// + /// + public string shader + { + get { return _content.shader; } + set { _content.shader = value; } + } + + /// + /// + /// + public Color color + { + get { return _color; } + set + { + if (_color != value) + { + _color = value; + UpdateGear(4); + + OnChange("color"); + } + } + } + + /// + /// + /// + public GameObject wrapTarget + { + get { return _content.wrapTarget; } + } + + /// + /// + /// + /// + /// + /// + /// + public void SetWrapTarget(GameObject gameObject, bool cloneMaterial, int width, int height) + { + _content.SetWrapTarget(gameObject, cloneMaterial); + _content.SetSize(width, height); + sourceWidth = width; + sourceHeight = height; + + UpdateLayout(); + } + + override public IFilter filter + { + get { return _content.filter; } + set { _content.filter = value; } + } + + override public BlendMode blendMode + { + get { return _content.blendMode; } + set { _content.blendMode = value; } + } + + /// + /// + /// + protected void LoadContent() + { + ClearContent(); + + if (string.IsNullOrEmpty(_url)) + return; + + _contentItem = UIPackage.GetItemByURL(_url); + + if (_contentItem != null) + { + _contentItem = _contentItem.getBranch(); + _contentItem = _contentItem.getHighResolution(); + _contentItem.Load(); + + if (_contentItem.type == PackageItemType.Spine) + { +#if FAIRYGUI_SPINE + LoadSpine(); +#endif + } + else if (_contentItem.type == PackageItemType.DragoneBones) + { +#if FAIRYGUI_DRAGONBONES + LoadDragonBones(); +#endif + } + } + else + LoadExternal(); + } + + virtual protected void OnChange(string propertyName) + { + if (_contentItem == null) + return; + + + if (_contentItem.type == PackageItemType.Spine) + { +#if FAIRYGUI_SPINE + OnChangeSpine(propertyName); +#endif + } + else if (_contentItem.type == PackageItemType.DragoneBones) + { +#if FAIRYGUI_DRAGONBONES + OnChangeDragonBones(propertyName); +#endif + } + } + + virtual protected void LoadExternal() + { + } + + virtual protected void FreeExternal() + { + GameObject.DestroyImmediate(_content.wrapTarget); + } + + protected void UpdateLayout() + { + if (sourceWidth == 0 || sourceHeight == 0) + return; + + float contentWidth = sourceWidth; + float contentHeight = sourceHeight; + + if (_autoSize) + { + _updatingLayout = true; + if (contentWidth == 0) + contentWidth = 50; + if (contentHeight == 0) + contentHeight = 30; + SetSize(contentWidth, contentHeight); + + _updatingLayout = false; + + if (_width == contentWidth && _height == contentHeight) + { + _content.SetXY(0, 0); + _content.SetScale(1, 1); + + InvalidateBatchingState(); + return; + } + //如果ä¸ç›¸ç­‰ï¼Œå¯èƒ½æ˜¯ç”±äºŽå¤§å°é™åˆ¶é€ æˆçš„,è¦åŽç»­å¤„ç† + } + + float sx = 1, sy = 1; + if (_fill != FillType.None) + { + sx = this.width / sourceWidth; + sy = this.height / sourceHeight; + + if (sx != 1 || sy != 1) + { + if (_fill == FillType.ScaleMatchHeight) + sx = sy; + else if (_fill == FillType.ScaleMatchWidth) + sy = sx; + else if (_fill == FillType.Scale) + { + if (sx > sy) + sx = sy; + else + sy = sx; + } + else if (_fill == FillType.ScaleNoBorder) + { + if (sx > sy) + sy = sx; + else + sx = sy; + } + + if (_shrinkOnly) + { + if (sx > 1) + sx = 1; + if (sy > 1) + sy = 1; + } + + contentWidth = sourceWidth * sx; + contentHeight = sourceHeight * sy; + } + } + + _content.SetScale(sx, sy); + + float nx; + float ny; + if (_align == AlignType.Center) + nx = (this.width - contentWidth) / 2; + else if (_align == AlignType.Right) + nx = this.width - contentWidth; + else + nx = 0; + if (_verticalAlign == VertAlignType.Middle) + ny = (this.height - contentHeight) / 2; + else if (_verticalAlign == VertAlignType.Bottom) + ny = this.height - contentHeight; + else + ny = 0; + _content.SetXY(nx, ny); + + InvalidateBatchingState(); + } + + protected void ClearContent() + { + if (_content.wrapTarget != null) + { + if (_contentItem != null) + { + if (_contentItem.type == PackageItemType.Spine) + { +#if FAIRYGUI_SPINE + FreeSpine(); +#endif + } + else if (_contentItem.type == PackageItemType.DragoneBones) + { +#if FAIRYGUI_DRAGONBONES + FreeDragonBones(); +#endif + } + } + else + FreeExternal(); + } + _content.wrapTarget = null; + _contentItem = null; + } + + protected void OnUpdateContent(UpdateContext context) + { + if (_contentItem == null) + return; + + + if (_contentItem.type == PackageItemType.Spine) + { +#if FAIRYGUI_SPINE + OnUpdateSpine(context); +#endif + } + else if (_contentItem.type == PackageItemType.DragoneBones) + { +#if FAIRYGUI_DRAGONBONES + OnUpdateDragonBones(context); +#endif + } + } + + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + if (!_updatingLayout) + UpdateLayout(); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + _url = buffer.ReadS(); + _align = (AlignType)buffer.ReadByte(); + _verticalAlign = (VertAlignType)buffer.ReadByte(); + _fill = (FillType)buffer.ReadByte(); + _shrinkOnly = buffer.ReadBool(); + _autoSize = buffer.ReadBool(); + _animationName = buffer.ReadS(); + _skinName = buffer.ReadS(); + _playing = buffer.ReadBool(); + _frame = buffer.ReadInt(); + _loop = buffer.ReadBool(); + + if (buffer.ReadBool()) + this.color = buffer.ReadColor(); //color + + if (!string.IsNullOrEmpty(_url)) + LoadContent(); + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs.meta new file mode 100644 index 00000000..84920c8c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GLoader3D.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 808355b0b55f945779f2a21d3d69cbfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs new file mode 100644 index 00000000..1697a935 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs @@ -0,0 +1,190 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GMovieClip class. + /// + public class GMovieClip : GObject, IAnimationGear, IColorGear + { + MovieClip _content; + EventListener _onPlayEnd; + + public GMovieClip() + { + } + + override protected void CreateDisplayObject() + { + _content = new MovieClip(); + _content.gOwner = this; + _content.ignoreEngineTimeScale = true; + displayObject = _content; + } + + /// + /// + /// + public EventListener onPlayEnd + { + get { return _onPlayEnd ?? (_onPlayEnd = new EventListener(this, "onPlayEnd")); } + } + + /// + /// + /// + public bool playing + { + get { return _content.playing; } + set + { + _content.playing = value; + UpdateGear(5); + } + } + + /// + /// + /// + public int frame + { + get { return _content.frame; } + set + { + _content.frame = value; + UpdateGear(5); + } + } + + /// + /// + /// + public Color color + { + get { return _content.color; } + set + { + _content.color = value; + UpdateGear(4); + } + } + + /// + /// + /// + public FlipType flip + { + get { return _content.graphics.flip; } + set { _content.graphics.flip = value; } + } + + /// + /// + /// + public Material material + { + get { return _content.material; } + set { _content.material = value; } + } + + /// + /// + /// + public string shader + { + get { return _content.shader; } + set { _content.shader = value; } + } + + /// + /// + /// + public float timeScale + { + get { return _content.timeScale; } + set { _content.timeScale = value; } + } + + /// + /// + /// + public bool ignoreEngineTimeScale + { + get { return _content.ignoreEngineTimeScale; } + set { _content.ignoreEngineTimeScale = value; } + } + + /// + /// + /// + public void Rewind() + { + _content.Rewind(); + } + + /// + /// + /// + /// + public void SyncStatus(GMovieClip anotherMc) + { + _content.SyncStatus(anotherMc._content); + } + + /// + /// + /// + /// + public void Advance(float time) + { + _content.Advance(time); + } + + /// + /// Play from the start to end, repeat times, set to endAt on complete. + /// 从start帧开始,播放到end帧(-1表示结尾),é‡å¤times次(0表示无é™å¾ªçŽ¯ï¼‰ï¼Œå¾ªçŽ¯ç»“æŸåŽï¼Œåœæ­¢åœ¨endAt帧(-1è¡¨ç¤ºå‚æ•°end) + /// + /// Start frame + /// End frame. -1 indicates the last frame. + /// Repeat times. 0 indicates infinite loop. + /// Stop frame. -1 indicates to equal to the end parameter. + public void SetPlaySettings(int start, int end, int times, int endAt) + { + ((MovieClip)displayObject).SetPlaySettings(start, end, times, endAt); + } + + override public void ConstructFromResource() + { + this.gameObjectName = packageItem.name; + + PackageItem contentItem = packageItem.getBranch(); + sourceWidth = contentItem.width; + sourceHeight = contentItem.height; + initWidth = sourceWidth; + initHeight = sourceHeight; + contentItem = contentItem.getHighResolution(); + contentItem.Load(); + + _content.interval = contentItem.interval; + _content.swing = contentItem.swing; + _content.repeatDelay = contentItem.repeatDelay; + _content.frames = contentItem.frames; + + SetSize(sourceWidth, sourceHeight); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + if (buffer.ReadBool()) + _content.color = buffer.ReadColor(); + _content.graphics.flip = (FlipType)buffer.ReadByte(); + _content.frame = buffer.ReadInt(); + _content.playing = buffer.ReadBool(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs.meta new file mode 100644 index 00000000..b4e35b3a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GMovieClip.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 158e4b32fb035414091844233b2b9269 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs new file mode 100644 index 00000000..fbad5fc2 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs @@ -0,0 +1,2179 @@ +using System; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class GObject : EventDispatcher + { + /// + /// GObjectçš„id,仅作为内部使用。与nameä¸åŒï¼Œid值是ä¸ä¼šç›¸åŒçš„。 + /// id is for internal use only. + /// + public string id { get; private set; } + + /// + /// Name of the object. + /// + public string name; + + /// + /// User defined data. + /// + public object data; + + /// + /// The source width of the object. + /// + public int sourceWidth; + + /// + /// The source height of the object. + /// + public int sourceHeight; + + /// + /// The initial width of the object. + /// + public int initWidth; + + /// + /// The initial height of the object. + /// + public int initHeight; + + /// + /// + /// + public int minWidth; + + /// + /// + /// + public int maxWidth; + + /// + /// + /// + public int minHeight; + + /// + /// + /// + public int maxHeight; + + /// + /// Relations Object. + /// + public Relations relations { get; private set; } + + /// + /// Restricted range of dragging. + /// + public Rect? dragBounds; + + /// + /// Parent object. + /// + public GComponent parent { get; private set; } + + /// + /// Lowlevel display object. + /// + public DisplayObject displayObject { get; protected set; } + + /// + /// 当å‰å…¨å±€æ­£åœ¨è¢«æ‹–动的对象 + /// + public static GObject draggingObject { get; private set; } + + /// + /// + /// + public PackageItem packageItem; + + float _x; + float _y; + float _z; + float _pivotX; + float _pivotY; + bool _pivotAsAnchor; + float _alpha; + float _rotation; + float _rotationX; + float _rotationY; + bool _visible; + bool _internalVisible; + bool _handlingController; + bool _touchable; + bool _grayed; + bool _draggable; + float _scaleX; + float _scaleY; + int _sortingOrder; + string _tooltips; + GGroup _group; + + GearBase[] _gears; + + EventListener _onClick; + EventListener _onRightClick; + EventListener _onTouchBegin; + EventListener _onTouchMove; + EventListener _onTouchEnd; + EventListener _onRollOver; + EventListener _onRollOut; + EventListener _onAddedToStage; + EventListener _onRemovedFromStage; + EventListener _onKeyDown; + EventListener _onClickLink; + EventListener _onPositionChanged; + EventListener _onSizeChanged; + EventListener _onDragStart; + EventListener _onDragMove; + EventListener _onDragEnd; + EventListener _onGearStop; + EventListener _onFocusIn; + EventListener _onFocusOut; + + internal protected bool underConstruct; + internal float _width; + internal float _height; + internal float _rawWidth; + internal float _rawHeight; + internal bool _gearLocked; + internal float _sizePercentInGroup; + internal bool _disposed; + internal GTreeNode _treeNode; + + internal static uint _gInstanceCounter; + + public GObject() + { + _width = 0; + _height = 0; + _alpha = 1; + _visible = true; + _touchable = true; + _scaleX = 1; + _scaleY = 1; + _internalVisible = true; + id = "_n" + _gInstanceCounter++; + name = string.Empty; + + CreateDisplayObject(); + + relations = new Relations(this); + _gears = new GearBase[10]; + } + + /// + /// Dispatched when the object or its child was clicked. + /// + public EventListener onClick + { + get { return _onClick ?? (_onClick = new EventListener(this, "onClick")); } + } + + /// + /// Dispatched when the object or its child was clicked by right mouse button. Web only. + /// + public EventListener onRightClick + { + get { return _onRightClick ?? (_onRightClick = new EventListener(this, "onRightClick")); } + } + + /// + /// Dispatched when the finger touched the object or its child just now. + /// + public EventListener onTouchBegin + { + get { return _onTouchBegin ?? (_onTouchBegin = new EventListener(this, "onTouchBegin")); } + } + + /// + /// + /// + public EventListener onTouchMove + { + get { return _onTouchMove ?? (_onTouchMove = new EventListener(this, "onTouchMove")); } + } + + /// + /// Dispatched when the finger was lifted from the screen or from the mouse button. + /// + public EventListener onTouchEnd + { + get { return _onTouchEnd ?? (_onTouchEnd = new EventListener(this, "onTouchEnd")); } + } + + /// + /// The cursor or finger hovers over an object. + /// + public EventListener onRollOver + { + get { return _onRollOver ?? (_onRollOver = new EventListener(this, "onRollOver")); } + } + + /// + /// The cursor or finger leave an object. + /// + public EventListener onRollOut + { + get { return _onRollOut ?? (_onRollOut = new EventListener(this, "onRollOut")); } + } + + /// + /// Dispatched when the object was added to the stage. + /// + public EventListener onAddedToStage + { + get { return _onAddedToStage ?? (_onAddedToStage = new EventListener(this, "onAddedToStage")); } + } + + /// + /// Dispatched when the object was removed from the stage. + /// + public EventListener onRemovedFromStage + { + get { return _onRemovedFromStage ?? (_onRemovedFromStage = new EventListener(this, "onRemovedFromStage")); } + } + + /// + /// Dispatched on key pressed when the object is in focus. + /// + public EventListener onKeyDown + { + get { return _onKeyDown ?? (_onKeyDown = new EventListener(this, "onKeyDown")); } + } + + /// + /// Dispatched when links in the object or its child was clicked. + /// + public EventListener onClickLink + { + get { return _onClickLink ?? (_onClickLink = new EventListener(this, "onClickLink")); } + } + + /// + /// Dispatched when the object was moved. + /// + public EventListener onPositionChanged + { + get { return _onPositionChanged ?? (_onPositionChanged = new EventListener(this, "onPositionChanged")); } + } + + /// + /// Dispatched when the object was resized. + /// + public EventListener onSizeChanged + { + get { return _onSizeChanged ?? (_onSizeChanged = new EventListener(this, "onSizeChanged")); } + } + + /// + /// Dispatched when drag start. + /// + public EventListener onDragStart + { + get { return _onDragStart ?? (_onDragStart = new EventListener(this, "onDragStart")); } + } + + /// + /// Dispatched when dragging. + /// + public EventListener onDragMove + { + get { return _onDragMove ?? (_onDragMove = new EventListener(this, "onDragMove")); } + } + + /// + /// Dispatched when drag end. + /// + public EventListener onDragEnd + { + get { return _onDragEnd ?? (_onDragEnd = new EventListener(this, "onDragEnd")); } + } + + /// + /// + /// + public EventListener onGearStop + { + get { return _onGearStop ?? (_onGearStop = new EventListener(this, "onGearStop")); } + } + + /// + /// + /// + public EventListener onFocusIn + { + get { return _onFocusIn ?? (_onFocusIn = new EventListener(this, "onFocusIn")); } + } + + /// + /// + /// + public EventListener onFocusOut + { + get { return _onFocusOut ?? (_onFocusOut = new EventListener(this, "onFocusOut")); } + } + + /// + /// The x coordinate of the object relative to the local coordinates of the parent. + /// + public float x + { + get { return _x; } + set + { + SetPosition(value, _y, _z); + } + } + + /// + /// The y coordinate of the object relative to the local coordinates of the parent. + /// + public float y + { + get { return _y; } + set + { + SetPosition(_x, value, _z); + } + } + + /// + /// The z coordinate of the object relative to the local coordinates of the parent. + /// + public float z + { + get { return _z; } + set + { + SetPosition(_x, _y, value); + } + } + + /// + /// The x and y coordinates of the object relative to the local coordinates of the parent. + /// + public Vector2 xy + { + get { return new Vector2(_x, _y); } + set { SetPosition(value.x, value.y, _z); } + } + + /// + /// The x,y,z coordinates of the object relative to the local coordinates of the parent. + /// + public Vector3 position + { + get { return new Vector3(_x, _y, _z); } + set { SetPosition(value.x, value.y, value.z); } + } + + /// + /// change the x and y coordinates of the object relative to the local coordinates of the parent. + /// + /// x value. + /// y value. + public void SetXY(float xv, float yv) + { + SetPosition(xv, yv, _z); + } + + /// + /// + /// + /// + /// + /// + public void SetXY(float xv, float yv, bool topLeftValue) + { + if (_pivotAsAnchor) + SetPosition(xv + _pivotX * _width, yv + _pivotY * _height, _z); + else + SetPosition(xv, yv, _z); + } + + /// + /// change the x,y,z coordinates of the object relative to the local coordinates of the parent. + /// + /// x value. + /// y value. + /// z value. + public void SetPosition(float xv, float yv, float zv) + { + if (_x != xv || _y != yv || _z != zv) + { + float dx = xv - _x; + float dy = yv - _y; + _x = xv; + _y = yv; + _z = zv; + + HandlePositionChanged(); + + if (this is GGroup) + ((GGroup)this).MoveChildren(dx, dy); + + UpdateGear(1); + + if (parent != null && !(parent is GList)) + { + parent.SetBoundsChangedFlag(); + if (_group != null) + _group.SetBoundsChangedFlag(true); + DispatchEvent("onPositionChanged", null); + } + + if (draggingObject == this && !sUpdateInDragging) + sGlobalRect = this.LocalToGlobal(new Rect(0, 0, this.width, this.height)); + } + } + + [Obsolete("Use UIConfig.makePixelPerfect or DisplayObject.pixelPerfect")] + public bool pixelSnapping + { + get { return false; } + set { } + } + + /// + /// Set the object in middle of the parent or GRoot if the parent is not set. + /// + public void Center() + { + Center(false); + } + + /// + /// Set the object in middle of the parent or GRoot if the parent is not set. + /// + /// Add relations to maintain the center state. + public void Center(bool restraint) + { + GComponent r; + if (parent != null) + r = parent; + else + r = this.root; + + this.SetXY((int)((r.width - this.width) / 2), (int)((r.height - this.height) / 2), true); + if (restraint) + { + this.AddRelation(r, RelationType.Center_Center); + this.AddRelation(r, RelationType.Middle_Middle); + } + } + + /// + /// 设置对象为全å±å¤§å°ï¼ˆé€»è¾‘å±å¹•)。 + /// + public void MakeFullScreen() + { + this.SetSize(GRoot.inst.width, GRoot.inst.height); + } + + /// + /// The width of the object in pixels. + /// + public float width + { + get + { + return _width; + } + set + { + SetSize(value, _rawHeight); + } + } + + /// + /// The height of the object in pixels. + /// + public float height + { + get + { + return _height; + } + set + { + SetSize(_rawWidth, value); + } + } + + /// + /// The size of the object in pixels. + /// + public Vector2 size + { + get { return new Vector2(width, height); } + set { SetSize(value.x, value.y); } + } + + /// + /// actualWidth = width * scalex + /// + public float actualWidth + { + get { return this.width * _scaleX; } + } + + /// + /// actualHeight = height * scaleY + /// + public float actualHeight + { + get { return this.height * _scaleY; } + } + + /// + /// Change size. + /// + /// Width value. + /// Height value. + public void SetSize(float wv, float hv) + { + SetSize(wv, hv, false); + } + + /// + /// Change size. + /// + /// Width value. + /// Height value. + /// If pivot is set, the object's positon will change when its size change. Set ignorePivot=true to keep the position. + public void SetSize(float wv, float hv, bool ignorePivot) + { + if (_rawWidth != wv || _rawHeight != hv) + { + _rawWidth = wv; + _rawHeight = hv; + if (wv < minWidth) + wv = minWidth; + else if (maxWidth > 0 && wv > maxWidth) + wv = maxWidth; + if (hv < minHeight) + hv = minHeight; + else if (maxHeight > 0 && hv > maxHeight) + hv = maxHeight; + float dWidth = wv - _width; + float dHeight = hv - _height; + _width = wv; + _height = hv; + + HandleSizeChanged(); + + if (_pivotX != 0 || _pivotY != 0) + { + if (!_pivotAsAnchor) + { + if (!ignorePivot) + SetXY(_x - _pivotX * dWidth, _y - _pivotY * dHeight); + else + HandlePositionChanged(); + } + else + HandlePositionChanged(); + } + + if (this is GGroup) + ((GGroup)this).ResizeChildren(dWidth, dHeight); + + UpdateGear(2); + + if (parent != null) + { + relations.OnOwnerSizeChanged(dWidth, dHeight, _pivotAsAnchor || !ignorePivot); + parent.SetBoundsChangedFlag(); + if (_group != null) + _group.SetBoundsChangedFlag(); + } + + DispatchEvent("onSizeChanged", null); + } + } + + protected void SetSizeDirectly(float wv, float hv) + { + _rawWidth = wv; + _rawHeight = hv; + if (wv < 0) + wv = 0; + if (hv < 0) + hv = 0; + _width = wv; + _height = hv; + } + + /// + /// + /// + public float xMin + { + get + { + return _pivotAsAnchor ? (_x - _width * _pivotX) : _x; + } + set + { + if (_pivotAsAnchor) + SetPosition(value + _width * _pivotX, _y, _z); + else + SetPosition(value, _y, _z); + } + } + + /// + /// + /// + public float yMin + { + get + { + return _pivotAsAnchor ? (_y - _height * _pivotY) : _y; + } + set + { + if (_pivotAsAnchor) + SetPosition(_x, value + _height * _pivotY, _z); + else + SetPosition(_x, value, _z); + } + } + + /// + /// The horizontal scale factor. '1' means no scale, cannt be negative. + /// + public float scaleX + { + get { return _scaleX; } + set + { + SetScale(value, _scaleY); + } + } + + /// + /// The vertical scale factor. '1' means no scale, cannt be negative. + /// + public float scaleY + { + get { return _scaleY; } + set + { + SetScale(_scaleX, value); + } + } + + /// + /// The scale factor. + /// + public Vector2 scale + { + get { return new Vector2(_scaleX, _scaleY); } + set { SetScale(value.x, value.y); } + } + + /// + /// Change the scale factor. + /// + /// The horizontal scale factor. + /// The vertical scale factor + public void SetScale(float wv, float hv) + { + if (_scaleX != wv || _scaleY != hv) + { + _scaleX = wv; + _scaleY = hv; + HandleScaleChanged(); + + UpdateGear(2); + } + } + + /// + /// + /// + public Vector2 skew + { + get + { + if (displayObject != null) + return displayObject.skew; + else + return Vector2.zero; + } + + set + { + if (displayObject != null) + displayObject.skew = value; + } + } + + /// + /// The x coordinate of the object's origin in its own coordinate space. + /// + public float pivotX + { + get { return _pivotX; } + set + { + SetPivot(value, _pivotY, _pivotAsAnchor); + } + } + + /// + /// The y coordinate of the object's origin in its own coordinate space. + /// + public float pivotY + { + get { return _pivotY; } + set + { + SetPivot(_pivotX, value, _pivotAsAnchor); + } + } + + /// + /// The x and y coordinates of the object's origin in its own coordinate space. + /// + public Vector2 pivot + { + get { return new Vector2(_pivotX, _pivotY); } + set { SetPivot(value.x, value.y, _pivotAsAnchor); } + } + + public bool pivotAsAnchor + { + get { return _pivotAsAnchor; } + set + { + SetPivot(_pivotX, _pivotY, value); + } + } + + /// + /// Change the x and y coordinates of the object's origin in its own coordinate space. + /// + /// x value in ratio + /// y value in ratio + public void SetPivot(float xv, float yv) + { + SetPivot(xv, yv, false); + } + + /// + /// Change the x and y coordinates of the object's origin in its own coordinate space. + /// + /// x value in ratio + /// y value in ratio + /// If use the pivot as the anchor position + public void SetPivot(float xv, float yv, bool asAnchor) + { + if (_pivotX != xv || _pivotY != yv || _pivotAsAnchor != asAnchor) + { + _pivotX = xv; + _pivotY = yv; + _pivotAsAnchor = asAnchor; + if (displayObject != null) + displayObject.pivot = new Vector2(_pivotX, _pivotY); + HandlePositionChanged(); + } + } + + /// + /// If the object can touch or click. GImage/GTextField is not touchable even it is true. + /// + public bool touchable + { + get + { + return _touchable; + } + set + { + if (_touchable != value) + { + _touchable = value; + UpdateGear(3); + + if (displayObject != null) + displayObject.touchable = _touchable; + } + } + } + + /// + /// If true, apply a grayed effect on this object. + /// + public bool grayed + { + get + { + return _grayed; + } + set + { + if (_grayed != value) + { + _grayed = value; + HandleGrayedChanged(); + UpdateGear(3); + } + } + } + + /// + /// Enabled is shortcut for grayed and !touchable combination. + /// + public bool enabled + { + get + { + return !_grayed && _touchable; + } + set + { + this.grayed = !value; + this.touchable = value; + } + } + + /// + /// The rotation around the z axis of the object in degrees. + /// + public float rotation + { + get + { + return _rotation; + } + set + { + _rotation = value; + if (displayObject != null) + displayObject.rotation = _rotation; + UpdateGear(3); + } + } + + /// + /// The rotation around the x axis of the object in degrees. + /// + public float rotationX + { + get + { + return _rotationX; + } + set + { + _rotationX = value; + if (displayObject != null) + displayObject.rotationX = _rotationX; + } + } + + /// + /// The rotation around the y axis of the object in degrees. + /// + public float rotationY + { + get + { + return _rotationY; + } + set + { + _rotationY = value; + if (displayObject != null) + displayObject.rotationY = _rotationY; + } + } + + /// + /// The opacity of the object. 0 = transparent, 1 = opaque. + /// + public float alpha + { + + get + { + return _alpha; + } + + set + { + _alpha = value; + HandleAlphaChanged(); + UpdateGear(3); + } + } + + /// + /// The visibility of the object. An invisible object will be untouchable. + /// + public bool visible + { + get + { + return _visible; + } + + set + { + if (_visible != value) + { + _visible = value; + HandleVisibleChanged(); + if (parent != null) + parent.SetBoundsChangedFlag(); + if (_group != null && _group.excludeInvisibles) + _group.SetBoundsChangedFlag(); + } + } + } + + internal bool internalVisible + { + get + { + return _internalVisible && (group == null || group.internalVisible); + } + } + + internal bool internalVisible2 + { + get + { + return _visible && (group == null || group.internalVisible2); + } + } + + internal bool internalVisible3 + { + get + { + return _visible && _internalVisible; + } + } + + /// + /// By default(when sortingOrder==0), object added to component is arrange by the added roder. + /// The bigger is the sorting order, the object is more in front. + /// + public int sortingOrder + { + get { return _sortingOrder; } + set + { + if (value < 0) + value = 0; + if (_sortingOrder != value) + { + int old = _sortingOrder; + _sortingOrder = value; + if (parent != null) + parent.ChildSortingOrderChanged(this, old, _sortingOrder); + } + } + } + + /// + /// If the object can be focused? + /// + public bool focusable + { + get { return displayObject != null && displayObject.focusable; } + set { if (displayObject != null) displayObject.focusable = value; } + } + + /// + /// If the object can be navigated by TAB? + /// + public bool tabStop + { + get { return displayObject != null && displayObject.tabStop; } + set { if (displayObject != null) displayObject.tabStop = value; } + } + + /// + /// If the object is focused. + /// + public bool focused + { + get { return displayObject != null && displayObject.focused; } + } + + /// + /// Request focus on this object. + /// + public void RequestFocus() + { + if (displayObject != null) + Stage.inst.SetFocus(displayObject, false); + } + + /// + /// Request focus on this object. + /// + public void RequestFocus(bool byKey) + { + if (displayObject != null) + Stage.inst.SetFocus(displayObject, byKey); + } + + /// + /// Tooltips of this object. UIConfig.tooltipsWin must be set first. + /// + public string tooltips + { + get { return _tooltips; } + set + { + if (!string.IsNullOrEmpty(_tooltips)) + { + this.onRollOver.Remove(__rollOver); + this.onRollOut.Remove(__rollOut); + } + + _tooltips = value; + if (!string.IsNullOrEmpty(_tooltips)) + { + this.onRollOver.Add(__rollOver); + this.onRollOut.Add(__rollOut); + } + } + } + + + /// + /// + /// + /// + public string cursor + { + get { return displayObject != null ? displayObject.cursor : null; } + set + { + if (displayObject != null) + displayObject.cursor = value; + } + } + + private void __rollOver() + { + this.root.ShowTooltips(tooltips); + } + + private void __rollOut() + { + this.root.HideTooltips(); + } + + /// + /// + /// + virtual public IFilter filter + { + get { return displayObject != null ? displayObject.filter : null; } + set { if (displayObject != null) displayObject.filter = value; } + } + + /// + /// + /// + virtual public BlendMode blendMode + { + get { return displayObject != null ? displayObject.blendMode : BlendMode.None; } + set { if (displayObject != null) displayObject.blendMode = value; } + } + + /// + /// 设定GameObjectçš„åç§° + /// + public string gameObjectName + { + get + { + if (displayObject != null) + return displayObject.gameObject.name; + else + return null; + } + + set + { + if (displayObject != null && displayObject.gameObject != null) + displayObject.gameObject.name = value; + } + } + + /// + /// + /// + /// + public void SetHome(GObject obj) + { + if (obj != null && displayObject != null && obj.displayObject != null) + displayObject.home = obj.displayObject.cachedTransform; + } + + /// + /// If the object has lowlevel displayobject and the displayobject has a container parent? + /// + public bool inContainer + { + get + { + return displayObject != null && displayObject.parent != null; + } + } + + /// + /// If the object is on stage. + /// + public bool onStage + { + get + { + return displayObject != null && displayObject.stage != null; + } + } + + /// + /// Resource url of this object. + /// + public string resourceURL + { + get + { + if (packageItem != null) + return UIPackage.URL_PREFIX + packageItem.owner.id + packageItem.id; + else + return null; + } + } + + /// + /// Gear to xy controller. + /// + public GearXY gearXY + { + get + { + return (GearXY)GetGear(1); + } + } + + /// + /// Gear to size controller. + /// + public GearSize gearSize + { + get + { + return (GearSize)GetGear(2); + } + } + + /// + /// Gear to look controller. + /// + public GearLook gearLook + { + get + { + return (GearLook)GetGear(3); + } + } + + public GearBase GetGear(int index) + { + GearBase gear = _gears[index]; + if (gear == null) + { + switch (index) + { + case 0: + gear = new GearDisplay(this); + break; + case 1: + gear = new GearXY(this); + break; + case 2: + gear = new GearSize(this); + break; + case 3: + gear = new GearLook(this); + break; + case 4: + gear = new GearColor(this); + break; + case 5: + gear = new GearAnimation(this); + break; + case 6: + gear = new GearText(this); + break; + case 7: + gear = new GearIcon(this); + break; + case 8: + gear = new GearDisplay2(this); + break; + case 9: + gear = new GearFontSize(this); + break; + default: + throw new System.Exception("FairyGUI: invalid gear index!"); + } + _gears[index] = gear; + } + return gear; + } + + protected void UpdateGear(int index) + { + if (underConstruct || _gearLocked) + return; + + GearBase gear = _gears[index]; + if (gear != null && gear.controller != null) + gear.UpdateState(); + } + + internal bool CheckGearController(int index, Controller c) + { + return _gears[index] != null && _gears[index].controller == c; + } + + internal void UpdateGearFromRelations(int index, float dx, float dy) + { + if (_gears[index] != null) + _gears[index].UpdateFromRelations(dx, dy); + } + + internal uint AddDisplayLock() + { + GearDisplay gearDisplay = (GearDisplay)_gears[0]; + if (gearDisplay != null && gearDisplay.controller != null) + { + uint ret = gearDisplay.AddLock(); + CheckGearDisplay(); + + return ret; + } + else + return 0; + } + + internal void ReleaseDisplayLock(uint token) + { + GearDisplay gearDisplay = (GearDisplay)_gears[0]; + if (gearDisplay != null && gearDisplay.controller != null) + { + gearDisplay.ReleaseLock(token); + CheckGearDisplay(); + } + } + + void CheckGearDisplay() + { + if (_handlingController) + return; + + bool connected = _gears[0] == null || ((GearDisplay)_gears[0]).connected; + if (_gears[8] != null) + connected = ((GearDisplay2)_gears[8]).Evaluate(connected); + + if (connected != _internalVisible) + { + _internalVisible = connected; + if (parent != null) + parent.ChildStateChanged(this); + if (_group != null && _group.excludeInvisibles) + _group.SetBoundsChangedFlag(); + } + } + + /// + /// Mark the fairy batching state is invalid. + /// + public void InvalidateBatchingState() + { + if (displayObject != null) + displayObject.InvalidateBatchingState(); + else if ((this is GGroup) && parent != null) + parent.container.InvalidateBatchingState(true); + } + + virtual public void HandleControllerChanged(Controller c) + { + _handlingController = true; + for (int i = 0; i < 10; i++) + { + GearBase gear = _gears[i]; + if (gear != null && gear.controller == c) + gear.Apply(); + } + _handlingController = false; + + CheckGearDisplay(); + } + + /// + /// + /// + /// + /// + public void AddRelation(GObject target, RelationType relationType) + { + AddRelation(target, relationType, false); + } + + /// + /// + /// + /// + /// + /// + public void AddRelation(GObject target, RelationType relationType, bool usePercent) + { + relations.Add(target, relationType, usePercent); + } + + /// + /// + /// + /// + /// + public void RemoveRelation(GObject target, RelationType relationType) + { + relations.Remove(target, relationType); + } + + /// + /// + /// + public void RemoveFromParent() + { + if (parent != null) + parent.RemoveChild(this); + } + + /// + /// Group belonging to. + /// + public GGroup group + { + get { return _group; } + set + { + if (_group != value) + { + if (_group != null) + _group.SetBoundsChangedFlag(); + _group = value; + if (_group != null) + _group.SetBoundsChangedFlag(); + HandleVisibleChanged(); + if (parent != null) + parent.ChildStateChanged(this); + } + } + } + + /// + /// + /// + public GRoot root + { + get + { + GObject p = this; + while (p.parent != null) + p = p.parent; + + if (p is GRoot) + return (GRoot)p; + + if (p.displayObject != null && p.displayObject.parent != null) + { + DisplayObject d = p.displayObject.parent.GetChild("GRoot"); + if (d != null && (d.gOwner is GRoot)) + return (GRoot)d.gOwner; + } + + return GRoot.inst; + } + } + + /// + /// + /// + virtual public string text + { + get { return null; } + set { /*override in child*/} + } + + /// + /// + /// + virtual public string icon + { + get { return null; } + set { /*override in child*/} + } + + /// + /// + /// + public bool draggable + { + get { return _draggable; } + set + { + if (_draggable != value) + { + _draggable = value; + InitDrag(); + } + } + } + + /// + /// + /// + public void StartDrag() + { + StartDrag(-1); + } + + /// + /// + /// + /// + public void StartDrag(int touchId) + { + if (displayObject.stage == null) + return; + + DragBegin(touchId); + } + + /// + /// + /// + public void StopDrag() + { + DragEnd(); + } + + /// + /// + /// + public bool dragging + { + get { return draggingObject == this; } + } + + /// + /// Transforms a point from the local coordinate system to global (Stage) coordinates. + /// + /// + /// + public Vector2 LocalToGlobal(Vector2 pt) + { + if (_pivotAsAnchor) + { + pt.x += _width * _pivotX; + pt.y += _height * _pivotY; + } + return displayObject.LocalToGlobal(pt); + } + + /// + /// Transforms a point from global (Stage) coordinates to the local coordinate system. + /// + /// + /// + public Vector2 GlobalToLocal(Vector2 pt) + { + pt = displayObject.GlobalToLocal(pt); + if (_pivotAsAnchor) + { + pt.x -= _width * _pivotX; + pt.y -= _height * _pivotY; + } + return pt; + } + + /// + /// + /// + /// + /// + public Rect LocalToGlobal(Rect rect) + { + Rect ret = new Rect(); + Vector2 v = this.LocalToGlobal(new Vector2(rect.xMin, rect.yMin)); + ret.xMin = v.x; + ret.yMin = v.y; + v = this.LocalToGlobal(new Vector2(rect.xMax, rect.yMax)); + ret.xMax = v.x; + ret.yMax = v.y; + return ret; + } + + /// + /// + /// + /// + /// + public Rect GlobalToLocal(Rect rect) + { + Rect ret = new Rect(); + Vector2 v = this.GlobalToLocal(new Vector2(rect.xMin, rect.yMin)); + ret.xMin = v.x; + ret.yMin = v.y; + v = this.GlobalToLocal(new Vector2(rect.xMax, rect.yMax)); + ret.xMax = v.x; + ret.yMax = v.y; + return ret; + } + + /// + /// Transforms a point from the local coordinate system to GRoot coordinates. + /// + /// + /// + /// + public Vector2 LocalToRoot(Vector2 pt, GRoot r) + { + pt = LocalToGlobal(pt); + if (r == null || r == GRoot.inst) + { + //fast + pt.x /= UIContentScaler.scaleFactor; + pt.y /= UIContentScaler.scaleFactor; + return pt; + } + else + return r.GlobalToLocal(pt); + } + + /// + /// Transforms a point from the GRoot coordinate to local coordinates system. + /// + /// + /// + /// + public Vector2 RootToLocal(Vector2 pt, GRoot r) + { + if (r == null || r == GRoot.inst) + { + //fast + pt.x *= UIContentScaler.scaleFactor; + pt.y *= UIContentScaler.scaleFactor; + } + else + pt = r.LocalToGlobal(pt); + return GlobalToLocal(pt); + } + + /// + /// + /// + /// + /// + public Vector2 WorldToLocal(Vector3 pt) + { + return WorldToLocal(pt, HitTestContext.cachedMainCamera); + } + + /// + /// + /// + /// + /// + /// + public Vector2 WorldToLocal(Vector3 pt, Camera camera) + { + Vector3 v = camera.WorldToScreenPoint(pt); + v.y = Screen.height - v.y; + v.z = 0; + return GlobalToLocal(v); + } + + /// + /// + /// + /// + /// + /// + public Vector2 TransformPoint(Vector2 pt, GObject targetSpace) + { + if (_pivotAsAnchor) + { + pt.x += _width * _pivotX; + pt.y += _height * _pivotY; + } + return this.displayObject.TransformPoint(pt, targetSpace != null ? targetSpace.displayObject : Stage.inst); + } + + /// + /// + /// + /// + /// + /// + public Rect TransformRect(Rect rect, GObject targetSpace) + { + if (_pivotAsAnchor) + { + rect.x += _width * _pivotX; + rect.y += _height * _pivotY; + } + return this.displayObject.TransformRect(rect, targetSpace != null ? targetSpace.displayObject : Stage.inst); + } + + /// + /// + /// + public bool isDisposed + { + get { return _disposed; } + } + + /// + /// + /// + virtual public void Dispose() + { + if (_disposed) + return; + + _disposed = true; + + RemoveFromParent(); + RemoveEventListeners(); + relations.Dispose(); + relations = null; + for (int i = 0; i < 10; i++) + { + GearBase gear = _gears[i]; + if (gear != null) + gear.Dispose(); + } + if (displayObject != null) + { + displayObject.gOwner = null; + displayObject.Dispose(); + } + data = null; + } + + /// + /// + /// + public GImage asImage + { + get { return this as GImage; } + } + + /// + /// + /// + public GComponent asCom + { + get { return this as GComponent; } + } + + /// + /// + /// + public GButton asButton + { + get { return this as GButton; } + } + + /// + /// + /// + public GLabel asLabel + { + get { return this as GLabel; } + } + + /// + /// + /// + public GProgressBar asProgress + { + get { return this as GProgressBar; } + } + + /// + /// + /// + public GSlider asSlider + { + get { return this as GSlider; } + } + + /// + /// + /// + public GComboBox asComboBox + { + get { return this as GComboBox; } + } + + /// + /// + /// + public GTextField asTextField + { + get { return this as GTextField; } + } + + /// + /// + /// + public GRichTextField asRichTextField + { + get { return this as GRichTextField; } + } + + /// + /// + /// + public GTextInput asTextInput + { + get { return this as GTextInput; } + } + + /// + /// + /// + public GLoader asLoader + { + get { return this as GLoader; } + } + + /// + /// + /// + public GLoader3D asLoader3D + { + get { return this as GLoader3D; } + } + + /// + /// + /// + public GList asList + { + get { return this as GList; } + } + + /// + /// + /// + public GGraph asGraph + { + get { return this as GGraph; } + } + + /// + /// + /// + public GGroup asGroup + { + get { return this as GGroup; } + } + + /// + /// + /// + public GMovieClip asMovieClip + { + get { return this as GMovieClip; } + } + + /// + /// + /// + public GTree asTree + { + get { return this as GTree; } + } + + /// + /// + /// + public GTreeNode treeNode + { + get { return _treeNode; } + } + + virtual protected void CreateDisplayObject() + { + } + + internal void InternalSetParent(GComponent value) + { + parent = value; + } + + virtual protected void HandlePositionChanged() + { + if (displayObject != null) + { + float xv = _x; + float yv = _y; + if (!_pivotAsAnchor) + { + xv += _width * _pivotX; + yv += _height * _pivotY; + } + displayObject.location = new Vector3(xv, yv, _z); + } + } + + virtual protected void HandleSizeChanged() + { + if (displayObject != null) + displayObject.SetSize(_width, _height); + } + + virtual protected void HandleScaleChanged() + { + if (displayObject != null) + displayObject.SetScale(_scaleX, _scaleY); + } + + virtual protected void HandleGrayedChanged() + { + if (displayObject != null) + displayObject.grayed = _grayed; + } + + virtual protected void HandleAlphaChanged() + { + if (displayObject != null) + displayObject.alpha = _alpha; + } + + virtual internal protected void HandleVisibleChanged() + { + if (displayObject != null) + displayObject.visible = internalVisible2; + } + + virtual public void ConstructFromResource() + { + } + + virtual public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + buffer.Seek(beginPos, 0); + buffer.Skip(5); + + id = buffer.ReadS(); + name = buffer.ReadS(); + float f1 = buffer.ReadInt(); + float f2 = buffer.ReadInt(); + SetXY(f1, f2); + + if (buffer.ReadBool()) + { + initWidth = buffer.ReadInt(); + initHeight = buffer.ReadInt(); + SetSize(initWidth, initHeight, true); + } + + if (buffer.ReadBool()) + { + minWidth = buffer.ReadInt(); + maxWidth = buffer.ReadInt(); + minHeight = buffer.ReadInt(); + maxHeight = buffer.ReadInt(); + } + + if (buffer.ReadBool()) + { + f1 = buffer.ReadFloat(); + f2 = buffer.ReadFloat(); + SetScale(f1, f2); + } + + if (buffer.ReadBool()) + { + f1 = buffer.ReadFloat(); + f2 = buffer.ReadFloat(); + this.skew = new Vector2(f1, f2); + } + + if (buffer.ReadBool()) + { + f1 = buffer.ReadFloat(); + f2 = buffer.ReadFloat(); + SetPivot(f1, f2, buffer.ReadBool()); + } + + f1 = buffer.ReadFloat(); + if (f1 != 1) + this.alpha = f1; + + f1 = buffer.ReadFloat(); + if (f1 != 0) + this.rotation = f1; + + if (!buffer.ReadBool()) + this.visible = false; + if (!buffer.ReadBool()) + this.touchable = false; + if (buffer.ReadBool()) + this.grayed = true; + this.blendMode = (BlendMode)buffer.ReadByte(); + + int filter = buffer.ReadByte(); + if (filter == 1) + { + ColorFilter cf = new ColorFilter(); + this.filter = cf; + + cf.AdjustBrightness(buffer.ReadFloat()); + cf.AdjustContrast(buffer.ReadFloat()); + cf.AdjustSaturation(buffer.ReadFloat()); + cf.AdjustHue(buffer.ReadFloat()); + } + + string str = buffer.ReadS(); + if (str != null) + this.data = str; + } + + virtual public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + buffer.Seek(beginPos, 1); + + string str = buffer.ReadS(); + if (str != null) + this.tooltips = str; + + int groupId = buffer.ReadShort(); + if (groupId >= 0) + group = parent.GetChildAt(groupId) as GGroup; + + buffer.Seek(beginPos, 2); + + int cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + GearBase gear = GetGear(buffer.ReadByte()); + gear.Setup(buffer); + + buffer.position = nextPos; + } + } + + #region Drag support + Vector2 _dragTouchStartPos; + bool _dragTesting; + + static Vector2 sGlobalDragStart = new Vector2(); + static Rect sGlobalRect = new Rect(); + static bool sUpdateInDragging = false; + + private void InitDrag() + { + if (_draggable) + { + onTouchBegin.Add(__touchBegin); + onTouchMove.Add(__touchMove); + onTouchEnd.Add(__touchEnd); + } + else + { + onTouchBegin.Remove(__touchBegin); + onTouchMove.Remove(__touchMove); + onTouchEnd.Remove(__touchEnd); + } + } + + private void DragBegin(int touchId) + { + if (DispatchEvent("onDragStart", touchId)) + return; + + if (draggingObject != null) + { + GObject tmp = draggingObject; + draggingObject.StopDrag(); + draggingObject = null; + tmp.DispatchEvent("onDragEnd", null); + } + + onTouchMove.Add(__touchMove); + onTouchEnd.Add(__touchEnd); + + sGlobalDragStart = Stage.inst.GetTouchPosition(touchId); + sGlobalRect = this.LocalToGlobal(new Rect(0, 0, this.width, this.height)); + _dragTesting = false; + + draggingObject = this; + Stage.inst.AddTouchMonitor(touchId, this); + } + + private void DragEnd() + { + if (draggingObject == this) + { + _dragTesting = false; + draggingObject = null; + } + } + + private void __touchBegin(EventContext context) + { + if ((Stage.inst.focus is InputTextField) && ((InputTextField)Stage.inst.focus).editable) + { + _dragTesting = false; + return; + } + + InputEvent evt = context.inputEvent; + _dragTouchStartPos = evt.position; + _dragTesting = true; + context.CaptureTouch(); + } + + private void __touchMove(EventContext context) + { + InputEvent evt = context.inputEvent; + + if (_dragTesting && draggingObject != this) + { + int sensitivity; + if (Stage.touchScreen) + sensitivity = UIConfig.touchDragSensitivity; + else + sensitivity = UIConfig.clickDragSensitivity; + if (Mathf.Abs(_dragTouchStartPos.x - evt.x) < sensitivity + && Mathf.Abs(_dragTouchStartPos.y - evt.y) < sensitivity) + return; + + _dragTesting = false; + DragBegin(evt.touchId); + } + + if (draggingObject == this) + { + float xx = evt.x - sGlobalDragStart.x + sGlobalRect.x; + float yy = evt.y - sGlobalDragStart.y + sGlobalRect.y; + + if (dragBounds != null) + { + Rect rect = GRoot.inst.LocalToGlobal((Rect)dragBounds); + if (xx < rect.x) + xx = rect.x; + else if (xx + sGlobalRect.width > rect.xMax) + { + xx = rect.xMax - sGlobalRect.width; + if (xx < rect.x) + xx = rect.x; + } + + if (yy < rect.y) + yy = rect.y; + else if (yy + sGlobalRect.height > rect.yMax) + { + yy = rect.yMax - sGlobalRect.height; + if (yy < rect.y) + yy = rect.y; + } + } + + Vector2 pt = this.parent.GlobalToLocal(new Vector2(xx, yy)); + if (float.IsNaN(pt.x)) + return; + + sUpdateInDragging = true; + this.SetXY(Mathf.RoundToInt(pt.x), Mathf.RoundToInt(pt.y)); + sUpdateInDragging = false; + + DispatchEvent("onDragMove", null); + } + } + + private void __touchEnd(EventContext context) + { + if (draggingObject == this) + { + draggingObject = null; + DispatchEvent("onDragEnd", null); + } + } + #endregion + + #region Tween Helpers + public GTweener TweenMove(Vector2 endValue, float duration) + { + return GTween.To(this.xy, endValue, duration).SetTarget(this, TweenPropType.XY); + } + + public GTweener TweenMoveX(float endValue, float duration) + { + return GTween.To(_x, endValue, duration).SetTarget(this, TweenPropType.X); + } + + public GTweener TweenMoveY(float endValue, float duration) + { + return GTween.To(_y, endValue, duration).SetTarget(this, TweenPropType.Y); + } + + public GTweener TweenScale(Vector2 endValue, float duration) + { + return GTween.To(this.scale, endValue, duration).SetTarget(this, TweenPropType.Scale); + } + + public GTweener TweenScaleX(float endValue, float duration) + { + return GTween.To(_scaleX, endValue, duration).SetTarget(this, TweenPropType.ScaleX); + } + + public GTweener TweenScaleY(float endValue, float duration) + { + return GTween.To(_scaleY, endValue, duration).SetTarget(this, TweenPropType.ScaleY); + } + + public GTweener TweenResize(Vector2 endValue, float duration) + { + return GTween.To(this.size, endValue, duration).SetTarget(this, TweenPropType.Size); + } + + public GTweener TweenFade(float endValue, float duration) + { + return GTween.To(_alpha, endValue, duration).SetTarget(this, TweenPropType.Alpha); + } + + public GTweener TweenRotate(float endValue, float duration) + { + return GTween.To(_rotation, endValue, duration).SetTarget(this, TweenPropType.Rotation); + } + #endregion + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs.meta new file mode 100644 index 00000000..9a83568e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObject.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d3ab09a55620b5f40a544e775edc4b22 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs new file mode 100644 index 00000000..baafadd9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs @@ -0,0 +1,106 @@ +using UnityEngine; +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GObjectPool is use for GObject pooling. + /// + public class GObjectPool + { + /// + /// Callback function when a new object is creating. + /// + /// + public delegate void InitCallbackDelegate(GObject obj); + + /// + /// Callback function when a new object is creating. + /// + public InitCallbackDelegate initCallback; + + Dictionary> _pool; + Transform _manager; + + /// + /// 需è¦è®¾ç½®ä¸€ä¸ªmanager,加入池里的对象都æˆä¸ºè¿™ä¸ªmanagerçš„å­©å­ + /// + /// + public GObjectPool(Transform manager) + { + _manager = manager; + _pool = new Dictionary>(); + } + + /// + /// Dispose all objects in the pool. + /// + public void Clear() + { + foreach (KeyValuePair> kv in _pool) + { + Queue list = kv.Value; + foreach (GObject obj in list) + obj.Dispose(); + } + _pool.Clear(); + } + + /// + /// + /// + public int count + { + get { return _pool.Count; } + } + + /// + /// + /// + /// + /// + public GObject GetObject(string url) + { + url = UIPackage.NormalizeURL(url); + if (url == null) + return null; + + Queue arr; + if (_pool.TryGetValue(url, out arr) + && arr.Count > 0) + return arr.Dequeue(); + + GObject obj = UIPackage.CreateObjectFromURL(url); + if (obj != null) + { + if (initCallback != null) + initCallback(obj); + } + + return obj; + } + + /// + /// + /// + /// + public void ReturnObject(GObject obj) + { + if (obj.displayObject.isDisposed) + return; + + string url = obj.resourceURL; + Queue arr; + if (!_pool.TryGetValue(url, out arr)) + { + arr = new Queue(); + _pool.Add(url, arr); + } + + if (_manager != null) + obj.displayObject.cachedTransform.SetParent(_manager, false); + arr.Enqueue(obj); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs.meta new file mode 100644 index 00000000..ff77930a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GObjectPool.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bb355b8d4ba140f469be6be6b062dfda +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs new file mode 100644 index 00000000..50d37488 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs @@ -0,0 +1,311 @@ +using System; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GProgressBar class. + /// + public class GProgressBar : GComponent + { + double _min; + double _max; + double _value; + ProgressTitleType _titleType; + bool _reverse; + + GObject _titleObject; + GMovieClip _aniObject; + GObject _barObjectH; + GObject _barObjectV; + float _barMaxWidth; + float _barMaxHeight; + float _barMaxWidthDelta; + float _barMaxHeightDelta; + float _barStartX; + float _barStartY; + + public GProgressBar() + { + _value = 50; + _max = 100; + } + + /// + /// + /// + public ProgressTitleType titleType + { + + get + { + return _titleType; + } + set + { + if (_titleType != value) + { + _titleType = value; + Update(_value); + } + } + } + + /// + /// + /// + public double min + { + get + { + return _min; + } + set + { + if (_min != value) + { + _min = value; + Update(_value); + } + } + } + + /// + /// + /// + public double max + { + get + { + return _max; + } + set + { + if (_max != value) + { + _max = value; + Update(_value); + } + } + } + + /// + /// + /// + public double value + { + get + { + return _value; + } + set + { + if (_value != value) + { + GTween.Kill(this, TweenPropType.Progress, false); + + _value = value; + Update(_value); + } + } + } + + public bool reverse + { + get { return _reverse; } + set { _reverse = value; } + } + + /// + /// åŠ¨æ€æ”¹å˜è¿›åº¦å€¼ã€‚ + /// + /// + /// + public GTweener TweenValue(double value, float duration) + { + double oldValule; + + GTweener twener = GTween.GetTween(this, TweenPropType.Progress); + if (twener != null) + { + oldValule = twener.value.d; + twener.Kill(false); + } + else + oldValule = _value; + + _value = value; + return GTween.ToDouble(oldValule, _value, duration) + .SetEase(EaseType.Linear) + .SetTarget(this, TweenPropType.Progress); + } + + /// + /// + /// + /// + public void Update(double newValue) + { + float percent = Mathf.Clamp01((float)((newValue - _min) / (_max - _min))); + if (_titleObject != null) + { + switch (_titleType) + { + case ProgressTitleType.Percent: + if (RTLSupport.BaseDirection == RTLSupport.DirectionType.RTL) + _titleObject.text = "%" + Mathf.FloorToInt(percent * 100); + else + _titleObject.text = Mathf.FloorToInt(percent * 100) + "%"; + break; + + case ProgressTitleType.ValueAndMax: + if (RTLSupport.BaseDirection == RTLSupport.DirectionType.RTL) + _titleObject.text = Math.Round(max) + "/" + Math.Round(newValue); + else + _titleObject.text = Math.Round(newValue) + "/" + Math.Round(max); + break; + + case ProgressTitleType.Value: + _titleObject.text = "" + Math.Round(newValue); + break; + + case ProgressTitleType.Max: + _titleObject.text = "" + Math.Round(_max); + break; + } + } + + float fullWidth = this.width - _barMaxWidthDelta; + float fullHeight = this.height - _barMaxHeightDelta; + if (!_reverse) + { + if (_barObjectH != null) + { + if (!SetFillAmount(_barObjectH, percent)) + _barObjectH.width = Mathf.RoundToInt(fullWidth * percent); + } + if (_barObjectV != null) + { + if (!SetFillAmount(_barObjectV, percent)) + _barObjectV.height = Mathf.RoundToInt(fullHeight * percent); + } + } + else + { + if (_barObjectH != null) + { + if (!SetFillAmount(_barObjectH, 1 - percent)) + { + _barObjectH.width = Mathf.RoundToInt(fullWidth * percent); + _barObjectH.x = _barStartX + (fullWidth - _barObjectH.width); + } + } + if (_barObjectV != null) + { + if (!SetFillAmount(_barObjectV, 1 - percent)) + { + _barObjectV.height = Mathf.RoundToInt(fullHeight * percent); + _barObjectV.y = _barStartY + (fullHeight - _barObjectV.height); + } + } + } + if (_aniObject != null) + _aniObject.frame = Mathf.RoundToInt(percent * 100); + + InvalidateBatchingState(true); + } + + bool SetFillAmount(GObject bar, float amount) + { + if ((bar is GImage) && ((GImage)bar).fillMethod != FillMethod.None) + ((GImage)bar).fillAmount = amount; + else if ((bar is GLoader) && ((GLoader)bar).fillMethod != FillMethod.None) + ((GLoader)bar).fillAmount = amount; + else + return false; + + return true; + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + buffer.Seek(0, 6); + + _titleType = (ProgressTitleType)buffer.ReadByte(); + _reverse = buffer.ReadBool(); + + _titleObject = GetChild("title"); + _barObjectH = GetChild("bar"); + _barObjectV = GetChild("bar_v"); + _aniObject = GetChild("ani") as GMovieClip; + + if (_barObjectH != null) + { + _barMaxWidth = _barObjectH.width; + _barMaxWidthDelta = this.width - _barMaxWidth; + _barStartX = _barObjectH.x; + } + if (_barObjectV != null) + { + _barMaxHeight = _barObjectV.height; + _barMaxHeightDelta = this.height - _barMaxHeight; + _barStartY = _barObjectV.y; + } + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!buffer.Seek(beginPos, 6)) + { + Update(_value); + return; + } + + if ((ObjectType)buffer.ReadByte() != packageItem.objectType) + { + Update(_value); + return; + } + + _value = buffer.ReadInt(); + _max = buffer.ReadInt(); + if (buffer.version >= 2) + _min = buffer.ReadInt(); + + if (buffer.version >= 5) + { + string sound = buffer.ReadS(); + if (!string.IsNullOrEmpty(sound)) + { + float volumeScale = buffer.ReadFloat(); + displayObject.onClick.Add(() => + { + NAudioClip audioClip = UIPackage.GetItemAssetByURL(sound) as NAudioClip; + if (audioClip != null && audioClip.nativeClip != null) + Stage.inst.PlayOneShotSound(audioClip.nativeClip, volumeScale); + }); + } + else + buffer.Skip(4); + } + + Update(_value); + } + + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + if (_barObjectH != null) + _barMaxWidth = this.width - _barMaxWidthDelta; + if (_barObjectV != null) + _barMaxHeight = this.height - _barMaxHeightDelta; + + if (!this.underConstruct) + Update(_value); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs.meta new file mode 100644 index 00000000..4e1209e7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GProgressBar.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4f13bf1fdc7711c4aa9c5e1631138025 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs new file mode 100644 index 00000000..7df005e5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// GRichTextField class. + /// + public class GRichTextField : GTextField + { + /// + /// + /// + public RichTextField richTextField { get; private set; } + + public GRichTextField() + : base() + { + } + + override protected void CreateDisplayObject() + { + richTextField = new RichTextField(); + richTextField.gOwner = this; + displayObject = richTextField; + + _textField = richTextField.textField; + } + + override protected void SetTextFieldText() + { + string str = _text; + if (_templateVars != null) + str = ParseTemplate(str); + + _textField.maxWidth = maxWidth; + if (_ubbEnabled) + richTextField.htmlText = UBBParser.inst.Parse(str); + else + richTextField.htmlText = str; + } + + /// + /// + /// + public Dictionary emojies + { + get { return richTextField.emojies; } + set { richTextField.emojies = value; } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs.meta new file mode 100644 index 00000000..72b28e17 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRichTextField.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c329d14f7b7d35348be7ec3e2a4b0591 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs new file mode 100644 index 00000000..83735b42 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs @@ -0,0 +1,847 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// GRoot is a topmost component of UI display list.You dont need to create GRoot. It is created automatically. + /// + public class GRoot : GComponent + { + /// + /// + /// + public static float contentScaleFactor + { + get { return UIContentScaler.scaleFactor; } + } + + /// + /// + /// + public static int contentScaleLevel + { + get { return UIContentScaler.scaleLevel; } + } + + GGraph _modalLayer; + GObject _modalWaitPane; + List _popupStack; + List _justClosedPopups; + HashSet _specialPopups; + GObject _tooltipWin; + GObject _defaultTooltipWin; + + internal static GRoot _inst; + public static GRoot inst + { + get + { + if (_inst == null) + Stage.Instantiate(); + + return _inst; + } + } + + public GRoot() + { + this.name = this.rootContainer.name = this.rootContainer.gameObject.name = "GRoot"; + this.opaque = false; + + _popupStack = new List(); + _justClosedPopups = new List(); + _specialPopups = new HashSet(); + + Stage.inst.onTouchBegin.AddCapture(__stageTouchBegin); + Stage.inst.onTouchEnd.AddCapture(__stageTouchEnd); + } + + override public void Dispose() + { + base.Dispose(); + + Stage.inst.onTouchBegin.RemoveCapture(__stageTouchBegin); + Stage.inst.onTouchEnd.RemoveCapture(__stageTouchEnd); + } + + /// + /// Set content scale factor. + /// + /// Design resolution of x axis. + /// Design resolution of y axis. + public void SetContentScaleFactor(int designResolutionX, int designResolutionY) + { + SetContentScaleFactor(designResolutionX, designResolutionY, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight); + } + + /// + /// Set content scale factor. + /// + /// Design resolution of x axis. + /// Design resolution of y axis. + /// Match mode. + public void SetContentScaleFactor(int designResolutionX, int designResolutionY, UIContentScaler.ScreenMatchMode screenMatchMode) + { + UIContentScaler scaler = Stage.inst.gameObject.GetComponent(); + scaler.designResolutionX = designResolutionX; + scaler.designResolutionY = designResolutionY; + scaler.scaleMode = UIContentScaler.ScaleMode.ScaleWithScreenSize; + scaler.screenMatchMode = screenMatchMode; + scaler.ApplyChange(); + ApplyContentScaleFactor(); + } + + /// + /// + /// + /// + public void SetContentScaleFactor(float constantScaleFactor) + { + UIContentScaler scaler = Stage.inst.gameObject.GetComponent(); + scaler.scaleMode = UIContentScaler.ScaleMode.ConstantPixelSize; + scaler.constantScaleFactor = constantScaleFactor; + scaler.ApplyChange(); + ApplyContentScaleFactor(); + } + + /// + /// This is called after screen size changed. + /// + public void ApplyContentScaleFactor() + { + this.SetSize(Mathf.CeilToInt(Stage.inst.width / UIContentScaler.scaleFactor), Mathf.CeilToInt(Stage.inst.height / UIContentScaler.scaleFactor)); + this.SetScale(UIContentScaler.scaleFactor, UIContentScaler.scaleFactor); + } + + /// + /// Display a window. + /// + /// + public void ShowWindow(Window win) + { + AddChild(win); + AdjustModalLayer(); + } + + /// + /// Call window.Hide + /// 关闭一个窗å£ã€‚将调用Window.Hide方法。 + /// + /// + public void HideWindow(Window win) + { + win.Hide(); + } + + /// + /// Remove a window from stage immediatelly. window.Hide/window.OnHide will never be called. + ///立刻关闭一个窗å£ã€‚ä¸ä¼šè°ƒç”¨Window.Hide方法,Window.OnHide也ä¸ä¼šè¢«è°ƒç”¨ã€‚ + /// + /// + public void HideWindowImmediately(Window win) + { + HideWindowImmediately(win, false); + } + + /// + /// Remove a window from stage immediatelly. window.Hide/window.OnHide will never be called. + /// 立刻关闭一个窗å£ã€‚ä¸ä¼šè°ƒç”¨Window.Hide方法,Window.OnHide也ä¸ä¼šè¢«è°ƒç”¨ã€‚ + /// + /// + /// True to dispose the window. + public void HideWindowImmediately(Window win, bool dispose) + { + if (win.parent == this) + RemoveChild(win, dispose); + else if (dispose) + win.Dispose(); + + AdjustModalLayer(); + } + + /// + /// å°†ä¸€ä¸ªçª—å£æåˆ°æ‰€æœ‰çª—å£çš„æœ€å‰é¢ + /// + /// + public void BringToFront(Window win) + { + int cnt = this.numChildren; + int i; + if (_modalLayer != null && _modalLayer.parent != null && !win.modal) + i = GetChildIndex(_modalLayer) - 1; + else + i = cnt - 1; + + for (; i >= 0; i--) + { + GObject g = GetChildAt(i); + if (g == win) + return; + if (g is Window) + break; + } + + if (i >= 0) + SetChildIndex(win, i); + } + + /// + /// Display a modal layer and a waiting sign in the front. + /// 显示一个åŠé€æ˜Žå±‚和一个等待标志在最å‰é¢ã€‚åŠé€æ˜Žå±‚的颜色å¯ä»¥é€šè¿‡UIConfig.modalLayerColor设定。 + /// 等待标志的资æºå¯ä»¥é€šè¿‡UIConfig.globalModalWaiting。等待标志组件会设置为å±å¹•大å°ï¼Œè¯·å†…部åšå¥½å…³è”。 + /// + public void ShowModalWait() + { + if (UIConfig.globalModalWaiting != null) + { + if (_modalWaitPane == null || _modalWaitPane.isDisposed) + { + _modalWaitPane = UIPackage.CreateObjectFromURL(UIConfig.globalModalWaiting); + _modalWaitPane.SetHome(this); + } + _modalWaitPane.SetSize(this.width, this.height); + _modalWaitPane.AddRelation(this, RelationType.Size); + + AddChild(_modalWaitPane); + } + } + + /// + /// Hide modal layer and waiting sign. + /// + public void CloseModalWait() + { + if (_modalWaitPane != null && _modalWaitPane.parent != null) + RemoveChild(_modalWaitPane); + } + + /// + /// Close all windows except modal windows. + /// + public void CloseAllExceptModals() + { + GObject[] arr = _children.ToArray(); + foreach (GObject g in arr) + { + if ((g is Window) && !(g as Window).modal) + HideWindowImmediately(g as Window); + } + } + + /// + /// Close all windows. + /// + public void CloseAllWindows() + { + GObject[] arr = _children.ToArray(); + foreach (GObject g in arr) + { + if (g is Window) + HideWindowImmediately(g as Window); + } + } + + /// + /// Get window on top. + /// + /// + public Window GetTopWindow() + { + int cnt = this.numChildren; + for (int i = cnt - 1; i >= 0; i--) + { + GObject g = this.GetChildAt(i); + if (g is Window) + { + return (Window)(g); + } + } + + return null; + } + + /// + /// + /// + public GGraph modalLayer + { + get + { + if (_modalLayer == null || _modalLayer.isDisposed) + CreateModalLayer(); + + return _modalLayer; + } + } + + void CreateModalLayer() + { + _modalLayer = new GGraph(); + _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor); + _modalLayer.AddRelation(this, RelationType.Size); + _modalLayer.name = _modalLayer.gameObjectName = "ModalLayer"; + _modalLayer.SetHome(this); + } + + /// + /// Return true if a modal window is on stage. + /// + public bool hasModalWindow + { + get { return _modalLayer != null && _modalLayer.parent != null; } + } + + /// + /// Return true if modal waiting layer is on stage. + /// + public bool modalWaiting + { + get + { + return (_modalWaitPane != null) && _modalWaitPane.onStage; + } + } + + /// + /// Get current touch target. (including hover) + /// + public GObject touchTarget + { + get + { + return DisplayObjectToGObject(Stage.inst.touchTarget); + } + } + + /// + /// + /// + /// + /// + public GObject DisplayObjectToGObject(DisplayObject obj) + { + while (obj != null) + { + if (obj.gOwner != null) + return obj.gOwner; + + obj = obj.parent; + } + return null; + } + + private void AdjustModalLayer() + { + if (_modalLayer == null || _modalLayer.isDisposed) + CreateModalLayer(); + + int cnt = this.numChildren; + + if (_modalWaitPane != null && _modalWaitPane.parent != null) + SetChildIndex(_modalWaitPane, cnt - 1); + + for (int i = cnt - 1; i >= 0; i--) + { + GObject g = this.GetChildAt(i); + if ((g is Window) && (g as Window).modal) + { + if (_modalLayer.parent == null) + AddChildAt(_modalLayer, i); + else + SetChildIndexBefore(_modalLayer, i); + return; + } + } + + if (_modalLayer.parent != null) + RemoveChild(_modalLayer); + } + + /// + /// Show a popup object. + /// 显示一个popup。 + /// popup的特点是点击popup对象外的区域,popup对象将自动消失。 + /// + /// + public void ShowPopup(GObject popup) + { + ShowPopup(popup, null, PopupDirection.Auto, false); + } + + /// + /// Show a popup object along with the specific target object. + /// 显示一个popup。将popup显示在指定对象的上边或者下边。 + /// popup的特点是点击popup对象外的区域,popup对象将自动消失。 + /// + /// + /// + public void ShowPopup(GObject popup, GObject target) + { + ShowPopup(popup, target, PopupDirection.Auto, false); + } + + [Obsolete] + public void ShowPopup(GObject popup, GObject target, object downward) + { + ShowPopup(popup, target, + downward == null ? PopupDirection.Auto : ((bool)downward == true ? PopupDirection.Down : PopupDirection.Up), + false); + } + + /// + /// Show a popup object along with the specific target object. + /// 显示一个popup。将popup显示在指定对象的上方或者下方。 + /// popup的特点是点击popup对象外的区域,popup对象将自动消失。 + /// + /// + /// + /// + public void ShowPopup(GObject popup, GObject target, PopupDirection dir) + { + ShowPopup(popup, target, dir, false); + } + + /// + /// Show a popup object along with the specific target object. + /// 显示一个popup。将popup显示在指定对象的上方或者下方。 + /// popup的特点是点击popup对象外的区域,popup对象将自动消失。 + /// 默认情况下,popup在touchEnd事件中关闭;特别设置closeUntilUpEvent=true则å¯ä½¿è¯¥popup在touchEnd中æ‰å…³é—­ã€‚ + /// + /// + /// + /// + /// + public void ShowPopup(GObject popup, GObject target, PopupDirection dir, bool closeUntilUpEvent) + { + if (_popupStack.Count > 0) + { + int k = _popupStack.IndexOf(popup); + if (k != -1) + { + for (int i = _popupStack.Count - 1; i >= k; i--) + { + int last = _popupStack.Count - 1; + GObject obj = _popupStack[last]; + ClosePopup(obj); + _popupStack.RemoveAt(last); + _specialPopups.Remove(obj); + } + } + } + _popupStack.Add(popup); + if (closeUntilUpEvent) + _specialPopups.Add(popup); + + if (target != null) + { + GObject p = target; + while (p != null) + { + if (p.parent == this) + { + if (popup.sortingOrder < p.sortingOrder) + { + popup.sortingOrder = p.sortingOrder; + } + break; + } + p = p.parent; + } + } + + AddChild(popup); + AdjustModalLayer(); + + if ((popup is Window) && target == null && dir == PopupDirection.Auto) + return; + + Vector2 pos = GetPoupPosition(popup, target, dir); + popup.xy = pos; + } + + [Obsolete] + public Vector2 GetPoupPosition(GObject popup, GObject target, object downward) + { + return GetPoupPosition(popup, target, + downward == null ? PopupDirection.Auto : ((bool)downward == true ? PopupDirection.Down : PopupDirection.Up)); + } + + /// + /// + /// + /// + /// + /// + /// + public Vector2 GetPoupPosition(GObject popup, GObject target, PopupDirection dir) + { + Vector2 pos; + Vector2 size = Vector2.zero; + if (target != null) + { + pos = target.LocalToRoot(Vector2.zero, this); + size = target.LocalToRoot(target.size, this) - pos; + } + else + { + pos = this.GlobalToLocal(Stage.inst.touchPosition); + } + float xx, yy; + xx = pos.x; + if (xx + popup.width > this.width) + xx = xx + size.x - popup.width; + yy = pos.y + size.y; + if ((dir == PopupDirection.Auto && yy + popup.height > this.height) + || dir == PopupDirection.Up) + { + yy = pos.y - popup.height - 1; + if (yy < 0) + { + yy = 0; + xx += size.x / 2; + } + } + + return new Vector2(Mathf.RoundToInt(xx), Mathf.RoundToInt(yy)); + } + + /// + /// If a popup is showing, then close it; otherwise, open it. + /// + /// + public void TogglePopup(GObject popup) + { + TogglePopup(popup, null, PopupDirection.Auto, false); + } + + /// + /// + /// + /// + /// + public void TogglePopup(GObject popup, GObject target) + { + TogglePopup(popup, target, PopupDirection.Auto, false); + } + + [Obsolete] + public void TogglePopup(GObject popup, GObject target, object downward) + { + TogglePopup(popup, target, + downward == null ? PopupDirection.Auto : ((bool)downward == true ? PopupDirection.Down : PopupDirection.Up), + false); + } + + /// + /// + /// + /// + /// + /// + public void TogglePopup(GObject popup, GObject target, PopupDirection dir) + { + TogglePopup(popup, target, dir, false); + } + + /// + /// + /// + /// + /// + /// + /// + public void TogglePopup(GObject popup, GObject target, PopupDirection dir, bool closeUntilUpEvent) + { + if (_justClosedPopups.IndexOf(popup) != -1) + return; + + ShowPopup(popup, target, dir, closeUntilUpEvent); + } + + /// + /// Close all popups. + /// + public void HidePopup() + { + HidePopup(null); + } + + /// + /// Close a popup. + /// + /// + public void HidePopup(GObject popup) + { + if (popup != null) + { + int k = _popupStack.IndexOf(popup); + if (k != -1) + { + for (int i = _popupStack.Count - 1; i >= k; i--) + { + int last = _popupStack.Count - 1; + GObject obj = _popupStack[last]; + ClosePopup(obj); + _popupStack.RemoveAt(last); + _specialPopups.Remove(obj); + } + } + } + else + { + foreach (GObject obj in _popupStack) + ClosePopup(obj); + _popupStack.Clear(); + _specialPopups.Clear(); + } + } + + /// + /// + /// + public bool hasAnyPopup + { + get { return _popupStack.Count > 0; } + } + + void ClosePopup(GObject target) + { + if (target.parent != null) + { + if (target is Window) + ((Window)target).Hide(); + else + RemoveChild(target); + } + } + + /// + /// + /// + /// + public void ShowTooltips(string msg) + { + ShowTooltips(msg, 0.1f); + } + + /// + /// + /// + /// + /// + public void ShowTooltips(string msg, float delay) + { + if (_defaultTooltipWin == null || _defaultTooltipWin.isDisposed) + { + string resourceURL = UIConfig.tooltipsWin; + if (string.IsNullOrEmpty(resourceURL)) + { + Debug.LogWarning("FairyGUI: UIConfig.tooltipsWin not defined"); + return; + } + + _defaultTooltipWin = UIPackage.CreateObjectFromURL(resourceURL); + _defaultTooltipWin.SetHome(this); + _defaultTooltipWin.touchable = false; + } + + _defaultTooltipWin.text = msg; + ShowTooltipsWin(_defaultTooltipWin, delay); + } + + /// + /// + /// + /// + public void ShowTooltipsWin(GObject tooltipWin) + { + ShowTooltipsWin(tooltipWin, 0.1f); + } + + /// + /// + /// + /// + /// + public void ShowTooltipsWin(GObject tooltipWin, float delay) + { + HideTooltips(); + + _tooltipWin = tooltipWin; + Timers.inst.Add(delay, 1, __showTooltipsWin); + } + + void __showTooltipsWin(object param) + { + if (_tooltipWin == null) + return; + + float xx = Stage.inst.touchPosition.x + 10; + float yy = Stage.inst.touchPosition.y + 20; + + Vector2 pt = this.GlobalToLocal(new Vector2(xx, yy)); + xx = pt.x; + yy = pt.y; + + if (xx + _tooltipWin.width > this.width) + xx = xx - _tooltipWin.width; + if (yy + _tooltipWin.height > this.height) + { + yy = yy - _tooltipWin.height - 1; + if (yy < 0) + yy = 0; + } + + _tooltipWin.x = Mathf.RoundToInt(xx); + _tooltipWin.y = Mathf.RoundToInt(yy); + AddChild(_tooltipWin); + } + + /// + /// + /// + public void HideTooltips() + { + if (_tooltipWin != null) + { + if (_tooltipWin.parent != null) + RemoveChild(_tooltipWin); + _tooltipWin = null; + } + } + + /// + /// + /// + public GObject focus + { + get + { + GObject obj = DisplayObjectToGObject(Stage.inst.focus); + if (obj != null && !IsAncestorOf(obj)) + return null; + else + return obj; + } + + set + { + if (value == null) + Stage.inst.focus = null; + else + Stage.inst.focus = value.displayObject; + } + } + + void __stageTouchBegin(EventContext context) + { + if (_tooltipWin != null) + HideTooltips(); + + CheckPopups(true); + } + + void __stageTouchEnd(EventContext context) + { + CheckPopups(false); + } + + void CheckPopups(bool touchBegin) + { + if (touchBegin) + _justClosedPopups.Clear(); + + if (_popupStack.Count > 0) + { + DisplayObject mc = Stage.inst.touchTarget as DisplayObject; + bool handled = false; + while (mc != Stage.inst && mc != null) + { + if (mc.gOwner != null) + { + int k = _popupStack.IndexOf(mc.gOwner); + if (k != -1) + { + for (int i = _popupStack.Count - 1; i > k; i--) + { + int last = _popupStack.Count - 1; + GObject popup = _popupStack[last]; + if (touchBegin == _specialPopups.Contains(popup)) + continue; + + ClosePopup(popup); + _justClosedPopups.Add(popup); + _popupStack.RemoveAt(last); + _specialPopups.Remove(popup); + } + handled = true; + break; + } + } + mc = mc.parent; + } + + if (!handled) + { + for (int i = _popupStack.Count - 1; i >= 0; i--) + { + GObject popup = _popupStack[i]; + if (touchBegin == _specialPopups.Contains(popup)) + continue; + + ClosePopup(popup); + _justClosedPopups.Add(popup); + _popupStack.RemoveAt(i); + _specialPopups.Remove(popup); + } + } + } + } + + /// + /// + /// + public void EnableSound() + { + Stage.inst.EnableSound(); + } + + /// + /// + /// + public void DisableSound() + { + Stage.inst.DisableSound(); + } + + /// + /// + /// + /// + /// + public void PlayOneShotSound(AudioClip clip, float volumeScale) + { + Stage.inst.PlayOneShotSound(clip, volumeScale); + } + + /// + /// + /// + /// + public void PlayOneShotSound(AudioClip clip) + { + Stage.inst.PlayOneShotSound(clip); + } + + /// + /// + /// + public float soundVolume + { + get { return Stage.inst.soundVolume; } + set { Stage.inst.soundVolume = value; } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs.meta new file mode 100644 index 00000000..75c0d929 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GRoot.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c82e50658ca58b2459448b9c86cb4777 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs new file mode 100644 index 00000000..c490ce10 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs @@ -0,0 +1,226 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// GScrollBar class. + /// + public class GScrollBar : GComponent + { + GObject _grip; + GObject _arrowButton1; + GObject _arrowButton2; + GObject _bar; + ScrollPane _target; + + bool _vertical; + float _scrollPerc; + bool _fixedGripSize; + bool _gripDragging; + + Vector2 _dragOffset; + + public GScrollBar() + { + _scrollPerc = 0; + } + + /// + /// + /// + /// + /// + public void SetScrollPane(ScrollPane target, bool vertical) + { + _target = target; + _vertical = vertical; + } + + /// + /// + /// + public void SetDisplayPerc(float value) + { + if (_vertical) + { + if (!_fixedGripSize) + _grip.height = Mathf.FloorToInt(value * _bar.height); + _grip.y = Mathf.RoundToInt(_bar.y + (_bar.height - _grip.height) * _scrollPerc); + } + else + { + if (!_fixedGripSize) + _grip.width = Mathf.FloorToInt(value * _bar.width); + _grip.x = Mathf.RoundToInt(_bar.x + (_bar.width - _grip.width) * _scrollPerc); + } + + _grip.visible = value != 0 && value != 1; + } + + /// + /// + /// + public void setScrollPerc(float value) + { + _scrollPerc = value; + if (_vertical) + _grip.y = Mathf.RoundToInt(_bar.y + (_bar.height - _grip.height) * _scrollPerc); + else + _grip.x = Mathf.RoundToInt(_bar.x + (_bar.width - _grip.width) * _scrollPerc); + } + + /// + /// + /// + public float minSize + { + get + { + if (_vertical) + return (_arrowButton1 != null ? _arrowButton1.height : 0) + (_arrowButton2 != null ? _arrowButton2.height : 0); + else + return (_arrowButton1 != null ? _arrowButton1.width : 0) + (_arrowButton2 != null ? _arrowButton2.width : 0); + } + } + + /// + /// + /// + public bool gripDragging + { + get + { + return _gripDragging; + } + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + buffer.Seek(0, 6); + + _fixedGripSize = buffer.ReadBool(); + + _grip = GetChild("grip"); + if (_grip == null) + { + Debug.LogWarning("FairyGUI: " + this.resourceURL + " should define grip"); + return; + } + + _bar = GetChild("bar"); + if (_bar == null) + { + Debug.LogWarning("FairyGUI: " + this.resourceURL + " should define bar"); + return; + } + + _arrowButton1 = GetChild("arrow1"); + _arrowButton2 = GetChild("arrow2"); + + _grip.onTouchBegin.Add(__gripTouchBegin); + _grip.onTouchMove.Add(__gripTouchMove); + _grip.onTouchEnd.Add(__gripTouchEnd); + + this.onTouchBegin.Add(__touchBegin); + if (_arrowButton1 != null) + _arrowButton1.onTouchBegin.Add(__arrowButton1Click); + if (_arrowButton2 != null) + _arrowButton2.onTouchBegin.Add(__arrowButton2Click); + } + + void __gripTouchBegin(EventContext context) + { + if (_bar == null) + return; + + context.StopPropagation(); + + InputEvent evt = context.inputEvent; + if (evt.button != 0) + return; + + context.CaptureTouch(); + + _gripDragging = true; + _target.UpdateScrollBarVisible(); + + _dragOffset = this.GlobalToLocal(new Vector2(evt.x, evt.y)) - _grip.xy; + } + + void __gripTouchMove(EventContext context) + { + InputEvent evt = context.inputEvent; + Vector2 pt = this.GlobalToLocal(new Vector2(evt.x, evt.y)); + if (float.IsNaN(pt.x)) + return; + + if (_vertical) + { + float curY = pt.y - _dragOffset.y; + float diff = _bar.height - _grip.height; + if (diff == 0) + _target.percY = 0; + else + _target.percY = (curY - _bar.y) / diff; + } + else + { + float curX = pt.x - _dragOffset.x; + float diff = _bar.width - _grip.width; + if (diff == 0) + _target.percX = 0; + else + _target.percX = (curX - _bar.x) / diff; + } + } + + void __gripTouchEnd(EventContext context) + { + _gripDragging = false; + _target.UpdateScrollBarVisible(); + } + + void __arrowButton1Click(EventContext context) + { + context.StopPropagation(); + + if (_vertical) + _target.ScrollUp(); + else + _target.ScrollLeft(); + } + + void __arrowButton2Click(EventContext context) + { + context.StopPropagation(); + + if (_vertical) + _target.ScrollDown(); + else + _target.ScrollRight(); + } + + void __touchBegin(EventContext context) + { + context.StopPropagation(); + + InputEvent evt = context.inputEvent; + Vector2 pt = _grip.GlobalToLocal(new Vector2(evt.x, evt.y)); + if (_vertical) + { + if (pt.y < 0) + _target.ScrollUp(4, false); + else + _target.ScrollDown(4, false); + } + else + { + if (pt.x < 0) + _target.ScrollLeft(4, false); + else + _target.ScrollRight(4, false); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs.meta new file mode 100644 index 00000000..7f28629e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GScrollBar.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b6b0ce43cdb60cf4e8e1ddccdf2f5082 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs new file mode 100644 index 00000000..86642640 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs @@ -0,0 +1,405 @@ +using System; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class GSlider : GComponent + { + double _min; + double _max; + double _value; + ProgressTitleType _titleType; + bool _reverse; + bool _wholeNumbers; + + GObject _titleObject; + GObject _barObjectH; + GObject _barObjectV; + float _barMaxWidth; + float _barMaxHeight; + float _barMaxWidthDelta; + float _barMaxHeightDelta; + GObject _gripObject; + Vector2 _clickPos; + float _clickPercent; + float _barStartX; + float _barStartY; + + EventListener _onChanged; + EventListener _onGripTouchEnd; + + public bool changeOnClick; + public bool canDrag; + + public GSlider() + { + _value = 50; + _max = 100; + changeOnClick = true; + canDrag = true; + } + + /// + /// + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// + /// + public EventListener onGripTouchEnd + { + get { return _onGripTouchEnd ?? (_onGripTouchEnd = new EventListener(this, "onGripTouchEnd")); } + } + + /// + /// + /// + public ProgressTitleType titleType + { + get + { + return _titleType; + } + set + { + if (_titleType != value) + { + _titleType = value; + Update(); + } + } + } + + /// + /// + /// + public double min + { + get + { + return _min; + } + set + { + if (_min != value) + { + _min = value; + Update(); + } + } + } + + /// + /// + /// + public double max + { + get + { + return _max; + } + set + { + if (_max != value) + { + _max = value; + Update(); + } + } + } + + /// + /// + /// + public double value + { + get + { + return _value; + } + set + { + if (_value != value) + { + _value = value; + Update(); + } + } + } + + /// + /// + /// + public bool wholeNumbers + { + get + { + return _wholeNumbers; + } + set + { + if (_wholeNumbers != value) + { + _wholeNumbers = value; + Update(); + } + } + } + + private void Update() + { + UpdateWithPercent((float)((_value - _min) / (_max - _min)), false); + } + + private void UpdateWithPercent(float percent, bool manual) + { + percent = Mathf.Clamp01(percent); + if (manual) + { + double newValue = _min + (_max - _min) * percent; + if (newValue < _min) + newValue = _min; + if (newValue > _max) + newValue = _max; + if (_wholeNumbers) + { + newValue = Math.Round(newValue); + percent = Mathf.Clamp01((float)((newValue - _min) / (_max - _min))); + } + + if (newValue != _value) + { + _value = newValue; + if (DispatchEvent("onChanged", null)) + return; + } + } + + if (_titleObject != null) + { + switch (_titleType) + { + case ProgressTitleType.Percent: + _titleObject.text = Mathf.FloorToInt(percent * 100) + "%"; + break; + + case ProgressTitleType.ValueAndMax: + _titleObject.text = Math.Round(_value) + "/" + Math.Round(max); + break; + + case ProgressTitleType.Value: + _titleObject.text = "" + Math.Round(_value); + break; + + case ProgressTitleType.Max: + _titleObject.text = "" + Math.Round(_max); + break; + } + } + + float fullWidth = this.width - _barMaxWidthDelta; + float fullHeight = this.height - _barMaxHeightDelta; + if (!_reverse) + { + if (_barObjectH != null) + { + if (!SetFillAmount(_barObjectH, percent)) + _barObjectH.width = Mathf.RoundToInt(fullWidth * percent); + } + if (_barObjectV != null) + { + if (!SetFillAmount(_barObjectV, percent)) + _barObjectV.height = Mathf.RoundToInt(fullHeight * percent); + } + } + else + { + if (_barObjectH != null) + { + if (!SetFillAmount(_barObjectH, 1 - percent)) + { + _barObjectH.width = Mathf.RoundToInt(fullWidth * percent); + _barObjectH.x = _barStartX + (fullWidth - _barObjectH.width); + } + } + if (_barObjectV != null) + { + if (!SetFillAmount(_barObjectV, 1 - percent)) + { + _barObjectV.height = Mathf.RoundToInt(fullHeight * percent); + _barObjectV.y = _barStartY + (fullHeight - _barObjectV.height); + } + } + } + + InvalidateBatchingState(true); + } + + bool SetFillAmount(GObject bar, float amount) + { + if ((bar is GImage) && ((GImage)bar).fillMethod != FillMethod.None) + ((GImage)bar).fillAmount = amount; + else if ((bar is GLoader) && ((GLoader)bar).fillMethod != FillMethod.None) + ((GLoader)bar).fillAmount = amount; + else + return false; + + return true; + } + + override protected void ConstructExtension(ByteBuffer buffer) + { + buffer.Seek(0, 6); + + _titleType = (ProgressTitleType)buffer.ReadByte(); + _reverse = buffer.ReadBool(); + if (buffer.version >= 2) + { + _wholeNumbers = buffer.ReadBool(); + this.changeOnClick = buffer.ReadBool(); + } + + _titleObject = GetChild("title"); + _barObjectH = GetChild("bar"); + _barObjectV = GetChild("bar_v"); + _gripObject = GetChild("grip"); + + if (_barObjectH != null) + { + _barMaxWidth = _barObjectH.width; + _barMaxWidthDelta = this.width - _barMaxWidth; + _barStartX = _barObjectH.x; + } + if (_barObjectV != null) + { + _barMaxHeight = _barObjectV.height; + _barMaxHeightDelta = this.height - _barMaxHeight; + _barStartY = _barObjectV.y; + } + + if (_gripObject != null) + { + _gripObject.onTouchBegin.Add(__gripTouchBegin); + _gripObject.onTouchMove.Add(__gripTouchMove); + _gripObject.onTouchEnd.Add(__gripTouchEnd); + } + + onTouchBegin.Add(__barTouchBegin); + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + if (!buffer.Seek(beginPos, 6)) + { + Update(); + return; + } + + if ((ObjectType)buffer.ReadByte() != packageItem.objectType) + { + Update(); + return; + } + + _value = buffer.ReadInt(); + _max = buffer.ReadInt(); + if (buffer.version >= 2) + _min = buffer.ReadInt(); + + + Update(); + } + + override protected void HandleSizeChanged() + { + base.HandleSizeChanged(); + + if (_barObjectH != null) + _barMaxWidth = this.width - _barMaxWidthDelta; + if (_barObjectV != null) + _barMaxHeight = this.height - _barMaxHeightDelta; + + if (!this.underConstruct) + Update(); + } + + private void __gripTouchBegin(EventContext context) + { + this.canDrag = true; + + context.StopPropagation(); + + InputEvent evt = context.inputEvent; + if (evt.button != 0) + return; + + context.CaptureTouch(); + + _clickPos = this.GlobalToLocal(new Vector2(evt.x, evt.y)); + _clickPercent = Mathf.Clamp01((float)((_value - _min) / (_max - _min))); + } + + private void __gripTouchMove(EventContext context) + { + if (!this.canDrag) + return; + + InputEvent evt = context.inputEvent; + Vector2 pt = this.GlobalToLocal(new Vector2(evt.x, evt.y)); + if (float.IsNaN(pt.x)) + return; + + float deltaX = pt.x - _clickPos.x; + float deltaY = pt.y - _clickPos.y; + if (_reverse) + { + deltaX = -deltaX; + deltaY = -deltaY; + } + + float percent; + if (_barObjectH != null) + percent = _clickPercent + deltaX / _barMaxWidth; + else + percent = _clickPercent + deltaY / _barMaxHeight; + + UpdateWithPercent(percent, true); + } + + private void __gripTouchEnd(EventContext context) + { + DispatchEvent("onGripTouchEnd", null); + } + + private void __barTouchBegin(EventContext context) + { + if (!changeOnClick) + return; + + InputEvent evt = context.inputEvent; + Vector2 pt = _gripObject.GlobalToLocal(new Vector2(evt.x, evt.y)); + float percent = Mathf.Clamp01((float)((_value - _min) / (_max - _min))); + float delta = 0; + if (_barObjectH != null) + delta = (pt.x - _gripObject.width / 2) / _barMaxWidth; + if (_barObjectV != null) + delta = (pt.y - _gripObject.height / 2) / _barMaxHeight; + if (_reverse) + percent -= delta; + else + percent += delta; + + UpdateWithPercent(percent, true); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs.meta new file mode 100644 index 00000000..5567093e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GSlider.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a2a1a4a3ec0a296489e15eb1ae1214ee +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs new file mode 100644 index 00000000..25d9fec7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs @@ -0,0 +1,438 @@ +using System.Collections.Generic; +using System.Text; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class GTextField : GObject, ITextColorGear + { + protected TextField _textField; + protected string _text; + protected bool _ubbEnabled; + protected bool _updatingSize; + protected Dictionary _templateVars; + + public GTextField() + : base() + { + TextFormat tf = _textField.textFormat; + tf.font = UIConfig.defaultFont; + tf.size = 12; + tf.color = Color.black; + tf.lineSpacing = 3; + tf.letterSpacing = 0; + _textField.textFormat = tf; + + _text = string.Empty; + _textField.autoSize = AutoSizeType.Both; + _textField.wordWrap = false; + } + + override protected void CreateDisplayObject() + { + _textField = new TextField(); + _textField.gOwner = this; + displayObject = _textField; + } + + /// + /// + /// + override public string text + { + get + { + if (this is GTextInput) + _text = ((GTextInput)this).inputTextField.text; + return _text; + } + set + { + if (value == null) + value = string.Empty; + _text = value; + SetTextFieldText(); + UpdateSize(); + UpdateGear(6); + } + } + + virtual protected void SetTextFieldText() + { + string str = _text; + if (_templateVars != null) + str = ParseTemplate(str); + + _textField.maxWidth = maxWidth; + if (_ubbEnabled) + _textField.htmlText = UBBParser.inst.Parse(XMLUtils.EncodeString(str)); + else + _textField.text = str; + } + + /// + /// + /// + public Dictionary templateVars + { + get { return _templateVars; } + set + { + if (_templateVars == null && value == null) + return; + + _templateVars = value; + + FlushVars(); + } + } + + /// + /// + /// + /// + /// + /// + public GTextField SetVar(string name, string value) + { + if (_templateVars == null) + _templateVars = new Dictionary(); + _templateVars[name] = value; + + return this; + } + + /// + /// + /// + public void FlushVars() + { + SetTextFieldText(); + UpdateSize(); + } + + /// + /// + /// + public bool HasCharacter(char ch) + { + return _textField.HasCharacter(ch); + } + + protected string ParseTemplate(string template) + { + int pos1 = 0, pos2 = 0; + int pos3; + string tag; + string value; + StringBuilder buffer = new StringBuilder(); + + while ((pos2 = template.IndexOf('{', pos1)) != -1) + { + if (pos2 > 0 && template[pos2 - 1] == '\\') + { + buffer.Append(template, pos1, pos2 - pos1 - 1); + buffer.Append('{'); + pos1 = pos2 + 1; + continue; + } + + buffer.Append(template, pos1, pos2 - pos1); + pos1 = pos2; + pos2 = template.IndexOf('}', pos1); + if (pos2 == -1) + break; + + if (pos2 == pos1 + 1) + { + buffer.Append(template, pos1, 2); + pos1 = pos2 + 1; + continue; + } + + tag = template.Substring(pos1 + 1, pos2 - pos1 - 1); + pos3 = tag.IndexOf('='); + if (pos3 != -1) + { + if (!_templateVars.TryGetValue(tag.Substring(0, pos3), out value)) + value = tag.Substring(pos3 + 1); + } + else + { + if (!_templateVars.TryGetValue(tag, out value)) + value = ""; + } + buffer.Append(value); + pos1 = pos2 + 1; + } + if (pos1 < template.Length) + buffer.Append(template, pos1, template.Length - pos1); + + return buffer.ToString(); + } + + /// + /// + /// + public TextFormat textFormat + { + get + { + return _textField.textFormat; + } + set + { + _textField.textFormat = value; + if (!underConstruct) + UpdateSize(); + } + } + + /// + /// + /// + public Color color + { + get + { + return _textField.textFormat.color; + } + set + { + if (_textField.textFormat.color != value) + { + TextFormat tf = _textField.textFormat; + tf.color = value; + _textField.textFormat = tf; + UpdateGear(4); + } + } + } + + /// + /// + /// + public AlignType align + { + get { return _textField.align; } + set { _textField.align = value; } + } + + /// + /// + /// + public VertAlignType verticalAlign + { + get { return _textField.verticalAlign; } + set { _textField.verticalAlign = value; } + } + + /// + /// + /// + public bool singleLine + { + get { return _textField.singleLine; } + set { _textField.singleLine = value; } + } + + /// + /// + /// + public float stroke + { + get { return _textField.stroke; } + set { _textField.stroke = value; } + } + + /// + /// + /// + public Color strokeColor + { + get { return _textField.strokeColor; } + set + { + _textField.strokeColor = value; + UpdateGear(4); + } + } + + /// + /// + /// + public Vector2 shadowOffset + { + get { return _textField.shadowOffset; } + set { _textField.shadowOffset = value; } + } + + /// + /// + /// + public bool UBBEnabled + { + get { return _ubbEnabled; } + set { _ubbEnabled = value; } + } + + /// + /// + /// + public AutoSizeType autoSize + { + get { return _textField.autoSize; } + set + { + _textField.autoSize = value; + if (value == AutoSizeType.Both) + { + _textField.wordWrap = false; + + if (!underConstruct) + this.SetSize(_textField.textWidth, _textField.textHeight); + } + else + { + _textField.wordWrap = true; + + if (value == AutoSizeType.Height) + { + if (!underConstruct) + { + displayObject.width = this.width; + this.height = _textField.textHeight; + } + } + else + displayObject.SetSize(this.width, this.height); + } + } + } + + /// + /// + /// + public float textWidth + { + get { return _textField.textWidth; } + } + + /// + /// + /// + public float textHeight + { + get { return _textField.textHeight; } + } + + protected void UpdateSize() + { + if (_updatingSize) + return; + + _updatingSize = true; + + if (_textField.autoSize == AutoSizeType.Both) + { + this.size = displayObject.size; + InvalidateBatchingState(); + } + else if (_textField.autoSize == AutoSizeType.Height) + { + this.height = displayObject.height; + InvalidateBatchingState(); + } + + _updatingSize = false; + } + + override protected void HandleSizeChanged() + { + if (_updatingSize) + return; + + if (underConstruct) + displayObject.SetSize(this.width, this.height); + else if (_textField.autoSize != AutoSizeType.Both) + { + if (_textField.autoSize == AutoSizeType.Height) + { + displayObject.width = this.width;//å…ˆè°ƒæ•´å®½åº¦ï¼Œè®©æ–‡æœ¬é‡æŽ’ + if (_text != string.Empty) //文本为空时,1是本æ¥å°±ä¸éœ€è¦è°ƒæ•´ï¼Œ 2是为了防止改掉文本为空时的默认高度,造æˆå…³è”错误 + SetSizeDirectly(this.width, displayObject.height); + } + else + displayObject.SetSize(this.width, this.height); + } + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 5); + + TextFormat tf = _textField.textFormat; + + tf.font = buffer.ReadS(); + tf.size = buffer.ReadShort(); + tf.color = buffer.ReadColor(); + this.align = (AlignType)buffer.ReadByte(); + this.verticalAlign = (VertAlignType)buffer.ReadByte(); + tf.lineSpacing = buffer.ReadShort(); + tf.letterSpacing = buffer.ReadShort(); + _ubbEnabled = buffer.ReadBool(); + this.autoSize = (AutoSizeType)buffer.ReadByte(); + tf.underline = buffer.ReadBool(); + tf.italic = buffer.ReadBool(); + tf.bold = buffer.ReadBool(); + this.singleLine = buffer.ReadBool(); + if (buffer.ReadBool()) + { + tf.outlineColor = buffer.ReadColor(); + tf.outline = buffer.ReadFloat(); + } + + if (buffer.ReadBool()) + { + tf.shadowColor = buffer.ReadColor(); + float f1 = buffer.ReadFloat(); + float f2 = buffer.ReadFloat(); + tf.shadowOffset = new Vector2(f1, f2); + } + + if (buffer.ReadBool()) + _templateVars = new Dictionary(); + + if (buffer.version >= 3) + { + tf.strikethrough = buffer.ReadBool(); +#if FAIRYGUI_TMPRO + tf.faceDilate = buffer.ReadFloat(); + tf.outlineSoftness = buffer.ReadFloat(); + tf.underlaySoftness = buffer.ReadFloat(); +#else + buffer.Skip(12); +#endif + } + + _textField.textFormat = tf; + } + + override public void Setup_AfterAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_AfterAdd(buffer, beginPos); + + buffer.Seek(beginPos, 6); + + string str = buffer.ReadS(); + if (str != null) + this.text = str; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs.meta new file mode 100644 index 00000000..d4a98162 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextField.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d64856957bd90d24aa05d134fb14e01d +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs new file mode 100644 index 00000000..d0b76b66 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs @@ -0,0 +1,243 @@ +using System.Collections.Generic; +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class GTextInput : GTextField + { + /// + /// + /// + public InputTextField inputTextField { get; private set; } + + EventListener _onChanged; + EventListener _onSubmit; + + public GTextInput() + { + _textField.autoSize = AutoSizeType.None; + _textField.wordWrap = false; + } + + /// + /// + /// + public EventListener onChanged + { + get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); } + } + + /// + /// + /// + public EventListener onSubmit + { + get { return _onSubmit ?? (_onSubmit = new EventListener(this, "onSubmit")); } + } + + /// + /// + /// + public bool editable + { + get { return inputTextField.editable; } + set { inputTextField.editable = value; } + } + + /// + /// + /// + public bool hideInput + { + get { return inputTextField.hideInput; } + set { inputTextField.hideInput = value; } + } + + /// + /// + /// + public int maxLength + { + get { return inputTextField.maxLength; } + set { inputTextField.maxLength = value; } + } + + /// + /// + /// + public string restrict + { + get { return inputTextField.restrict; } + set { inputTextField.restrict = value; } + } + + /// + /// + /// + public bool displayAsPassword + { + get { return inputTextField.displayAsPassword; } + set { inputTextField.displayAsPassword = value; } + } + + /// + /// + /// + public int caretPosition + { + get { return inputTextField.caretPosition; } + set { inputTextField.caretPosition = value; } + } + + /// + /// + /// + public string promptText + { + get { return inputTextField.promptText; } + set { inputTextField.promptText = value; } + } + + /// + /// 在移动设备上是å¦ä½¿ç”¨é”®ç›˜è¾“入。如果false,则文本在获得焦点åŽä¸ä¼šå¼¹å‡ºé”®ç›˜ã€‚ + /// + public bool keyboardInput + { + get { return inputTextField.keyboardInput; } + set { inputTextField.keyboardInput = value; } + } + + /// + /// + /// + public int keyboardType + { + get { return inputTextField.keyboardType; } + set { inputTextField.keyboardType = value; } + } + + /// + /// + /// + public bool disableIME + { + get { return inputTextField.disableIME; } + set { inputTextField.disableIME = value; } + } + + /// + /// + /// + public Dictionary emojies + { + get { return inputTextField.emojies; } + set { inputTextField.emojies = value; } + } + + /// + /// + /// + public int border + { + get { return inputTextField.border; } + set { inputTextField.border = value; } + } + + /// + /// + /// + public int corner + { + get { return inputTextField.corner; } + set { inputTextField.corner = value; } + } + + /// + /// + /// + public Color borderColor + { + get { return inputTextField.borderColor; } + set { inputTextField.borderColor = value; } + } + + /// + /// + /// + public Color backgroundColor + { + get { return inputTextField.backgroundColor; } + set { inputTextField.backgroundColor = value; } + } + + /// + /// + /// + public bool mouseWheelEnabled + { + get { return inputTextField.mouseWheelEnabled; } + set { inputTextField.mouseWheelEnabled = value; } + } + + /// + /// + /// + /// + /// + public void SetSelection(int start, int length) + { + inputTextField.SetSelection(start, length); + } + + /// + /// + /// + /// + public void ReplaceSelection(string value) + { + inputTextField.ReplaceSelection(value); + } + + override protected void SetTextFieldText() + { + inputTextField.text = _text; + } + + override protected void CreateDisplayObject() + { + inputTextField = new InputTextField(); + inputTextField.gOwner = this; + displayObject = inputTextField; + + _textField = inputTextField.textField; + } + + public override void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 4); + + string str = buffer.ReadS(); + if (str != null) + inputTextField.promptText = str; + + str = buffer.ReadS(); + if (str != null) + inputTextField.restrict = str; + + int iv = buffer.ReadInt(); + if (iv != 0) + inputTextField.maxLength = iv; + iv = buffer.ReadInt(); + if (iv != 0) + inputTextField.keyboardType = iv; + if (buffer.ReadBool()) + inputTextField.displayAsPassword = true; + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs.meta new file mode 100644 index 00000000..3e4eacf7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTextInput.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0e6f98107e4db9142b9de3358cf95378 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs new file mode 100644 index 00000000..de456298 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs @@ -0,0 +1,557 @@ +using System; +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class GTree : GList + { + public delegate void TreeNodeRenderDelegate(GTreeNode node, GComponent obj); + public delegate void TreeNodeWillExpandDelegate(GTreeNode node, bool expand); + + /// + /// 当TreeNodeéœ€è¦æ›´æ–°æ—¶å›žè°ƒ + /// + public TreeNodeRenderDelegate treeNodeRender; + + /// + /// 当TreeNodeå³å°†å±•开或者收缩时回调。å¯ä»¥åœ¨å›žè°ƒä¸­åЍæ€å¢žåŠ å­èŠ‚ç‚¹ã€‚ + /// + public TreeNodeWillExpandDelegate treeNodeWillExpand; + + int _indent; + GTreeNode _rootNode; + int _clickToExpand; + bool _expandedStatusInEvt; + + private static List helperIntList = new List(); + + /// + /// + /// + public GTree() + { + _indent = 30; + + _rootNode = new GTreeNode(true); + _rootNode._SetTree(this); + _rootNode.expanded = true; + + } + + /// + /// TreeView的顶层节点,这是个虚拟节点,也就是他ä¸ä¼šæ˜¾ç¤ºå‡ºæ¥ã€‚ + /// + public GTreeNode rootNode + { + get { return _rootNode; } + } + + /// + /// TreeViewæ¯çº§çš„缩进,å•ä½åƒç´ ã€‚ + /// + public int indent + { + get { return _indent; } + set { _indent = value; } + } + + /// + /// + /// + public int clickToExpand + { + get { return _clickToExpand; } + set { _clickToExpand = value; } + } + + /// + /// + /// + /// + public GTreeNode GetSelectedNode() + { + int i = this.selectedIndex; + if (i != -1) + return (GTreeNode)this.GetChildAt(i)._treeNode; + else + return null; + } + + /// + /// + /// + /// + public List GetSelectedNodes() + { + return GetSelectedNodes(null); + } + + /// + /// + /// + /// + /// + public List GetSelectedNodes(List result) + { + if (result == null) + result = new List(); + helperIntList.Clear(); + List sels = GetSelection(helperIntList); + int cnt = sels.Count; + for (int i = 0; i < cnt; i++) + { + GTreeNode node = GetChildAt(sels[i])._treeNode; + result.Add(node); + } + return result; + } + /// + /// + /// + /// + public void SelectNode(GTreeNode node) + { + SelectNode(node, false); + } + + /// + /// + /// + /// + /// + public void SelectNode(GTreeNode node, bool scrollItToView) + { + GTreeNode parentNode = node.parent; + while (parentNode != null && parentNode != _rootNode) + { + parentNode.expanded = true; + parentNode = parentNode.parent; + } + AddSelection(GetChildIndex(node.cell), scrollItToView); + } + + /// + /// + /// + /// + public void UnselectNode(GTreeNode node) + { + RemoveSelection(GetChildIndex(node.cell)); + } + + /// + /// + /// + public void ExpandAll() + { + ExpandAll(_rootNode); + } + + /// + /// + /// + /// + public void ExpandAll(GTreeNode folderNode) + { + folderNode.expanded = true; + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + GTreeNode node = folderNode.GetChildAt(i); + if (node.isFolder) + ExpandAll(node); + } + } + + /// + /// + /// + /// + public void CollapseAll() + { + CollapseAll(_rootNode); + } + + /// + /// + /// + /// + public void CollapseAll(GTreeNode folderNode) + { + if (folderNode != _rootNode) + folderNode.expanded = false; + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + GTreeNode node = folderNode.GetChildAt(i); + if (node.isFolder) + CollapseAll(node); + } + } + + /// + /// + /// + /// + void CreateCell(GTreeNode node) + { + GComponent child = itemPool.GetObject(string.IsNullOrEmpty(node._resURL) ? this.defaultItem : node._resURL) as GComponent; + if (child == null) + throw new Exception("FairyGUI: cannot create tree node object."); + child.displayObject.home = this.displayObject.cachedTransform; + child._treeNode = node; + node._cell = child; + + GObject indentObj = node.cell.GetChild("indent"); + if (indentObj != null) + indentObj.width = (node.level - 1) * indent; + + Controller cc; + + cc = child.GetController("expanded"); + if (cc != null) + { + cc.onChanged.Add(__expandedStateChanged); + cc.selectedIndex = node.expanded ? 1 : 0; + } + + cc = child.GetController("leaf"); + if (cc != null) + cc.selectedIndex = node.isFolder ? 0 : 1; + + if (node.isFolder) + child.onTouchBegin.Add(__cellTouchBegin); + + if (treeNodeRender != null) + treeNodeRender(node, node._cell); + } + + /// + /// + /// + /// + internal void _AfterInserted(GTreeNode node) + { + if (node._cell == null) + CreateCell(node); + + int index = GetInsertIndexForNode(node); + AddChildAt(node.cell, index); + if (treeNodeRender != null) + treeNodeRender(node, node._cell); + + if (node.isFolder && node.expanded) + CheckChildren(node, index); + } + + /// + /// + /// + /// + /// + int GetInsertIndexForNode(GTreeNode node) + { + GTreeNode prevNode = node.GetPrevSibling(); + if (prevNode == null) + prevNode = node.parent; + int insertIndex = GetChildIndex(prevNode.cell) + 1; + int myLevel = node.level; + int cnt = this.numChildren; + for (int i = insertIndex; i < cnt; i++) + { + GTreeNode testNode = GetChildAt(i)._treeNode; + if (testNode.level <= myLevel) + break; + + insertIndex++; + } + + return insertIndex; + } + + /// + /// + /// + /// + internal void _AfterRemoved(GTreeNode node) + { + RemoveNode(node); + } + + /// + /// + /// + /// + internal void _AfterExpanded(GTreeNode node) + { + if (node == _rootNode) + { + CheckChildren(_rootNode, 0); + return; + } + + if (this.treeNodeWillExpand != null) + this.treeNodeWillExpand(node, true); + + if (node._cell == null) + return; + + if (this.treeNodeRender != null) + this.treeNodeRender(node, node._cell); + + Controller cc = node._cell.GetController("expanded"); + if (cc != null) + cc.selectedIndex = 1; + + if (node._cell.parent != null) + CheckChildren(node, GetChildIndex(node._cell)); + } + + /// + /// + /// + /// + internal void _AfterCollapsed(GTreeNode node) + { + if (node == _rootNode) + { + CheckChildren(_rootNode, 0); + return; + } + + if (this.treeNodeWillExpand != null) + this.treeNodeWillExpand(node, false); + + if (node._cell == null) + return; + + if (this.treeNodeRender != null) + this.treeNodeRender(node, node._cell); + + Controller cc = node._cell.GetController("expanded"); + if (cc != null) + cc.selectedIndex = 0; + + if (node._cell.parent != null) + HideFolderNode(node); + } + + /// + /// + /// + /// + internal void _AfterMoved(GTreeNode node) + { + int startIndex = GetChildIndex(node._cell); + int endIndex; + if (node.isFolder) + endIndex = GetFolderEndIndex(startIndex, node.level); + else + endIndex = startIndex + 1; + int insertIndex = GetInsertIndexForNode(node); + int cnt = endIndex - startIndex; + + if (insertIndex < startIndex) + { + for (int i = 0; i < cnt; i++) + { + GObject obj = GetChildAt(startIndex + i); + SetChildIndex(obj, insertIndex + i); + } + } + else + { + for (int i = 0; i < cnt; i++) + { + GObject obj = GetChildAt(startIndex); + SetChildIndex(obj, insertIndex); + } + } + } + + private int GetFolderEndIndex(int startIndex, int level) + { + int cnt = this.numChildren; + for (int i = startIndex + 1; i < cnt; i++) + { + GTreeNode node = GetChildAt(i)._treeNode; + if (node.level <= level) + return i; + } + + return cnt; + } + + /// + /// + /// + /// + /// + /// + int CheckChildren(GTreeNode folderNode, int index) + { + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + index++; + GTreeNode node = folderNode.GetChildAt(i); + if (node.cell == null) + CreateCell(node); + + if (node.cell.parent == null) + AddChildAt(node.cell, index); + + if (node.isFolder && node.expanded) + index = CheckChildren(node, index); + } + + return index; + } + + /// + /// + /// + /// + void HideFolderNode(GTreeNode folderNode) + { + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + GTreeNode node = folderNode.GetChildAt(i); + if (node.cell != null && node.cell.parent != null) + RemoveChild(node.cell); + + if (node.isFolder && node.expanded) + HideFolderNode(node); + } + } + + /// + /// + /// + /// + void RemoveNode(GTreeNode node) + { + if (node.cell != null) + { + if (node.cell.parent != null) + RemoveChild(node.cell); + itemPool.ReturnObject(node.cell); + node._cell._treeNode = null; + node._cell = null; + } + + if (node.isFolder) + { + int cnt = node.numChildren; + for (int i = 0; i < cnt; i++) + { + GTreeNode node2 = node.GetChildAt(i); + RemoveNode(node2); + } + } + } + + void __cellTouchBegin(EventContext context) + { + GTreeNode node = ((GObject)context.sender)._treeNode; + _expandedStatusInEvt = node.expanded; + } + + void __expandedStateChanged(EventContext context) + { + Controller cc = (Controller)context.sender; + GTreeNode node = cc.parent._treeNode; + node.expanded = cc.selectedIndex == 1; + } + + override protected void DispatchItemEvent(GObject item, EventContext context) + { + if (_clickToExpand != 0) + { + GTreeNode node = item._treeNode; + if (node != null && _expandedStatusInEvt == node.expanded) + { + if (_clickToExpand == 2) + { + if (context.inputEvent.isDoubleClick) + node.expanded = !node.expanded; + } + else + node.expanded = !node.expanded; + } + } + + base.DispatchItemEvent(item, context); + } + + override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos) + { + base.Setup_BeforeAdd(buffer, beginPos); + + buffer.Seek(beginPos, 9); + + _indent = buffer.ReadInt(); + _clickToExpand = buffer.ReadByte(); + } + + override protected void ReadItems(ByteBuffer buffer) + { + int nextPos; + string str; + bool isFolder; + GTreeNode lastNode = null; + int level; + int prevLevel = 0; + + int cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + str = buffer.ReadS(); + if (str == null) + { + str = this.defaultItem; + if (str == null) + { + buffer.position = nextPos; + continue; + } + } + + isFolder = buffer.ReadBool(); + level = buffer.ReadByte(); + + GTreeNode node = new GTreeNode(isFolder, str); + node.expanded = true; + if (i == 0) + _rootNode.AddChild(node); + else + { + if (level > prevLevel) + lastNode.AddChild(node); + else if (level < prevLevel) + { + for (int j = level; j <= prevLevel; j++) + lastNode = lastNode.parent; + lastNode.AddChild(node); + } + else + lastNode.parent.AddChild(node); + } + lastNode = node; + prevLevel = level; + + SetupItem(buffer, node.cell); + + buffer.position = nextPos; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs.meta new file mode 100644 index 00000000..f3872c95 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTree.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2d05bd744ca041a8beb8cfd9421d8a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs new file mode 100644 index 00000000..3ac04ebd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs @@ -0,0 +1,406 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + public class GTreeNode + { + /// + /// + /// + public object data; + + /// + /// + /// + public GTreeNode parent { get; private set; } + + /// + /// + /// + public GTree tree { get; private set; } + + List _children; + bool _expanded; + int _level; + internal GComponent _cell; + internal string _resURL; + + /// + /// + /// + /// + public GTreeNode(bool hasChild) : this(hasChild, null) + { + + } + + /// + /// + /// + /// + /// + public GTreeNode(bool hasChild, string resURL) + { + if (hasChild) + _children = new List(); + _resURL = resURL; + } + + /// + /// + /// + public GComponent cell + { + get { return _cell; } + } + + /// + /// + /// + public int level + { + get { return _level; } + } + + /// + /// + /// + public bool expanded + { + get + { + return _expanded; + } + + set + { + if (_children == null) + return; + + if (_expanded != value) + { + _expanded = value; + if (tree != null) + { + if (_expanded) + tree._AfterExpanded(this); + else + tree._AfterCollapsed(this); + } + } + } + } + + /// + /// + /// + public void ExpandToRoot() + { + GTreeNode p = this; + while (p != null) + { + p.expanded = true; + p = p.parent; + } + } + + /// + /// + /// + public bool isFolder + { + get { return _children != null; } + } + + /// + /// + /// + public string text + { + get + { + if (_cell != null) + return _cell.text; + else + return null; + } + + set + { + if (_cell != null) + _cell.text = value; + } + } + + /// + /// + /// + public string icon + { + get + { + if (_cell != null) + return _cell.icon; + else + return null; + } + + set + { + if (_cell != null) + _cell.icon = value; + } + } + + /// + /// + /// + /// + /// + public GTreeNode AddChild(GTreeNode child) + { + AddChildAt(child, _children.Count); + return child; + } + + /// + /// + /// + /// + /// + /// + public GTreeNode AddChildAt(GTreeNode child, int index) + { + if (child == null) + throw new Exception("child is null"); + + int numChildren = _children.Count; + + if (index >= 0 && index <= numChildren) + { + if (child.parent == this) + { + SetChildIndex(child, index); + } + else + { + if (child.parent != null) + child.parent.RemoveChild(child); + + int cnt = _children.Count; + if (index == cnt) + _children.Add(child); + else + _children.Insert(index, child); + + child.parent = this; + child._level = _level + 1; + child._SetTree(this.tree); + if (tree != null && this == tree.rootNode || _cell != null && _cell.parent != null && _expanded) + tree._AfterInserted(child); + } + + return child; + } + else + { + throw new Exception("Invalid child index"); + } + } + + /// + /// + /// + /// + /// + public GTreeNode RemoveChild(GTreeNode child) + { + int childIndex = _children.IndexOf(child); + if (childIndex != -1) + { + RemoveChildAt(childIndex); + } + return child; + } + + /// + /// + /// + /// + /// + public GTreeNode RemoveChildAt(int index) + { + if (index >= 0 && index < numChildren) + { + GTreeNode child = _children[index]; + _children.RemoveAt(index); + + child.parent = null; + if (tree != null) + { + child._SetTree(null); + tree._AfterRemoved(child); + } + + return child; + } + else + { + throw new Exception("Invalid child index"); + } + } + + /// + /// + /// + /// + /// + public void RemoveChildren(int beginIndex = 0, int endIndex = -1) + { + if (endIndex < 0 || endIndex >= numChildren) + endIndex = numChildren - 1; + + for (int i = beginIndex; i <= endIndex; ++i) + RemoveChildAt(beginIndex); + } + + /// + /// + /// + /// + /// + public GTreeNode GetChildAt(int index) + { + if (index >= 0 && index < numChildren) + return _children[index]; + else + throw new Exception("Invalid child index"); + } + + /// + /// + /// + /// + /// + public int GetChildIndex(GTreeNode child) + { + return _children.IndexOf(child); + } + + /// + /// + /// + /// + public GTreeNode GetPrevSibling() + { + if (parent == null) + return null; + + int i = parent._children.IndexOf(this); + if (i <= 0) + return null; + + return parent._children[i - 1]; + } + + /// + /// + /// + /// + public GTreeNode GetNextSibling() + { + if (parent == null) + return null; + + int i = parent._children.IndexOf(this); + if (i < 0 || i >= parent._children.Count - 1) + return null; + + return parent._children[i + 1]; + } + + /// + /// + /// + /// + /// + public void SetChildIndex(GTreeNode child, int index) + { + int oldIndex = _children.IndexOf(child); + if (oldIndex == -1) + throw new Exception("Not a child of this container"); + + int cnt = _children.Count; + if (index < 0) + index = 0; + else if (index > cnt) + index = cnt; + + if (oldIndex == index) + return; + + _children.RemoveAt(oldIndex); + _children.Insert(index, child); + if (tree != null && this == tree.rootNode || _cell != null && _cell.parent != null && _expanded) + tree._AfterMoved(child); + } + + /// + /// + /// + /// + /// + public void SwapChildren(GTreeNode child1, GTreeNode child2) + { + int index1 = _children.IndexOf(child1); + int index2 = _children.IndexOf(child2); + if (index1 == -1 || index2 == -1) + throw new Exception("Not a child of this container"); + SwapChildrenAt(index1, index2); + } + + /// + /// + /// + /// + /// + public void SwapChildrenAt(int index1, int index2) + { + GTreeNode child1 = _children[index1]; + GTreeNode child2 = _children[index2]; + + SetChildIndex(child1, index2); + SetChildIndex(child2, index1); + } + + /// + /// + /// + public int numChildren + { + get { return (null == _children) ? 0 : _children.Count; } + } + + internal void _SetTree(GTree value) + { + tree = value; + if (tree != null && tree.treeNodeWillExpand != null && _expanded) + tree.treeNodeWillExpand(this, true); + + if (_children != null) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + GTreeNode node = _children[i]; + node._level = _level + 1; + node._SetTree(value); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs.meta new file mode 100644 index 00000000..f0747008 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/GTreeNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0507f7de6e0d34b85853b6a2f591aaf9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears.meta new file mode 100644 index 00000000..f84ad616 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b22c996c870881c438177e27f3450ac7 +folderAsset: yes +timeCreated: 1476166202 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs new file mode 100644 index 00000000..3638afcc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs @@ -0,0 +1,109 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class GearAnimationValue + { + public bool playing; + public int frame; + public string animationName; + public string skinName; + + public GearAnimationValue(bool playing, int frame) + { + this.playing = playing; + this.frame = frame; + } + } + + /// + /// Gear is a connection between object and controller. + /// + public class GearAnimation : GearBase + { + Dictionary _storage; + GearAnimationValue _default; + + public GearAnimation(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = new GearAnimationValue(((IAnimationGear)_owner).playing, ((IAnimationGear)_owner).frame); + if (_owner is GLoader3D) + { + _default.animationName = ((GLoader3D)_owner).animationName; + _default.skinName = ((GLoader3D)_owner).skinName; + } + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + GearAnimationValue gv; + if (pageId == null) + gv = _default; + else + { + gv = new GearAnimationValue(false, 0); + _storage[pageId] = gv; + } + + gv.playing = buffer.ReadBool(); + gv.frame = buffer.ReadInt(); + } + + public void AddExtStatus(string pageId, ByteBuffer buffer) + { + GearAnimationValue gv; + if (pageId == null) + gv = _default; + else + gv = _storage[pageId]; + gv.animationName = buffer.ReadS(); + gv.skinName = buffer.ReadS(); + } + + override public void Apply() + { + _owner._gearLocked = true; + + GearAnimationValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + gv = _default; + + IAnimationGear mc = (IAnimationGear)_owner; + mc.frame = gv.frame; + mc.playing = gv.playing; + if (_owner is GLoader3D) + { + ((GLoader3D)_owner).animationName = gv.animationName; + ((GLoader3D)_owner).skinName = gv.skinName; + } + + _owner._gearLocked = false; + } + + override public void UpdateState() + { + IAnimationGear mc = (IAnimationGear)_owner; + GearAnimationValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + _storage[_controller.selectedPageId] = gv = new GearAnimationValue(mc.playing, mc.frame); + else + { + gv.playing = mc.playing; + gv.frame = mc.frame; + } + + if (_owner is GLoader3D) + { + gv.animationName = ((GLoader3D)_owner).animationName; + gv.skinName = ((GLoader3D)_owner).skinName; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs.meta new file mode 100644 index 00000000..abd89f75 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearAnimation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 87e99c1910ca9684d8719dae7bdb7658 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs new file mode 100644 index 00000000..6d05ef7d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs @@ -0,0 +1,203 @@ +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + abstract public class GearBase + { + public static bool disableAllTweenEffect = false; + + protected GObject _owner; + protected Controller _controller; + protected GearTweenConfig _tweenConfig; + + public GearBase(GObject owner) + { + _owner = owner; + } + + public void Dispose() + { + if (_tweenConfig != null && _tweenConfig._tweener != null) + { + _tweenConfig._tweener.Kill(); + _tweenConfig._tweener = null; + } + } + + /// + /// Controller object. + /// + public Controller controller + { + get + { + return _controller; + } + + set + { + if (value != _controller) + { + _controller = value; + if (_controller != null) + Init(); + } + } + } + + public GearTweenConfig tweenConfig + { + get + { + if (_tweenConfig == null) + _tweenConfig = new GearTweenConfig(); + return _tweenConfig; + } + } + + public void Setup(ByteBuffer buffer) + { + _controller = _owner.parent.GetControllerAt(buffer.ReadShort()); + Init(); + + int cnt = buffer.ReadShort(); + if (this is GearDisplay) + { + ((GearDisplay)this).pages = buffer.ReadSArray(cnt); + } + else if (this is GearDisplay2) + { + ((GearDisplay2)this).pages = buffer.ReadSArray(cnt); + } + else + { + for (int i = 0; i < cnt; i++) + { + string page = buffer.ReadS(); + if (page == null) + continue; + + AddStatus(page, buffer); + } + + if (buffer.ReadBool()) + AddStatus(null, buffer); + } + + if (buffer.ReadBool()) + { + _tweenConfig = new GearTweenConfig(); + _tweenConfig.easeType = (EaseType)buffer.ReadByte(); + _tweenConfig.duration = buffer.ReadFloat(); + _tweenConfig.delay = buffer.ReadFloat(); + } + + if (buffer.version >= 2) + { + if (this is GearXY) + { + if (buffer.ReadBool()) + { + ((GearXY)this).positionsInPercent = true; + for (int i = 0; i < cnt; i++) + { + string page = buffer.ReadS(); + if (page == null) + continue; + + ((GearXY)this).AddExtStatus(page, buffer); + } + + if (buffer.ReadBool()) + ((GearXY)this).AddExtStatus(null, buffer); + } + } + else if (this is GearDisplay2) + ((GearDisplay2)this).condition = buffer.ReadByte(); + } + + if (buffer.version >= 4 && _tweenConfig != null && _tweenConfig.easeType == EaseType.Custom) + { + _tweenConfig.customEase = new CustomEase(); + _tweenConfig.customEase.Create(buffer.ReadPath()); + } + + if (buffer.version >= 6) + { + if (this is GearAnimation) + { + for (int i = 0; i < cnt; i++) + { + string page = buffer.ReadS(); + if (page == null) + continue; + + ((GearAnimation)this).AddExtStatus(page, buffer); + } + + if (buffer.ReadBool()) + ((GearAnimation)this).AddExtStatus(null, buffer); + } + } + } + + virtual public void UpdateFromRelations(float dx, float dy) + { + } + + abstract protected void AddStatus(string pageId, ByteBuffer buffer); + abstract protected void Init(); + + /// + /// Call when controller active page changed. + /// + abstract public void Apply(); + + /// + /// Call when object's properties changed. + /// + abstract public void UpdateState(); + } + + public class GearTweenConfig + { + /// + /// Use tween to apply change. + /// + public bool tween; + + /// + /// Ease type. + /// + public EaseType easeType; + + /// + /// + /// + public CustomEase customEase; + + /// + /// Tween duration in seconds. + /// + public float duration; + + /// + /// Tween delay in seconds. + /// + public float delay; + + internal uint _displayLockToken; + internal GTweener _tweener; + + public GearTweenConfig() + { + tween = true; + easeType = EaseType.QuadOut; + duration = 0.3f; + delay = 0; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs.meta new file mode 100644 index 00000000..e043dd60 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearBase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2050e67af29d06a44834f7ffbfe14e83 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs new file mode 100644 index 00000000..0e07b854 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs @@ -0,0 +1,142 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class GearColorValue + { + public Color color; + public Color strokeColor; + + public GearColorValue() + { + } + + public GearColorValue(Color color, Color strokeColor) + { + this.color = color; + this.strokeColor = strokeColor; + } + } + + /// + /// Gear is a connection between object and controller. + /// + public class GearColor : GearBase, ITweenListener + { + Dictionary _storage; + GearColorValue _default; + + public GearColor(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = new GearColorValue(); + _default.color = ((IColorGear)_owner).color; + if (_owner is ITextColorGear) + _default.strokeColor = ((ITextColorGear)_owner).strokeColor; + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + GearColorValue gv; + if (pageId == null) + gv = _default; + else + { + gv = new GearColorValue(Color.black, Color.black); + _storage[pageId] = gv; + } + + gv.color = buffer.ReadColor(); + gv.strokeColor = buffer.ReadColor(); + } + + override public void Apply() + { + GearColorValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + gv = _default; + + if (_tweenConfig != null && _tweenConfig.tween && UIPackage._constructing == 0 && !disableAllTweenEffect) + { + if ((_owner is ITextColorGear) && gv.strokeColor.a > 0) + { + _owner._gearLocked = true; + ((ITextColorGear)_owner).strokeColor = gv.strokeColor; + _owner._gearLocked = false; + } + + if (_tweenConfig._tweener != null) + { + if (_tweenConfig._tweener.endValue.color != gv.color) + { + _tweenConfig._tweener.Kill(true); + _tweenConfig._tweener = null; + } + else + return; + } + + if (((IColorGear)_owner).color != gv.color) + { + if (_owner.CheckGearController(0, _controller)) + _tweenConfig._displayLockToken = _owner.AddDisplayLock(); + + _tweenConfig._tweener = GTween.To(((IColorGear)_owner).color, gv.color, _tweenConfig.duration) + .SetDelay(_tweenConfig.delay) + .SetEase(_tweenConfig.easeType, _tweenConfig.customEase) + .SetTarget(this) + .SetListener(this); + } + } + else + { + _owner._gearLocked = true; + ((IColorGear)_owner).color = gv.color; + if ((_owner is ITextColorGear) && gv.strokeColor.a > 0) + ((ITextColorGear)_owner).strokeColor = gv.strokeColor; + _owner._gearLocked = false; + } + } + + public void OnTweenStart(GTweener tweener) + { + } + + public void OnTweenUpdate(GTweener tweener) + { + _owner._gearLocked = true; + ((IColorGear)_owner).color = tweener.value.color; + _owner._gearLocked = false; + + _owner.InvalidateBatchingState(); + } + + public void OnTweenComplete(GTweener tweener) + { + _tweenConfig._tweener = null; + if (_tweenConfig._displayLockToken != 0) + { + _owner.ReleaseDisplayLock(_tweenConfig._displayLockToken); + _tweenConfig._displayLockToken = 0; + } + _owner.DispatchEvent("onGearStop", this); + } + + override public void UpdateState() + { + GearColorValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + _storage[_controller.selectedPageId] = gv = new GearColorValue(); + gv.color = ((IColorGear)_owner).color; + if (_owner is ITextColorGear) + gv.strokeColor = ((ITextColorGear)_owner).strokeColor; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs.meta new file mode 100644 index 00000000..42ab1106 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearColor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a4878a5e9a94c1d429c827f93ca3072b +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs new file mode 100644 index 00000000..c8c2e8ae --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs @@ -0,0 +1,68 @@ +using System; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + public class GearDisplay : GearBase + { + /// + /// Pages involed in this gear. + /// + public string[] pages { get; set; } + + int _visible; + uint _displayLockToken; + + public GearDisplay(GObject owner) + : base(owner) + { + _displayLockToken = 1; + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + } + + override protected void Init() + { + pages = null; + } + + override public void Apply() + { + _displayLockToken++; + if (_displayLockToken == 0) + _displayLockToken = 1; + + if (pages == null || pages.Length == 0 + || Array.IndexOf(pages, _controller.selectedPageId) != -1) + _visible = 1; + else + _visible = 0; + } + + override public void UpdateState() + { + } + + public uint AddLock() + { + _visible++; + return _displayLockToken; + } + + public void ReleaseLock(uint token) + { + if (token == _displayLockToken) + _visible--; + } + + public bool connected + { + get { return _controller == null || _visible > 0; } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs.meta new file mode 100644 index 00000000..c7d04c5f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f88c3ac62122e7141a5d6c41eb11da27 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs new file mode 100644 index 00000000..8e812d0b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs @@ -0,0 +1,55 @@ +using System; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + public class GearDisplay2 : GearBase + { + /// + /// Pages involed in this gear. + /// + public string[] pages { get; set; } + public int condition; + + int _visible; + + public GearDisplay2(GObject owner) + : base(owner) + { + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + } + + override protected void Init() + { + pages = null; + } + + override public void Apply() + { + if (pages == null || pages.Length == 0 + || Array.IndexOf(pages, _controller.selectedPageId) != -1) + _visible = 1; + else + _visible = 0; + } + + override public void UpdateState() + { + } + public bool Evaluate(bool connected) + { + bool v = _controller == null || _visible > 0; + if (this.condition == 0) + v = v && connected; + else + v = v || connected; + return v; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs.meta new file mode 100644 index 00000000..a0dbf5e9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearDisplay2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96390d060150348e98dfe41bf7d23f5f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs new file mode 100644 index 00000000..5d6ef058 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + public class GearFontSize : GearBase + { + Dictionary _storage; + int _default; + + public GearFontSize(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = ((GTextField)_owner).textFormat.size; + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + if (pageId == null) + _default = buffer.ReadInt(); + else + _storage[pageId] = buffer.ReadInt(); + } + + override public void Apply() + { + _owner._gearLocked = true; + + int cv; + if (!_storage.TryGetValue(_controller.selectedPageId, out cv)) + cv = _default; + + TextFormat tf = ((GTextField)_owner).textFormat; + tf.size = cv; + ((GTextField)_owner).textFormat = tf; + + _owner._gearLocked = false; + } + + override public void UpdateState() + { + _storage[_controller.selectedPageId] = ((GTextField)_owner).textFormat.size; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs.meta new file mode 100644 index 00000000..e1ee194f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearFontSize.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d3a7b66a83334b44bb8630ecc980a59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs new file mode 100644 index 00000000..be04750e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + public class GearIcon : GearBase + { + Dictionary _storage; + string _default; + + public GearIcon(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = _owner.icon; + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + if (pageId == null) + _default = buffer.ReadS(); + else + _storage[pageId] = buffer.ReadS(); + } + + override public void Apply() + { + _owner._gearLocked = true; + + string cv; + if (!_storage.TryGetValue(_controller.selectedPageId, out cv)) + cv = _default; + + _owner.icon = cv; + + _owner._gearLocked = false; + } + + override public void UpdateState() + { + _storage[_controller.selectedPageId] = _owner.icon; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs.meta new file mode 100644 index 00000000..48d00725 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearIcon.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 27b2a638ddb815f40994e0477c3ea4c0 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs new file mode 100644 index 00000000..20c7520e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs @@ -0,0 +1,152 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class GearLookValue + { + public float alpha; + public float rotation; + public bool grayed; + public bool touchable; + + public GearLookValue(float alpha, float rotation, bool grayed, bool touchable) + { + this.alpha = alpha; + this.rotation = rotation; + this.grayed = grayed; + this.touchable = touchable; + } + } + + /// + /// Gear is a connection between object and controller. + /// + public class GearLook : GearBase, ITweenListener + { + Dictionary _storage; + GearLookValue _default; + + public GearLook(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = new GearLookValue(_owner.alpha, _owner.rotation, _owner.grayed, _owner.touchable); + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + GearLookValue gv; + if (pageId == null) + gv = _default; + else + { + gv = new GearLookValue(0, 0, false, false); + _storage[pageId] = gv; + } + + gv.alpha = buffer.ReadFloat(); + gv.rotation = buffer.ReadFloat(); + gv.grayed = buffer.ReadBool(); + gv.touchable = buffer.ReadBool(); + } + + override public void Apply() + { + GearLookValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + gv = _default; + + if (_tweenConfig != null && _tweenConfig.tween && UIPackage._constructing == 0 && !disableAllTweenEffect) + { + _owner._gearLocked = true; + _owner.grayed = gv.grayed; + _owner.touchable = gv.touchable; + _owner._gearLocked = false; + + if (_tweenConfig._tweener != null) + { + if (_tweenConfig._tweener.endValue.x != gv.alpha || _tweenConfig._tweener.endValue.y != gv.rotation) + { + _tweenConfig._tweener.Kill(true); + _tweenConfig._tweener = null; + } + else + return; + } + + bool a = gv.alpha != _owner.alpha; + bool b = gv.rotation != _owner.rotation; + if (a || b) + { + if (_owner.CheckGearController(0, _controller)) + _tweenConfig._displayLockToken = _owner.AddDisplayLock(); + + _tweenConfig._tweener = GTween.To(new Vector2(_owner.alpha, _owner.rotation), new Vector2(gv.alpha, gv.rotation), _tweenConfig.duration) + .SetDelay(_tweenConfig.delay) + .SetEase(_tweenConfig.easeType, _tweenConfig.customEase) + .SetUserData((a ? 1 : 0) + (b ? 2 : 0)) + .SetTarget(this) + .SetListener(this); + } + } + else + { + _owner._gearLocked = true; + _owner.alpha = gv.alpha; + _owner.rotation = gv.rotation; + _owner.grayed = gv.grayed; + _owner.touchable = gv.touchable; + _owner._gearLocked = false; + } + } + + public void OnTweenStart(GTweener tweener) + { + } + + public void OnTweenUpdate(GTweener tweener) + { + int flag = (int)tweener.userData; + _owner._gearLocked = true; + if ((flag & 1) != 0) + _owner.alpha = tweener.value.x; + if ((flag & 2) != 0) + { + _owner.rotation = tweener.value.y; + _owner.InvalidateBatchingState(); + } + _owner._gearLocked = false; + } + + public void OnTweenComplete(GTweener tweener) + { + _tweenConfig._tweener = null; + if (_tweenConfig._displayLockToken != 0) + { + _owner.ReleaseDisplayLock(_tweenConfig._displayLockToken); + _tweenConfig._displayLockToken = 0; + } + _owner.DispatchEvent("onGearStop", this); + } + + override public void UpdateState() + { + GearLookValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + _storage[_controller.selectedPageId] = new GearLookValue(_owner.alpha, _owner.rotation, _owner.grayed, _owner.touchable); + else + { + gv.alpha = _owner.alpha; + gv.rotation = _owner.rotation; + gv.grayed = _owner.grayed; + gv.touchable = _owner.touchable; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs.meta new file mode 100644 index 00000000..1ece8e1e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearLook.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 77704143cdb38714196c9ff520a079f8 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs new file mode 100644 index 00000000..e949097e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs @@ -0,0 +1,163 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class GearSizeValue + { + public float width; + public float height; + public float scaleX; + public float scaleY; + + public GearSizeValue(float width, float height, float scaleX, float scaleY) + { + this.width = width; + this.height = height; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + } + + /// + /// Gear is a connection between object and controller. + /// + public class GearSize : GearBase, ITweenListener + { + Dictionary _storage; + GearSizeValue _default; + + public GearSize(GObject owner) + : base(owner) + { + + } + + protected override void Init() + { + _default = new GearSizeValue(_owner.width, _owner.height, _owner.scaleX, _owner.scaleY); + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + GearSizeValue gv; + if (pageId == null) + gv = _default; + else + { + gv = new GearSizeValue(0, 0, 1, 1); + _storage[pageId] = gv; + } + + gv.width = buffer.ReadInt(); + gv.height = buffer.ReadInt(); + gv.scaleX = buffer.ReadFloat(); + gv.scaleY = buffer.ReadFloat(); + } + + override public void Apply() + { + GearSizeValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + gv = _default; + + if (_tweenConfig != null && _tweenConfig.tween && UIPackage._constructing == 0 && !disableAllTweenEffect) + { + if (_tweenConfig._tweener != null) + { + if (_tweenConfig._tweener.endValue.x != gv.width || _tweenConfig._tweener.endValue.y != gv.height + || _tweenConfig._tweener.endValue.z != gv.scaleX || _tweenConfig._tweener.endValue.w != gv.scaleY) + { + _tweenConfig._tweener.Kill(true); + _tweenConfig._tweener = null; + } + else + return; + } + + bool a = gv.width != _owner.width || gv.height != _owner.height; + bool b = gv.scaleX != _owner.scaleX || gv.scaleY != _owner.scaleY; + if (a || b) + { + if (_owner.CheckGearController(0, _controller)) + _tweenConfig._displayLockToken = _owner.AddDisplayLock(); + + _tweenConfig._tweener = GTween.To(new Vector4(_owner.width, _owner.height, _owner.scaleX, _owner.scaleY), + new Vector4(gv.width, gv.height, gv.scaleX, gv.scaleY), _tweenConfig.duration) + .SetDelay(_tweenConfig.delay) + .SetEase(_tweenConfig.easeType, _tweenConfig.customEase) + .SetUserData((a ? 1 : 0) + (b ? 2 : 0)) + .SetTarget(this) + .SetListener(this); + } + } + else + { + _owner._gearLocked = true; + _owner.SetSize(gv.width, gv.height, _owner.CheckGearController(1, _controller)); + _owner.SetScale(gv.scaleX, gv.scaleY); + _owner._gearLocked = false; + } + } + + public void OnTweenStart(GTweener tweener) + { + } + + public void OnTweenUpdate(GTweener tweener) + { + _owner._gearLocked = true; + int flag = (int)tweener.userData; + if ((flag & 1) != 0) + _owner.SetSize(tweener.value.x, tweener.value.y, _owner.CheckGearController(1, _controller)); + if ((flag & 2) != 0) + _owner.SetScale(tweener.value.z, tweener.value.w); + _owner._gearLocked = false; + + _owner.InvalidateBatchingState(); + } + + public void OnTweenComplete(GTweener tweener) + { + _tweenConfig._tweener = null; + if (_tweenConfig._displayLockToken != 0) + { + _owner.ReleaseDisplayLock(_tweenConfig._displayLockToken); + _tweenConfig._displayLockToken = 0; + } + _owner.DispatchEvent("onGearStop", this); + } + + override public void UpdateState() + { + GearSizeValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + _storage[_controller.selectedPageId] = new GearSizeValue(_owner.width, _owner.height, _owner.scaleX, _owner.scaleY); + else + { + gv.width = _owner.width; + gv.height = _owner.height; + gv.scaleX = _owner.scaleX; + gv.scaleY = _owner.scaleY; + } + } + + override public void UpdateFromRelations(float dx, float dy) + { + if (_controller != null && _storage != null) + { + foreach (GearSizeValue gv in _storage.Values) + { + gv.width += dx; + gv.height += dy; + } + _default.width += dx; + _default.height += dy; + + UpdateState(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs.meta new file mode 100644 index 00000000..866fd7c3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearSize.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 254f71ab913968a4e853a99ce79f0266 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs new file mode 100644 index 00000000..7cef4408 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// Gear is a connection between object and controller. + /// + public class GearText : GearBase + { + Dictionary _storage; + string _default; + + public GearText(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = _owner.text; + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + if (pageId == null) + _default = buffer.ReadS(); + else + _storage[pageId] = buffer.ReadS(); + } + + override public void Apply() + { + _owner._gearLocked = true; + + string cv; + if (!_storage.TryGetValue(_controller.selectedPageId, out cv)) + cv = _default; + + _owner.text = cv; + + _owner._gearLocked = false; + } + + override public void UpdateState() + { + _storage[_controller.selectedPageId] = _owner.text; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs.meta new file mode 100644 index 00000000..25e9678e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearText.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d8b20f3a5dd39ec42bed3456334916fc +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs new file mode 100644 index 00000000..ed48c788 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs @@ -0,0 +1,177 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class GearXYValue + { + public float x; + public float y; + public float px; + public float py; + + public GearXYValue(float x = 0, float y = 0, float px = 0, float py = 0) + { + this.x = x; + this.y = y; + this.px = px; + this.py = py; + } + } + + /// + /// Gear is a connection between object and controller. + /// + public class GearXY : GearBase, ITweenListener + { + public bool positionsInPercent; + + Dictionary _storage; + GearXYValue _default; + + public GearXY(GObject owner) + : base(owner) + { + } + + protected override void Init() + { + _default = new GearXYValue(_owner.x, _owner.y, _owner.x / _owner.parent.width, _owner.y / _owner.parent.height); + _storage = new Dictionary(); + } + + override protected void AddStatus(string pageId, ByteBuffer buffer) + { + GearXYValue gv; + if (pageId == null) + gv = _default; + else + { + gv = new GearXYValue(); + _storage[pageId] = gv; + } + + gv.x = buffer.ReadInt(); + gv.y = buffer.ReadInt(); + } + + public void AddExtStatus(string pageId, ByteBuffer buffer) + { + GearXYValue gv; + if (pageId == null) + gv = _default; + else + gv = _storage[pageId]; + gv.px = buffer.ReadFloat(); + gv.py = buffer.ReadFloat(); + } + + override public void Apply() + { + GearXYValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + gv = _default; + + Vector2 endPos = new Vector2(); + + if (positionsInPercent && _owner.parent != null) + { + endPos.x = gv.px * _owner.parent.width; + endPos.y = gv.py * _owner.parent.height; + } + else + { + endPos.x = gv.x; + endPos.y = gv.y; + } + + if (_tweenConfig != null && _tweenConfig.tween && UIPackage._constructing == 0 && !disableAllTweenEffect) + { + if (_tweenConfig._tweener != null) + { + if (_tweenConfig._tweener.endValue.x != endPos.x || _tweenConfig._tweener.endValue.y != endPos.y) + { + _tweenConfig._tweener.Kill(true); + _tweenConfig._tweener = null; + } + else + return; + } + Vector2 origin = _owner.xy; + + if (endPos != origin) + { + if (_owner.CheckGearController(0, _controller)) + _tweenConfig._displayLockToken = _owner.AddDisplayLock(); + + _tweenConfig._tweener = GTween.To(origin, endPos, _tweenConfig.duration) + .SetDelay(_tweenConfig.delay) + .SetEase(_tweenConfig.easeType, _tweenConfig.customEase) + .SetTarget(this) + .SetListener(this); + } + } + else + { + _owner._gearLocked = true; + _owner.SetXY(endPos.x, endPos.y); + _owner._gearLocked = false; + } + } + + public void OnTweenStart(GTweener tweener) + {//nothing + } + + public void OnTweenUpdate(GTweener tweener) + { + _owner._gearLocked = true; + _owner.SetXY(tweener.value.x, tweener.value.y); + _owner._gearLocked = false; + + _owner.InvalidateBatchingState(); + } + + public void OnTweenComplete(GTweener tweener) + { + _tweenConfig._tweener = null; + if (_tweenConfig._displayLockToken != 0) + { + _owner.ReleaseDisplayLock(_tweenConfig._displayLockToken); + _tweenConfig._displayLockToken = 0; + } + _owner.DispatchEvent("onGearStop", this); + } + + override public void UpdateState() + { + GearXYValue gv; + if (!_storage.TryGetValue(_controller.selectedPageId, out gv)) + _storage[_controller.selectedPageId] = gv = new GearXYValue(); + + gv.x = _owner.x; + gv.y = _owner.y; + + gv.px = _owner.x / _owner.parent.width; + gv.py = _owner.y / _owner.parent.height; + + } + + override public void UpdateFromRelations(float dx, float dy) + { + if (_controller != null && _storage != null && !positionsInPercent) + { + foreach (GearXYValue gv in _storage.Values) + { + gv.x += dx; + gv.y += dy; + } + _default.x += dx; + _default.y += dy; + + UpdateState(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs.meta new file mode 100644 index 00000000..16bda584 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/GearXY.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 082a852494dc8b94485733188788d58c +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs new file mode 100644 index 00000000..7c7900fa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs @@ -0,0 +1,35 @@ + +namespace FairyGUI +{ + /// + /// + /// + public interface IAnimationGear + { + /// + /// + /// + bool playing { get; set; } + + /// + /// + /// + int frame { get; set; } + + /// + /// + /// + float timeScale { get; set; } + + /// + /// + /// + bool ignoreEngineTimeScale { get; set; } + + /// + /// + /// + /// + void Advance(float time); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs.meta new file mode 100644 index 00000000..75bc854b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IAnimationGear.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d68e5b2a3af5c444689f459a8b265df7 +timeCreated: 1476166204 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs new file mode 100644 index 00000000..a3b9f238 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public interface IColorGear + { + /// + /// + /// + Color color { get; set; } + } + + /// + /// + /// + public interface ITextColorGear : IColorGear + { + /// + /// + /// + Color strokeColor { get; set; } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs.meta new file mode 100644 index 00000000..084c242a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Gears/IColorGear.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e872cd17b52152a4fa250c830b9bb8cd +timeCreated: 1476166204 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs new file mode 100644 index 00000000..e6623b28 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs @@ -0,0 +1,36 @@ + +namespace FairyGUI +{ + /// + /// + /// + public delegate void UILoadCallback(); + + /// + /// + /// + public interface IUISource + { + /// + /// + /// + string fileName { get; set; } + + /// + /// + /// + bool loaded { get; } + + /// + /// + /// + /// + void Load(UILoadCallback callback); + + /// + /// å–æ¶ˆåŠ è½½ + /// + void Cancel(); + + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs.meta new file mode 100644 index 00000000..b3dcf47b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/IUISource.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c742c10608d6ac84bb210a9d6abcb05d +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs new file mode 100644 index 00000000..5955172b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs @@ -0,0 +1,29 @@ + +namespace FairyGUI +{ + /// + /// + /// + public struct Margin + { + /// + /// + /// + public int left; + + /// + /// + /// + public int right; + + /// + /// + /// + public int top; + + /// + /// + /// + public int bottom; + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs.meta new file mode 100644 index 00000000..e2ad2729 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Margin.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7f31f9a61b0590943ac37f1c16ff0dc9 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs new file mode 100644 index 00000000..434816d3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs @@ -0,0 +1,85 @@ +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class PackageItem + { + public UIPackage owner; + + public PackageItemType type; + public ObjectType objectType; + + public string id; + public string name; + public int width; + public int height; + public string file; + public bool exported; + public NTexture texture; + public ByteBuffer rawData; + public string[] branches; + public string[] highResolution; + + //image + public Rect? scale9Grid; + public bool scaleByTile; + public int tileGridIndice; + public PixelHitTestData pixelHitTestData; + + //movieclip + public float interval; + public float repeatDelay; + public bool swing; + public MovieClip.Frame[] frames; + + //component + public bool translated; + public UIObjectFactory.GComponentCreator extensionCreator; + + //font + public BitmapFont bitmapFont; + + //sound + public NAudioClip audioClip; + + //spine/dragonbones + public Vector2 skeletonAnchor; + public object skeletonAsset; + + public object Load() + { + return owner.GetItemAsset(this); + } + + public PackageItem getBranch() + { + if (branches != null && owner._branchIndex != -1) + { + string itemId = branches[owner._branchIndex]; + if (itemId != null) + return owner.GetItem(itemId); + } + + return this; + } + + public PackageItem getHighResolution() + { + if (highResolution != null && GRoot.contentScaleLevel > 0) + { + int i = GRoot.contentScaleLevel - 1; + if (i >= highResolution.Length) + i = highResolution.Length - 1; + string itemId = highResolution[i]; + if (itemId != null) + return owner.GetItem(itemId); + } + + return this; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs.meta new file mode 100644 index 00000000..b2458967 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PackageItem.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: acb6fb5c63e3f49409db871a5a97261b +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs new file mode 100644 index 00000000..f349860b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs @@ -0,0 +1,565 @@ +using System; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public class PopupMenu : EventDispatcher + { + protected GComponent _contentPane; + protected GList _list; + protected GObject _expandingItem; + + PopupMenu _parentMenu; + TimerCallback _showSubMenu; + TimerCallback _closeSubMenu; + EventListener _onPopup; + EventListener _onClose; + + public int visibleItemCount; + public bool hideOnClickItem; + public bool autoSize; + + const string EVENT_TYPE = "PopupMenuItemClick"; + + public PopupMenu() + { + Create(null); + } + + /// + /// + /// + /// + public PopupMenu(string resourceURL) + { + Create(resourceURL); + } + + public EventListener onPopup + { + get { return _onPopup ?? (_onPopup = new EventListener(this, "onPopup")); } + } + + public EventListener onClose + { + get { return _onClose ?? (_onClose = new EventListener(this, "onClose")); } + } + + void Create(string resourceURL) + { + if (resourceURL == null) + { + resourceURL = UIConfig.popupMenu; + if (resourceURL == null) + { + Debug.LogError("FairyGUI: UIConfig.popupMenu not defined"); + return; + } + } + + _contentPane = UIPackage.CreateObjectFromURL(resourceURL).asCom; + _contentPane.onAddedToStage.Add(__addedToStage); + _contentPane.onRemovedFromStage.Add(__removeFromStage); + _contentPane.focusable = false; + + _list = _contentPane.GetChild("list").asList; + _list.RemoveChildrenToPool(); + + _list.AddRelation(_contentPane, RelationType.Width); + _list.RemoveRelation(_contentPane, RelationType.Height); + _contentPane.AddRelation(_list, RelationType.Height); + + _list.onClickItem.Add(__clickItem); + + hideOnClickItem = true; + _showSubMenu = __showSubMenu; + _closeSubMenu = CloseSubMenu; + } + + /// + /// + /// + /// + /// + /// + public GButton AddItem(string caption, EventCallback0 callback) + { + GButton item = CreateItem(caption, callback); + _list.AddChild(item); + + return item; + } + + /// + /// + /// + /// + /// + /// + public GButton AddItem(string caption, EventCallback1 callback) + { + GButton item = CreateItem(caption, callback); + _list.AddChild(item); + + return item; + } + + /// + /// + /// + /// + /// + /// + /// + public GButton AddItemAt(string caption, int index, EventCallback1 callback) + { + GButton item = CreateItem(caption, callback); + _list.AddChildAt(item, index); + + return item; + } + + /// + /// + /// + /// + /// + /// + /// + public GButton AddItemAt(string caption, int index, EventCallback0 callback) + { + GButton item = CreateItem(caption, callback); + _list.AddChildAt(item, index); + + return item; + } + + GButton CreateItem(string caption, Delegate callback) + { + GButton item = _list.GetFromPool(_list.defaultItem).asButton; + item.title = caption; + item.grayed = false; + Controller c = item.GetController("checked"); + if (c != null) + c.selectedIndex = 0; + item.RemoveEventListeners(EVENT_TYPE); + if (callback is EventCallback0) + item.AddEventListener(EVENT_TYPE, (EventCallback0)callback); + else + item.AddEventListener(EVENT_TYPE, (EventCallback1)callback); + + item.onRollOver.Add(__rollOver); + item.onRollOut.Add(__rollOut); + + return item; + } + + /// + /// + /// + public void AddSeperator() + { + AddSeperator(-1); + } + + /// + /// + /// + public void AddSeperator(int index) + { + if (UIConfig.popupMenu_seperator == null) + { + Debug.LogError("FairyGUI: UIConfig.popupMenu_seperator not defined"); + return; + } + + if (index == -1) + _list.AddItemFromPool(UIConfig.popupMenu_seperator); + else + { + GObject item = _list.GetFromPool(UIConfig.popupMenu_seperator); + _list.AddChildAt(item, index); + } + } + + /// + /// + /// + /// + /// + public string GetItemName(int index) + { + GButton item = _list.GetChildAt(index).asButton; + return item.name; + } + + /// + /// + /// + /// + /// + public void SetItemText(string name, string caption) + { + GButton item = _list.GetChild(name).asButton; + item.title = caption; + } + + /// + /// + /// + /// + /// + public void SetItemVisible(string name, bool visible) + { + GButton item = _list.GetChild(name).asButton; + if (item.visible != visible) + { + item.visible = visible; + _list.SetBoundsChangedFlag(); + } + } + + /// + /// + /// + /// + /// + public void SetItemGrayed(string name, bool grayed) + { + GButton item = _list.GetChild(name).asButton; + item.grayed = grayed; + } + + /// + /// + /// + /// + /// + public void SetItemCheckable(string name, bool checkable) + { + GButton item = _list.GetChild(name).asButton; + Controller c = item.GetController("checked"); + if (c != null) + { + if (checkable) + { + if (c.selectedIndex == 0) + c.selectedIndex = 1; + } + else + c.selectedIndex = 0; + } + } + + /// + /// + /// + /// + /// + public void SetItemChecked(string name, bool check) + { + GButton item = _list.GetChild(name).asButton; + Controller c = item.GetController("checked"); + if (c != null) + c.selectedIndex = check ? 2 : 1; + } + + [Obsolete("Use IsItemChecked instead")] + public bool isItemChecked(string name) + { + return IsItemChecked(name); + } + + /// + /// + /// + /// + /// + public bool IsItemChecked(string name) + { + GButton item = _list.GetChild(name).asButton; + Controller c = item.GetController("checked"); + if (c != null) + return c.selectedIndex == 2; + else + return false; + } + + /// + /// + /// + /// + public void RemoveItem(string name) + { + GComponent item = _list.GetChild(name).asCom; + if (item != null) + { + item.RemoveEventListeners(EVENT_TYPE); + if (item.data is PopupMenu) + { + ((PopupMenu)item.data).Dispose(); + item.data = null; + } + int index = _list.GetChildIndex(item); + _list.RemoveChildToPoolAt(index); + } + } + + /// + /// + /// + public void ClearItems() + { + _list.RemoveChildrenToPool(); + } + + /// + /// + /// + public int itemCount + { + get { return _list.numChildren; } + } + + /// + /// + /// + public GComponent contentPane + { + get { return _contentPane; } + } + + /// + /// + /// + public GList list + { + get { return _list; } + } + + public void Dispose() + { + int cnt = _list.numChildren; + for (int i = 0; i < cnt; i++) + { + GObject obj = _list.GetChildAt(i); + if (obj.data is PopupMenu) + ((PopupMenu)obj.data).Dispose(); + } + _contentPane.Dispose(); + } + + /// + /// + /// + public void Show() + { + Show(null, PopupDirection.Auto); + } + + /// + /// + /// + /// + public void Show(GObject target) + { + Show(target, PopupDirection.Auto, null); + } + + [Obsolete] + public void Show(GObject target, object downward) + { + Show(target, downward == null ? PopupDirection.Auto : ((bool)downward == true ? PopupDirection.Down : PopupDirection.Up), null); + } + + /// + /// + /// + /// + /// + public void Show(GObject target, PopupDirection dir) + { + Show(target, PopupDirection.Auto, null); + } + + /// + /// + /// + /// + /// + /// + public void Show(GObject target, PopupDirection dir, PopupMenu parentMenu) + { + GRoot r = target != null ? target.root : GRoot.inst; + r.ShowPopup(this.contentPane, (target is GRoot) ? null : target, dir); + _parentMenu = parentMenu; + } + + public void Hide() + { + if (contentPane.parent != null) + ((GRoot)contentPane.parent).HidePopup(contentPane); + } + + void ShowSubMenu(GObject item) + { + _expandingItem = item; + + PopupMenu popup = item.data as PopupMenu; + if (item is GButton) + ((GButton)item).selected = true; + popup.Show(item, PopupDirection.Auto, this); + + Vector2 pt = contentPane.LocalToRoot(new Vector2(item.x + item.width - 5, item.y - 5), item.root); + popup.contentPane.position = pt; + } + + void CloseSubMenu(object param) + { + if (contentPane.isDisposed) + return; + + if (_expandingItem == null) + return; + + if (_expandingItem is GButton) + ((GButton)_expandingItem).selected = false; + PopupMenu popup = (PopupMenu)_expandingItem.data; + if (popup == null) + return; + + _expandingItem = null; + popup.Hide(); + } + + private void __clickItem(EventContext context) + { + GButton item = ((GObject)context.data).asButton; + if (item == null) + return; + + if (item.grayed) + { + _list.selectedIndex = -1; + return; + } + + Controller c = item.GetController("checked"); + if (c != null && c.selectedIndex != 0) + { + if (c.selectedIndex == 1) + c.selectedIndex = 2; + else + c.selectedIndex = 1; + } + + if (hideOnClickItem) + { + if (_parentMenu != null) + _parentMenu.Hide(); + Hide(); + } + + item.DispatchEvent(EVENT_TYPE, item); //event data is for backward compatibility + } + + void __addedToStage() + { + DispatchEvent("onPopup", null); + + if (autoSize) + { + _list.EnsureBoundsCorrect(); + int cnt = _list.numChildren; + float maxDelta = -1000; + for (int i = 0; i < cnt; i++) + { + GButton obj = _list.GetChildAt(i).asButton; + if (obj == null) + continue; + GTextField tf = obj.GetTextField(); + if (tf != null) + { + float v = tf.textWidth - tf.width; + if (v > maxDelta) + maxDelta = v; + } + } + + if (contentPane.width + maxDelta > contentPane.initWidth) + contentPane.width += maxDelta; + else + contentPane.width = contentPane.initWidth; + } + + _list.selectedIndex = -1; + _list.ResizeToFit(visibleItemCount > 0 ? visibleItemCount : int.MaxValue, 10); + } + + void __removeFromStage() + { + _parentMenu = null; + + if (_expandingItem != null) + Timers.inst.Add(0, 1, _closeSubMenu); + + DispatchEvent("onClose", null); + } + + void __rollOver(EventContext context) + { + GObject item = (GObject)context.sender; + if ((item.data is PopupMenu) || _expandingItem != null) + { + Timers.inst.Add(0.1f, 1, _showSubMenu, item); + } + } + + void __showSubMenu(object param) + { + if (contentPane.isDisposed) + return; + + GObject item = (GObject)param; + GRoot r = contentPane.root; + if (r == null) + return; + + if (_expandingItem != null) + { + if (_expandingItem == item) + return; + + CloseSubMenu(null); + } + + PopupMenu popup = item.data as PopupMenu; + if (popup == null) + return; + + ShowSubMenu(item); + } + + void __rollOut(EventContext context) + { + if (_expandingItem == null) + return; + + Timers.inst.Remove(_showSubMenu); + + GRoot r = contentPane.root; + if (r != null) + { + PopupMenu popup = (PopupMenu)_expandingItem.data; + Vector2 pt = popup.contentPane.GlobalToLocal(context.inputEvent.position); + if (pt.x >= 0 && pt.y >= 0 && pt.x < popup.contentPane.width && pt.y < popup.contentPane.height) + return; + } + + CloseSubMenu(null); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs.meta new file mode 100644 index 00000000..5493a99a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/PopupMenu.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f15a5c9ba9a949d468aeb92e75f70dbd +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs new file mode 100644 index 00000000..62133ad6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs @@ -0,0 +1,672 @@ +using System.Collections.Generic; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + class RelationDef + { + public bool percent; + public RelationType type; + public int axis; + + public void copyFrom(RelationDef source) + { + this.percent = source.percent; + this.type = source.type; + this.axis = source.axis; + } + } + + class RelationItem + { + GObject _owner; + GObject _target; + List _defs; + Vector4 _targetData; + + public RelationItem(GObject owner) + { + _owner = owner; + _defs = new List(); + } + + public GObject target + { + get { return _target; } + set + { + if (_target != value) + { + if (_target != null) + ReleaseRefTarget(_target); + _target = value; + if (_target != null) + AddRefTarget(_target); + } + } + } + + public void Add(RelationType relationType, bool usePercent) + { + if (relationType == RelationType.Size) + { + Add(RelationType.Width, usePercent); + Add(RelationType.Height, usePercent); + return; + } + + int dc = _defs.Count; + for (int k = 0; k < dc; k++) + { + if (_defs[k].type == relationType) + return; + } + + InternalAdd(relationType, usePercent); + } + + public void InternalAdd(RelationType relationType, bool usePercent) + { + if (relationType == RelationType.Size) + { + InternalAdd(RelationType.Width, usePercent); + InternalAdd(RelationType.Height, usePercent); + return; + } + + RelationDef info = new RelationDef(); + info.percent = usePercent; + info.type = relationType; + info.axis = (relationType <= RelationType.Right_Right || relationType == RelationType.Width || relationType >= RelationType.LeftExt_Left && relationType <= RelationType.RightExt_Right) ? 0 : 1; + _defs.Add(info); + } + + public void Remove(RelationType relationType) + { + if (relationType == RelationType.Size) + { + Remove(RelationType.Width); + Remove(RelationType.Height); + return; + } + + int dc = _defs.Count; + for (int k = 0; k < dc; k++) + { + if (_defs[k].type == relationType) + { + _defs.RemoveAt(k); + break; + } + } + } + + public void CopyFrom(RelationItem source) + { + this.target = source.target; + + _defs.Clear(); + foreach (RelationDef info in source._defs) + { + RelationDef info2 = new RelationDef(); + info2.copyFrom(info); + _defs.Add(info2); + } + } + + public void Dispose() + { + if (_target != null) + { + ReleaseRefTarget(_target); + _target = null; + } + } + + public bool isEmpty + { + get { return _defs.Count == 0; } + } + + public void ApplyOnSelfSizeChanged(float dWidth, float dHeight, bool applyPivot) + { + int cnt = _defs.Count; + if (cnt == 0) + return; + + float ox = _owner.x; + float oy = _owner.y; + + for (int i = 0; i < cnt; i++) + { + RelationDef info = _defs[i]; + switch (info.type) + { + case RelationType.Center_Center: + _owner.x -= (0.5f - (applyPivot ? _owner.pivotX : 0)) * dWidth; + break; + + case RelationType.Right_Center: + case RelationType.Right_Left: + case RelationType.Right_Right: + _owner.x -= (1 - (applyPivot ? _owner.pivotX : 0)) * dWidth; + break; + + case RelationType.Middle_Middle: + _owner.y -= (0.5f - (applyPivot ? _owner.pivotY : 0)) * dHeight; + break; + + case RelationType.Bottom_Middle: + case RelationType.Bottom_Top: + case RelationType.Bottom_Bottom: + _owner.y -= (1 - (applyPivot ? _owner.pivotY : 0)) * dHeight; + break; + } + } + + if (!Mathf.Approximately(ox, _owner.x) || !Mathf.Approximately(oy, _owner.y)) + { + ox = _owner.x - ox; + oy = _owner.y - oy; + + _owner.UpdateGearFromRelations(1, ox, oy); + + if (_owner.parent != null) + { + int transCount = _owner.parent._transitions.Count; + for (int i = 0; i < transCount; i++) + _owner.parent._transitions[i].UpdateFromRelations(_owner.id, ox, oy); + } + } + } + + void ApplyOnXYChanged(RelationDef info, float dx, float dy) + { + float tmp; + switch (info.type) + { + case RelationType.Left_Left: + case RelationType.Left_Center: + case RelationType.Left_Right: + case RelationType.Center_Center: + case RelationType.Right_Left: + case RelationType.Right_Center: + case RelationType.Right_Right: + _owner.x += dx; + break; + + case RelationType.Top_Top: + case RelationType.Top_Middle: + case RelationType.Top_Bottom: + case RelationType.Middle_Middle: + case RelationType.Bottom_Top: + case RelationType.Bottom_Middle: + case RelationType.Bottom_Bottom: + _owner.y += dy; + break; + + case RelationType.Width: + case RelationType.Height: + break; + + case RelationType.LeftExt_Left: + case RelationType.LeftExt_Right: + if (_owner != _target.parent) + { + tmp = _owner.xMin; + _owner.width = _owner._rawWidth - dx; + _owner.xMin = tmp + dx; + } + else + _owner.width = _owner._rawWidth - dx; + break; + + case RelationType.RightExt_Left: + case RelationType.RightExt_Right: + if (_owner != _target.parent) + { + tmp = _owner.xMin; + _owner.width = _owner._rawWidth + dx; + _owner.xMin = tmp; + } + else + _owner.width = _owner._rawWidth + dx; + break; + + case RelationType.TopExt_Top: + case RelationType.TopExt_Bottom: + if (_owner != _target.parent) + { + tmp = _owner.yMin; + _owner.height = _owner._rawHeight - dy; + _owner.yMin = tmp + dy; + } + else + _owner.height = _owner._rawHeight - dy; + break; + + case RelationType.BottomExt_Top: + case RelationType.BottomExt_Bottom: + if (_owner != _target.parent) + { + tmp = _owner.yMin; + _owner.height = _owner._rawHeight + dy; + _owner.yMin = tmp; + } + else + _owner.height = _owner._rawHeight + dy; + break; + } + } + + void ApplyOnSizeChanged(RelationDef info) + { + float pos = 0, pivot = 0, delta = 0; + if (info.axis == 0) + { + if (_target != _owner.parent) + { + pos = _target.x; + if (_target.pivotAsAnchor) + pivot = _target.pivotX; + } + + if (info.percent) + { + if (_targetData.z != 0) + delta = _target._width / _targetData.z; + } + else + delta = _target._width - _targetData.z; + } + else + { + if (_target != _owner.parent) + { + pos = _target.y; + if (_target.pivotAsAnchor) + pivot = _target.pivotY; + } + + if (info.percent) + { + if (_targetData.w != 0) + delta = _target._height / _targetData.w; + } + else + delta = _target._height - _targetData.w; + } + + float v, tmp; + + switch (info.type) + { + case RelationType.Left_Left: + if (info.percent) + _owner.xMin = pos + (_owner.xMin - pos) * delta; + else if (pivot != 0) + _owner.x += delta * (-pivot); + break; + case RelationType.Left_Center: + if (info.percent) + _owner.xMin = pos + (_owner.xMin - pos) * delta; + else + _owner.x += delta * (0.5f - pivot); + break; + case RelationType.Left_Right: + if (info.percent) + _owner.xMin = pos + (_owner.xMin - pos) * delta; + else + _owner.x += delta * (1 - pivot); + break; + case RelationType.Center_Center: + if (info.percent) + _owner.xMin = pos + (_owner.xMin + _owner._rawWidth * 0.5f - pos) * delta - _owner._rawWidth * 0.5f; + else + _owner.x += delta * (0.5f - pivot); + break; + case RelationType.Right_Left: + if (info.percent) + _owner.xMin = pos + (_owner.xMin + _owner._rawWidth - pos) * delta - _owner._rawWidth; + else if (pivot != 0) + _owner.x += delta * (-pivot); + break; + case RelationType.Right_Center: + if (info.percent) + _owner.xMin = pos + (_owner.xMin + _owner._rawWidth - pos) * delta - _owner._rawWidth; + else + _owner.x += delta * (0.5f - pivot); + break; + case RelationType.Right_Right: + if (info.percent) + _owner.xMin = pos + (_owner.xMin + _owner._rawWidth - pos) * delta - _owner._rawWidth; + else + _owner.x += delta * (1 - pivot); + break; + + case RelationType.Top_Top: + if (info.percent) + _owner.yMin = pos + (_owner.yMin - pos) * delta; + else if (pivot != 0) + _owner.y += delta * (-pivot); + break; + case RelationType.Top_Middle: + if (info.percent) + _owner.yMin = pos + (_owner.yMin - pos) * delta; + else + _owner.y += delta * (0.5f - pivot); + break; + case RelationType.Top_Bottom: + if (info.percent) + _owner.yMin = pos + (_owner.yMin - pos) * delta; + else + _owner.y += delta * (1 - pivot); + break; + case RelationType.Middle_Middle: + if (info.percent) + _owner.yMin = pos + (_owner.yMin + _owner._rawHeight * 0.5f - pos) * delta - _owner._rawHeight * 0.5f; + else + _owner.y += delta * (0.5f - pivot); + break; + case RelationType.Bottom_Top: + if (info.percent) + _owner.yMin = pos + (_owner.yMin + _owner._rawHeight - pos) * delta - _owner._rawHeight; + else if (pivot != 0) + _owner.y += delta * (-pivot); + break; + case RelationType.Bottom_Middle: + if (info.percent) + _owner.yMin = pos + (_owner.yMin + _owner._rawHeight - pos) * delta - _owner._rawHeight; + else + _owner.y += delta * (0.5f - pivot); + break; + case RelationType.Bottom_Bottom: + if (info.percent) + _owner.yMin = pos + (_owner.yMin + _owner._rawHeight - pos) * delta - _owner._rawHeight; + else + _owner.y += delta * (1 - pivot); + break; + + case RelationType.Width: + if (_owner.underConstruct && _owner == _target.parent) + v = _owner.sourceWidth - _target.initWidth; + else + v = _owner._rawWidth - _targetData.z; + if (info.percent) + v = v * delta; + if (_target == _owner.parent) + { + if (_owner.pivotAsAnchor) + { + tmp = _owner.xMin; + _owner.SetSize(_target._width + v, _owner._rawHeight, true); + _owner.xMin = tmp; + } + else + _owner.SetSize(_target._width + v, _owner._rawHeight, true); + } + else + _owner.width = _target._width + v; + break; + case RelationType.Height: + if (_owner.underConstruct && _owner == _target.parent) + v = _owner.sourceHeight - _target.initHeight; + else + v = _owner._rawHeight - _targetData.w; + if (info.percent) + v = v * delta; + if (_target == _owner.parent) + { + if (_owner.pivotAsAnchor) + { + tmp = _owner.yMin; + _owner.SetSize(_owner._rawWidth, _target._height + v, true); + _owner.yMin = tmp; + } + else + _owner.SetSize(_owner._rawWidth, _target._height + v, true); + } + else + _owner.height = _target._height + v; + break; + + case RelationType.LeftExt_Left: + tmp = _owner.xMin; + if (info.percent) + v = pos + (tmp - pos) * delta - tmp; + else + v = delta * (-pivot); + _owner.width = _owner._rawWidth - v; + _owner.xMin = tmp + v; + break; + case RelationType.LeftExt_Right: + tmp = _owner.xMin; + if (info.percent) + v = pos + (tmp - pos) * delta - tmp; + else + v = delta * (1 - pivot); + _owner.width = _owner._rawWidth - v; + _owner.xMin = tmp + v; + break; + case RelationType.RightExt_Left: + tmp = _owner.xMin; + if (info.percent) + v = pos + (tmp + _owner._rawWidth - pos) * delta - (tmp + _owner._rawWidth); + else + v = delta * (-pivot); + _owner.width = _owner._rawWidth + v; + _owner.xMin = tmp; + break; + case RelationType.RightExt_Right: + tmp = _owner.xMin; + if (info.percent) + { + if (_owner == _target.parent) + { + if (_owner.underConstruct) + _owner.width = pos + _target._width - _target._width * pivot + + (_owner.sourceWidth - pos - _target.initWidth + _target.initWidth * pivot) * delta; + else + _owner.width = pos + (_owner._rawWidth - pos) * delta; + } + else + { + v = pos + (tmp + _owner._rawWidth - pos) * delta - (tmp + _owner._rawWidth); + _owner.width = _owner._rawWidth + v; + _owner.xMin = tmp; + } + } + else + { + if (_owner == _target.parent) + { + if (_owner.underConstruct) + _owner.width = _owner.sourceWidth + (_target._width - _target.initWidth) * (1 - pivot); + else + _owner.width = _owner._rawWidth + delta * (1 - pivot); + } + else + { + v = delta * (1 - pivot); + _owner.width = _owner._rawWidth + v; + _owner.xMin = tmp; + } + } + break; + case RelationType.TopExt_Top: + tmp = _owner.yMin; + if (info.percent) + v = pos + (tmp - pos) * delta - tmp; + else + v = delta * (-pivot); + _owner.height = _owner._rawHeight - v; + _owner.yMin = tmp + v; + break; + case RelationType.TopExt_Bottom: + tmp = _owner.yMin; + if (info.percent) + v = pos + (tmp - pos) * delta - tmp; + else + v = delta * (1 - pivot); + _owner.height = _owner._rawHeight - v; + _owner.yMin = tmp + v; + break; + case RelationType.BottomExt_Top: + tmp = _owner.yMin; + if (info.percent) + v = pos + (tmp + _owner._rawHeight - pos) * delta - (tmp + _owner._rawHeight); + else + v = delta * (-pivot); + _owner.height = _owner._rawHeight + v; + _owner.yMin = tmp; + break; + case RelationType.BottomExt_Bottom: + tmp = _owner.yMin; + if (info.percent) + { + if (_owner == _target.parent) + { + if (_owner.underConstruct) + _owner.height = pos + _target._height - _target._height * pivot + + (_owner.sourceHeight - pos - _target.initHeight + _target.initHeight * pivot) * delta; + else + _owner.height = pos + (_owner._rawHeight - pos) * delta; + } + else + { + v = pos + (tmp + _owner._rawHeight - pos) * delta - (tmp + _owner._rawHeight); + _owner.height = _owner._rawHeight + v; + _owner.yMin = tmp; + } + } + else + { + if (_owner == _target.parent) + { + if (_owner.underConstruct) + _owner.height = _owner.sourceHeight + (_target._height - _target.initHeight) * (1 - pivot); + else + _owner.height = _owner._rawHeight + delta * (1 - pivot); + } + else + { + v = delta * (1 - pivot); + _owner.height = _owner._rawHeight + v; + _owner.yMin = tmp; + } + } + break; + } + } + + void AddRefTarget(GObject target) + { + if (target != _owner.parent) + target.onPositionChanged.Add(__targetXYChanged); + target.onSizeChanged.Add(__targetSizeChanged); + _targetData.x = _target.x; + _targetData.y = _target.y; + _targetData.z = _target._width; + _targetData.w = _target._height; + } + + void ReleaseRefTarget(GObject target) + { + target.onPositionChanged.Remove(__targetXYChanged); + target.onSizeChanged.Remove(__targetSizeChanged); + } + + void __targetXYChanged(EventContext context) + { + if (_owner.relations.handling != null + || _owner.group != null && _owner.group._updating != 0) + { + _targetData.x = _target.x; + _targetData.y = _target.y; + return; + } + + _owner.relations.handling = (GObject)context.sender; + + float ox = _owner.x; + float oy = _owner.y; + float dx = _target.x - _targetData.x; + float dy = _target.y - _targetData.y; + + int cnt = _defs.Count; + for (int i = 0; i < cnt; i++) + ApplyOnXYChanged(_defs[i], dx, dy); + + _targetData.x = _target.x; + _targetData.y = _target.y; + + if (!Mathf.Approximately(ox, _owner.x) || !Mathf.Approximately(oy, _owner.y)) + { + ox = _owner.x - ox; + oy = _owner.y - oy; + + _owner.UpdateGearFromRelations(1, ox, oy); + + if (_owner.parent != null) + { + int transCount = _owner.parent._transitions.Count; + for (int i = 0; i < transCount; i++) + _owner.parent._transitions[i].UpdateFromRelations(_owner.id, ox, oy); + } + } + + _owner.relations.handling = null; + } + + void __targetSizeChanged(EventContext context) + { + if (_owner.relations.handling != null + || _owner.group != null && _owner.group._updating != 0) + { + _targetData.z = _target._width; + _targetData.w = _target._height; + return; + } + + _owner.relations.handling = (GObject)context.sender; + + float ox = _owner.x; + float oy = _owner.y; + float ow = _owner._rawWidth; + float oh = _owner._rawHeight; + + int cnt = _defs.Count; + for (int i = 0; i < cnt; i++) + ApplyOnSizeChanged(_defs[i]); + + _targetData.z = _target._width; + _targetData.w = _target._height; + + if (!Mathf.Approximately(ox, _owner.x) || !Mathf.Approximately(oy, _owner.y)) + { + ox = _owner.x - ox; + oy = _owner.y - oy; + + _owner.UpdateGearFromRelations(1, ox, oy); + + if (_owner.parent != null) + { + int transCount = _owner.parent._transitions.Count; + for (int i = 0; i < transCount; i++) + _owner.parent._transitions[i].UpdateFromRelations(_owner.id, ox, oy); + } + } + + if (!Mathf.Approximately(ow, _owner._rawWidth) || !Mathf.Approximately(oh, _owner._rawHeight)) + { + ow = _owner._rawWidth - ow; + oh = _owner._rawHeight - oh; + + _owner.UpdateGearFromRelations(2, ow, oh); + } + + _owner.relations.handling = null; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs.meta new file mode 100644 index 00000000..759d86d9 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/RelationItem.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 859441fdd74333a498ff048e6b48798b +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs new file mode 100644 index 00000000..14ef2ba3 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class Relations + { + GObject _owner; + List _items; + + public GObject handling; + + public Relations(GObject owner) + { + _owner = owner; + _items = new List(); + } + + /// + /// + /// + /// + /// + public void Add(GObject target, RelationType relationType) + { + Add(target, relationType, false); + } + + /// + /// + /// + /// + /// + /// + public void Add(GObject target, RelationType relationType, bool usePercent) + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + RelationItem item = _items[i]; + if (item.target == target) + { + item.Add(relationType, usePercent); + return; + } + } + RelationItem newItem = new RelationItem(_owner); + newItem.target = target; + newItem.Add(relationType, usePercent); + _items.Add(newItem); + } + + /// + /// + /// + /// + /// + public void Remove(GObject target, RelationType relationType) + { + int cnt = _items.Count; + int i = 0; + while (i < cnt) + { + RelationItem item = _items[i]; + if (item.target == target) + { + item.Remove(relationType); + if (item.isEmpty) + { + item.Dispose(); + _items.RemoveAt(i); + cnt--; + continue; + } + else + i++; + } + i++; + } + } + + /// + /// + /// + /// + /// + public bool Contains(GObject target) + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + RelationItem item = _items[i]; + if (item.target == target) + return true; + } + return false; + } + + /// + /// + /// + /// + public void ClearFor(GObject target) + { + int cnt = _items.Count; + int i = 0; + while (i < cnt) + { + RelationItem item = _items[i]; + if (item.target == target) + { + item.Dispose(); + _items.RemoveAt(i); + cnt--; + } + else + i++; + } + } + + /// + /// + /// + public void ClearAll() + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + RelationItem item = _items[i]; + item.Dispose(); + } + _items.Clear(); + } + + /// + /// + /// + /// + public void CopyFrom(Relations source) + { + ClearAll(); + + List arr = source._items; + foreach (RelationItem ri in arr) + { + RelationItem item = new RelationItem(_owner); + item.CopyFrom(ri); + _items.Add(item); + } + } + + /// + /// + /// + public void Dispose() + { + ClearAll(); + handling = null; + } + + /// + /// + /// + /// + /// + /// + public void OnOwnerSizeChanged(float dWidth, float dHeight, bool applyPivot) + { + int cnt = _items.Count; + if (cnt == 0) + return; + + for (int i = 0; i < cnt; i++) + _items[i].ApplyOnSelfSizeChanged(dWidth, dHeight, applyPivot); + } + + /// + /// + /// + public bool isEmpty + { + get + { + return _items.Count == 0; + } + } + + public void Setup(ByteBuffer buffer, bool parentToChild) + { + int cnt = buffer.ReadByte(); + GObject target; + for (int i = 0; i < cnt; i++) + { + int targetIndex = buffer.ReadShort(); + if (targetIndex == -1) + target = _owner.parent; + else if (parentToChild) + target = ((GComponent)_owner).GetChildAt(targetIndex); + else + target = _owner.parent.GetChildAt(targetIndex); + + RelationItem newItem = new RelationItem(_owner); + newItem.target = target; + _items.Add(newItem); + + int cnt2 = buffer.ReadByte(); + for (int j = 0; j < cnt2; j++) + { + RelationType rt = (RelationType)buffer.ReadByte(); + bool usePercent = buffer.ReadBool(); + newItem.InternalAdd(rt, usePercent); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs.meta new file mode 100644 index 00000000..6efd374e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Relations.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4376a9406aa478a4b82816818842d737 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs new file mode 100644 index 00000000..b81783b8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs @@ -0,0 +1,2301 @@ +using System; +using UnityEngine; +using FairyGUI.Utils; + +namespace FairyGUI +{ + /// + /// + /// + public class ScrollPane : EventDispatcher + { + /// + /// 当å‰è¢«æ‹–æ‹½çš„æ»šåŠ¨é¢æ¿ã€‚åŒä¸€æ—¶é—´åªèƒ½æœ‰ä¸€ä¸ªåœ¨è¿›è¡Œæ­¤æ“作。 + /// + public static ScrollPane draggingPane { get; private set; } + + ScrollType _scrollType; + float _scrollStep; + float _decelerationRate; + Margin _scrollBarMargin; + bool _bouncebackEffect; + bool _touchEffect; + bool _scrollBarDisplayAuto; + bool _vScrollNone; + bool _hScrollNone; + bool _needRefresh; + int _refreshBarAxis; + + bool _displayOnLeft; + bool _snapToItem; + internal bool _displayInDemand; + bool _mouseWheelEnabled; + bool _softnessOnTopOrLeftSide; + bool _pageMode; + Vector2 _pageSize; + bool _inertiaDisabled; + bool _maskDisabled; + bool _floating; + bool _dontClipMargin; + + float _xPos; + float _yPos; + + Vector2 _viewSize; + Vector2 _contentSize; + Vector2 _overlapSize; + Vector2 _containerPos; + Vector2 _beginTouchPos; + Vector2 _lastTouchPos; + Vector2 _lastTouchGlobalPos; + Vector2 _velocity; + float _velocityScale; + float _lastMoveTime; + bool _dragged; + bool _isHoldAreaDone; + int _aniFlag; + internal int _loop; + int _headerLockedSize; + int _footerLockedSize; + bool _hover; + + int _tweening; + Vector2 _tweenStart; + Vector2 _tweenChange; + Vector2 _tweenTime; + Vector2 _tweenDuration; + + Action _refreshDelegate; + TimerCallback _tweenUpdateDelegate; + GTweenCallback1 _hideScrollBarDelegate; + + GComponent _owner; + Container _maskContainer; + Container _container; + GScrollBar _hzScrollBar; + GScrollBar _vtScrollBar; + GComponent _header; + GComponent _footer; + Controller _pageController; + + EventListener _onScroll; + EventListener _onScrollEnd; + EventListener _onPullDownRelease; + EventListener _onPullUpRelease; + + static int _gestureFlag; + + public static float TWEEN_TIME_GO = 0.3f; //调用SetPos(ani)时使用的缓动时间 + public static float TWEEN_TIME_DEFAULT = 0.3f; //惯性滚动的最å°ç¼“动时间 + public static float PULL_RATIO = 0.5f; //下拉过顶或者上拉过底时å…许超过的è·ç¦»å æ˜¾ç¤ºåŒºåŸŸçš„æ¯”例 + + public ScrollPane(GComponent owner) + { + _onScroll = new EventListener(this, "onScroll"); + _onScrollEnd = new EventListener(this, "onScrollEnd"); + + _scrollStep = UIConfig.defaultScrollStep; + _softnessOnTopOrLeftSide = UIConfig.allowSoftnessOnTopOrLeftSide; + _decelerationRate = UIConfig.defaultScrollDecelerationRate; + _touchEffect = UIConfig.defaultScrollTouchEffect; + _bouncebackEffect = UIConfig.defaultScrollBounceEffect; + _mouseWheelEnabled = true; + _pageSize = Vector2.one; + + _refreshDelegate = Refresh; + _tweenUpdateDelegate = TweenUpdate; + _hideScrollBarDelegate = __barTweenComplete; + + _owner = owner; + + _maskContainer = new Container(); + _owner.rootContainer.AddChild(_maskContainer); + + _container = _owner.container; + _container.SetXY(0, 0); + _maskContainer.AddChild(_container); + + _owner.rootContainer.onMouseWheel.Add(__mouseWheel); + _owner.rootContainer.onTouchBegin.Add(__touchBegin); + _owner.rootContainer.onTouchMove.Add(__touchMove); + _owner.rootContainer.onTouchEnd.Add(__touchEnd); + } + + public void Setup(ByteBuffer buffer) + { + _scrollType = (ScrollType)buffer.ReadByte(); + ScrollBarDisplayType scrollBarDisplay = (ScrollBarDisplayType)buffer.ReadByte(); + int flags = buffer.ReadInt(); + + if (buffer.ReadBool()) + { + _scrollBarMargin.top = buffer.ReadInt(); + _scrollBarMargin.bottom = buffer.ReadInt(); + _scrollBarMargin.left = buffer.ReadInt(); + _scrollBarMargin.right = buffer.ReadInt(); + } + + string vtScrollBarRes = buffer.ReadS(); + string hzScrollBarRes = buffer.ReadS(); + string headerRes = buffer.ReadS(); + string footerRes = buffer.ReadS(); + + _displayOnLeft = (flags & 1) != 0; + _snapToItem = (flags & 2) != 0; + _displayInDemand = (flags & 4) != 0; + _pageMode = (flags & 8) != 0; + if ((flags & 16) != 0) + _touchEffect = true; + else if ((flags & 32) != 0) + _touchEffect = false; + if ((flags & 64) != 0) + _bouncebackEffect = true; + else if ((flags & 128) != 0) + _bouncebackEffect = false; + _inertiaDisabled = (flags & 256) != 0; + _maskDisabled = (flags & 512) != 0; + _floating = (flags & 1024) != 0; + _dontClipMargin = (flags & 2048) != 0; + + if (scrollBarDisplay == ScrollBarDisplayType.Default) + { + if (Application.isMobilePlatform) + scrollBarDisplay = ScrollBarDisplayType.Auto; + else + scrollBarDisplay = UIConfig.defaultScrollBarDisplay; + } + + if (scrollBarDisplay != ScrollBarDisplayType.Hidden) + { + if (_scrollType == ScrollType.Both || _scrollType == ScrollType.Vertical) + { + string res = vtScrollBarRes != null ? vtScrollBarRes : UIConfig.verticalScrollBar; + if (!string.IsNullOrEmpty(res)) + { + _vtScrollBar = UIPackage.CreateObjectFromURL(res) as GScrollBar; + if (_vtScrollBar == null) + Debug.LogWarning("FairyGUI: cannot create scrollbar from " + res); + else + { + _vtScrollBar.SetScrollPane(this, true); + _owner.rootContainer.AddChild(_vtScrollBar.displayObject); + } + } + } + if (_scrollType == ScrollType.Both || _scrollType == ScrollType.Horizontal) + { + string res = hzScrollBarRes != null ? hzScrollBarRes : UIConfig.horizontalScrollBar; + if (!string.IsNullOrEmpty(res)) + { + _hzScrollBar = UIPackage.CreateObjectFromURL(res) as GScrollBar; + if (_hzScrollBar == null) + Debug.LogWarning("FairyGUI: cannot create scrollbar from " + res); + else + { + _hzScrollBar.SetScrollPane(this, false); + _owner.rootContainer.AddChild(_hzScrollBar.displayObject); + } + } + } + + _scrollBarDisplayAuto = scrollBarDisplay == ScrollBarDisplayType.Auto; + if (_scrollBarDisplayAuto) + { + if (_vtScrollBar != null) + _vtScrollBar.displayObject.visible = false; + if (_hzScrollBar != null) + _hzScrollBar.displayObject.visible = false; + + _owner.rootContainer.onRollOver.Add(__rollOver); + _owner.rootContainer.onRollOut.Add(__rollOut); + } + } + else + _mouseWheelEnabled = false; + + if (Application.isPlaying) + { + if (headerRes != null) + { + _header = (GComponent)UIPackage.CreateObjectFromURL(headerRes); + if (_header == null) + Debug.LogWarning("FairyGUI: cannot create scrollPane header from " + headerRes); + } + + if (footerRes != null) + { + _footer = (GComponent)UIPackage.CreateObjectFromURL(footerRes); + if (_footer == null) + Debug.LogWarning("FairyGUI: cannot create scrollPane footer from " + footerRes); + } + + if (_header != null || _footer != null) + _refreshBarAxis = (_scrollType == ScrollType.Both || _scrollType == ScrollType.Vertical) ? 1 : 0; + } + + SetSize(owner.width, owner.height); + } + + /// + /// + /// + public void Dispose() + { + RemoveEventListeners(); + + if (_tweening != 0) + Timers.inst.Remove(_tweenUpdateDelegate); + + if (draggingPane == this) + draggingPane = null; + + _pageController = null; + + if (_hzScrollBar != null) + _hzScrollBar.Dispose(); + if (_vtScrollBar != null) + _vtScrollBar.Dispose(); + if (_header != null) + _header.Dispose(); + if (_footer != null) + _footer.Dispose(); + } + + /// + /// Dispatched when scrolling. + /// 在滚动时派å‘该事件。 + /// + public EventListener onScroll + { + get { return _onScroll ?? (_onScroll = new EventListener(this, "onScroll")); } + } + + /// + /// åœ¨æ»šåŠ¨ç»“æŸæ—¶æ´¾å‘该事件。 + /// + public EventListener onScrollEnd + { + get { return _onScrollEnd ?? (_onScrollEnd = new EventListener(this, "onScrollEnd")); } + } + + /// + /// å‘下拉过上边缘åŽé‡Šæ”¾åˆ™æ´¾å‘该事件。 + /// + public EventListener onPullDownRelease + { + get { return _onPullDownRelease ?? (_onPullDownRelease = new EventListener(this, "onPullDownRelease")); } + } + + /// + /// å‘上拉过下边缘åŽé‡Šæ”¾åˆ™æ´¾å‘该事件。 + /// + public EventListener onPullUpRelease + { + get { return _onPullUpRelease ?? (_onPullUpRelease = new EventListener(this, "onPullUpRelease")); } + } + + /// + /// + /// + public GComponent owner + { + get { return _owner; } + } + + /// + /// + /// + public GScrollBar hzScrollBar + { + get { return _hzScrollBar; } + } + + /// + /// + /// + public GScrollBar vtScrollBar + { + get { return _vtScrollBar; } + } + + /// + /// + /// + public GComponent header + { + get { return _header; } + } + + /// + /// + /// + public GComponent footer + { + get { return _footer; } + } + + /// + /// 滚动到达边缘时是å¦å…许回弹效果。 + /// + public bool bouncebackEffect + { + get { return _bouncebackEffect; } + set { _bouncebackEffect = value; } + } + + /// + /// 是å¦å…许拖拽内容区域进行滚动。 + /// + public bool touchEffect + { + get { return _touchEffect; } + set { _touchEffect = value; } + } + + /// + /// 是å¦å…许惯性滚动。 + /// + public bool inertiaDisabled + { + get { return _inertiaDisabled; } + set { _inertiaDisabled = value; } + } + + /// + /// 是å¦å…许在左/上边缘显示虚化效果。 + /// + public bool softnessOnTopOrLeftSide + { + get { return _softnessOnTopOrLeftSide; } + set { _softnessOnTopOrLeftSide = value; } + } + + /// + /// 当调用ScrollPane.scrollUp/Down/Left/Right时,或者点击滚动æ¡çš„上下箭头时,滑动的è·ç¦»ã€‚ + /// + public float scrollStep + { + get { return _scrollStep; } + set + { + _scrollStep = value; + if (_scrollStep == 0) + _scrollStep = UIConfig.defaultScrollStep; + } + } + + /// + /// 滚动ä½ç½®æ˜¯å¦ä¿æŒè´´è¿‘在æŸä¸ªå…ƒä»¶çš„边缘。 + /// + public bool snapToItem + { + get { return _snapToItem; } + set { _snapToItem = value; } + } + + /// + /// 是å¦é¡µé¢æ»šåŠ¨æ¨¡å¼ã€‚ + /// + public bool pageMode + { + get { return _pageMode; } + set { _pageMode = value; } + } + + /// + /// + /// + public Controller pageController + { + get { return _pageController; } + set { _pageController = value; } + } + + /// + /// 是å¦å…许使用鼠标滚轮进行滚动。 + /// + public bool mouseWheelEnabled + { + get { return _mouseWheelEnabled; } + set { _mouseWheelEnabled = value; } + } + + /// + /// 当处于惯性滚动时å‡é€Ÿçš„速率。默认值是UIConfig.defaultScrollDecelerationRate。 + /// 越接近1,å‡é€Ÿè¶Šæ…¢ï¼Œæ„å‘³ç€æ»‘动的时间和è·ç¦»æ›´é•¿ã€‚ + /// + public float decelerationRate + { + get { return _decelerationRate; } + set { _decelerationRate = value; } + } + + /// + /// + public bool isDragged + { + get { return _dragged; } + } + + /// + /// 当å‰X轴滚动ä½ç½®ç™¾åˆ†æ¯”,0~1(包å«ï¼‰ã€‚ + /// + public float percX + { + get { return _overlapSize.x == 0 ? 0 : _xPos / _overlapSize.x; } + set { SetPercX(value, false); } + } + + /// + /// 设置当å‰X轴滚动ä½ç½®ç™¾åˆ†æ¯”,0~1(包å«ï¼‰ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetPercX(float value, bool ani) + { + _owner.EnsureBoundsCorrect(); + SetPosX(_overlapSize.x * Mathf.Clamp01(value), ani); + } + + /// + /// 当å‰Y轴滚动ä½ç½®ç™¾åˆ†æ¯”,0~1(包å«ï¼‰ã€‚ + /// + public float percY + { + get { return _overlapSize.y == 0 ? 0 : _yPos / _overlapSize.y; } + set { SetPercY(value, false); } + } + + /// + /// 设置当å‰Y轴滚动ä½ç½®ç™¾åˆ†æ¯”,0~1(包å«ï¼‰ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetPercY(float value, bool ani) + { + _owner.EnsureBoundsCorrect(); + SetPosY(_overlapSize.y * Mathf.Clamp01(value), ani); + } + + /// + /// 当å‰X轴滚动ä½ç½®ï¼Œå€¼èŒƒå›´æ˜¯viewWidth与contentWidth之差。 + /// + public float posX + { + get { return _xPos; } + set { SetPosX(value, false); } + } + + /// + /// 设置当å‰X轴滚动ä½ç½®ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetPosX(float value, bool ani) + { + _owner.EnsureBoundsCorrect(); + + if (_loop == 1) + LoopCheckingNewPos(ref value, 0); + + value = Mathf.Clamp(value, 0, _overlapSize.x); + if (value != _xPos) + { + _xPos = value; + PosChanged(ani); + } + } + + /// + /// 当å‰Y轴滚动ä½ç½®ï¼Œå€¼èŒƒå›´æ˜¯viewHeight与contentHeight之差。 + /// + public float posY + { + get { return _yPos; } + set { SetPosY(value, false); } + } + + /// + /// 设置当å‰Y轴滚动ä½ç½®ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetPosY(float value, bool ani) + { + _owner.EnsureBoundsCorrect(); + + if (_loop == 2) + LoopCheckingNewPos(ref value, 1); + + value = Mathf.Clamp(value, 0, _overlapSize.y); + if (value != _yPos) + { + _yPos = value; + PosChanged(ani); + } + } + + /// + /// è¿”å›žå½“å‰æ»šåЍä½ç½®æ˜¯å¦åœ¨æœ€ä¸‹è¾¹ã€‚ + /// + public bool isBottomMost + { + get { return _yPos == _overlapSize.y || _overlapSize.y == 0; } + } + + /// + /// è¿”å›žå½“å‰æ»šåЍä½ç½®æ˜¯å¦åœ¨æœ€å³è¾¹ã€‚ + /// + public bool isRightMost + { + get { return _xPos == _overlapSize.x || _overlapSize.x == 0; } + } + + /// + /// 如果处于分页模å¼ï¼Œè¿”回当å‰åœ¨X轴的页ç ã€‚ + /// + public int currentPageX + { + get + { + if (!_pageMode) + return 0; + + int page = Mathf.FloorToInt(_xPos / _pageSize.x); + if (_xPos - page * _pageSize.x > _pageSize.x * 0.5f) + page++; + + return page; + } + set + { + if (!_pageMode) + return; + + _owner.EnsureBoundsCorrect(); + + if (_overlapSize.x > 0) + this.SetPosX(value * _pageSize.x, false); + } + } + + /// + /// 如果处于分页模å¼ï¼Œå¯è®¾ç½®X轴的页ç ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetCurrentPageX(int value, bool ani) + { + if (!_pageMode) + return; + + _owner.EnsureBoundsCorrect(); + + if (_overlapSize.x > 0) + this.SetPosX(value * _pageSize.x, ani); + } + + /// + /// 如果处于分页模å¼ï¼Œè¿”回当å‰åœ¨Y轴的页ç ã€‚ + /// + public int currentPageY + { + get + { + if (!_pageMode) + return 0; + + int page = Mathf.FloorToInt(_yPos / _pageSize.y); + if (_yPos - page * _pageSize.y > _pageSize.y * 0.5f) + page++; + + return page; + } + set + { + if (!_pageMode) + return; + + _owner.EnsureBoundsCorrect(); + + if (_overlapSize.y > 0) + this.SetPosY(value * _pageSize.y, false); + } + } + + /// + /// 如果处于分页模å¼ï¼Œå¯è®¾ç½®Y轴的页ç ã€‚ + /// + /// + /// 是å¦ä½¿ç”¨ç¼“动到达目标。 + public void SetCurrentPageY(int value, bool ani) + { + if (!_pageMode) + return; + + _owner.EnsureBoundsCorrect(); + + if (_overlapSize.y > 0) + this.SetPosY(value * _pageSize.y, ani); + } + + /// + /// 这个值与PosXä¸åŒåœ¨äºŽï¼Œä»–åæ˜ çš„æ˜¯å®žæ—¶ä½ç½®ï¼Œè€ŒPosXåœ¨æœ‰ç¼“åŠ¨è¿‡ç¨‹çš„æƒ…å†µä¸‹åªæ˜¯ç»ˆå€¼ã€‚ + /// + public float scrollingPosX + { + get + { + return Mathf.Clamp(-_container.x, 0, _overlapSize.x); + } + } + + /// + /// 这个值与PosYä¸åŒåœ¨äºŽï¼Œä»–åæ˜ çš„æ˜¯å®žæ—¶ä½ç½®ï¼Œè€ŒPosYåœ¨æœ‰ç¼“åŠ¨è¿‡ç¨‹çš„æƒ…å†µä¸‹åªæ˜¯ç»ˆå€¼ã€‚ + /// + public float scrollingPosY + { + get + { + return Mathf.Clamp(-_container.y, 0, _overlapSize.y); + } + } + + /// + /// 显示内容宽度。 + /// + public float contentWidth + { + get + { + return _contentSize.x; + } + } + + /// + /// 显示内容高度。 + /// + public float contentHeight + { + get + { + return _contentSize.y; + } + } + + /// + /// 显示区域宽度。 + /// + public float viewWidth + { + get { return _viewSize.x; } + set + { + value = value + _owner.margin.left + _owner.margin.right; + if (_vtScrollBar != null && !_floating) + value += _vtScrollBar.width; + _owner.width = value; + } + } + + /// + /// 显示区域高度。 + /// + public float viewHeight + { + get { return _viewSize.y; } + set + { + value = value + _owner.margin.top + _owner.margin.bottom; + if (_hzScrollBar != null && !_floating) + value += _hzScrollBar.height; + _owner.height = value; + } + } + + /// + /// + /// + public void ScrollTop() + { + ScrollTop(false); + } + + /// + /// + /// + /// + public void ScrollTop(bool ani) + { + this.SetPercY(0, ani); + } + + /// + /// + /// + public void ScrollBottom() + { + ScrollBottom(false); + } + + /// + /// + /// + /// + public void ScrollBottom(bool ani) + { + this.SetPercY(1, ani); + } + + /// + /// + /// + public void ScrollUp() + { + ScrollUp(1, false); + } + + /// + /// + /// + /// + /// + public void ScrollUp(float ratio, bool ani) + { + if (_pageMode) + SetPosY(_yPos - _pageSize.y * ratio, ani); + else + SetPosY(_yPos - _scrollStep * ratio, ani); + } + + /// + /// + /// + public void ScrollDown() + { + ScrollDown(1, false); + } + + /// + /// + /// + /// + /// + public void ScrollDown(float ratio, bool ani) + { + if (_pageMode) + SetPosY(_yPos + _pageSize.y * ratio, ani); + else + SetPosY(_yPos + _scrollStep * ratio, ani); + } + + /// + /// + /// + public void ScrollLeft() + { + ScrollLeft(1, false); + } + + /// + /// + /// + /// + /// + public void ScrollLeft(float ratio, bool ani) + { + if (_pageMode) + SetPosX(_xPos - _pageSize.x * ratio, ani); + else + SetPosX(_xPos - _scrollStep * ratio, ani); + } + + /// + /// + /// + public void ScrollRight() + { + ScrollRight(1, false); + } + + /// + /// + /// + /// + /// + public void ScrollRight(float ratio, bool ani) + { + if (_pageMode) + SetPosX(_xPos + _pageSize.x * ratio, ani); + else + SetPosX(_xPos + _scrollStep * ratio, ani); + } + + /// + /// + /// + /// obj can be any object on stage, not limited to the direct child of this container. + public void ScrollToView(GObject obj) + { + ScrollToView(obj, false); + } + + /// + /// + /// + /// obj can be any object on stage, not limited to the direct child of this container. + /// If moving to target position with animation + public void ScrollToView(GObject obj, bool ani) + { + ScrollToView(obj, ani, false); + } + + /// + /// + /// + /// obj can be any object on stage, not limited to the direct child of this container. + /// If moving to target position with animation + /// If true, scroll to make the target on the top/left; If false, scroll to make the target any position in view. + public void ScrollToView(GObject obj, bool ani, bool setFirst) + { + _owner.EnsureBoundsCorrect(); + if (_needRefresh) + Refresh(); + + Rect rect = new Rect(obj.x, obj.y, obj.width, obj.height); + if (obj.parent != _owner) + rect = obj.parent.TransformRect(rect, _owner); + ScrollToView(rect, ani, setFirst); + } + + /// + /// + /// + /// Rect in local coordinates + /// If moving to target position with animation + /// If true, scroll to make the target on the top/left; If false, scroll to make the target any position in view. + public void ScrollToView(Rect rect, bool ani, bool setFirst) + { + _owner.EnsureBoundsCorrect(); + if (_needRefresh) + Refresh(); + + if (_overlapSize.y > 0) + { + float bottom = _yPos + _viewSize.y; + if (setFirst || rect.y <= _yPos || rect.height >= _viewSize.y) + { + if (_pageMode) + this.SetPosY(Mathf.Floor(rect.y / _pageSize.y) * _pageSize.y, ani); + else + SetPosY(rect.y, ani); + } + else if (rect.y + rect.height > bottom) + { + if (_pageMode) + this.SetPosY(Mathf.Floor(rect.y / _pageSize.y) * _pageSize.y, ani); + else if (rect.height <= _viewSize.y / 2) + SetPosY(rect.y + rect.height * 2 - _viewSize.y, ani); + else + SetPosY(rect.y + rect.height - _viewSize.y, ani); + } + } + if (_overlapSize.x > 0) + { + float right = _xPos + _viewSize.x; + if (setFirst || rect.x <= _xPos || rect.width >= _viewSize.x) + { + if (_pageMode) + this.SetPosX(Mathf.Floor(rect.x / _pageSize.x) * _pageSize.x, ani); + SetPosX(rect.x, ani); + } + else if (rect.x + rect.width > right) + { + if (_pageMode) + this.SetPosX(Mathf.Floor(rect.x / _pageSize.x) * _pageSize.x, ani); + else if (rect.width <= _viewSize.x / 2) + SetPosX(rect.x + rect.width * 2 - _viewSize.x, ani); + else + SetPosX(rect.x + rect.width - _viewSize.x, ani); + } + } + + if (!ani && _needRefresh) + Refresh(); + } + + /// + /// + /// + /// obj must be the direct child of this container + /// + public bool IsChildInView(GObject obj) + { + if (_overlapSize.y > 0) + { + float dist = obj.y + _container.y; + if (dist <= -obj.height || dist >= _viewSize.y) + return false; + } + if (_overlapSize.x > 0) + { + float dist = obj.x + _container.x; + if (dist <= -obj.width || dist >= _viewSize.x) + return false; + } + + return true; + } + + /// + /// å½“æ»šåŠ¨é¢æ¿å¤„äºŽæ‹–æ‹½æ»šåŠ¨çŠ¶æ€æˆ–å³å°†è¿›å…¥æ‹–æ‹½çŠ¶æ€æ—¶ï¼Œå¯ä»¥è°ƒç”¨æ­¤æ–¹æ³•åœæ­¢æˆ–ç¦æ­¢æœ¬æ¬¡æ‹–拽。 + /// + public void CancelDragging() + { + Stage.inst.RemoveTouchMonitor(_owner.rootContainer); + + if (draggingPane == this) + draggingPane = null; + + _gestureFlag = 0; + _dragged = false; + } + + /// + /// 设置Header固定显示。如果size为0ï¼Œåˆ™å–æ¶ˆå›ºå®šæ˜¾ç¤ºã€‚ + /// + /// Headeræ˜¾ç¤ºçš„å¤§å° + public void LockHeader(int size) + { + if (_headerLockedSize == size) + return; + + _headerLockedSize = size; + if (!isDispatching("onPullDownRelease") && _container.xy[_refreshBarAxis] >= 0) + { + _tweenStart = _container.xy; + _tweenChange = Vector2.zero; + _tweenChange[_refreshBarAxis] = _headerLockedSize - _tweenStart[_refreshBarAxis]; + _tweenDuration = new Vector2(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT); + StartTween(2); + } + } + + /// + /// 设置Footer固定显示。如果size为0ï¼Œåˆ™å–æ¶ˆå›ºå®šæ˜¾ç¤ºã€‚ + /// + /// + public void LockFooter(int size) + { + if (_footerLockedSize == size) + return; + + _footerLockedSize = size; + if (!isDispatching("onPullUpRelease") && _container.xy[_refreshBarAxis] <= -_overlapSize[_refreshBarAxis]) + { + _tweenStart = _container.xy; + _tweenChange = Vector2.zero; + float max = _overlapSize[_refreshBarAxis]; + if (max == 0) + max = Mathf.Max(_contentSize[_refreshBarAxis] + _footerLockedSize - _viewSize[_refreshBarAxis], 0); + else + max += _footerLockedSize; + _tweenChange[_refreshBarAxis] = -max - _tweenStart[_refreshBarAxis]; + _tweenDuration = new Vector2(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT); + StartTween(2); + } + } + + internal void OnOwnerSizeChanged() + { + SetSize(_owner.width, _owner.height); + PosChanged(false); + } + + internal void HandleControllerChanged(Controller c) + { + if (_pageController == c) + { + if (_scrollType == ScrollType.Horizontal) + this.SetCurrentPageX(c.selectedIndex, true); + else + this.SetCurrentPageY(c.selectedIndex, true); + } + } + + void UpdatePageController() + { + if (_pageController != null && !_pageController.changing) + { + int index; + if (_scrollType == ScrollType.Horizontal) + index = this.currentPageX; + else + index = this.currentPageY; + if (index < _pageController.pageCount) + { + Controller c = _pageController; + _pageController = null; //防止HandleControllerChanged的调用 + c.selectedIndex = index; + _pageController = c; + } + } + } + + internal void AdjustMaskContainer() + { + float mx, my; + if (_displayOnLeft && _vtScrollBar != null && !_floating) + mx = Mathf.FloorToInt(_owner.margin.left + _vtScrollBar.width); + else + mx = _owner.margin.left; + my = _owner.margin.top; + mx += _owner._alignOffset.x; + my += _owner._alignOffset.y; + + _maskContainer.SetXY(mx, my); + } + + void SetSize(float aWidth, float aHeight) + { + AdjustMaskContainer(); + + if (_hzScrollBar != null) + { + _hzScrollBar.y = aHeight - _hzScrollBar.height; + if (_vtScrollBar != null) + { + _hzScrollBar.width = aWidth - _vtScrollBar.width - _scrollBarMargin.left - _scrollBarMargin.right; + if (_displayOnLeft) + _hzScrollBar.x = _scrollBarMargin.left + _vtScrollBar.width; + else + _hzScrollBar.x = _scrollBarMargin.left; + } + else + { + _hzScrollBar.width = aWidth - _scrollBarMargin.left - _scrollBarMargin.right; + _hzScrollBar.x = _scrollBarMargin.left; + } + } + if (_vtScrollBar != null) + { + if (!_displayOnLeft) + _vtScrollBar.x = aWidth - _vtScrollBar.width; + if (_hzScrollBar != null) + _vtScrollBar.height = aHeight - _hzScrollBar.height - _scrollBarMargin.top - _scrollBarMargin.bottom; + else + _vtScrollBar.height = aHeight - _scrollBarMargin.top - _scrollBarMargin.bottom; + _vtScrollBar.y = _scrollBarMargin.top; + } + + _viewSize.x = aWidth; + _viewSize.y = aHeight; + if (_hzScrollBar != null && !_floating) + _viewSize.y -= _hzScrollBar.height; + if (_vtScrollBar != null && !_floating) + _viewSize.x -= _vtScrollBar.width; + _viewSize.x -= (_owner.margin.left + _owner.margin.right); + _viewSize.y -= (_owner.margin.top + _owner.margin.bottom); + + _viewSize.x = Mathf.Max(1, _viewSize.x); + _viewSize.y = Mathf.Max(1, _viewSize.y); + _pageSize.x = _viewSize.x; + _pageSize.y = _viewSize.y; + + HandleSizeChanged(); + } + + internal void SetContentSize(float aWidth, float aHeight) + { + if (Mathf.Approximately(_contentSize.x, aWidth) && Mathf.Approximately(_contentSize.y, aHeight)) + return; + + _contentSize.x = aWidth; + _contentSize.y = aHeight; + HandleSizeChanged(); + } + + /// + /// 内部使用。由虚拟列表调用。在滚动时修改显示内容的大å°ï¼Œéœ€è¦è¿›è¡Œä¿®æ­£ï¼Œé¿å…滚动跳跃。 + /// + /// + /// + /// + /// + internal void ChangeContentSizeOnScrolling(float deltaWidth, float deltaHeight, float deltaPosX, float deltaPosY) + { + bool isRightmost = _xPos == _overlapSize.x; + bool isBottom = _yPos == _overlapSize.y; + + _contentSize.x += deltaWidth; + _contentSize.y += deltaHeight; + HandleSizeChanged(); + + if (_tweening == 1) + { + //å¦‚æžœåŽŸæ¥æ»šåЍä½ç½®æ˜¯è´´è¾¹ï¼ŒåР入处ç†ç»§ç»­è´´è¾¹ã€‚ + if (deltaWidth != 0 && isRightmost && _tweenChange.x < 0) + { + _xPos = _overlapSize.x; + _tweenChange.x = -_xPos - _tweenStart.x; + } + + if (deltaHeight != 0 && isBottom && _tweenChange.y < 0) + { + _yPos = _overlapSize.y; + _tweenChange.y = -_yPos - _tweenStart.y; + } + } + else if (_tweening == 2) + { + //釿–°è°ƒæ•´èµ·å§‹ä½ç½®ï¼Œç¡®ä¿èƒ½å¤Ÿé¡ºæ»‘滚下去 + if (deltaPosX != 0) + { + _container.x -= deltaPosX; + _tweenStart.x -= deltaPosX; + _xPos = -_container.x; + } + if (deltaPosY != 0) + { + _container.y -= deltaPosY; + _tweenStart.y -= deltaPosY; + _yPos = -_container.y; + } + } + else if (_dragged) + { + if (deltaPosX != 0) + { + _container.x -= deltaPosX; + _containerPos.x -= deltaPosX; + _xPos = -_container.x; + } + if (deltaPosY != 0) + { + _container.y -= deltaPosY; + _containerPos.y -= deltaPosY; + _yPos = -_container.y; + } + } + else + { + //å¦‚æžœåŽŸæ¥æ»šåЍä½ç½®æ˜¯è´´è¾¹ï¼ŒåР入处ç†ç»§ç»­è´´è¾¹ã€‚ + if (deltaWidth != 0 && isRightmost) + { + _xPos = _overlapSize.x; + _container.x = -_xPos; + } + + if (deltaHeight != 0 && isBottom) + { + _yPos = _overlapSize.y; + _container.y = -_yPos; + } + } + + if (_pageMode) + UpdatePageController(); + } + + void HandleSizeChanged() + { + if (_displayInDemand) + { + _vScrollNone = _contentSize.y <= _viewSize.y; + _hScrollNone = _contentSize.x <= _viewSize.x; + } + + if (_vtScrollBar != null) + { + if (_contentSize.y == 0) + _vtScrollBar.SetDisplayPerc(0); + else + _vtScrollBar.SetDisplayPerc(Mathf.Min(1, _viewSize.y / _contentSize.y)); + } + if (_hzScrollBar != null) + { + if (_contentSize.x == 0) + _hzScrollBar.SetDisplayPerc(0); + else + _hzScrollBar.SetDisplayPerc(Mathf.Min(1, _viewSize.x / _contentSize.x)); + } + + UpdateScrollBarVisible(); + + if (!_maskDisabled) + { + Rect rect = new Rect(-_owner._alignOffset.x, -_owner._alignOffset.y, _viewSize.x, _viewSize.y); + if (_vScrollNone && _vtScrollBar != null) + rect.width += _vtScrollBar.width; + if (_hScrollNone && _hzScrollBar != null) + rect.height += _hzScrollBar.height; + if (_dontClipMargin) + { + rect.x -= _owner.margin.left; + rect.width += (_owner.margin.left + _owner.margin.right); + rect.y -= _owner.margin.top; + rect.height += (_owner.margin.top + _owner.margin.bottom); + } + + _maskContainer.clipRect = rect; + } + + if (_scrollType == ScrollType.Horizontal || _scrollType == ScrollType.Both) + _overlapSize.x = Mathf.CeilToInt(Math.Max(0, _contentSize.x - _viewSize.x)); + else + _overlapSize.x = 0; + if (_scrollType == ScrollType.Vertical || _scrollType == ScrollType.Both) + _overlapSize.y = Mathf.CeilToInt(Math.Max(0, _contentSize.y - _viewSize.y)); + else + _overlapSize.y = 0; + + //边界检查 + _xPos = Mathf.Clamp(_xPos, 0, _overlapSize.x); + _yPos = Mathf.Clamp(_yPos, 0, _overlapSize.y); + float max = _overlapSize[_refreshBarAxis]; + if (max == 0) + max = Mathf.Max(_contentSize[_refreshBarAxis] + _footerLockedSize - _viewSize[_refreshBarAxis], 0); + else + max += _footerLockedSize; + if (_refreshBarAxis == 0) + _container.SetXY(Mathf.Clamp(_container.x, -max, _headerLockedSize), Mathf.Clamp(_container.y, -_overlapSize.y, 0)); + else + _container.SetXY(Mathf.Clamp(_container.x, -_overlapSize.x, 0), Mathf.Clamp(_container.y, -max, _headerLockedSize)); + + if (_header != null) + { + if (_refreshBarAxis == 0) + _header.height = _viewSize.y; + else + _header.width = _viewSize.x; + } + + if (_footer != null) + { + if (_refreshBarAxis == 0) + _footer.height = _viewSize.y; + else + _footer.width = _viewSize.x; + } + + UpdateScrollBarPos(); + if (_pageMode) + UpdatePageController(); + } + + private void PosChanged(bool ani) + { + //åªè¦æœ‰1å¤„è¦æ±‚ä¸è¦ç¼“动,那就ä¸ç¼“动 + if (_aniFlag == 0) + _aniFlag = ani ? 1 : -1; + else if (_aniFlag == 1 && !ani) + _aniFlag = -1; + + _needRefresh = true; + + UpdateContext.OnBegin -= _refreshDelegate; + UpdateContext.OnBegin += _refreshDelegate; + } + + private void Refresh() + { + _needRefresh = false; + UpdateContext.OnBegin -= _refreshDelegate; + + if (_owner.displayObject == null || _owner.displayObject.isDisposed) + return; + + if (_pageMode || _snapToItem) + { + Vector2 pos = new Vector2(-_xPos, -_yPos); + AlignPosition(ref pos, false); + _xPos = -pos.x; + _yPos = -pos.y; + } + + Refresh2(); + + _onScroll.Call(); + if (_needRefresh) //在onScroll事件里开å‘者å¯èƒ½ä¿®æ”¹ä½ç½®ï¼Œè¿™é‡Œå†åˆ·æ–°ä¸€æ¬¡ï¼Œé¿å…é—ªçƒ + { + _needRefresh = false; + UpdateContext.OnBegin -= _refreshDelegate; + + Refresh2(); + } + + UpdateScrollBarPos(); + _aniFlag = 0; + } + + void Refresh2() + { + if (_aniFlag == 1 && !_dragged) + { + Vector2 pos = new Vector2(); + + if (_overlapSize.x > 0) + pos.x = -(int)_xPos; + else + { + if (_container.x != 0) + _container.x = 0; + pos.x = 0; + } + if (_overlapSize.y > 0) + pos.y = -(int)_yPos; + else + { + if (_container.y != 0) + _container.y = 0; + pos.y = 0; + } + + if (pos.x != _container.x || pos.y != _container.y) + { + _tweenDuration = new Vector2(TWEEN_TIME_GO, TWEEN_TIME_GO); + _tweenStart = _container.xy; + _tweenChange = pos - _tweenStart; + StartTween(1); + } + else if (_tweening != 0) + KillTween(); + } + else + { + if (_tweening != 0) + KillTween(); + + _container.SetXY((int)-_xPos, (int)-_yPos); + + LoopCheckingCurrent(); + } + + if (_pageMode) + UpdatePageController(); + } + + private void __touchBegin(EventContext context) + { + if (!_touchEffect) + return; + + InputEvent evt = context.inputEvent; + if (evt.button != 0) + return; + + context.CaptureTouch(); + + Vector2 pt = _owner.GlobalToLocal(evt.position); + + if (_tweening != 0) + { + KillTween(); + Stage.inst.CancelClick(evt.touchId); + + //ç«‹åˆ»åœæ­¢æƒ¯æ€§æ»šåŠ¨ï¼Œå¯èƒ½ä½ç½®ä¸å¯¹é½ï¼Œè®¾å®šè¿™ä¸ªæ ‡å¿—,使touchEndæ—¶å½’ä½ + _dragged = true; + } + else + _dragged = false; + + _containerPos = _container.xy; + _beginTouchPos = _lastTouchPos = pt; + _lastTouchGlobalPos = evt.position; + _isHoldAreaDone = false; + _velocity = Vector2.zero; + _velocityScale = 1; + _lastMoveTime = Time.unscaledTime; + } + + private void __touchMove(EventContext context) + { + if (!_touchEffect || draggingPane != null && draggingPane != this || GObject.draggingObject != null) //å·²ç»æœ‰å…¶ä»–拖动 + return; + + InputEvent evt = context.inputEvent; + Vector2 pt = _owner.GlobalToLocal(evt.position); + if (float.IsNaN(pt.x)) + return; + + int sensitivity; + if (Stage.touchScreen) + sensitivity = UIConfig.touchScrollSensitivity; + else + sensitivity = 8; + + float diff; + bool sv = false, sh = false; + + if (_scrollType == ScrollType.Vertical) + { + if (!_isHoldAreaDone) + { + //表示正在监测垂直方å‘的手势 + _gestureFlag |= 1; + + diff = Mathf.Abs(_beginTouchPos.y - pt.y); + if (diff < sensitivity) + return; + + if ((_gestureFlag & 2) != 0) //å·²ç»æœ‰æ°´å¹³æ–¹å‘çš„æ‰‹åŠ¿åœ¨ç›‘æµ‹ï¼Œé‚£ä¹ˆæˆ‘ä»¬ç”¨ä¸¥æ ¼çš„æ–¹å¼æ£€æŸ¥æ˜¯ä¸æ˜¯æŒ‰åž‚ç›´æ–¹å‘移动,é¿å…å†²çª + { + float diff2 = Mathf.Abs(_beginTouchPos.x - pt.x); + if (diff < diff2) //ä¸é€šè¿‡åˆ™ä¸å…许滚动了 + return; + } + } + + sv = true; + } + else if (_scrollType == ScrollType.Horizontal) + { + if (!_isHoldAreaDone) + { + _gestureFlag |= 2; + + diff = Mathf.Abs(_beginTouchPos.x - pt.x); + if (diff < sensitivity) + return; + + if ((_gestureFlag & 1) != 0) + { + float diff2 = Mathf.Abs(_beginTouchPos.y - pt.y); + if (diff < diff2) + return; + } + } + + sh = true; + } + else + { + _gestureFlag = 3; + + if (!_isHoldAreaDone) + { + diff = Mathf.Abs(_beginTouchPos.y - pt.y); + if (diff < sensitivity) + { + diff = Mathf.Abs(_beginTouchPos.x - pt.x); + if (diff < sensitivity) + return; + } + } + + sv = sh = true; + } + + Vector2 newPos = _containerPos + pt - _beginTouchPos; + newPos.x = (int)newPos.x; + newPos.y = (int)newPos.y; + + if (sv) + { + if (newPos.y > 0) + { + if (!_bouncebackEffect) + _container.y = 0; + else if (_header != null && _header.maxHeight != 0) + _container.y = (int)Mathf.Min(newPos.y * 0.5f, _header.maxHeight); + else + _container.y = (int)Mathf.Min(newPos.y * 0.5f, _viewSize.y * PULL_RATIO); + } + else if (newPos.y < -_overlapSize.y) + { + if (!_bouncebackEffect) + _container.y = -_overlapSize.y; + else if (_footer != null && _footer.maxHeight > 0) + _container.y = (int)Mathf.Max((newPos.y + _overlapSize.y) * 0.5f, -_footer.maxHeight) - _overlapSize.y; + else + _container.y = (int)Mathf.Max((newPos.y + _overlapSize.y) * 0.5f, -_viewSize.y * PULL_RATIO) - _overlapSize.y; + } + else + _container.y = newPos.y; + } + + if (sh) + { + if (newPos.x > 0) + { + if (!_bouncebackEffect) + _container.x = 0; + else if (_header != null && _header.maxWidth != 0) + _container.x = (int)Mathf.Min(newPos.x * 0.5f, _header.maxWidth); + else + _container.x = (int)Mathf.Min(newPos.x * 0.5f, _viewSize.x * PULL_RATIO); + } + else if (newPos.x < 0 - _overlapSize.x) + { + if (!_bouncebackEffect) + _container.x = -_overlapSize.x; + else if (_footer != null && _footer.maxWidth > 0) + _container.x = (int)Mathf.Max((newPos.x + _overlapSize.x) * 0.5f, -_footer.maxWidth) - _overlapSize.x; + else + _container.x = (int)Mathf.Max((newPos.x + _overlapSize.x) * 0.5f, -_viewSize.x * PULL_RATIO) - _overlapSize.x; + } + else + _container.x = newPos.x; + } + + //更新速度 + float deltaTime = Time.unscaledDeltaTime; + float elapsed = (Time.unscaledTime - _lastMoveTime) * 60 - 1; + if (elapsed > 1) //é€Ÿåº¦è¡°å‡ + _velocity = _velocity * Mathf.Pow(0.833f, elapsed); + Vector2 deltaPosition = pt - _lastTouchPos; + if (!sh) + deltaPosition.x = 0; + if (!sv) + deltaPosition.y = 0; + _velocity = Vector2.Lerp(_velocity, deltaPosition / deltaTime, deltaTime * 10); + + /*速度计算使用的是本地ä½ç§»ï¼Œä½†åœ¨åŽç»­çš„æƒ¯æ€§æ»šåŠ¨åˆ¤æ–­ä¸­éœ€è¦ç”¨åˆ°å±å¹•ä½ç§»ï¼Œæ‰€ä»¥è¿™é‡Œè¦è®°å½•一个ä½ç§»çš„æ¯”例。 + *åŽç»­çš„处ç†è¦ä½¿ç”¨è¿™ä¸ªæ¯”例但ä¸ä½¿ç”¨å标转æ¢çš„æ–¹æ³•的原因是,在曲é¢UI等异形UI中,还无法简å•地进行å±å¹•åæ ‡å’Œæœ¬åœ°å标的转æ¢ã€‚ + */ + Vector2 deltaGlobalPosition = _lastTouchGlobalPos - evt.position; + if (deltaPosition.x != 0) + _velocityScale = Mathf.Abs(deltaGlobalPosition.x / deltaPosition.x); + else if (deltaPosition.y != 0) + _velocityScale = Mathf.Abs(deltaGlobalPosition.y / deltaPosition.y); + + _lastTouchPos = pt; + _lastTouchGlobalPos = evt.position; + _lastMoveTime = Time.unscaledTime; + + //åŒæ­¥æ›´æ–°pos值 + if (_overlapSize.x > 0) + _xPos = Mathf.Clamp(-_container.x, 0, _overlapSize.x); + if (_overlapSize.y > 0) + _yPos = Mathf.Clamp(-_container.y, 0, _overlapSize.y); + + //循环滚动特别检查 + if (_loop != 0) + { + newPos = _container.xy; + if (LoopCheckingCurrent()) + _containerPos += _container.xy - newPos; + } + + draggingPane = this; + _isHoldAreaDone = true; + _dragged = true; + + UpdateScrollBarPos(); + UpdateScrollBarVisible(); + if (_pageMode) + UpdatePageController(); + _onScroll.Call(); + } + + private void __touchEnd(EventContext context) + { + if (draggingPane == this) + draggingPane = null; + + _gestureFlag = 0; + + if (!_dragged || !_touchEffect) + { + _dragged = false; + return; + } + + _dragged = false; + _tweenStart = _container.xy; + + Vector2 endPos = _tweenStart; + bool flag = false; + if (_container.x > 0) + { + endPos.x = 0; + flag = true; + } + else if (_container.x < -_overlapSize.x) + { + endPos.x = -_overlapSize.x; + flag = true; + } + if (_container.y > 0) + { + endPos.y = 0; + flag = true; + } + else if (_container.y < -_overlapSize.y) + { + endPos.y = -_overlapSize.y; + flag = true; + } + + if (flag) + { + _tweenChange = endPos - _tweenStart; + if (_tweenChange.x < -UIConfig.touchDragSensitivity || _tweenChange.y < -UIConfig.touchDragSensitivity) + DispatchEvent("onPullDownRelease", null); + else if (_tweenChange.x > UIConfig.touchDragSensitivity || _tweenChange.y > UIConfig.touchDragSensitivity) + DispatchEvent("onPullUpRelease", null); + + if (_headerLockedSize > 0 && endPos[_refreshBarAxis] == 0) + { + endPos[_refreshBarAxis] = _headerLockedSize; + _tweenChange = endPos - _tweenStart; + } + else if (_footerLockedSize > 0 && endPos[_refreshBarAxis] == -_overlapSize[_refreshBarAxis]) + { + float max = _overlapSize[_refreshBarAxis]; + if (max == 0) + max = Mathf.Max(_contentSize[_refreshBarAxis] + _footerLockedSize - _viewSize[_refreshBarAxis], 0); + else + max += _footerLockedSize; + endPos[_refreshBarAxis] = -max; + _tweenChange = endPos - _tweenStart; + } + + _tweenDuration.Set(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT); + } + else + { + //更新速度 + if (!_inertiaDisabled) + { + float elapsed = (Time.unscaledTime - _lastMoveTime) * 60 - 1; + if (elapsed > 1) + _velocity = _velocity * Mathf.Pow(0.833f, elapsed); + + //æ ¹æ®é€Ÿåº¦è®¡ç®—目标ä½ç½®å’Œéœ€è¦æ—¶é—´ + endPos = UpdateTargetAndDuration(_tweenStart); + } + else + _tweenDuration.Set(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT); + Vector2 oldChange = endPos - _tweenStart; + + //调整目标ä½ç½® + LoopCheckingTarget(ref endPos); + if (_pageMode || _snapToItem) + AlignPosition(ref endPos, true); + + _tweenChange = endPos - _tweenStart; + if (_tweenChange.x == 0 && _tweenChange.y == 0) + { + UpdateScrollBarVisible(); + return; + } + + //如果目标ä½ç½®å·²è°ƒæ•´ï¼Œéšä¹‹è°ƒæ•´éœ€è¦æ—¶é—´ + if (_pageMode || _snapToItem) + { + FixDuration(0, oldChange.x); + FixDuration(1, oldChange.y); + } + } + + StartTween(2); + } + + private void __mouseWheel(EventContext context) + { + if (!_mouseWheelEnabled) + return; + + InputEvent evt = context.inputEvent; + float delta = evt.mouseWheelDelta / Stage.devicePixelRatio; + if (_snapToItem && Mathf.Abs(delta) < 1) + delta = Mathf.Sign(delta); + + if (_overlapSize.x > 0 && _overlapSize.y == 0) + { + float step = _pageMode ? _pageSize.x : _scrollStep; + SetPosX(_xPos + step * delta, false); + } + else + { + float step = _pageMode ? _pageSize.y : _scrollStep; + SetPosY(_yPos + step * delta, false); + } + } + + private void __rollOver() + { + _hover = true; + UpdateScrollBarVisible(); + } + + private void __rollOut() + { + _hover = false; + UpdateScrollBarVisible(); + } + + internal void UpdateClipSoft() + { + Vector2 softness = _owner.clipSoftness; + if (softness.x != 0 || softness.y != 0) + { + _maskContainer.clipSoftness = new Vector4( + (_container.x >= 0 || !_softnessOnTopOrLeftSide) ? 0 : softness.x, + (_container.y >= 0 || !_softnessOnTopOrLeftSide) ? 0 : softness.y, + (-_container.x - _overlapSize.x >= 0) ? 0 : softness.x, + (-_container.y - _overlapSize.y >= 0) ? 0 : softness.y); + } + else + _maskContainer.clipSoftness = null; + } + + private void UpdateScrollBarPos() + { + if (_vtScrollBar != null) + _vtScrollBar.setScrollPerc(_overlapSize.y == 0 ? 0 : Mathf.Clamp(-_container.y, 0, _overlapSize.y) / _overlapSize.y); + + if (_hzScrollBar != null) + _hzScrollBar.setScrollPerc(_overlapSize.x == 0 ? 0 : Mathf.Clamp(-_container.x, 0, _overlapSize.x) / _overlapSize.x); + + UpdateClipSoft(); + CheckRefreshBar(); + } + + public void UpdateScrollBarVisible() + { + if (_vtScrollBar != null) + { + if (_viewSize.y <= _vtScrollBar.minSize || _vScrollNone) + _vtScrollBar.displayObject.visible = false; + else + UpdateScrollBarVisible2(_vtScrollBar); + } + + if (_hzScrollBar != null) + { + if (_viewSize.x <= _hzScrollBar.minSize || _hScrollNone) + _hzScrollBar.displayObject.visible = false; + else + UpdateScrollBarVisible2(_hzScrollBar); + } + } + + private void UpdateScrollBarVisible2(GScrollBar bar) + { + if (_scrollBarDisplayAuto) + GTween.Kill(bar, TweenPropType.Alpha, false); + + if (_scrollBarDisplayAuto && !_hover && _tweening == 0 && !_dragged && !bar.gripDragging) + { + if (bar.displayObject.visible) + GTween.To(1, 0, 0.5f).SetDelay(0.5f).OnComplete(_hideScrollBarDelegate).SetTarget(bar, TweenPropType.Alpha); + } + else + { + bar.alpha = 1; + bar.displayObject.visible = true; + } + } + + private void __barTweenComplete(GTweener tweener) + { + GObject bar = (GObject)tweener.target; + bar.alpha = 1; + bar.displayObject.visible = false; + } + + float GetLoopPartSize(float division, int axis) + { + return (_contentSize[axis] + (axis == 0 ? ((GList)_owner).columnGap : ((GList)_owner).lineGap)) / division; + } + + /// + /// 对当å‰çš„æ»šåЍä½ç½®è¿›è¡Œå¾ªçŽ¯æ»šåŠ¨è¾¹ç•Œæ£€æŸ¥ã€‚å½“åˆ°è¾¾è¾¹ç•Œæ—¶ï¼Œå›žé€€ä¸€åŠå†…容区域(循环滚动内容大å°é€šå¸¸æ˜¯çœŸå®žå†…容大å°çš„å¶æ•°å€ï¼‰ã€‚ + /// + /// + bool LoopCheckingCurrent() + { + bool changed = false; + if (_loop == 1 && _overlapSize.x > 0) + { + if (_xPos < 0.001f) + { + _xPos += GetLoopPartSize(2, 0); + changed = true; + } + else if (_xPos >= _overlapSize.x) + { + _xPos -= GetLoopPartSize(2, 0); + changed = true; + } + } + else if (_loop == 2 && _overlapSize.y > 0) + { + if (_yPos < 0.001f) + { + _yPos += GetLoopPartSize(2, 1); + changed = true; + } + else if (_yPos >= _overlapSize.y) + { + _yPos -= GetLoopPartSize(2, 1); + changed = true; + } + } + + if (changed) + _container.SetXY((int)-_xPos, (int)-_yPos); + + return changed; + } + + /// + /// 对目标ä½ç½®è¿›è¡Œå¾ªçŽ¯æ»šåŠ¨è¾¹ç•Œæ£€æŸ¥ã€‚å½“åˆ°è¾¾è¾¹ç•Œæ—¶ï¼Œå›žé€€ä¸€åŠå†…容区域(循环滚动内容大å°é€šå¸¸æ˜¯çœŸå®žå†…容大å°çš„å¶æ•°å€ï¼‰ã€‚ + /// + /// + void LoopCheckingTarget(ref Vector2 endPos) + { + if (_loop == 1) + LoopCheckingTarget(ref endPos, 0); + + if (_loop == 2) + LoopCheckingTarget(ref endPos, 1); + } + + void LoopCheckingTarget(ref Vector2 endPos, int axis) + { + if (endPos[axis] > 0) + { + float halfSize = GetLoopPartSize(2, axis); + float tmp = _tweenStart[axis] - halfSize; + if (tmp <= 0 && tmp >= -_overlapSize[axis]) + { + endPos[axis] -= halfSize; + _tweenStart[axis] = tmp; + } + } + else if (endPos[axis] < -_overlapSize[axis]) + { + float halfSize = GetLoopPartSize(2, axis); + float tmp = _tweenStart[axis] + halfSize; + if (tmp <= 0 && tmp >= -_overlapSize[axis]) + { + endPos[axis] += halfSize; + _tweenStart[axis] = tmp; + } + } + } + + void LoopCheckingNewPos(ref float value, int axis) + { + if (_overlapSize[axis] == 0) + return; + + float pos = axis == 0 ? _xPos : _yPos; + bool changed = false; + if (value < 0.001f) + { + value += GetLoopPartSize(2, axis); + if (value > pos) + { + float v = GetLoopPartSize(6, axis); + v = Mathf.CeilToInt((value - pos) / v) * v; + pos = Mathf.Clamp(pos + v, 0, _overlapSize[axis]); + changed = true; + } + } + else if (value >= _overlapSize[axis]) + { + value -= GetLoopPartSize(2, axis); + if (value < pos) + { + float v = GetLoopPartSize(6, axis); + v = Mathf.CeilToInt((pos - value) / v) * v; + pos = Mathf.Clamp(pos - v, 0, _overlapSize[axis]); + changed = true; + } + } + + if (changed) + { + if (axis == 0) + _container.x = -(int)pos; + else + _container.y = -(int)pos; + } + } + + /// + /// 从oldPos滚动至pos,调整posä½ç½®å¯¹é½é¡µé¢ã€å¯¹é½item等(如果需è¦ï¼‰ã€‚ + /// + /// + /// + void AlignPosition(ref Vector2 pos, bool inertialScrolling) + { + if (_pageMode) + { + pos.x = AlignByPage(pos.x, 0, inertialScrolling); + pos.y = AlignByPage(pos.y, 1, inertialScrolling); + } + else if (_snapToItem) + { + float tmpX = -pos.x; + float tmpY = -pos.y; + float xDir = 0; + float yDir = 0; + if (inertialScrolling) + { + xDir = pos.x - _containerPos.x; + yDir = pos.y - _containerPos.y; + } + _owner.GetSnappingPositionWithDir(ref tmpX, ref tmpY, xDir, yDir); + if (pos.x < 0 && pos.x > -_overlapSize.x) + pos.x = -tmpX; + if (pos.y < 0 && pos.y > -_overlapSize.y) + pos.y = -tmpY; + } + } + + /// + /// 从oldPos滚动至pos,调整目标ä½ç½®åˆ°å¯¹é½é¡µé¢ã€‚ + /// + /// + /// + /// + /// + float AlignByPage(float pos, int axis, bool inertialScrolling) + { + int page; + + if (pos > 0) + page = 0; + else if (pos < -_overlapSize[axis]) + page = Mathf.CeilToInt(_contentSize[axis] / _pageSize[axis]) - 1; + else + { + page = Mathf.FloorToInt(-pos / _pageSize[axis]); + float change = inertialScrolling ? (pos - _containerPos[axis]) : (pos - _container.xy[axis]); + float testPageSize = Mathf.Min(_pageSize[axis], _contentSize[axis] - (page + 1) * _pageSize[axis]); + float delta = -pos - page * _pageSize[axis]; + + //页é¢å¸é™„ç­–ç•¥ + if (Mathf.Abs(change) > _pageSize[axis])//如果滚动è·ç¦»è¶…过1页,则需è¦è¶…过页é¢çš„一åŠï¼Œæ‰èƒ½åˆ°æ›´ä¸‹ä¸€é¡µ + { + if (delta > testPageSize * 0.5f) + page++; + } + else //å¦åˆ™åªéœ€è¦é¡µé¢çš„1/3,当然,需è¦è€ƒè™‘到左移和å³ç§»çš„æƒ…况 + { + if (delta > testPageSize * (change < 0 ? UIConfig.defaultScrollPagingThreshold : (1 - UIConfig.defaultScrollPagingThreshold))) + page++; + } + + //釿–°è®¡ç®—终点 + pos = -page * _pageSize[axis]; + if (pos < -_overlapSize[axis]) //最åŽä¸€é¡µæœªå¿…有pageSize那么大 + pos = -_overlapSize[axis]; + } + + //惯性滚动模å¼ä¸‹ï¼Œä¼šå¢žåŠ åˆ¤æ–­å°½é‡ä¸è¦æ»šåŠ¨è¶…è¿‡ä¸€é¡µ + if (inertialScrolling) + { + float oldPos = _tweenStart[axis]; + int oldPage; + if (oldPos > 0) + oldPage = 0; + else if (oldPos < -_overlapSize[axis]) + oldPage = Mathf.CeilToInt(_contentSize[axis] / _pageSize[axis]) - 1; + else + oldPage = Mathf.FloorToInt(-oldPos / _pageSize[axis]); + int startPage = Mathf.FloorToInt(-_containerPos[axis] / _pageSize[axis]); + if (Mathf.Abs(page - startPage) > 1 && Mathf.Abs(oldPage - startPage) <= 1) + { + if (page > startPage) + page = startPage + 1; + else + page = startPage - 1; + pos = -page * _pageSize[axis]; + } + } + + return pos; + } + + /// + /// æ ¹æ®å½“å‰é€Ÿåº¦ï¼Œè®¡ç®—滚动的目标ä½ç½®ï¼Œä»¥åŠåˆ°è¾¾æ—¶é—´ã€‚ + /// + /// + /// + Vector2 UpdateTargetAndDuration(Vector2 orignPos) + { + Vector2 ret = Vector2.zero; + ret.x = UpdateTargetAndDuration(orignPos.x, 0); + ret.y = UpdateTargetAndDuration(orignPos.y, 1); + return ret; + } + + float UpdateTargetAndDuration(float pos, int axis) + { + float v = _velocity[axis]; + float duration = 0; + + if (pos > 0) + pos = 0; + else if (pos < -_overlapSize[axis]) + pos = -_overlapSize[axis]; + else + { + //以å±å¹•åƒç´ ä¸ºåŸºå‡† + float v2 = Mathf.Abs(v) * _velocityScale; + //在移动设备上,需è¦å¯¹ä¸åŒåˆ†è¾¨çއåšä¸€ä¸ªé€‚é…,我们的速度判断以1136分辨率为基准 + if (Stage.touchScreen) + v2 *= 1136f / Mathf.Max(Screen.width, Screen.height); + //这里有一些阈值的处ç†ï¼Œå› ä¸ºåœ¨ä½Žé€Ÿå†…,ä¸å¸Œæœ›äº§ç”Ÿè¾ƒå¤§çš„æ»šåŠ¨ï¼ˆç”šè‡³ä¸æ»šåŠ¨ï¼‰ + float ratio = 0; + if (_pageMode || !Stage.touchScreen) + { + if (v2 > 500) + ratio = Mathf.Pow((v2 - 500) / 500, 2); + } + else + { + if (v2 > 1000) + ratio = Mathf.Pow((v2 - 1000) / 1000, 2); + } + + if (ratio != 0) + { + if (ratio > 1) + ratio = 1; + + v2 *= ratio; + v *= ratio; + _velocity[axis] = v; + + //算法:v*(_decelerationRateçš„n次幂)= 60,å³åœ¨n帧åŽé€Ÿåº¦é™ä¸º60(å‡è®¾æ¯ç§’60帧)。 + duration = Mathf.Log(60 / v2, _decelerationRate) / 60; + + //计算è·ç¦»è¦ä½¿ç”¨æœ¬åœ°é€Ÿåº¦ + //ç†è®ºå…¬å¼è²Œä¼¼æ»šåŠ¨çš„è·ç¦»ä¸å¤Ÿï¼Œæ”¹ä¸ºç»éªŒå…¬å¼ + //float change = (int)((v/ 60 - 1) / (1 - _decelerationRate)); + float change = (int)(v * duration * 0.4f); + pos += change; + } + } + + if (duration < TWEEN_TIME_DEFAULT) + duration = TWEEN_TIME_DEFAULT; + _tweenDuration[axis] = duration; + + return pos; + } + + /// + /// æ ¹æ®ä¿®æ”¹åŽçš„tweenChange釿–°è®¡ç®—å‡é€Ÿæ—¶é—´ã€‚ + /// + void FixDuration(int axis, float oldChange) + { + if (_tweenChange[axis] == 0 || Mathf.Abs(_tweenChange[axis]) >= Mathf.Abs(oldChange)) + return; + + float newDuration = Mathf.Abs(_tweenChange[axis] / oldChange) * _tweenDuration[axis]; + if (newDuration < TWEEN_TIME_DEFAULT) + newDuration = TWEEN_TIME_DEFAULT; + + _tweenDuration[axis] = newDuration; + } + + void StartTween(int type) + { + _tweenTime.Set(0, 0); + _tweening = type; + Timers.inst.AddUpdate(_tweenUpdateDelegate); + + UpdateScrollBarVisible(); + } + + void KillTween() + { + if (_tweening == 1) //å–æ¶ˆç±»åž‹ä¸º1çš„tween需立刻设置到终点 + { + _container.xy = _tweenStart + _tweenChange; + _onScroll.Call(); + } + + _tweening = 0; + Timers.inst.Remove(_tweenUpdateDelegate); + + UpdateScrollBarVisible(); + + _onScrollEnd.Call(); + } + + void CheckRefreshBar() + { + if (_header == null && _footer == null) + return; + + float pos = _container.xy[_refreshBarAxis]; + if (_header != null) + { + if (pos > 0) + { + if (_header.displayObject.parent == null) + _maskContainer.AddChildAt(_header.displayObject, 0); + Vector2 vec; + + vec = _header.size; + vec[_refreshBarAxis] = pos; + _header.size = vec; + } + else + { + if (_header.displayObject.parent != null) + _maskContainer.RemoveChild(_header.displayObject); + } + } + + if (_footer != null) + { + float max = _overlapSize[_refreshBarAxis]; + if (pos < -max || max == 0 && _footerLockedSize > 0) + { + if (_footer.displayObject.parent == null) + _maskContainer.AddChildAt(_footer.displayObject, 0); + + Vector2 vec; + + vec = _footer.xy; + if (max > 0) + vec[_refreshBarAxis] = pos + _contentSize[_refreshBarAxis]; + else + vec[_refreshBarAxis] = Mathf.Max(Mathf.Min(pos + _viewSize[_refreshBarAxis], _viewSize[_refreshBarAxis] - _footerLockedSize), _viewSize[_refreshBarAxis] - _contentSize[_refreshBarAxis]); + _footer.xy = vec; + + vec = _footer.size; + if (max > 0) + vec[_refreshBarAxis] = -max - pos; + else + vec[_refreshBarAxis] = _viewSize[_refreshBarAxis] - _footer.xy[_refreshBarAxis]; + _footer.size = vec; + } + else + { + if (_footer.displayObject.parent != null) + _maskContainer.RemoveChild(_footer.displayObject); + } + } + } + + void TweenUpdate(object param) + { + if (_owner.displayObject == null || _owner.displayObject.isDisposed) + { + Timers.inst.Remove(_tweenUpdateDelegate); + return; + } + + float nx = RunTween(0); + float ny = RunTween(1); + + _container.SetXY(nx, ny); + + if (_tweening == 2) + { + if (_overlapSize.x > 0) + _xPos = Mathf.Clamp(-nx, 0, _overlapSize.x); + if (_overlapSize.y > 0) + _yPos = Mathf.Clamp(-ny, 0, _overlapSize.y); + + if (_pageMode) + UpdatePageController(); + } + + if (_tweenChange.x == 0 && _tweenChange.y == 0) + { + _tweening = 0; + Timers.inst.Remove(_tweenUpdateDelegate); + + LoopCheckingCurrent(); + + UpdateScrollBarPos(); + UpdateScrollBarVisible(); + + _onScroll.Call(); + _onScrollEnd.Call(); + } + else + { + UpdateScrollBarPos(); + _onScroll.Call(); + } + } + + float RunTween(int axis) + { + float newValue; + if (_tweenChange[axis] != 0) + { + _tweenTime[axis] += Time.unscaledDeltaTime; + if (_tweenTime[axis] >= _tweenDuration[axis]) + { + newValue = _tweenStart[axis] + _tweenChange[axis]; + _tweenChange[axis] = 0; + } + else + { + float ratio = EaseFunc(_tweenTime[axis], _tweenDuration[axis]); + newValue = _tweenStart[axis] + (int)(_tweenChange[axis] * ratio); + } + + float threshold1 = 0; + float threshold2 = -_overlapSize[axis]; + if (_headerLockedSize > 0 && _refreshBarAxis == axis) + threshold1 = _headerLockedSize; + if (_footerLockedSize > 0 && _refreshBarAxis == axis) + { + float max = _overlapSize[_refreshBarAxis]; + if (max == 0) + max = Mathf.Max(_contentSize[_refreshBarAxis] + _footerLockedSize - _viewSize[_refreshBarAxis], 0); + else + max += _footerLockedSize; + threshold2 = -max; + } + + if (_tweening == 2 && _bouncebackEffect) + { + if (newValue > 20 + threshold1 && _tweenChange[axis] > 0 + || newValue > threshold1 && _tweenChange[axis] == 0)//开始回弹 + { + _tweenTime[axis] = 0; + _tweenDuration[axis] = TWEEN_TIME_DEFAULT; + _tweenChange[axis] = -newValue + threshold1; + _tweenStart[axis] = newValue; + } + else if (newValue < threshold2 - 20 && _tweenChange[axis] < 0 + || newValue < threshold2 && _tweenChange[axis] == 0)//开始回弹 + { + _tweenTime[axis] = 0; + _tweenDuration[axis] = TWEEN_TIME_DEFAULT; + _tweenChange[axis] = threshold2 - newValue; + _tweenStart[axis] = newValue; + } + } + else + { + if (newValue > threshold1) + { + newValue = threshold1; + _tweenChange[axis] = 0; + } + else if (newValue < threshold2) + { + newValue = threshold2; + _tweenChange[axis] = 0; + } + } + } + else + newValue = _container.xy[axis]; + + return newValue; + } + + static float EaseFunc(float t, float d) + { + return (t = t / d - 1) * t * t + 1;//cubicOut + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs.meta new file mode 100644 index 00000000..e8a7d0fd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/ScrollPane.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e51675ea70043e1488812e46428e83aa +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs new file mode 100644 index 00000000..faa957b5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs @@ -0,0 +1,1771 @@ +using System; +using System.Collections.Generic; +using FairyGUI.Utils; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + public delegate void PlayCompleteCallback(); + + /// + /// + /// + public delegate void TransitionHook(); + + /// + /// + /// + public class Transition : ITweenListener + { + /// + /// 动效的å称。在编辑器里设定。 + /// + public string name { get; private set; } + + /// + /// 当你å¯åŠ¨äº†è‡ªåŠ¨åˆæ‰¹ï¼ŒåŠ¨æ•ˆé‡Œæœ‰æ¶‰åŠåˆ°XYã€å¤§å°ã€æ—‹è½¬ç­‰çš„æ”¹å˜ï¼Œå¦‚果你观察到元件的显示深度在播放过程中有错误,å¯ä»¥å¼€å¯è¿™ä¸ªé€‰é¡¹ã€‚ + /// + public bool invalidateBatchingEveryFrame; + + GComponent _owner; + TransitionItem[] _items; + int _totalTimes; + int _totalTasks; + bool _playing; + bool _paused; + float _ownerBaseX; + float _ownerBaseY; + PlayCompleteCallback _onComplete; + int _options; + bool _reversed; + float _totalDuration; + bool _autoPlay; + int _autoPlayTimes; + float _autoPlayDelay; + float _timeScale; + bool _ignoreEngineTimeScale; + float _startTime; + float _endTime; + GTweenCallback _delayedCallDelegate; + GTweenCallback _checkAllDelegate; + GTweenCallback1 _delayedCallDelegate2; + + const int OPTION_IGNORE_DISPLAY_CONTROLLER = 1; + const int OPTION_AUTO_STOP_DISABLED = 2; + const int OPTION_AUTO_STOP_AT_END = 4; + + public Transition(GComponent owner) + { + _owner = owner; + _timeScale = 1; + _ignoreEngineTimeScale = true; + + _delayedCallDelegate = OnDelayedPlay; + _delayedCallDelegate2 = OnDelayedPlayItem; + _checkAllDelegate = CheckAllComplete; + } + + /// + /// + /// + public void Play() + { + _Play(1, 0, 0, -1, null, false); + } + + /// + /// + /// + /// + public void Play(PlayCompleteCallback onComplete) + { + _Play(1, 0, 0, -1, onComplete, false); + } + + /// + /// + /// + /// + /// + /// + public void Play(int times, float delay, PlayCompleteCallback onComplete) + { + _Play(times, delay, 0, -1, onComplete, false); + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void Play(int times, float delay, float startTime, float endTime, PlayCompleteCallback onComplete) + { + _Play(times, delay, startTime, endTime, onComplete, false); + } + + /// + /// + /// + public void PlayReverse() + { + _Play(1, 0, 0, -1, null, true); + } + + /// + /// + /// + /// + public void PlayReverse(PlayCompleteCallback onComplete) + { + _Play(1, 0, 0, -1, onComplete, true); + } + + /// + /// + /// + /// + /// + /// + public void PlayReverse(int times, float delay, PlayCompleteCallback onComplete) + { + _Play(times, delay, 0, -1, onComplete, true); + } + + /// + /// + /// + /// + public void ChangePlayTimes(int value) + { + _totalTimes = value; + } + + /// + /// 设置动效是å¦è‡ªåŠ¨æ’­æ”¾ã€‚ + /// + /// + /// + /// + public void SetAutoPlay(bool autoPlay, int times, float delay) + { + if (_autoPlay != autoPlay) + { + _autoPlay = autoPlay; + _autoPlayTimes = times; + _autoPlayDelay = delay; + if (_autoPlay) + { + if (_owner.onStage) + Play(times, delay, null); + } + else + { + if (!_owner.onStage) + Stop(false, true); + } + } + } + + void _Play(int times, float delay, float startTime, float endTime, PlayCompleteCallback onComplete, bool reverse) + { + Stop(true, true); + + _totalTimes = times; + _reversed = reverse; + _startTime = startTime; + _endTime = endTime; + _playing = true; + _paused = false; + _onComplete = onComplete; + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target == null) + { + if (item.targetId.Length > 0) + item.target = _owner.GetChildById(item.targetId); + else + item.target = _owner; + } + else if (item.target != _owner && item.target.parent != _owner) //maybe removed + item.target = null; + + if (item.target != null && item.type == TransitionActionType.Transition) + { + TValue_Transition value = (TValue_Transition)item.value; + Transition trans = ((GComponent)item.target).GetTransition(value.transName); + if (trans == this) + trans = null; + if (trans != null) + { + if (value.playTimes == 0) //stop + { + int j; + for (j = i - 1; j >= 0; j--) + { + TransitionItem item2 = _items[j]; + if (item2.type == TransitionActionType.Transition) + { + TValue_Transition value2 = (TValue_Transition)item2.value; + if (value2.trans == trans) + { + value2.stopTime = item.time - item2.time; + break; + } + } + } + if (j < 0) + value.stopTime = 0; + else + trans = null; //no need to handle stop anymore + } + else + value.stopTime = -1; + } + value.trans = trans; + } + } + + if (delay == 0) + OnDelayedPlay(); + else + GTween.DelayedCall(delay).SetTarget(this).OnComplete(_delayedCallDelegate); + } + + /// + /// + /// + public void Stop() + { + Stop(true, false); + } + + /// + /// + /// + /// + /// + public void Stop(bool setToComplete, bool processCallback) + { + if (!_playing) + return; + + _playing = false; + _totalTasks = 0; + _totalTimes = 0; + PlayCompleteCallback func = _onComplete; + _onComplete = null; + + GTween.Kill(this);//delay start + + int cnt = _items.Length; + if (_reversed) + { + for (int i = cnt - 1; i >= 0; i--) + { + TransitionItem item = _items[i]; + if (item.target == null) + continue; + + StopItem(item, setToComplete); + } + } + else + { + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target == null) + continue; + + StopItem(item, setToComplete); + } + } + + if (processCallback && func != null) + func(); + + } + + void StopItem(TransitionItem item, bool setToComplete) + { + if (item.displayLockToken != 0) + { + item.target.ReleaseDisplayLock(item.displayLockToken); + item.displayLockToken = 0; + } + + if (item.tweener != null) + { + item.tweener.Kill(setToComplete); + item.tweener = null; + + if (item.type == TransitionActionType.Shake && !setToComplete) //震动必须归ä½ï¼Œå¦åˆ™ä¸‹æ¬¡å°±è¶Šéœ‡è¶Šè¿œäº†ã€‚ + { + item.target._gearLocked = true; + item.target.SetXY(item.target.x - ((TValue_Shake)item.value).lastOffset.x, item.target.y - ((TValue_Shake)item.value).lastOffset.y); + item.target._gearLocked = false; + + _owner.InvalidateBatchingState(true); + } + } + + if (item.type == TransitionActionType.Transition) + { + TValue_Transition value = (TValue_Transition)item.value; + if (value.trans != null) + value.trans.Stop(setToComplete, false); + } + } + + /// + /// + /// + /// + public void SetPaused(bool paused) + { + if (!_playing || _paused == paused) + return; + + _paused = paused; + GTweener tweener = GTween.GetTween(this); + if (tweener != null) + tweener.SetPaused(paused); + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target == null) + continue; + + if (item.type == TransitionActionType.Transition) + { + if (((TValue_Transition)item.value).trans != null) + ((TValue_Transition)item.value).trans.SetPaused(paused); + } + else if (item.type == TransitionActionType.Animation) + { + if (paused) + { + ((TValue_Animation)item.value).flag = ((IAnimationGear)item.target).playing; + ((IAnimationGear)item.target).playing = false; + } + else + ((IAnimationGear)item.target).playing = ((TValue_Animation)item.value).flag; + } + + if (item.tweener != null) + item.tweener.SetPaused(paused); + } + } + + public void Dispose() + { + if (_playing) + GTween.Kill(this);//delay start + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.tweener != null) + { + item.tweener.Kill(); + item.tweener = null; + } + + item.target = null; + item.hook = null; + if (item.tweenConfig != null) + item.tweenConfig.endHook = null; + } + + _playing = false; + _onComplete = null; + } + + /// + /// + /// + public bool playing + { + get { return _playing; } + } + + /// + /// transition's total duration, maybe zero when the transition only has one frame + /// + public float totalDuration + { + get { return _totalDuration; } + } + + /// + /// + /// + /// + /// + public void SetValue(string label, params object[] aParams) + { + int cnt = _items.Length; + object value; + bool found = false; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.label == label) + { + if (item.tweenConfig != null) + value = item.tweenConfig.startValue; + else + value = item.value; + found = true; + } + else if (item.tweenConfig != null && item.tweenConfig.endLabel == label) + { + value = item.tweenConfig.endValue; + found = true; + } + else + continue; + + switch (item.type) + { + case TransitionActionType.XY: + case TransitionActionType.Size: + case TransitionActionType.Pivot: + case TransitionActionType.Scale: + case TransitionActionType.Skew: + { + TValue tvalue = (TValue)value; + tvalue.b1 = true; + tvalue.b2 = true; + tvalue.f1 = Convert.ToSingle(aParams[0]); + tvalue.f2 = Convert.ToSingle(aParams[1]); + } + break; + + case TransitionActionType.Alpha: + ((TValue)value).f1 = Convert.ToSingle(aParams[0]); + break; + + case TransitionActionType.Rotation: + ((TValue)value).f1 = Convert.ToSingle(aParams[0]); + break; + + case TransitionActionType.Color: + ((TValue)value).color = (Color)aParams[0]; + break; + + case TransitionActionType.Animation: + { + TValue_Animation tvalue = (TValue_Animation)value; + tvalue.frame = Convert.ToInt32(aParams[0]); + if (aParams.Length > 1) + tvalue.playing = Convert.ToBoolean(aParams[1]); + if (aParams.Length > 2) + tvalue.animationName = (string)aParams[2]; + if (aParams.Length > 3) + tvalue.skinName = (string)aParams[3]; + } + break; + + case TransitionActionType.Visible: + ((TValue_Visible)value).visible = Convert.ToBoolean(aParams[0]); + break; + + case TransitionActionType.Sound: + { + TValue_Sound tvalue = (TValue_Sound)value; + tvalue.sound = (string)aParams[0]; + if (aParams.Length > 1) + tvalue.volume = Convert.ToSingle(aParams[1]); + } + break; + + case TransitionActionType.Transition: + { + TValue_Transition tvalue = (TValue_Transition)value; + tvalue.transName = (string)aParams[0]; + if (aParams.Length > 1) + tvalue.playTimes = Convert.ToInt32(aParams[1]); + } + break; + + case TransitionActionType.Shake: + { + ((TValue_Shake)value).amplitude = Convert.ToSingle(aParams[0]); + if (aParams.Length > 1) + ((TValue_Shake)value).duration = Convert.ToSingle(aParams[1]); + } + break; + + case TransitionActionType.ColorFilter: + { + TValue tvalue = (TValue)value; + tvalue.f1 = Convert.ToSingle(aParams[0]); + tvalue.f2 = Convert.ToSingle(aParams[1]); + tvalue.f3 = Convert.ToSingle(aParams[2]); + tvalue.f4 = Convert.ToSingle(aParams[3]); + } + break; + + case TransitionActionType.Text: + case TransitionActionType.Icon: + ((TValue_Text)value).text = (string)aParams[0]; + break; + } + } + + if (!found) + throw new Exception("label not exists"); + } + + /// + /// + /// + /// + /// + public void SetHook(string label, TransitionHook callback) + { + int cnt = _items.Length; + bool found = false; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.label == label) + { + item.hook = callback; + found = true; + break; + } + else if (item.tweenConfig != null && item.tweenConfig.endLabel == label) + { + item.tweenConfig.endHook = callback; + found = true; + break; + } + } + if (!found) + throw new Exception("label not exists"); + } + + /// + /// + /// + public void ClearHooks() + { + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + item.hook = null; + if (item.tweenConfig != null) + item.tweenConfig.endHook = null; + } + } + + /// + /// + /// + /// + /// + public void SetTarget(string label, GObject newTarget) + { + int cnt = _items.Length; + bool found = false; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.label == label) + { + item.targetId = (newTarget == _owner || newTarget == null) ? string.Empty : newTarget.id; + if (_playing) + { + if (item.targetId.Length > 0) + item.target = _owner.GetChildById(item.targetId); + else + item.target = _owner; + } + else + item.target = null; + found = true; + } + } + if (!found) + throw new Exception("label not exists"); + } + + /// + /// + /// + /// + /// + public void SetDuration(string label, float value) + { + int cnt = _items.Length; + bool found = false; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.tweenConfig != null && item.label == label) + { + item.tweenConfig.duration = value; + found = true; + } + } + + if (!found) + throw new Exception("label not exists or not a tween label"); + } + + /// + /// + /// + /// + /// + public float GetLabelTime(string label) + { + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.label == label) + return item.time; + else if (item.tweenConfig != null && item.tweenConfig.endLabel == label) + return item.time + item.tweenConfig.duration; + } + + return float.NaN; + } + + /// + /// + /// + public float timeScale + { + get { return _timeScale; } + set + { + if (_timeScale != value) + { + _timeScale = value; + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.tweener != null) + item.tweener.SetTimeScale(value); + else if (item.type == TransitionActionType.Transition) + { + if (((TValue_Transition)item.value).trans != null) + ((TValue_Transition)item.value).trans.timeScale = value; + } + else if (item.type == TransitionActionType.Animation) + { + if (item.target != null) + ((IAnimationGear)item.target).timeScale = value; + } + } + } + } + } + + /// + /// + /// + public bool ignoreEngineTimeScale + { + get { return _ignoreEngineTimeScale; } + set + { + if (_ignoreEngineTimeScale != value) + { + _ignoreEngineTimeScale = value; + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.tweener != null) + item.tweener.SetIgnoreEngineTimeScale(value); + else if (item.type == TransitionActionType.Transition) + { + if (((TValue_Transition)item.value).trans != null) + ((TValue_Transition)item.value).trans.ignoreEngineTimeScale = value; + } + else if (item.type == TransitionActionType.Animation) + { + if (item.target != null) + ((IAnimationGear)item.target).ignoreEngineTimeScale = value; + } + } + } + } + } + + internal void UpdateFromRelations(string targetId, float dx, float dy) + { + int cnt = _items.Length; + if (cnt == 0) + return; + + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.type == TransitionActionType.XY && item.targetId == targetId) + { + if (item.tweenConfig != null) + { + if (!item.tweenConfig.startValue.b3) + { + item.tweenConfig.startValue.f1 += dx; + item.tweenConfig.startValue.f2 += dy; + } + if (!item.tweenConfig.endValue.b3) + { + item.tweenConfig.endValue.f1 += dx; + item.tweenConfig.endValue.f2 += dy; + } + } + else + { + if (!((TValue)item.value).b3) + { + ((TValue)item.value).f1 += dx; + ((TValue)item.value).f2 += dy; + } + } + } + } + } + + internal void OnOwnerAddedToStage() + { + if (_autoPlay && !_playing) + Play(_autoPlayTimes, _autoPlayDelay, null); + } + + internal void OnOwnerRemovedFromStage() + { + if ((_options & OPTION_AUTO_STOP_DISABLED) == 0) + Stop((_options & OPTION_AUTO_STOP_AT_END) != 0 ? true : false, false); + } + + void OnDelayedPlay() + { + InternalPlay(); + + _playing = _totalTasks > 0; + if (_playing) + { + if ((_options & OPTION_IGNORE_DISPLAY_CONTROLLER) != 0) + { + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target != null && item.target != _owner) + item.displayLockToken = item.target.AddDisplayLock(); + } + } + } + else if (_onComplete != null) + { + PlayCompleteCallback func = _onComplete; + _onComplete = null; + func(); + } + } + + void InternalPlay() + { + _ownerBaseX = _owner.x; + _ownerBaseY = _owner.y; + + _totalTasks = 1; //prevent to complete inside the loop + + bool needSkipAnimations = false; + int cnt = _items.Length; + if (!_reversed) + { + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target == null) + continue; + + if (item.type == TransitionActionType.Animation && _startTime != 0 && item.time <= _startTime) + { + needSkipAnimations = true; + ((TValue_Animation)item.value).flag = false; + } + else + PlayItem(item); + } + } + else + { + for (int i = cnt - 1; i >= 0; i--) + { + TransitionItem item = _items[i]; + if (item.target == null) + continue; + + PlayItem(item); + } + } + + if (needSkipAnimations) + SkipAnimations(); + + _totalTasks--; + } + + void PlayItem(TransitionItem item) + { + float time; + if (item.tweenConfig != null) + { + if (_reversed) + time = (_totalDuration - item.time - item.tweenConfig.duration); + else + time = item.time; + + if (_endTime == -1 || time <= _endTime) + { + TValue startValue; + TValue endValue; + + if (_reversed) + { + startValue = item.tweenConfig.endValue; + endValue = item.tweenConfig.startValue; + } + else + { + startValue = item.tweenConfig.startValue; + endValue = item.tweenConfig.endValue; + } + + ((TValue)item.value).b1 = startValue.b1 || endValue.b1; + ((TValue)item.value).b2 = startValue.b2 || endValue.b2; + + switch (item.type) + { + case TransitionActionType.XY: + case TransitionActionType.Size: + case TransitionActionType.Scale: + case TransitionActionType.Skew: + item.tweener = GTween.To(startValue.vec2, endValue.vec2, item.tweenConfig.duration); + break; + + case TransitionActionType.Alpha: + case TransitionActionType.Rotation: + item.tweener = GTween.To(startValue.f1, endValue.f1, item.tweenConfig.duration); + break; + + case TransitionActionType.Color: + item.tweener = GTween.To(startValue.color, endValue.color, item.tweenConfig.duration); + break; + + case TransitionActionType.ColorFilter: + item.tweener = GTween.To(startValue.vec4, endValue.vec4, item.tweenConfig.duration); + break; + } + + item.tweener.SetDelay(time) + .SetEase(item.tweenConfig.easeType, item.tweenConfig.customEase) + .SetRepeat(item.tweenConfig.repeat, item.tweenConfig.yoyo) + .SetTimeScale(_timeScale) + .SetIgnoreEngineTimeScale(_ignoreEngineTimeScale) + .SetTarget(item) + .SetListener(this); + + if (_endTime >= 0) + item.tweener.SetBreakpoint(_endTime - time); + + _totalTasks++; + } + } + else if (item.type == TransitionActionType.Shake) + { + TValue_Shake value = (TValue_Shake)item.value; + + if (_reversed) + time = (_totalDuration - item.time - value.duration); + else + time = item.time; + + if (_endTime == -1 || time <= _endTime) + { + value.lastOffset.Set(0, 0); + value.offset.Set(0, 0); + item.tweener = GTween.Shake(Vector3.zero, value.amplitude, value.duration) + .SetDelay(time) + .SetTimeScale(_timeScale) + .SetIgnoreEngineTimeScale(_ignoreEngineTimeScale) + .SetTarget(item) + .SetListener(this); + + if (_endTime >= 0) + item.tweener.SetBreakpoint(_endTime - item.time); + + _totalTasks++; + } + } + else + { + if (_reversed) + time = (_totalDuration - item.time); + else + time = item.time; + + if (time <= _startTime) + { + ApplyValue(item); + CallHook(item, false); + } + else if (_endTime == -1 || time <= _endTime) + { + _totalTasks++; + item.tweener = GTween.DelayedCall(time) + .SetTimeScale(_timeScale) + .SetIgnoreEngineTimeScale(_ignoreEngineTimeScale) + .SetTarget(item) + .OnComplete(_delayedCallDelegate2); + } + } + + if (item.tweener != null) + item.tweener.Seek(_startTime); + } + + void SkipAnimations() + { + int frame; + float playStartTime; + float playTotalTime; + TValue_Animation value; + IAnimationGear target; + TransitionItem item; + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + item = _items[i]; + if (item.type != TransitionActionType.Animation || item.time > _startTime) + continue; + + value = (TValue_Animation)item.value; + if (value.flag) + continue; + + target = (IAnimationGear)item.target; + frame = target.frame; + playStartTime = target.playing ? 0 : -1; + playTotalTime = 0; + + for (int j = i; j < cnt; j++) + { + item = _items[j]; + if (item.type != TransitionActionType.Animation || item.target != target || item.time > _startTime) + continue; + + value = (TValue_Animation)item.value; + value.flag = true; + + if (value.frame != -1) + { + frame = value.frame; + if (value.playing) + playStartTime = item.time; + else + playStartTime = -1; + playTotalTime = 0; + } + else + { + if (value.playing) + { + if (playStartTime < 0) + playStartTime = item.time; + } + else + { + if (playStartTime >= 0) + playTotalTime += (item.time - playStartTime); + playStartTime = -1; + } + } + + CallHook(item, false); + } + + if (playStartTime >= 0) + playTotalTime += (_startTime - playStartTime); + + target.playing = playStartTime >= 0; + target.frame = frame; + if (playTotalTime > 0) + target.Advance(playTotalTime); + } + } + + void OnDelayedPlayItem(GTweener tweener) + { + TransitionItem item = (TransitionItem)tweener.target; + item.tweener = null; + _totalTasks--; + + ApplyValue(item); + CallHook(item, false); + + CheckAllComplete(); + } + + public void OnTweenStart(GTweener tweener) + { + TransitionItem item = (TransitionItem)tweener.target; + + if (item.type == TransitionActionType.XY || item.type == TransitionActionType.Size) //ä½ç½®å’Œå¤§å°è¦åˆ°startæ‰æœ€ç»ˆç¡®è®¤èµ·å§‹å€¼ + { + TValue startValue; + TValue endValue; + + if (_reversed) + { + startValue = item.tweenConfig.endValue; + endValue = item.tweenConfig.startValue; + } + else + { + startValue = item.tweenConfig.startValue; + endValue = item.tweenConfig.endValue; + } + + if (item.type == TransitionActionType.XY) + { + if (item.target != _owner) + { + if (!startValue.b1) + tweener.startValue.x = item.target.x; + else if (startValue.b3) //percent + tweener.startValue.x = startValue.f1 * _owner.width; + + if (!startValue.b2) + tweener.startValue.y = item.target.y; + else if (startValue.b3) //percent + tweener.startValue.y = startValue.f2 * _owner.height; + + if (!endValue.b1) + tweener.endValue.x = tweener.startValue.x; + else if (endValue.b3) + tweener.endValue.x = endValue.f1 * _owner.width; + + if (!endValue.b2) + tweener.endValue.y = tweener.startValue.y; + else if (endValue.b3) + tweener.endValue.y = endValue.f2 * _owner.height; + } + else + { + if (!startValue.b1) + tweener.startValue.x = item.target.x - _ownerBaseX; + if (!startValue.b2) + tweener.startValue.y = item.target.y - _ownerBaseY; + + if (!endValue.b1) + tweener.endValue.x = tweener.startValue.x; + if (!endValue.b2) + tweener.endValue.y = tweener.startValue.y; + } + } + else + { + if (!startValue.b1) + tweener.startValue.x = item.target.width; + if (!startValue.b2) + tweener.startValue.y = item.target.height; + + if (!endValue.b1) + tweener.endValue.x = tweener.startValue.x; + if (!endValue.b2) + tweener.endValue.y = tweener.startValue.y; + } + + if (item.tweenConfig.path != null) + { + ((TValue)item.value).b1 = ((TValue)item.value).b2 = true; + tweener.SetPath(item.tweenConfig.path); + } + } + + CallHook(item, false); + } + + public void OnTweenUpdate(GTweener tweener) + { + TransitionItem item = (TransitionItem)tweener.target; + switch (item.type) + { + case TransitionActionType.XY: + case TransitionActionType.Size: + case TransitionActionType.Scale: + case TransitionActionType.Skew: + ((TValue)item.value).vec2 = tweener.value.vec2; + if (item.tweenConfig.path != null) + { + ((TValue)item.value).f1 += tweener.startValue.x; + ((TValue)item.value).f2 += tweener.startValue.y; + } + break; + + case TransitionActionType.Alpha: + case TransitionActionType.Rotation: + ((TValue)item.value).f1 = tweener.value.x; + break; + + case TransitionActionType.Color: + ((TValue)item.value).color = tweener.value.color; + break; + + case TransitionActionType.ColorFilter: + ((TValue)item.value).vec4 = tweener.value.vec4; + break; + + case TransitionActionType.Shake: + ((TValue_Shake)item.value).offset = tweener.deltaValue.vec2; + break; + } + ApplyValue(item); + } + + public void OnTweenComplete(GTweener tweener) + { + TransitionItem item = (TransitionItem)tweener.target; + item.tweener = null; + _totalTasks--; + + if (tweener.allCompleted) //å½“æ•´ä½“æ’­æ”¾ç»“æŸæ—¶é—´åœ¨è¿™ä¸ªtween的中间时ä¸åº”è¯¥è°ƒç”¨ç»“å°¾é’©å­ + CallHook(item, true); + + CheckAllComplete(); + } + + void OnPlayTransCompleted(TransitionItem item) + { + _totalTasks--; + + CheckAllComplete(); + } + + void CallHook(TransitionItem item, bool tweenEnd) + { + if (tweenEnd) + { + if (item.tweenConfig != null && item.tweenConfig.endHook != null) + item.tweenConfig.endHook(); + } + else + { + if (item.time >= _startTime && item.hook != null) + item.hook(); + } + } + + void CheckAllComplete() + { + if (_playing && _totalTasks == 0) + { + if (_totalTimes < 0) + { + InternalPlay(); + if (_totalTasks == 0) + GTween.DelayedCall(0).SetTarget(this).OnComplete(_checkAllDelegate); + } + else + { + _totalTimes--; + if (_totalTimes > 0) + { + InternalPlay(); + if (_totalTasks == 0) + GTween.DelayedCall(0).SetTarget(this).OnComplete(_checkAllDelegate); + } + else + { + _playing = false; + + int cnt = _items.Length; + for (int i = 0; i < cnt; i++) + { + TransitionItem item = _items[i]; + if (item.target != null && item.displayLockToken != 0) + { + item.target.ReleaseDisplayLock(item.displayLockToken); + item.displayLockToken = 0; + } + } + + if (_onComplete != null) + { + PlayCompleteCallback func = _onComplete; + _onComplete = null; + func(); + } + } + } + } + } + + void ApplyValue(TransitionItem item) + { + item.target._gearLocked = true; + + switch (item.type) + { + case TransitionActionType.XY: + { + TValue value = (TValue)item.value; + if (item.target == _owner) + { + if (value.b1 && value.b2) + item.target.SetXY(value.f1 + _ownerBaseX, value.f2 + _ownerBaseY); + else if (value.b1) + item.target.x = value.f1 + _ownerBaseX; + else + item.target.y = value.f2 + _ownerBaseY; + } + else + { + if (value.b3) //position in percent + { + if (value.b1 && value.b2) + item.target.SetXY(value.f1 * _owner.width, value.f2 * _owner.height); + else if (value.b1) + item.target.x = value.f1 * _owner.width; + else if (value.b2) + item.target.y = value.f2 * _owner.height; + } + else + { + if (value.b1 && value.b2) + item.target.SetXY(value.f1, value.f2); + else if (value.b1) + item.target.x = value.f1; + else if (value.b2) + item.target.y = value.f2; + } + } + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + } + break; + + case TransitionActionType.Size: + { + TValue value = (TValue)item.value; + if (!value.b1) + value.f1 = item.target.width; + if (!value.b2) + value.f2 = item.target.height; + item.target.SetSize(value.f1, value.f2); + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + } + break; + + case TransitionActionType.Pivot: + item.target.SetPivot(((TValue)item.value).f1, ((TValue)item.value).f2, item.target.pivotAsAnchor); + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + break; + + case TransitionActionType.Alpha: + item.target.alpha = ((TValue)item.value).f1; + break; + + case TransitionActionType.Rotation: + item.target.rotation = ((TValue)item.value).f1; + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + break; + + case TransitionActionType.Scale: + item.target.SetScale(((TValue)item.value).f1, ((TValue)item.value).f2); + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + break; + + case TransitionActionType.Skew: + item.target.skew = ((TValue)item.value).vec2; + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + break; + + case TransitionActionType.Color: + ((IColorGear)item.target).color = ((TValue)item.value).color; + break; + + case TransitionActionType.Animation: + { + TValue_Animation value = (TValue_Animation)item.value; + if (value.frame >= 0) + ((IAnimationGear)item.target).frame = value.frame; + ((IAnimationGear)item.target).playing = value.playing; + ((IAnimationGear)item.target).timeScale = _timeScale; + ((IAnimationGear)item.target).ignoreEngineTimeScale = _ignoreEngineTimeScale; + if (value.animationName != null) + ((GLoader3D)item.target).animationName = value.animationName; + if (value.skinName != null) + ((GLoader3D)item.target).skinName = value.skinName; + } + break; + + case TransitionActionType.Visible: + item.target.visible = ((TValue_Visible)item.value).visible; + break; + + case TransitionActionType.Shake: + { + TValue_Shake value = (TValue_Shake)item.value; + item.target.SetXY(item.target.x - value.lastOffset.x + value.offset.x, item.target.y - value.lastOffset.y + value.offset.y); + value.lastOffset = value.offset; + + if (invalidateBatchingEveryFrame) + _owner.InvalidateBatchingState(true); + } + break; + + case TransitionActionType.Transition: + if (_playing) + { + TValue_Transition value = (TValue_Transition)item.value; + if (value.trans != null) + { + _totalTasks++; + + float startTime = _startTime > item.time ? (_startTime - item.time) : 0; + float endTime = _endTime >= 0 ? (_endTime - item.time) : -1; + if (value.stopTime >= 0 && (endTime < 0 || endTime > value.stopTime)) + endTime = value.stopTime; + value.trans.timeScale = _timeScale; + value.trans.ignoreEngineTimeScale = _ignoreEngineTimeScale; + value.trans._Play(value.playTimes, 0, startTime, endTime, value.playCompleteDelegate, _reversed); + } + } + break; + + case TransitionActionType.Sound: + if (_playing && item.time >= _startTime) + { + TValue_Sound value = (TValue_Sound)item.value; + if (value.audioClip == null) + { + if (UIConfig.soundLoader == null || value.sound.StartsWith(UIPackage.URL_PREFIX)) + value.audioClip = UIPackage.GetItemAssetByURL(value.sound) as NAudioClip; + else + value.audioClip = UIConfig.soundLoader(value.sound); + } + + if (value.audioClip != null && value.audioClip.nativeClip != null) + Stage.inst.PlayOneShotSound(value.audioClip.nativeClip, value.volume); + } + break; + + case TransitionActionType.ColorFilter: + { + TValue value = (TValue)item.value; + ColorFilter cf = item.target.filter as ColorFilter; + if (cf == null) + { + cf = new ColorFilter(); + item.target.filter = cf; + } + else + cf.Reset(); + + cf.AdjustBrightness(value.f1); + cf.AdjustContrast(value.f2); + cf.AdjustSaturation(value.f3); + cf.AdjustHue(value.f4); + } + break; + + case TransitionActionType.Text: + item.target.text = ((TValue_Text)item.value).text; + break; + + case TransitionActionType.Icon: + item.target.icon = ((TValue_Text)item.value).text; + break; + } + + item.target._gearLocked = false; + } + + public void Setup(ByteBuffer buffer) + { + this.name = buffer.ReadS(); + _options = buffer.ReadInt(); + _autoPlay = buffer.ReadBool(); + _autoPlayTimes = buffer.ReadInt(); + _autoPlayDelay = buffer.ReadFloat(); + + int cnt = buffer.ReadShort(); + _items = new TransitionItem[cnt]; + for (int i = 0; i < cnt; i++) + { + int dataLen = buffer.ReadShort(); + int curPos = buffer.position; + + buffer.Seek(curPos, 0); + + TransitionItem item = new TransitionItem((TransitionActionType)buffer.ReadByte()); + _items[i] = item; + + item.time = buffer.ReadFloat(); + int targetId = buffer.ReadShort(); + if (targetId < 0) + item.targetId = string.Empty; + else + item.targetId = _owner.GetChildAt(targetId).id; + item.label = buffer.ReadS(); + + if (buffer.ReadBool()) + { + buffer.Seek(curPos, 1); + + item.tweenConfig = new TweenConfig(); + item.tweenConfig.duration = buffer.ReadFloat(); + if (item.time + item.tweenConfig.duration > _totalDuration) + _totalDuration = item.time + item.tweenConfig.duration; + item.tweenConfig.easeType = (EaseType)buffer.ReadByte(); + item.tweenConfig.repeat = buffer.ReadInt(); + item.tweenConfig.yoyo = buffer.ReadBool(); + item.tweenConfig.endLabel = buffer.ReadS(); + + buffer.Seek(curPos, 2); + + DecodeValue(item, buffer, item.tweenConfig.startValue); + + buffer.Seek(curPos, 3); + + DecodeValue(item, buffer, item.tweenConfig.endValue); + + if (buffer.version >= 2) + { + var pts = buffer.ReadPath(); + if (pts.Count > 0) + { + item.tweenConfig.path = new GPath(); + item.tweenConfig.path.Create(pts); + } + } + + if (buffer.version >= 4 && item.tweenConfig.easeType == EaseType.Custom) + { + var pts = buffer.ReadPath(); + if (pts.Count > 0) + { + item.tweenConfig.customEase = new CustomEase(); + item.tweenConfig.customEase.Create(pts); + } + } + } + else + { + if (item.time > _totalDuration) + _totalDuration = item.time; + + buffer.Seek(curPos, 2); + + DecodeValue(item, buffer, item.value); + } + + buffer.position = curPos + dataLen; + } + } + + void DecodeValue(TransitionItem item, ByteBuffer buffer, object value) + { + switch (item.type) + { + case TransitionActionType.XY: + case TransitionActionType.Size: + case TransitionActionType.Pivot: + case TransitionActionType.Skew: + { + TValue tvalue = (TValue)value; + tvalue.b1 = buffer.ReadBool(); + tvalue.b2 = buffer.ReadBool(); + tvalue.f1 = buffer.ReadFloat(); + tvalue.f2 = buffer.ReadFloat(); + + if (buffer.version >= 2 && item.type == TransitionActionType.XY) + tvalue.b3 = buffer.ReadBool(); //percent + } + break; + + case TransitionActionType.Alpha: + case TransitionActionType.Rotation: + ((TValue)value).f1 = buffer.ReadFloat(); + break; + + case TransitionActionType.Scale: + ((TValue)value).f1 = buffer.ReadFloat(); + ((TValue)value).f2 = buffer.ReadFloat(); + break; + + case TransitionActionType.Color: + ((TValue)value).color = buffer.ReadColor(); + break; + + case TransitionActionType.Animation: + ((TValue_Animation)value).playing = buffer.ReadBool(); + ((TValue_Animation)value).frame = buffer.ReadInt(); + if (buffer.version >= 6) + { + ((TValue_Animation)value).animationName = buffer.ReadS(); + ((TValue_Animation)value).skinName = buffer.ReadS(); + } + break; + + case TransitionActionType.Visible: + ((TValue_Visible)value).visible = buffer.ReadBool(); + break; + + case TransitionActionType.Sound: + ((TValue_Sound)value).sound = buffer.ReadS(); + ((TValue_Sound)value).volume = buffer.ReadFloat(); + break; + + case TransitionActionType.Transition: + ((TValue_Transition)value).transName = buffer.ReadS(); + ((TValue_Transition)value).playTimes = buffer.ReadInt(); + ((TValue_Transition)value).playCompleteDelegate = () => { OnPlayTransCompleted(item); }; + break; + + case TransitionActionType.Shake: + ((TValue_Shake)value).amplitude = buffer.ReadFloat(); + ((TValue_Shake)value).duration = buffer.ReadFloat(); + break; + + case TransitionActionType.ColorFilter: + { + TValue tvalue = (TValue)value; + tvalue.f1 = buffer.ReadFloat(); + tvalue.f2 = buffer.ReadFloat(); + tvalue.f3 = buffer.ReadFloat(); + tvalue.f4 = buffer.ReadFloat(); + } + break; + + case TransitionActionType.Text: + case TransitionActionType.Icon: + ((TValue_Text)value).text = buffer.ReadS(); + break; + } + } + } + + class TransitionItem + { + public float time; + public string targetId; + public TransitionActionType type; + public TweenConfig tweenConfig; + public string label; + public object value; + public TransitionHook hook; + + //running properties + public GTweener tweener; + public GObject target; + public uint displayLockToken; + + public TransitionItem(TransitionActionType type) + { + this.type = type; + + switch (type) + { + case TransitionActionType.XY: + case TransitionActionType.Size: + case TransitionActionType.Scale: + case TransitionActionType.Pivot: + case TransitionActionType.Skew: + case TransitionActionType.Alpha: + case TransitionActionType.Rotation: + case TransitionActionType.Color: + case TransitionActionType.ColorFilter: + value = new TValue(); + break; + + case TransitionActionType.Animation: + value = new TValue_Animation(); + break; + + case TransitionActionType.Shake: + value = new TValue_Shake(); + break; + + case TransitionActionType.Sound: + value = new TValue_Sound(); + break; + + case TransitionActionType.Transition: + value = new TValue_Transition(); + break; + + case TransitionActionType.Visible: + value = new TValue_Visible(); + break; + + case TransitionActionType.Text: + case TransitionActionType.Icon: + value = new TValue_Text(); + break; + } + } + } + + class TweenConfig + { + public float duration; + public EaseType easeType; + public CustomEase customEase; + public int repeat; + public bool yoyo; + + public TValue startValue; + public TValue endValue; + + public string endLabel; + public TransitionHook endHook; + + public GPath path; + + public TweenConfig() + { + easeType = EaseType.QuadOut; + startValue = new TValue(); + endValue = new TValue(); + } + } + + class TValue_Visible + { + public bool visible; + } + + class TValue_Animation + { + public int frame; + public bool playing; + public bool flag; + public string animationName; + public string skinName; + } + + class TValue_Sound + { + public string sound; + public float volume; + public NAudioClip audioClip; + } + + class TValue_Transition + { + public string transName; + public int playTimes; + public Transition trans; + public PlayCompleteCallback playCompleteDelegate; + public float stopTime; + } + + class TValue_Shake + { + public float amplitude; + public float duration; + public Vector2 lastOffset; + public Vector2 offset; + } + + class TValue_Text + { + public string text; + } + + class TValue + { + public float f1; + public float f2; + public float f3; + public float f4; + public bool b1; + public bool b2; + public bool b3; + + public TValue() + { + b1 = true; + b2 = true; + } + + public void Copy(TValue source) + { + this.f1 = source.f1; + this.f2 = source.f2; + this.f3 = source.f3; + this.f4 = source.f4; + this.b1 = source.b1; + this.b2 = source.b2; + } + + public Vector2 vec2 + { + get { return new Vector2(f1, f2); } + set + { + f1 = value.x; + f2 = value.y; + } + } + + public Vector4 vec4 + { + get { return new Vector4(f1, f2, f3, f4); } + set + { + f1 = value.x; + f2 = value.y; + f3 = value.z; + f4 = value.w; + } + } + + public Color color + { + get { return new Color(f1, f2, f3, f4); } + set + { + f1 = value.r; + f2 = value.g; + f3 = value.b; + f4 = value.a; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs.meta new file mode 100644 index 00000000..0fa5f1e5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Transition.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5b4b16745502a0a428467b2981a2a786 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs new file mode 100644 index 00000000..1b441fe7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs @@ -0,0 +1,253 @@ +using System.Collections.Generic; +using FairyGUI.Utils; + +namespace FairyGUI +{ + public class TranslationHelper + { + public static Dictionary> strings; + + public static void LoadFromXML(XML source) + { + strings = new Dictionary>(); + XMLList.Enumerator et = source.GetEnumerator("string"); + while (et.MoveNext()) + { + XML cxml = et.Current; + string key = cxml.GetAttribute("name"); + string text = cxml.text; + int i = key.IndexOf("-"); + if (i == -1) + continue; + + string key2 = key.Substring(0, i); + string key3 = key.Substring(i + 1); + Dictionary col; + if (!strings.TryGetValue(key2, out col)) + { + col = new Dictionary(); + strings[key2] = col; + } + col[key3] = text; + } + } + + public static void TranslateComponent(PackageItem item) + { + if (TranslationHelper.strings == null) + return; + + Dictionary strings; + if (!TranslationHelper.strings.TryGetValue(item.owner.id + item.id, out strings)) + return; + + string elementId, value; + ByteBuffer buffer = item.rawData; + + buffer.Seek(0, 2); + + int childCount = buffer.ReadShort(); + for (int i = 0; i < childCount; i++) + { + int dataLen = buffer.ReadShort(); + int curPos = buffer.position; + + buffer.Seek(curPos, 0); + + ObjectType baseType = (ObjectType)buffer.ReadByte(); + ObjectType type = baseType; + buffer.Skip(4); + elementId = buffer.ReadS(); + + if (type == ObjectType.Component) + { + if (buffer.Seek(curPos, 6)) + type = (ObjectType)buffer.ReadByte(); + } + + buffer.Seek(curPos, 1); + + if (strings.TryGetValue(elementId + "-tips", out value)) + buffer.WriteS(value); + + buffer.Seek(curPos, 2); + + int gearCnt = buffer.ReadShort(); + for (int j = 0; j < gearCnt; j++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + if (buffer.ReadByte() == 6) //gearText + { + buffer.Skip(2);//controller + int valueCnt = buffer.ReadShort(); + for (int k = 0; k < valueCnt; k++) + { + string page = buffer.ReadS(); + if (page != null) + { + if (strings.TryGetValue(elementId + "-texts_" + k, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + } + } + + if (buffer.ReadBool() && strings.TryGetValue(elementId + "-texts_def", out value)) + buffer.WriteS(value); + } + + buffer.position = nextPos; + } + + if (baseType == ObjectType.Component && buffer.version >= 2) + { + buffer.Seek(curPos, 4); + + buffer.Skip(2); //pageController + + buffer.Skip(4 * buffer.ReadShort()); + + int cpCount = buffer.ReadShort(); + for (int k = 0; k < cpCount; k++) + { + string target = buffer.ReadS(); + int propertyId = buffer.ReadShort(); + if (propertyId == 0 && strings.TryGetValue(elementId + "-cp-" + target, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + } + } + + switch (type) + { + case ObjectType.Text: + case ObjectType.RichText: + case ObjectType.InputText: + { + if (strings.TryGetValue(elementId, out value)) + { + buffer.Seek(curPos, 6); + buffer.WriteS(value); + } + if (strings.TryGetValue(elementId + "-prompt", out value)) + { + buffer.Seek(curPos, 4); + buffer.WriteS(value); + } + break; + } + + case ObjectType.List: + case ObjectType.Tree: + { + buffer.Seek(curPos, 8); + buffer.Skip(2); + int itemCount = buffer.ReadShort(); + for (int j = 0; j < itemCount; j++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + buffer.Skip(2); //url + if (type == ObjectType.Tree) + buffer.Skip(2); + + //title + if (strings.TryGetValue(elementId + "-" + j, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + + //selected title + if (strings.TryGetValue(elementId + "-" + j + "-0", out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + + if (buffer.version >= 2) + { + buffer.Skip(6); + buffer.Skip(buffer.ReadShort() * 4);//controllers + + int cpCount = buffer.ReadShort(); + for (int k = 0; k < cpCount; k++) + { + string target = buffer.ReadS(); + int propertyId = buffer.ReadShort(); + if (propertyId == 0 && strings.TryGetValue(elementId + "-" + j + "-" + target, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + } + } + + buffer.position = nextPos; + } + break; + } + + case ObjectType.Label: + { + if (buffer.Seek(curPos, 6) && (ObjectType)buffer.ReadByte() == type) + { + if (strings.TryGetValue(elementId, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + + buffer.Skip(2); + if (buffer.ReadBool()) + buffer.Skip(4); + buffer.Skip(4); + if (buffer.ReadBool() && strings.TryGetValue(elementId + "-prompt", out value)) + buffer.WriteS(value); + } + break; + } + + case ObjectType.Button: + { + if (buffer.Seek(curPos, 6) && (ObjectType)buffer.ReadByte() == type) + { + if (strings.TryGetValue(elementId, out value)) + buffer.WriteS(value); + else + buffer.Skip(2); + if (strings.TryGetValue(elementId + "-0", out value)) + buffer.WriteS(value); + } + break; + } + + case ObjectType.ComboBox: + { + if (buffer.Seek(curPos, 6) && (ObjectType)buffer.ReadByte() == type) + { + int itemCount = buffer.ReadShort(); + for (int j = 0; j < itemCount; j++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + if (strings.TryGetValue(elementId + "-" + j, out value)) + buffer.WriteS(value); + + buffer.position = nextPos; + } + + if (strings.TryGetValue(elementId, out value)) + buffer.WriteS(value); + } + + break; + } + } + + buffer.position = curPos + dataLen; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs.meta new file mode 100644 index 00000000..9d4c70de --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/TranslationHelper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3efa1901e4c7ea44d9573c70d21e49f5 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree.meta new file mode 100644 index 00000000..e3466372 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4e3a2d82c02599a4f926286440678b58 +folderAsset: yes +timeCreated: 1467555752 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs new file mode 100644 index 00000000..686ddfd7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs @@ -0,0 +1,348 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + [Obsolete("Use GTree and GTreeNode instead")] + public class TreeNode + { + /// + /// + /// + public object data; + + /// + /// + /// + public TreeNode parent { get; private set; } + + /// + /// + /// + public TreeView tree { get; private set; } + + /// + /// + /// + public GComponent cell { get; internal set; } + + /// + /// + /// + public int level { get; private set; } + + private List _children; + private bool _expanded; + + /// + /// + /// + /// + public TreeNode(bool hasChild) + { + if (hasChild) + _children = new List(); + } + + /// + /// + /// + public bool expanded + { + get + { + return _expanded; + } + + set + { + if (_children == null) + return; + + if (_expanded != value) + { + _expanded = value; + if (tree != null) + { + if (_expanded) + tree.AfterExpanded(this); + else + tree.AfterCollapsed(this); + } + } + } + } + + /// + /// + /// + public bool isFolder + { + get { return _children != null; } + } + + /// + /// + /// + public string text + { + get + { + if (cell != null) + return cell.text; + else + return null; + } + } + + /// + /// + /// + /// + /// + public TreeNode AddChild(TreeNode child) + { + AddChildAt(child, _children.Count); + return child; + } + + /// + /// + /// + /// + /// + /// + public TreeNode AddChildAt(TreeNode child, int index) + { + if (child == null) + throw new Exception("child is null"); + + int numChildren = _children.Count; + + if (index >= 0 && index <= numChildren) + { + if (child.parent == this) + { + SetChildIndex(child, index); + } + else + { + if (child.parent != null) + child.parent.RemoveChild(child); + + int cnt = _children.Count; + if (index == cnt) + _children.Add(child); + else + _children.Insert(index, child); + + child.parent = this; + child.level = this.level + 1; + child.SetTree(this.tree); + if (this.cell != null && this.cell.parent != null && _expanded) + tree.AfterInserted(child); + } + + return child; + } + else + { + throw new Exception("Invalid child index"); + } + } + + /// + /// + /// + /// + /// + public TreeNode RemoveChild(TreeNode child) + { + int childIndex = _children.IndexOf(child); + if (childIndex != -1) + { + RemoveChildAt(childIndex); + } + return child; + } + + /// + /// + /// + /// + /// + public TreeNode RemoveChildAt(int index) + { + if (index >= 0 && index < numChildren) + { + TreeNode child = _children[index]; + _children.RemoveAt(index); + + child.parent = null; + if (tree != null) + { + child.SetTree(null); + tree.AfterRemoved(child); + } + + return child; + } + else + { + throw new Exception("Invalid child index"); + } + } + + /// + /// + /// + /// + /// + public void RemoveChildren(int beginIndex = 0, int endIndex = -1) + { + if (endIndex < 0 || endIndex >= numChildren) + endIndex = numChildren - 1; + + for (int i = beginIndex; i <= endIndex; ++i) + RemoveChildAt(beginIndex); + } + + /// + /// + /// + /// + /// + public TreeNode GetChildAt(int index) + { + if (index >= 0 && index < numChildren) + return _children[index]; + else + throw new Exception("Invalid child index"); + } + + /// + /// + /// + /// + /// + public int GetChildIndex(TreeNode child) + { + return _children.IndexOf(child); + } + + /// + /// + /// + /// + public TreeNode GetPrevSibling() + { + if (parent == null) + return null; + + int i = parent._children.IndexOf(this); + if (i <= 0) + return null; + + return parent._children[i - 1]; + } + + /// + /// + /// + /// + public TreeNode GetNextSibling() + { + if (parent == null) + return null; + + int i = parent._children.IndexOf(this); + if (i < 0 || i >= parent._children.Count - 1) + return null; + + return parent._children[i + 1]; + } + + /// + /// + /// + /// + /// + public void SetChildIndex(TreeNode child, int index) + { + int oldIndex = _children.IndexOf(child); + if (oldIndex == -1) + throw new Exception("Not a child of this container"); + + int cnt = _children.Count; + if (index < 0) + index = 0; + else if (index > cnt) + index = cnt; + + if (oldIndex == index) + return; + + _children.RemoveAt(oldIndex); + _children.Insert(index, child); + if (this.cell != null && this.cell.parent != null && _expanded) + tree.AfterMoved(child); + } + + /// + /// + /// + /// + /// + public void SwapChildren(TreeNode child1, TreeNode child2) + { + int index1 = _children.IndexOf(child1); + int index2 = _children.IndexOf(child2); + if (index1 == -1 || index2 == -1) + throw new Exception("Not a child of this container"); + SwapChildrenAt(index1, index2); + } + + /// + /// + /// + /// + /// + public void SwapChildrenAt(int index1, int index2) + { + TreeNode child1 = _children[index1]; + TreeNode child2 = _children[index2]; + + SetChildIndex(child1, index2); + SetChildIndex(child2, index1); + } + + /// + /// + /// + public int numChildren + { + get { return (null == _children) ? 0 : _children.Count; } + } + + internal void SetTree(TreeView value) + { + tree = value; + if (tree != null && tree.treeNodeWillExpand != null && _expanded) + tree.treeNodeWillExpand(this, true); + + if (_children != null) + { + int cnt = _children.Count; + for (int i = 0; i < cnt; i++) + { + TreeNode node = _children[i]; + node.level = level + 1; + node.SetTree(value); + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs.meta new file mode 100644 index 00000000..26e5a28a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeNode.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6bfc19586c7b07e4b9193f658c390727 +timeCreated: 1467555753 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs new file mode 100644 index 00000000..17bdc0db --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs @@ -0,0 +1,490 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI +{ + /// + /// + /// + [Obsolete("Use GTree and GTreeNode instead")] + public class TreeView : EventDispatcher + { + /// + /// TreeView使用的List对象 + /// + public GList list { get; private set; } + + /// + /// TreeView的顶层节点,这是个虚拟节点,也就是他ä¸ä¼šæ˜¾ç¤ºå‡ºæ¥ã€‚ + /// + public TreeNode root { get; private set; } + + /// + /// TreeViewæ¯çº§çš„缩进,å•ä½åƒç´ ã€‚ + /// + public int indent; + + public delegate GComponent TreeNodeCreateCellDelegate(TreeNode node); + public delegate void TreeNodeRenderDelegate(TreeNode node); + public delegate void TreeNodeWillExpandDelegate(TreeNode node, bool expand); + + /// + /// 当TreeNode需è¦åˆ›å»ºå¯¹è±¡çš„æ˜¾ç¤ºå¯¹è±¡æ—¶å›žè°ƒ + /// + public TreeNodeCreateCellDelegate treeNodeCreateCell; + + /// + /// 当TreeNodeéœ€è¦æ›´æ–°æ—¶å›žè°ƒ + /// + public TreeNodeRenderDelegate treeNodeRender; + + /// + /// 当TreeNodeå³å°†å±•开或者收缩时回调。å¯ä»¥åœ¨å›žè°ƒä¸­åЍæ€å¢žåŠ å­èŠ‚ç‚¹ã€‚ + /// + public TreeNodeWillExpandDelegate treeNodeWillExpand; + + /// + /// 点击任æ„TreeNodeæ—¶è§¦å‘ + /// + public EventListener onClickNode { get; private set; } + + /// + /// å³é”®ç‚¹å‡»ä»»æ„TreeNodeæ—¶è§¦å‘ + /// + public EventListener onRightClickNode { get; private set; } + + /// + /// + /// + /// + public TreeView(GList list) + { + this.list = list; + list.onClickItem.Add(__clickItem); + list.onRightClickItem.Add(__clickItem); + list.RemoveChildrenToPool(); + + root = new TreeNode(true); + root.SetTree(this); + root.cell = list; + root.expanded = true; + + indent = 30; + + onClickNode = new EventListener(this, "onClickNode"); + onRightClickNode = new EventListener(this, "onRightClickNode"); + } + + /// + /// + /// + /// + public TreeNode GetSelectedNode() + { + if (list.selectedIndex != -1) + return (TreeNode)list.GetChildAt(list.selectedIndex).data; + else + return null; + } + + /// + /// + /// + /// + public List GetSelection() + { + List sels = list.GetSelection(); + int cnt = sels.Count; + List ret = new List(); + for (int i = 0; i < cnt; i++) + { + TreeNode node = (TreeNode)list.GetChildAt(sels[i]).data; + ret.Add(node); + } + return ret; + } + + /// + /// + /// + /// + /// + public void AddSelection(TreeNode node, bool scrollItToView = false) + { + TreeNode parentNode = node.parent; + while (parentNode != null && parentNode != root) + { + parentNode.expanded = true; + parentNode = parentNode.parent; + } + list.AddSelection(list.GetChildIndex(node.cell), scrollItToView); + } + + /// + /// + /// + /// + public void RemoveSelection(TreeNode node) + { + list.RemoveSelection(list.GetChildIndex(node.cell)); + } + + /// + /// + /// + public void ClearSelection() + { + list.ClearSelection(); + } + + /// + /// + /// + /// + /// + public int GetNodeIndex(TreeNode node) + { + return list.GetChildIndex(node.cell); + } + + /// + /// + /// + /// + public void UpdateNode(TreeNode node) + { + if (node.cell == null) + return; + + if (treeNodeRender != null) + treeNodeRender(node); + } + + /// + /// + /// + /// + public void UpdateNodes(List nodes) + { + int cnt = nodes.Count; + for (int i = 0; i < cnt; i++) + { + TreeNode node = nodes[i]; + if (node.cell == null) + return; + + if (treeNodeRender != null) + treeNodeRender(node); + } + } + + /// + /// + /// + /// + public void ExpandAll(TreeNode folderNode) + { + folderNode.expanded = true; + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + TreeNode node = folderNode.GetChildAt(i); + if (node.isFolder) + ExpandAll(node); + } + } + + /// + /// + /// + /// + public void CollapseAll(TreeNode folderNode) + { + if (folderNode != root) + folderNode.expanded = false; + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + TreeNode node = folderNode.GetChildAt(i); + if (node.isFolder) + CollapseAll(node); + } + } + + /// + /// + /// + /// + void CreateCell(TreeNode node) + { + if (treeNodeCreateCell != null) + node.cell = treeNodeCreateCell(node); + else + node.cell = list.itemPool.GetObject(list.defaultItem) as GComponent; + if (node.cell == null) + throw new Exception("Unable to create tree cell"); + node.cell.data = node; + + GObject indentObj = node.cell.GetChild("indent"); + if (indentObj != null) + indentObj.width = (node.level - 1) * indent; + + GButton expandButton = (GButton)node.cell.GetChild("expandButton"); + if (expandButton != null) + { + if (node.isFolder) + { + expandButton.visible = true; + expandButton.onClick.Add(__clickExpandButton); + expandButton.data = node; + expandButton.selected = node.expanded; + } + else + expandButton.visible = false; + } + + if (treeNodeRender != null) + treeNodeRender(node); + } + + /// + /// + /// + /// + internal void AfterInserted(TreeNode node) + { + CreateCell(node); + + int index = GetInsertIndexForNode(node); + list.AddChildAt(node.cell, index); + if (treeNodeRender != null) + treeNodeRender(node); + + if (node.isFolder && node.expanded) + CheckChildren(node, index); + } + + /// + /// + /// + /// + /// + int GetInsertIndexForNode(TreeNode node) + { + TreeNode prevNode = node.GetPrevSibling(); + if (prevNode == null) + prevNode = node.parent; + int insertIndex = list.GetChildIndex(prevNode.cell) + 1; + int myLevel = node.level; + int cnt = list.numChildren; + for (int i = insertIndex; i < cnt; i++) + { + TreeNode testNode = (TreeNode)list.GetChildAt(i).data; + if (testNode.level <= myLevel) + break; + + insertIndex++; + } + + return insertIndex; + } + + /// + /// + /// + /// + internal void AfterRemoved(TreeNode node) + { + RemoveNode(node); + } + + /// + /// + /// + /// + internal void AfterExpanded(TreeNode node) + { + if (node != root && treeNodeWillExpand != null) + treeNodeWillExpand(node, true); + + if (node.cell == null) + return; + + if (node != root) + { + if (treeNodeRender != null) + treeNodeRender(node); + + GButton expandButton = (GButton)node.cell.GetChild("expandButton"); + if (expandButton != null) + expandButton.selected = true; + } + + if (node.cell.parent != null) + CheckChildren(node, list.GetChildIndex(node.cell)); + } + + /// + /// + /// + /// + internal void AfterCollapsed(TreeNode node) + { + if (node != root && treeNodeWillExpand != null) + treeNodeWillExpand(node, false); + + if (node.cell == null) + return; + + if (node != root) + { + if (treeNodeRender != null) + treeNodeRender(node); + + GButton expandButton = (GButton)node.cell.GetChild("expandButton"); + if (expandButton != null) + expandButton.selected = false; + } + + if (node.cell.parent != null) + HideFolderNode(node); + } + + /// + /// + /// + /// + internal void AfterMoved(TreeNode node) + { + if (!node.isFolder) + list.RemoveChild(node.cell); + else + HideFolderNode(node); + + int index = GetInsertIndexForNode(node); + list.AddChildAt(node.cell, index); + + if (node.isFolder && node.expanded) + CheckChildren(node, index); + } + + /// + /// + /// + /// + /// + /// + int CheckChildren(TreeNode folderNode, int index) + { + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + index++; + TreeNode node = folderNode.GetChildAt(i); + if (node.cell == null) + CreateCell(node); + + if (node.cell.parent == null) + list.AddChildAt(node.cell, index); + + if (node.isFolder && node.expanded) + index = CheckChildren(node, index); + } + + return index; + } + + /// + /// + /// + /// + void HideFolderNode(TreeNode folderNode) + { + int cnt = folderNode.numChildren; + for (int i = 0; i < cnt; i++) + { + TreeNode node = folderNode.GetChildAt(i); + if (node.cell != null) + { + if (node.cell.parent != null) + list.RemoveChild(node.cell); + list.itemPool.ReturnObject(node.cell); + node.cell.data = null; + node.cell = null; + } + if (node.isFolder && node.expanded) + HideFolderNode(node); + } + } + + /// + /// + /// + /// + void RemoveNode(TreeNode node) + { + if (node.cell != null) + { + if (node.cell.parent != null) + list.RemoveChild(node.cell); + list.itemPool.ReturnObject(node.cell); + node.cell.data = null; + node.cell = null; + } + + if (node.isFolder) + { + int cnt = node.numChildren; + for (int i = 0; i < cnt; i++) + { + TreeNode node2 = node.GetChildAt(i); + RemoveNode(node2); + } + } + } + + void __clickExpandButton(EventContext context) + { + context.StopPropagation(); + + GButton expandButton = (GButton)context.sender; + TreeNode node = (TreeNode)expandButton.parent.data; + if (list.scrollPane != null) + { + float posY = list.scrollPane.posY; + if (expandButton.selected) + node.expanded = true; + else + node.expanded = false; + list.scrollPane.posY = posY; + list.scrollPane.ScrollToView(node.cell); + } + else + { + if (expandButton.selected) + node.expanded = true; + else + node.expanded = false; + } + } + + void __clickItem(EventContext context) + { + float posY = 0; + if (list.scrollPane != null) + posY = list.scrollPane.posY; + + TreeNode node = (TreeNode)((GObject)context.data).data; + if (context.type == list.onRightClickItem.type) + onRightClickNode.Call(node); + else + onClickNode.Call(node); + + if (list.scrollPane != null) + { + list.scrollPane.posY = posY; + list.scrollPane.ScrollToView(node.cell); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs.meta new file mode 100644 index 00000000..1dc0f1cf --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Tree/TreeView.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5a8a82de90eec564d9b40a4192d27f3d +timeCreated: 1467555753 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs new file mode 100644 index 00000000..a10131ea --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs @@ -0,0 +1,462 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Global configs. These options should be set before any UI construction. + /// + [AddComponentMenu("FairyGUI/UI Config")] + public class UIConfig : MonoBehaviour + { + /// + /// Dynamic Font Support. + /// 4.x: Put the xxx.ttf into /Resources or /Resources/Fonts, and set defaultFont="xxx". + /// 5.x: set defaultFont to system font name(or names joint with comma). e.g. defaultFont="Microsoft YaHei, SimHei" + /// + public static string defaultFont = ""; + + [Obsolete("No use anymore")] + public static bool renderingTextBrighterOnDesktop = true; + + /// + /// Resource using in Window.ShowModalWait for locking the window. + /// + public static string windowModalWaiting; + + /// + /// Resource using in GRoot.ShowModalWait for locking the screen. + /// + public static string globalModalWaiting; + + /// + /// When a modal window is in front, the background becomes dark. + /// + public static Color modalLayerColor = new Color(0f, 0f, 0f, 0.4f); + + /// + /// Default button click sound. + /// + public static NAudioClip buttonSound; + + /// + /// Default button click sound volume. + /// + public static float buttonSoundVolumeScale = 1f; + + /// + /// Resource url of horizontal scrollbar + /// + public static string horizontalScrollBar; + + /// + /// Resource url of vertical scrollbar + /// + public static string verticalScrollBar; + + /// + /// Scrolling step in pixels + /// 当调用ScrollPane.scrollUp/Down/Left/Right时,或者点击滚动æ¡çš„上下箭头时,滑动的è·ç¦»ã€‚ + /// 鼠标滚轮触å‘一次滚动的è·ç¦»è®¾å®šä¸ºdefaultScrollStep*2 + /// + public static float defaultScrollStep = 25; + + /// + /// Deceleration ratio of scrollpane when its in touch dragging. + /// 当手指拖动并释放滚动区域åŽï¼Œå†…容会滑动一定è·ç¦»åŽåœä¸‹ï¼Œè¿™ä¸ªé€ŸçŽ‡å°±æ˜¯å‡é€Ÿçš„速率。 + /// 越接近1,å‡é€Ÿè¶Šæ…¢ï¼Œæ„å‘³ç€æ»‘动的时间和è·ç¦»æ›´é•¿ã€‚ + /// 这个是全局设置,也å¯ä»¥é€šè¿‡ScrollPane.decelerationRate进行个性设置。 + /// + public static float defaultScrollDecelerationRate = 0.967f; + + /// + /// Scrollbar display mode. Recommended 'Auto' for mobile and 'Visible' for web. + /// + public static ScrollBarDisplayType defaultScrollBarDisplay = ScrollBarDisplayType.Default; + + /// + /// Allow dragging anywhere in container to scroll. + /// + public static bool defaultScrollTouchEffect = true; + + /// + /// The "rebound" effect in the scolling container. + /// + public static bool defaultScrollBounceEffect = true; + + /// + /// When the scrolling container is set to "snap to the item", the rolling distance threshold of which item is close to is determined. + /// + public static float defaultScrollSnappingThreshold = 0.5f; + + /// + /// When the scrolling container is set to "page mode", it determines the scrolling distance threshold to which page to turn. + /// + public static float defaultScrollPagingThreshold = 0.3f; + + /// + /// Resources url of PopupMenu. + /// + public static string popupMenu; + + /// + /// Resource url of menu seperator. + /// + public static string popupMenu_seperator; + + /// + /// In case of failure of loading content for GLoader, use this sign to indicate an error. + /// + public static string loaderErrorSign; + + /// + /// Resource url of tooltips. + /// + public static string tooltipsWin; + + /// + /// The number of visible items in ComboBox. + /// + public static int defaultComboBoxVisibleItemCount = 10; + + /// + /// Pixel offsets of finger to trigger scrolling + /// + public static int touchScrollSensitivity = 20; + + /// + /// Pixel offsets of finger to trigger dragging + /// + public static int touchDragSensitivity = 10; + + /// + /// Pixel offsets of mouse pointer to trigger dragging. + /// + public static int clickDragSensitivity = 2; + + /// + /// Allow softness on top or left side for scrollpane. + /// + public static bool allowSoftnessOnTopOrLeftSide = true; + + /// + /// When click the window, brings to front automatically. + /// + public static bool bringWindowToFrontOnClick = true; + + /// + /// + /// + public static float inputCaretSize = 1; + + /// + /// + /// + public static Color inputHighlightColor = new Color32(255, 223, 141, 128); + + /// + /// + /// + public static float frameTimeForAsyncUIConstruction = 0.002f; + + /// + /// if RenderTexture using in painting mode has depth support. + /// + public static bool depthSupportForPaintingMode = true; + + /// + /// Indicates whether to draw extra 4 or 8 times to achieve stroke effect for textfield. + /// If it is true, that is the 8 times, otherwise it is the 4 times. + /// + public static bool enhancedTextOutlineEffect = false; + + [Obsolete("No use anymore.")] + public static VertAlignType richTextRowVerticalAlign = VertAlignType.Bottom; + + /// + /// Suggest to enable it on low dpi (e.g. 96dpi) screens. + /// + public static bool makePixelPerfect = false; + + public enum ConfigKey + { + DefaultFont, + ButtonSound, + ButtonSoundVolumeScale, + HorizontalScrollBar, + VerticalScrollBar, + DefaultScrollStep, + DefaultScrollBarDisplay, + DefaultScrollTouchEffect, + DefaultScrollBounceEffect, + TouchScrollSensitivity, + WindowModalWaiting, + GlobalModalWaiting, + PopupMenu, + PopupMenu_seperator, + LoaderErrorSign, + TooltipsWin, + DefaultComboBoxVisibleItemCount, + TouchDragSensitivity, + ClickDragSensitivity, + ModalLayerColor, + RenderingTextBrighterOnDesktop, + AllowSoftnessOnTopOrLeftSide, + InputCaretSize, + InputHighlightColor, + EnhancedTextOutlineEffect, + DepthSupportForPaintingMode, + RichTextRowVerticalAlign, + Branch, + + PleaseSelect = 100 + } + + [Serializable] + public class ConfigValue + { + public bool valid; + public string s; + public int i; + public float f; + public bool b; + public Color c; + + public void Reset() + { + valid = false; + s = null; + i = 0; + f = 0; + b = false; + c = Color.black; + } + } + + public List Items = new List(); + public List PreloadPackages = new List(); + + void Awake() + { + if (Application.isPlaying) + { + foreach (string packagePath in PreloadPackages) + { + UIPackage.AddPackage(packagePath); + } + + Load(); + } + } + + public void Load() + { + int cnt = Items.Count; + for (int i = 0; i < cnt; i++) + { + ConfigValue value = Items[i]; + if (!value.valid) + continue; + + switch ((UIConfig.ConfigKey)i) + { + case ConfigKey.ButtonSound: + if (Application.isPlaying) + UIConfig.buttonSound = UIPackage.GetItemAssetByURL(value.s) as NAudioClip; + break; + + case ConfigKey.ButtonSoundVolumeScale: + UIConfig.buttonSoundVolumeScale = value.f; + break; + + case ConfigKey.ClickDragSensitivity: + UIConfig.clickDragSensitivity = value.i; + break; + + case ConfigKey.DefaultComboBoxVisibleItemCount: + UIConfig.defaultComboBoxVisibleItemCount = value.i; + break; + + case ConfigKey.DefaultFont: + UIConfig.defaultFont = value.s; + break; + + case ConfigKey.DefaultScrollBarDisplay: + UIConfig.defaultScrollBarDisplay = (ScrollBarDisplayType)value.i; + break; + + case ConfigKey.DefaultScrollBounceEffect: + UIConfig.defaultScrollBounceEffect = value.b; + break; + + case ConfigKey.DefaultScrollStep: + UIConfig.defaultScrollStep = value.i; + break; + + case ConfigKey.DefaultScrollTouchEffect: + UIConfig.defaultScrollTouchEffect = value.b; + break; + + case ConfigKey.GlobalModalWaiting: + UIConfig.globalModalWaiting = value.s; + break; + + case ConfigKey.HorizontalScrollBar: + UIConfig.horizontalScrollBar = value.s; + break; + + case ConfigKey.LoaderErrorSign: + UIConfig.loaderErrorSign = value.s; + break; + + case ConfigKey.ModalLayerColor: + UIConfig.modalLayerColor = value.c; + break; + + case ConfigKey.PopupMenu: + UIConfig.popupMenu = value.s; + break; + + case ConfigKey.PopupMenu_seperator: + UIConfig.popupMenu_seperator = value.s; + break; + + case ConfigKey.TooltipsWin: + UIConfig.tooltipsWin = value.s; + break; + + case ConfigKey.TouchDragSensitivity: + UIConfig.touchDragSensitivity = value.i; + break; + + case ConfigKey.TouchScrollSensitivity: + UIConfig.touchScrollSensitivity = value.i; + break; + + case ConfigKey.VerticalScrollBar: + UIConfig.verticalScrollBar = value.s; + break; + + case ConfigKey.WindowModalWaiting: + UIConfig.windowModalWaiting = value.s; + break; + + case ConfigKey.AllowSoftnessOnTopOrLeftSide: + UIConfig.allowSoftnessOnTopOrLeftSide = value.b; + break; + + case ConfigKey.InputCaretSize: + UIConfig.inputCaretSize = value.i; + break; + + case ConfigKey.InputHighlightColor: + UIConfig.inputHighlightColor = value.c; + break; + + case ConfigKey.DepthSupportForPaintingMode: + UIConfig.depthSupportForPaintingMode = value.b; + break; + + case ConfigKey.EnhancedTextOutlineEffect: + UIConfig.enhancedTextOutlineEffect = value.b; + break; + + case ConfigKey.Branch: + UIPackage.branch = value.s; + break; + } + } + } + + public static void SetDefaultValue(ConfigKey key, ConfigValue value) + { + switch (key) + { + case ConfigKey.ButtonSoundVolumeScale: + value.f = 1; + break; + + case ConfigKey.ClickDragSensitivity: + value.i = 2; + break; + + case ConfigKey.DefaultComboBoxVisibleItemCount: + value.i = 10; + break; + + case ConfigKey.DefaultScrollBarDisplay: + value.i = (int)ScrollBarDisplayType.Default; + break; + + case ConfigKey.DefaultScrollBounceEffect: + case ConfigKey.DefaultScrollTouchEffect: + value.b = true; + break; + + case ConfigKey.DefaultScrollStep: + value.i = 25; + break; + + case ConfigKey.ModalLayerColor: + value.c = new Color(0f, 0f, 0f, 0.4f); + break; + + case ConfigKey.RenderingTextBrighterOnDesktop: + value.b = true; + break; + + case ConfigKey.TouchDragSensitivity: + value.i = 10; + break; + + case ConfigKey.TouchScrollSensitivity: + value.i = 20; + break; + + case ConfigKey.InputCaretSize: + value.i = 1; + break; + + case ConfigKey.InputHighlightColor: + value.c = new Color32(255, 223, 141, 128); + break; + + case ConfigKey.DepthSupportForPaintingMode: + value.b = false; + break; + + case ConfigKey.Branch: + value.s = ""; + break; + } + } + + public static void ClearResourceRefs() + { + UIConfig.defaultFont = ""; + UIConfig.buttonSound = null; + UIConfig.globalModalWaiting = null; + UIConfig.horizontalScrollBar = null; + UIConfig.loaderErrorSign = null; + UIConfig.popupMenu = null; + UIConfig.popupMenu_seperator = null; + UIConfig.tooltipsWin = null; + UIConfig.verticalScrollBar = null; + UIConfig.windowModalWaiting = null; + UIPackage.branch = null; + } + + public void ApplyModifiedProperties() + { + EMRenderSupport.Reload(); + } + + public delegate NAudioClip SoundLoader(string url); + + /// + /// + /// + public static SoundLoader soundLoader = null; + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs.meta new file mode 100644 index 00000000..75dfcf26 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIConfig.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ace51c3cbb5309547a7029cadaaa20ca +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs new file mode 100644 index 00000000..1daebb1e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs @@ -0,0 +1,217 @@ +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + [ExecuteInEditMode] + [AddComponentMenu("FairyGUI/UI Content Scaler")] + public class UIContentScaler : MonoBehaviour + { + /// + /// + /// + public enum ScaleMode + { + ConstantPixelSize, + ScaleWithScreenSize, + ConstantPhysicalSize + } + + /// + /// + /// + public enum ScreenMatchMode + { + MatchWidthOrHeight, + MatchWidth, + MatchHeight + } + + /// + /// + /// + public ScaleMode scaleMode; + + /// + /// + /// + public ScreenMatchMode screenMatchMode; + + /// + /// + /// + public int designResolutionX; + + /// + /// + /// + public int designResolutionY; + + /// + /// + /// + public int fallbackScreenDPI = 96; + + /// + /// + /// + public int defaultSpriteDPI = 96; + + /// + /// + /// + public float constantScaleFactor = 1; + + /// + /// 当false时,计算比例时会考虑designResolutionX/Y的设置是针对横å±è¿˜æ˜¯ç«–å±ã€‚å¦åˆ™ä¸è€ƒè™‘。 + /// + public bool ignoreOrientation = false; + + [System.NonSerialized] + public static float scaleFactor = 1; + + [System.NonSerialized] + public static int scaleLevel = 0; + + [System.NonSerialized] + bool _changed; + + void OnEnable() + { + if (Application.isPlaying) + { + //播放模å¼ä¸‹éƒ½æ˜¯é€šè¿‡Stage自带的UIContentScalerå®žçŽ°è°ƒæ•´çš„ï¼Œæ‰€ä»¥è¿™é‡Œåªæ˜¯æŠŠå‚数传过去 + UIContentScaler scaler = Stage.inst.gameObject.GetComponent(); + if (scaler != this) + { + scaler.scaleMode = scaleMode; + if (scaleMode == ScaleMode.ScaleWithScreenSize) + { + scaler.designResolutionX = designResolutionX; + scaler.designResolutionY = designResolutionY; + scaler.screenMatchMode = screenMatchMode; + scaler.ignoreOrientation = ignoreOrientation; + } + else if (scaleMode == ScaleMode.ConstantPhysicalSize) + { + scaler.fallbackScreenDPI = fallbackScreenDPI; + scaler.defaultSpriteDPI = defaultSpriteDPI; + } + else + { + scaler.constantScaleFactor = constantScaleFactor; + } + scaler.ApplyChange(); + GRoot.inst.ApplyContentScaleFactor(); + } + } + else //Screen width/height is not reliable in OnEnable in editmode + _changed = true; + } + + void Update() + { + if (_changed) + { + _changed = false; + ApplyChange(); + } + } + + void OnDestroy() + { + if (!Application.isPlaying) + { + scaleFactor = 1; + scaleLevel = 0; + } + } + + //For UIContentScalerEditor Only, as the Screen.width/height is not correct in OnInspectorGUI + /// + /// + /// + public void ApplyModifiedProperties() + { + _changed = true; + } + + /// + /// + /// + public void ApplyChange() + { + float screenWidth; + float screenHeight; + + if (Application.isPlaying) //In case of multi display, we keep using the display which Stage object resides. + { + screenWidth = Stage.inst.width; + screenHeight = Stage.inst.height; + } + else + { + screenWidth = Screen.width; + screenHeight = Screen.height; + } + if (scaleMode == ScaleMode.ScaleWithScreenSize) + { + if (designResolutionX == 0 || designResolutionY == 0) + return; + + int dx = designResolutionX; + int dy = designResolutionY; + if (!ignoreOrientation && (screenWidth > screenHeight && dx < dy || screenWidth < screenHeight && dx > dy)) + { + //scale should not change when orientation change + int tmp = dx; + dx = dy; + dy = tmp; + } + + if (screenMatchMode == ScreenMatchMode.MatchWidthOrHeight) + { + float s1 = (float)screenWidth / dx; + float s2 = (float)screenHeight / dy; + scaleFactor = Mathf.Min(s1, s2); + } + else if (screenMatchMode == ScreenMatchMode.MatchWidth) + scaleFactor = (float)screenWidth / dx; + else + scaleFactor = (float)screenHeight / dy; + } + else if (scaleMode == ScaleMode.ConstantPhysicalSize) + { + float dpi = Screen.dpi; + if (dpi == 0) + dpi = fallbackScreenDPI; + if (dpi == 0) + dpi = 96; + scaleFactor = dpi / (defaultSpriteDPI == 0 ? 96 : defaultSpriteDPI); + } + else + scaleFactor = constantScaleFactor; + + if (scaleFactor > 10) + scaleFactor = 10; + + UpdateScaleLevel(); + + StageCamera.screenSizeVer++; + } + + void UpdateScaleLevel() + { + if (scaleFactor > 3) + scaleLevel = 3; //x4 + else if (scaleFactor > 2) + scaleLevel = 2; //x3 + else if (scaleFactor > 1) + scaleLevel = 1; //x2 + else + scaleLevel = 0; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs.meta new file mode 100644 index 00000000..ce5ce1a1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIContentScaler.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a723f7fd716aac049aa24e9186f18685 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs new file mode 100644 index 00000000..51ff2b19 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs @@ -0,0 +1,202 @@ +using System; +using System.Collections.Generic; +#if FAIRYGUI_TOLUA +using LuaInterface; +#endif + +namespace FairyGUI +{ + /// + /// + /// + public class UIObjectFactory + { + public delegate GComponent GComponentCreator(); + public delegate GLoader GLoaderCreator(); + + static Dictionary packageItemExtensions = new Dictionary(); + static GLoaderCreator loaderCreator; + + /// + /// + /// + /// + /// + public static void SetPackageItemExtension(string url, System.Type type) + { + SetPackageItemExtension(url, () => { return (GComponent)Activator.CreateInstance(type); }); + } + + /// + /// + /// + /// + /// + public static void SetPackageItemExtension(string url, GComponentCreator creator) + { + if (url == null) + throw new Exception("Invaild url: " + url); + + PackageItem pi = UIPackage.GetItemByURL(url); + if (pi != null) + pi.extensionCreator = creator; + + packageItemExtensions[url] = creator; + } + +#if FAIRYGUI_TOLUA + public static void SetExtension(string url, System.Type baseType, LuaFunction extendFunction) + { + SetPackageItemExtension(url, () => + { + GComponent gcom = (GComponent)Activator.CreateInstance(baseType); + + extendFunction.BeginPCall(); + extendFunction.Push(gcom); + extendFunction.PCall(); + gcom.SetLuaPeer(extendFunction.CheckLuaTable()); + extendFunction.EndPCall(); + + return gcom; + }); + } +#endif + + /// + /// + /// + /// + public static void SetLoaderExtension(System.Type type) + { + loaderCreator = () => { return (GLoader)Activator.CreateInstance(type); }; + } + + /// + /// + /// + /// + public static void SetLoaderExtension(GLoaderCreator creator) + { + loaderCreator = creator; + } + + internal static void ResolvePackageItemExtension(PackageItem pi) + { + if (!packageItemExtensions.TryGetValue(UIPackage.URL_PREFIX + pi.owner.id + pi.id, out pi.extensionCreator) + && !packageItemExtensions.TryGetValue(UIPackage.URL_PREFIX + pi.owner.name + "/" + pi.name, out pi.extensionCreator)) + pi.extensionCreator = null; + } + + public static void Clear() + { + packageItemExtensions.Clear(); + loaderCreator = null; + } + + /// + /// + /// + /// + /// + /// + public static GObject NewObject(PackageItem pi, System.Type userClass = null) + { + GObject obj; + if (pi.type == PackageItemType.Component) + { + if (userClass != null) + { + Stats.LatestObjectCreation++; + obj = (GComponent)Activator.CreateInstance(userClass); + } + else if (pi.extensionCreator != null) + { + Stats.LatestObjectCreation++; + obj = pi.extensionCreator(); + } + else + obj = NewObject(pi.objectType); + } + else + obj = NewObject(pi.objectType); + + if (obj != null) + obj.packageItem = pi; + + return obj; + } + + /// + /// + /// + /// + /// + public static GObject NewObject(ObjectType type) + { + Stats.LatestObjectCreation++; + + switch (type) + { + case ObjectType.Image: + return new GImage(); + + case ObjectType.MovieClip: + return new GMovieClip(); + + case ObjectType.Component: + return new GComponent(); + + case ObjectType.Text: + return new GTextField(); + + case ObjectType.RichText: + return new GRichTextField(); + + case ObjectType.InputText: + return new GTextInput(); + + case ObjectType.Group: + return new GGroup(); + + case ObjectType.List: + return new GList(); + + case ObjectType.Graph: + return new GGraph(); + + case ObjectType.Loader: + if (loaderCreator != null) + return loaderCreator(); + else + return new GLoader(); + + case ObjectType.Button: + return new GButton(); + + case ObjectType.Label: + return new GLabel(); + + case ObjectType.ProgressBar: + return new GProgressBar(); + + case ObjectType.Slider: + return new GSlider(); + + case ObjectType.ScrollBar: + return new GScrollBar(); + + case ObjectType.ComboBox: + return new GComboBox(); + + case ObjectType.Tree: + return new GTree(); + + case ObjectType.Loader3D: + return new GLoader3D(); + + default: + return null; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs.meta new file mode 100644 index 00000000..5ed1d23b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIObjectFactory.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 461feec05183bbf4f908aa1455325715 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs new file mode 100644 index 00000000..4b791f91 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs @@ -0,0 +1,1666 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using FairyGUI.Utils; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FairyGUI +{ + /// + /// A UI Package contains a description file and some texture, sound assets. + /// + public class UIPackage + { + /// + /// Unload UIAssetBundle by FairyGUI system. + /// if use AssetBundlesManager set value to false + /// then unload UIAssetBundle by AssetBundlesManager + /// + public static bool unloadBundleByFGUI = true; + + /// + /// The event is triggered when all reference to this package item dropped. + /// + public static event Action onReleaseResource; + + /// + /// Package id. It is generated by the Editor. + /// + public string id { get; private set; } + + /// + /// Package name. + /// + public string name { get; private set; } + + /// + /// Use this callback to provide resources to the package. + /// + /// Resource name without extension. + /// Resource extension. e.g. '.png' '.wav' + /// Resource type. e.g. 'Texture' 'AudioClip' + /// How to destroy this resource. + /// + public delegate object LoadResource(string name, string extension, System.Type type, out DestroyMethod destroyMethod); + + /// + /// A async load resource callback. After loaded, you should call item.owner.SetItemAsset. + /// + /// Resource name without extension. + /// Resource extension. e.g. '.png' '.wav' + /// Resource type. e.g. 'Texture' 'AudioClip' + /// Resource item object. + /// + public delegate void LoadResourceAsync(string name, string extension, System.Type type, PackageItem item); + + /// + /// + /// + /// + public delegate void CreateObjectCallback(GObject result); + + List _items; + Dictionary _itemsById; + Dictionary _itemsByName; + Dictionary[] _dependencies; + string _assetPath; + string[] _branches; + internal int _branchIndex; + AssetBundle _resBundle; + string _customId; + bool _fromBundle; + LoadResource _loadFunc; + LoadResourceAsync _loadAsyncFunc; + + class AtlasSprite + { + public PackageItem atlas; + public Rect rect = new Rect(); + public Vector2 offset = new Vector2(); + public Vector2 originalSize = new Vector2(); + public bool rotated; + } + Dictionary _sprites; + + static Dictionary _packageInstById = new Dictionary(); + static Dictionary _packageInstByName = new Dictionary(); + static List _packageList = new List(); + static string _branch; + static Dictionary _vars = new Dictionary(); + + internal static int _constructing; + + public const string URL_PREFIX = "ui://"; + +#if UNITY_EDITOR + static LoadResource _loadFromAssetsPath = (string name, string extension, System.Type type, out DestroyMethod destroyMethod) => + { + destroyMethod = DestroyMethod.Unload; + return AssetDatabase.LoadAssetAtPath(name + extension, type); + }; +#endif + + static LoadResource _loadFromResourcesPath = (string name, string extension, System.Type type, out DestroyMethod destroyMethod) => + { + destroyMethod = DestroyMethod.Unload; + return Resources.Load(name, type); + }; + + public UIPackage() + { + _items = new List(); + _itemsById = new Dictionary(); + _itemsByName = new Dictionary(); + _sprites = new Dictionary(); + + _branchIndex = -1; + } + + /// + /// + /// + public static string branch + { + get { return _branch; } + set + { + _branch = value; + bool empty = string.IsNullOrEmpty(_branch); + var iter = _packageInstById.GetEnumerator(); + while (iter.MoveNext()) + { + UIPackage pkg = iter.Current.Value; + if (empty) + pkg._branchIndex = -1; + else if (pkg._branches != null) + pkg._branchIndex = Array.IndexOf(pkg._branches, value); + } + iter.Dispose(); + } + } + + /// + /// + /// + public static string GetVar(string key) + { + string value; + if (_vars.TryGetValue(key, out value)) + return value; + else + return null; + } + + /// + /// + /// + public static void SetVar(string key, string value) + { + if (value == null) + _vars.Remove(key); + else + _vars[key] = value; + } + + /// + /// Return a UIPackage with a certain id. + /// + /// ID of the package. + /// UIPackage + public static UIPackage GetById(string id) + { + UIPackage pkg; + if (_packageInstById.TryGetValue(id, out pkg)) + return pkg; + else + return null; + } + + /// + /// Return a UIPackage with a certain name. + /// + /// Name of the package. + /// UIPackage + public static UIPackage GetByName(string name) + { + UIPackage pkg; + if (_packageInstByName.TryGetValue(name, out pkg)) + return pkg; + else + return null; + } + + /// + /// Add a UI package from assetbundle. + /// + /// A assetbundle. + /// UIPackage + public static UIPackage AddPackage(AssetBundle bundle) + { + return AddPackage(bundle, bundle, null); + } + + /// + /// Add a UI package from two assetbundles. desc and res can be same. + /// + /// A assetbunble contains description file. + /// A assetbundle contains resources. + /// UIPackage + public static UIPackage AddPackage(AssetBundle desc, AssetBundle res) + { + return AddPackage(desc, res, null); + } + + /// + /// Add a UI package from two assetbundles with a optional main asset name. + /// + /// A assetbunble contains description file. + /// A assetbundle contains resources. + /// Main asset name. e.g. Basics_fui + /// UIPackage + public static UIPackage AddPackage(AssetBundle desc, AssetBundle res, string mainAssetName) + { + byte[] source = null; + if (!string.IsNullOrEmpty(mainAssetName)) + { + TextAsset ta = desc.LoadAsset(mainAssetName); + if (ta != null) + source = ta.bytes; + } + else + { + string[] names = desc.GetAllAssetNames(); + string searchPattern = "_fui"; + foreach (string n in names) + { + if (n.IndexOf(searchPattern) != -1) + { + TextAsset ta = desc.LoadAsset(n); + if (ta != null) + { + source = ta.bytes; + mainAssetName = Path.GetFileNameWithoutExtension(n); + break; + } + } + } + } + + if (source == null) + throw new Exception("FairyGUI: no package found in this bundle."); + + if (desc != res) + desc.Unload(true); + + ByteBuffer buffer = new ByteBuffer(source); + + UIPackage pkg = new UIPackage(); + pkg._resBundle = res; + pkg._fromBundle = true; + int pos = mainAssetName.IndexOf("_fui"); + if (pos != -1) + mainAssetName = mainAssetName.Substring(0, pos); + if (!pkg.LoadPackage(buffer, mainAssetName)) + return null; + + _packageInstById[pkg.id] = pkg; + _packageInstByName[pkg.name] = pkg; + _packageList.Add(pkg); + + return pkg; + } + + /// + /// Add a UI package from a path relative to Unity Resources path. + /// + /// Path relative to Unity Resources path. + /// UIPackage + public static UIPackage AddPackage(string descFilePath) + { + if (descFilePath.StartsWith("Assets/")) + { +#if UNITY_EDITOR + return AddPackage(descFilePath, _loadFromAssetsPath); +#else + + Debug.LogWarning("FairyGUI: failed to load package in '" + descFilePath + "'"); + return null; +#endif + } + else + return AddPackage(descFilePath, _loadFromResourcesPath); + } + + /// + /// 使用自定义的加载方å¼è½½å…¥ä¸€ä¸ªåŒ…。 + /// + /// 包资æºè·¯å¾„。 + /// 载入函数 + /// + public static UIPackage AddPackage(string assetPath, LoadResource loadFunc) + { + if (_packageInstById.ContainsKey(assetPath)) + return _packageInstById[assetPath]; + + DestroyMethod dm; + TextAsset asset = (TextAsset)loadFunc(assetPath + "_fui", ".bytes", typeof(TextAsset), out dm); + if (asset == null) + { + if (Application.isPlaying) + throw new Exception("FairyGUI: Cannot load ui package in '" + assetPath + "'"); + else + Debug.LogWarning("FairyGUI: Cannot load ui package in '" + assetPath + "'"); + } + + ByteBuffer buffer = new ByteBuffer(asset.bytes); + + UIPackage pkg = new UIPackage(); + pkg._loadFunc = loadFunc; + pkg._assetPath = assetPath; + if (!pkg.LoadPackage(buffer, assetPath)) + return null; + + _packageInstById[pkg.id] = pkg; + _packageInstByName[pkg.name] = pkg; + _packageInstById[assetPath] = pkg; + _packageList.Add(pkg); + return pkg; + } + + /// + /// Load Package by custom load method. + /// + /// Description file data + /// Prefix of the resource file name. The file name would be in format of 'assetNamePrefix_resFileName'. It can be empty. + /// Load method + /// + public static UIPackage AddPackage(byte[] descData, string assetNamePrefix, LoadResource loadFunc) + { + ByteBuffer buffer = new ByteBuffer(descData); + + UIPackage pkg = new UIPackage(); + pkg._loadFunc = loadFunc; + if (!pkg.LoadPackage(buffer, assetNamePrefix)) + return null; + + _packageInstById[pkg.id] = pkg; + _packageInstByName[pkg.name] = pkg; + _packageList.Add(pkg); + + return pkg; + } + + /// + /// Load Package async by custom load method. + /// + /// Description file data + /// refix of the resource file name. The file name would be in format of 'assetNamePrefix_resFileName'. It can be empty. + /// Load method + /// + public static UIPackage AddPackage(byte[] descData, string assetNamePrefix, LoadResourceAsync loadFunc) + { + ByteBuffer buffer = new ByteBuffer(descData); + + UIPackage pkg = new UIPackage(); + pkg._loadAsyncFunc = loadFunc; + if (!pkg.LoadPackage(buffer, assetNamePrefix)) + return null; + + _packageInstById[pkg.id] = pkg; + _packageInstByName[pkg.name] = pkg; + _packageList.Add(pkg); + + return pkg; + } + + /// + /// Remove a package. All resources in this package will be disposed. + /// + /// + public static void RemovePackage(string packageIdOrName) + { + UIPackage pkg = null; + if (!_packageInstById.TryGetValue(packageIdOrName, out pkg)) + { + if (!_packageInstByName.TryGetValue(packageIdOrName, out pkg)) + throw new Exception("FairyGUI: '" + packageIdOrName + "' is not a valid package id or name."); + } + pkg.Dispose(); + _packageInstById.Remove(pkg.id); + if (pkg._customId != null) + _packageInstById.Remove(pkg._customId); + if (pkg._assetPath != null) + _packageInstById.Remove(pkg._assetPath); + _packageInstByName.Remove(pkg.name); + _packageList.Remove(pkg); + } + + /// + /// + /// + public static void RemoveAllPackages() + { + if (_packageInstById.Count > 0) + { + UIPackage[] pkgs = _packageList.ToArray(); + + foreach (UIPackage pkg in pkgs) + { + pkg.Dispose(); + } + } + _packageList.Clear(); + _packageInstById.Clear(); + _packageInstByName.Clear(); + } + + /// + /// + /// + /// + public static List GetPackages() + { + return _packageList; + } + + /// + /// Create a UI object. + /// + /// Package name. + /// Resource name. + /// A UI object. + public static GObject CreateObject(string pkgName, string resName) + { + UIPackage pkg = GetByName(pkgName); + if (pkg != null) + return pkg.CreateObject(resName); + else + return null; + } + + /// + /// Create a UI object. + /// + /// Package name. + /// Resource name. + /// Custom implementation of this object. + /// A UI object. + public static GObject CreateObject(string pkgName, string resName, System.Type userClass) + { + UIPackage pkg = GetByName(pkgName); + if (pkg != null) + return pkg.CreateObject(resName, userClass); + else + return null; + } + + /// + /// Create a UI object. + /// + /// Resource url. + /// A UI object. + public static GObject CreateObjectFromURL(string url) + { + PackageItem pi = GetItemByURL(url); + if (pi != null) + return pi.owner.CreateObject(pi, null); + else + return null; + } + + /// + /// Create a UI object. + /// + /// Resource url. + /// Custom implementation of this object. + /// A UI object. + public static GObject CreateObjectFromURL(string url, System.Type userClass) + { + PackageItem pi = GetItemByURL(url); + if (pi != null) + return pi.owner.CreateObject(pi, userClass); + else + return null; + } + + public static void CreateObjectAsync(string pkgName, string resName, CreateObjectCallback callback) + { + UIPackage pkg = GetByName(pkgName); + if (pkg != null) + pkg.CreateObjectAsync(resName, callback); + else + Debug.LogError("FairyGUI: package not found - " + pkgName); + } + + public static void CreateObjectFromURL(string url, CreateObjectCallback callback) + { + PackageItem pi = GetItemByURL(url); + if (pi != null) + AsyncCreationHelper.CreateObject(pi, callback); + else + Debug.LogError("FairyGUI: resource not found - " + url); + } + + /// + /// Get a asset with a certain name. + /// + /// Package name. + /// Resource name. + /// If resource is atlas, returns NTexture; If resource is sound, returns AudioClip. + public static object GetItemAsset(string pkgName, string resName) + { + UIPackage pkg = GetByName(pkgName); + if (pkg != null) + return pkg.GetItemAsset(resName); + else + return null; + } + + /// + /// Get a asset with a certain name. + /// + /// Resource url. + /// If resource is atlas, returns NTexture; If resource is sound, returns AudioClip. + public static object GetItemAssetByURL(string url) + { + PackageItem item = GetItemByURL(url); + if (item == null) + return null; + + return item.owner.GetItemAsset(item); + } + + /// + /// Get url of an item in package. + /// + /// Package name. + /// Resource name. + /// Url. + public static string GetItemURL(string pkgName, string resName) + { + UIPackage pkg = GetByName(pkgName); + if (pkg == null) + return null; + + PackageItem pi; + if (!pkg._itemsByName.TryGetValue(resName, out pi)) + return null; + + return URL_PREFIX + pkg.id + pi.id; + } + + public static PackageItem GetItemByURL(string url) + { + if (url == null) + return null; + + int pos1 = url.IndexOf("//"); + if (pos1 == -1) + return null; + + int pos2 = url.IndexOf('/', pos1 + 2); + if (pos2 == -1) + { + if (url.Length > 13) + { + string pkgId = url.Substring(5, 8); + UIPackage pkg = GetById(pkgId); + if (pkg != null) + { + string srcId = url.Substring(13); + return pkg.GetItem(srcId); + } + } + } + else + { + string pkgName = url.Substring(pos1 + 2, pos2 - pos1 - 2); + UIPackage pkg = GetByName(pkgName); + if (pkg != null) + { + string srcName = url.Substring(pos2 + 1); + return pkg.GetItemByName(srcName); + } + } + + return null; + } + + /// + /// å°†'ui://包å/组件å'转æ¢ä¸ºä»¥å†…部id表达的urlæ ¼å¼ã€‚如果传入的url本身就是内部idæ ¼å¼ï¼Œåˆ™ç›´æŽ¥è¿”回。 + /// åŒæ—¶è¿™ä¸ªæ–¹æ³•è¿˜å¸¦æ ¼å¼æ£€æµ‹ï¼Œå¦‚æžœä¼ å…¥ä¸æ­£ç¡®çš„url,会返回null。 + /// + /// + /// + public static string NormalizeURL(string url) + { + if (url == null) + return null; + + int pos1 = url.IndexOf("//"); + if (pos1 == -1) + return null; + + int pos2 = url.IndexOf('/', pos1 + 2); + if (pos2 == -1) + return url; + else + { + string pkgName = url.Substring(pos1 + 2, pos2 - pos1 - 2); + string srcName = url.Substring(pos2 + 1); + return GetItemURL(pkgName, srcName); + } + } + + /// + /// Set strings source. + /// + /// + public static void SetStringsSource(XML source) + { + TranslationHelper.LoadFromXML(source); + } + + /// + /// + /// + public string assetPath + { + get { return _assetPath; } + } + + /// + /// Set a custom id for package, then you can use it in GetById. + /// + public string customId + { + get { return _customId; } + set + { + if (_customId != null) + _packageInstById.Remove(_customId); + _customId = value; + if (_customId != null) + _packageInstById[_customId] = this; + } + } + + /// + /// + /// + public AssetBundle resBundle + { + get { return _resBundle; } + } + + /// + /// 获得本包ä¾èµ–的包的id列表 + /// + public Dictionary[] dependencies + { + get { return _dependencies; } + } + + bool LoadPackage(ByteBuffer buffer, string assetNamePrefix) + { + if (buffer.ReadUint() != 0x46475549) + { + if (Application.isPlaying) + throw new Exception("FairyGUI: old package format found in '" + assetNamePrefix + "'"); + else + { + Debug.LogWarning("FairyGUI: old package format found in '" + assetNamePrefix + "'"); + return false; + } + } + + buffer.version = buffer.ReadInt(); + bool ver2 = buffer.version >= 2; + buffer.ReadBool(); //compressed + id = buffer.ReadString(); + name = buffer.ReadString(); + + UIPackage existingPkg; + if (_packageInstById.TryGetValue(id, out existingPkg)) + { + if (name != existingPkg.name) + Debug.LogWarning("FairyGUI: Package conflicts, '" + name + "' and '" + existingPkg.name + "'"); + +#if UNITY_EDITOR + //maybe multiple pkgs in different folder, pefer the one in resources + if (Application.isEditor) + { + if (existingPkg._loadFunc == _loadFromAssetsPath) //old one is outside resources path + existingPkg.Dispose(); //replace the existing + else if (existingPkg._loadFunc == _loadFromResourcesPath && _loadFunc == _loadFromResourcesPath + && _assetPath.Length < existingPkg._assetPath.Length) //both in resources path, pefer short path + existingPkg.Dispose(); //replace the existing + else //keep the existing + return false; + } +#endif + } + + buffer.Skip(20); + int indexTablePos = buffer.position; + int cnt; + + buffer.Seek(indexTablePos, 4); + + cnt = buffer.ReadInt(); + string[] stringTable = new string[cnt]; + for (int i = 0; i < cnt; i++) + stringTable[i] = buffer.ReadString(); + buffer.stringTable = stringTable; + + if (buffer.Seek(indexTablePos, 5)) + { + cnt = buffer.ReadInt(); + for (int i = 0; i < cnt; i++) + { + int index = buffer.ReadUshort(); + int len = buffer.ReadInt(); + stringTable[index] = buffer.ReadString(len); + } + } + + buffer.Seek(indexTablePos, 0); + + cnt = buffer.ReadShort(); + _dependencies = new Dictionary[cnt]; + for (int i = 0; i < cnt; i++) + { + Dictionary kv = new Dictionary(); + kv.Add("id", buffer.ReadS()); + kv.Add("name", buffer.ReadS()); + _dependencies[i] = kv; + } + + bool branchIncluded = false; + if (ver2) + { + cnt = buffer.ReadShort(); + if (cnt > 0) + { + _branches = buffer.ReadSArray(cnt); + if (!string.IsNullOrEmpty(_branch)) + _branchIndex = Array.IndexOf(_branches, _branch); + } + + branchIncluded = cnt > 0; + } + + buffer.Seek(indexTablePos, 1); + + PackageItem pi; + string assetPath; + if (assetNamePrefix.Length > 0) + { + assetPath = Path.GetDirectoryName(assetNamePrefix); + if (assetPath.Length > 0) + assetPath += "/"; + assetNamePrefix = assetNamePrefix + "_"; + } + else + assetPath = string.Empty; + + cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadInt(); + nextPos += buffer.position; + + pi = new PackageItem(); + pi.owner = this; + pi.type = (PackageItemType)buffer.ReadByte(); + pi.id = buffer.ReadS(); + pi.name = buffer.ReadS(); + buffer.ReadS(); //path + pi.file = buffer.ReadS(); + pi.exported = buffer.ReadBool(); + pi.width = buffer.ReadInt(); + pi.height = buffer.ReadInt(); + + switch (pi.type) + { + case PackageItemType.Image: + { + pi.objectType = ObjectType.Image; + int scaleOption = buffer.ReadByte(); + if (scaleOption == 1) + { + Rect rect = new Rect(); + rect.x = buffer.ReadInt(); + rect.y = buffer.ReadInt(); + rect.width = buffer.ReadInt(); + rect.height = buffer.ReadInt(); + pi.scale9Grid = rect; + + pi.tileGridIndice = buffer.ReadInt(); + } + else if (scaleOption == 2) + pi.scaleByTile = true; + + buffer.ReadBool(); //smoothing + break; + } + + case PackageItemType.MovieClip: + { + buffer.ReadBool(); //smoothing + pi.objectType = ObjectType.MovieClip; + pi.rawData = buffer.ReadBuffer(); + break; + } + + case PackageItemType.Font: + { + pi.rawData = buffer.ReadBuffer(); + break; + } + + case PackageItemType.Component: + { + int extension = buffer.ReadByte(); + if (extension > 0) + pi.objectType = (ObjectType)extension; + else + pi.objectType = ObjectType.Component; + pi.rawData = buffer.ReadBuffer(); + + UIObjectFactory.ResolvePackageItemExtension(pi); + break; + } + + case PackageItemType.Atlas: + case PackageItemType.Sound: + case PackageItemType.Misc: + { + pi.file = assetNamePrefix + pi.file; + break; + } + + case PackageItemType.Spine: + case PackageItemType.DragoneBones: + { + pi.file = assetPath + pi.file; + pi.skeletonAnchor.x = buffer.ReadFloat(); + pi.skeletonAnchor.y = buffer.ReadFloat(); + break; + } + } + + if (ver2) + { + string str = buffer.ReadS();//branch + if (str != null) + pi.name = str + "/" + pi.name; + + int branchCnt = buffer.ReadByte(); + if (branchCnt > 0) + { + if (branchIncluded) + pi.branches = buffer.ReadSArray(branchCnt); + else + _itemsById[buffer.ReadS()] = pi; + } + + int highResCnt = buffer.ReadByte(); + if (highResCnt > 0) + pi.highResolution = buffer.ReadSArray(highResCnt); + } + + _items.Add(pi); + _itemsById[pi.id] = pi; + if (pi.name != null) + _itemsByName[pi.name] = pi; + + buffer.position = nextPos; + } + + buffer.Seek(indexTablePos, 2); + + cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + string itemId = buffer.ReadS(); + pi = _itemsById[buffer.ReadS()]; + + AtlasSprite sprite = new AtlasSprite(); + sprite.atlas = pi; + sprite.rect.x = buffer.ReadInt(); + sprite.rect.y = buffer.ReadInt(); + sprite.rect.width = buffer.ReadInt(); + sprite.rect.height = buffer.ReadInt(); + sprite.rotated = buffer.ReadBool(); + if (ver2 && buffer.ReadBool()) + { + sprite.offset.x = buffer.ReadInt(); + sprite.offset.y = buffer.ReadInt(); + sprite.originalSize.x = buffer.ReadInt(); + sprite.originalSize.y = buffer.ReadInt(); + } + else if (sprite.rotated) + { + sprite.originalSize.x = sprite.rect.height; + sprite.originalSize.y = sprite.rect.width; + } + else + { + sprite.originalSize.x = sprite.rect.width; + sprite.originalSize.y = sprite.rect.height; + } + + _sprites[itemId] = sprite; + + buffer.position = nextPos; + } + + if (buffer.Seek(indexTablePos, 3)) + { + cnt = buffer.ReadShort(); + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadInt(); + nextPos += buffer.position; + + if (_itemsById.TryGetValue(buffer.ReadS(), out pi)) + { + if (pi.type == PackageItemType.Image) + { + pi.pixelHitTestData = new PixelHitTestData(); + pi.pixelHitTestData.Load(buffer); + } + } + + buffer.position = nextPos; + } + } + + if (!Application.isPlaying) + _items.Sort(ComparePackageItem); + + return true; + } + + static int ComparePackageItem(PackageItem p1, PackageItem p2) + { + if (p1.name != null && p2.name != null) + return p1.name.CompareTo(p2.name); + else + return 0; + } + + /// + /// + /// + public void LoadAllAssets() + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + GetItemAsset(_items[i]); + } + + /// + /// + /// + public void UnloadAssets() + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + PackageItem pi = _items[i]; + if (pi.type == PackageItemType.Atlas) + { + if (pi.texture != null) + pi.texture.Unload(); + } + else if (pi.type == PackageItemType.Sound) + { + if (pi.audioClip != null) + pi.audioClip.Unload(); + } + } + + if (unloadBundleByFGUI && + _resBundle != null) + { + _resBundle.Unload(true); + _resBundle = null; + } + } + + /// + /// + /// + public void ReloadAssets() + { + if (_fromBundle) + throw new Exception("FairyGUI: new bundle must be passed to this function"); + + ReloadAssets(null); + } + + /// + /// + /// + public void ReloadAssets(AssetBundle resBundle) + { + _resBundle = resBundle; + _fromBundle = _resBundle != null; + + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + PackageItem pi = _items[i]; + if (pi.type == PackageItemType.Atlas) + { + if (pi.texture != null && pi.texture.nativeTexture == null) + LoadAtlas(pi); + } + else if (pi.type == PackageItemType.Sound) + { + if (pi.audioClip != null && pi.audioClip.nativeClip == null) + LoadSound(pi); + } + } + } + + void Dispose() + { + int cnt = _items.Count; + for (int i = 0; i < cnt; i++) + { + PackageItem pi = _items[i]; + if (pi.type == PackageItemType.Atlas) + { + if (pi.texture != null) + { + pi.texture.Dispose(); + pi.texture = null; + } + } + else if (pi.type == PackageItemType.Sound) + { + if (pi.audioClip != null) + { + pi.audioClip.Unload(); + pi.audioClip = null; + } + } + } + _items.Clear(); + + if (unloadBundleByFGUI && + _resBundle != null) + { + _resBundle.Unload(true); + _resBundle = null; + } + } + + /// + /// + /// + /// + /// + public GObject CreateObject(string resName) + { + PackageItem pi; + if (!_itemsByName.TryGetValue(resName, out pi)) + { + Debug.LogError("FairyGUI: resource not found - " + resName + " in " + this.name); + return null; + } + + return CreateObject(pi, null); + } + + /// + /// + /// + /// + /// + /// + public GObject CreateObject(string resName, System.Type userClass) + { + PackageItem pi; + if (!_itemsByName.TryGetValue(resName, out pi)) + { + Debug.LogError("FairyGUI: resource not found - " + resName + " in " + this.name); + return null; + } + + return CreateObject(pi, userClass); + } + + public void CreateObjectAsync(string resName, CreateObjectCallback callback) + { + PackageItem pi; + if (!_itemsByName.TryGetValue(resName, out pi)) + { + Debug.LogError("FairyGUI: resource not found - " + resName + " in " + this.name); + return; + } + + AsyncCreationHelper.CreateObject(pi, callback); + } + + GObject CreateObject(PackageItem item, System.Type userClass) + { + Stats.LatestObjectCreation = 0; + Stats.LatestGraphicsCreation = 0; + + GetItemAsset(item); + + GObject g = UIObjectFactory.NewObject(item, userClass); + if (g == null) + return null; + + _constructing++; + g.ConstructFromResource(); + _constructing--; + + return g; + } + + + /// + /// + /// + /// + /// + public object GetItemAsset(string resName) + { + PackageItem pi; + if (!_itemsByName.TryGetValue(resName, out pi)) + { + Debug.LogError("FairyGUI: Resource not found - " + resName + " in " + this.name); + return null; + } + + return GetItemAsset(pi); + } + + public List GetItems() + { + return _items; + } + + public PackageItem GetItem(string itemId) + { + PackageItem pi; + if (_itemsById.TryGetValue(itemId, out pi)) + return pi; + else + return null; + } + + public PackageItem GetItemByName(string itemName) + { + PackageItem pi; + if (_itemsByName.TryGetValue(itemName, out pi)) + return pi; + else + return null; + } + + public object GetItemAsset(PackageItem item) + { + switch (item.type) + { + case PackageItemType.Image: + if (item.texture == null) + LoadImage(item); + return item.texture; + + case PackageItemType.Atlas: + if (item.texture == null) + LoadAtlas(item); + return item.texture; + + case PackageItemType.Sound: + if (item.audioClip == null) + LoadSound(item); + return item.audioClip; + + case PackageItemType.Font: + if (item.bitmapFont == null) + LoadFont(item); + + return item.bitmapFont; + + case PackageItemType.MovieClip: + if (item.frames == null) + LoadMovieClip(item); + + return item.frames; + + case PackageItemType.Component: + return item.rawData; + + case PackageItemType.Misc: + return LoadBinary(item); + + case PackageItemType.Spine: + if (item.skeletonAsset == null) + LoadSpine(item); + return item.skeletonAsset; + + case PackageItemType.DragoneBones: + if (item.skeletonAsset == null) + LoadDragonBones(item); + return item.skeletonAsset; + + default: + return null; + } + } + + /// + /// + /// + /// + /// + /// + public void SetItemAsset(PackageItem item, object asset, DestroyMethod destroyMethod) + { + switch (item.type) + { + case PackageItemType.Atlas: + if (item.texture == null) + item.texture = new NTexture(null, new Rect(0, 0, item.width, item.height)); + item.texture.Reload((Texture)asset, null); + item.texture.destroyMethod = destroyMethod; + break; + + case PackageItemType.Sound: + if (item.audioClip == null) + item.audioClip = new NAudioClip(null); + item.audioClip.Reload((AudioClip)asset); + item.audioClip.destroyMethod = destroyMethod; + break; + + case PackageItemType.Spine: +#if FAIRYGUI_SPINE + item.skeletonAsset = (Spine.Unity.SkeletonDataAsset)asset; +#endif + break; + + case PackageItemType.DragoneBones: +#if FAIRYGUI_DRAGONBONES + item.skeletonAsset = (DragonBones.UnityDragonBonesData)asset; +#endif + break; + } + } + + void LoadAtlas(PackageItem item) + { + string ext = Path.GetExtension(item.file); + string fileName = item.file.Substring(0, item.file.Length - ext.Length); + + if (_loadAsyncFunc != null) + { + _loadAsyncFunc(fileName, ext, typeof(Texture), item); + if (item.texture == null) + item.texture = new NTexture(null, new Rect(0, 0, item.width, item.height)); + item.texture.destroyMethod = DestroyMethod.None; + } + else + { + Texture tex = null; + Texture alphaTex = null; + DestroyMethod dm; + + if (_fromBundle) + { + if (_resBundle != null) + tex = _resBundle.LoadAsset(fileName); + else + Debug.LogWarning("FairyGUI: bundle already unloaded."); + + dm = DestroyMethod.None; + } + else + tex = (Texture)_loadFunc(fileName, ext, typeof(Texture), out dm); + + if (tex == null) + Debug.LogWarning("FairyGUI: texture '" + item.file + "' not found in " + this.name); + + else if (!(tex is Texture2D)) + { + Debug.LogWarning("FairyGUI: settings for '" + item.file + "' is wrong! Correct values are: (Texture Type=Default, Texture Shape=2D)"); + tex = null; + } + else + { + if (((Texture2D)tex).mipmapCount > 1) + Debug.LogWarning("FairyGUI: settings for '" + item.file + "' is wrong! Correct values are: (Generate Mip Maps=unchecked)"); + } + + if (tex != null) + { + fileName = fileName + "!a"; + if (_fromBundle) + { + if (_resBundle != null) + alphaTex = _resBundle.LoadAsset(fileName); + } + else + alphaTex = (Texture2D)_loadFunc(fileName, ext, typeof(Texture2D), out dm); + } + + if (tex == null) + { + tex = NTexture.CreateEmptyTexture(); + dm = DestroyMethod.Destroy; + } + + if (item.texture == null) + { + item.texture = new NTexture(tex, alphaTex, (float)tex.width / item.width, (float)tex.height / item.height); + item.texture.onRelease += (NTexture t) => + { + if (onReleaseResource != null) + onReleaseResource(item); + }; + } + else + item.texture.Reload(tex, alphaTex); + item.texture.destroyMethod = dm; + } + } + + void LoadImage(PackageItem item) + { + AtlasSprite sprite; + if (_sprites.TryGetValue(item.id, out sprite)) + { + NTexture atlas = (NTexture)GetItemAsset(sprite.atlas); + if (atlas.width == sprite.rect.width && atlas.height == sprite.rect.height) + item.texture = atlas; + else + item.texture = new NTexture(atlas, sprite.rect, sprite.rotated, sprite.originalSize, sprite.offset); + } + else + item.texture = NTexture.Empty; + } + + void LoadSound(PackageItem item) + { + string ext = Path.GetExtension(item.file); + string fileName = item.file.Substring(0, item.file.Length - ext.Length); + + if (_loadAsyncFunc != null) + { + _loadAsyncFunc(fileName, ext, typeof(AudioClip), item); + if (item.audioClip == null) + item.audioClip = new NAudioClip(null); + item.audioClip.destroyMethod = DestroyMethod.None; + } + else + { + AudioClip audioClip = null; + DestroyMethod dm; + + if (_fromBundle) + { + if (_resBundle != null) + audioClip = _resBundle.LoadAsset(fileName); + dm = DestroyMethod.None; + } + else + { + audioClip = (AudioClip)_loadFunc(fileName, ext, typeof(AudioClip), out dm); + } + + if (item.audioClip == null) + item.audioClip = new NAudioClip(audioClip); + else + item.audioClip.Reload(audioClip); + item.audioClip.destroyMethod = dm; + } + } + + byte[] LoadBinary(PackageItem item) + { + string ext = Path.GetExtension(item.file); + string fileName = item.file.Substring(0, item.file.Length - ext.Length); + + TextAsset ta; + if (_resBundle != null) + { + ta = _resBundle.LoadAsset(fileName); + if (ta != null) + return ta.bytes; + else + return null; + } + else + { + DestroyMethod dm; + object ret = _loadFunc(fileName, ext, typeof(TextAsset), out dm); + if (ret == null) + return null; + if (ret is byte[]) + return (byte[])ret; + else + return ((TextAsset)ret).bytes; + } + } + + void LoadMovieClip(PackageItem item) + { + ByteBuffer buffer = item.rawData; + + buffer.Seek(0, 0); + + item.interval = buffer.ReadInt() / 1000f; + item.swing = buffer.ReadBool(); + item.repeatDelay = buffer.ReadInt() / 1000f; + + buffer.Seek(0, 1); + + int frameCount = buffer.ReadShort(); + item.frames = new MovieClip.Frame[frameCount]; + + string spriteId; + MovieClip.Frame frame; + AtlasSprite sprite; + Rect frameRect = new Rect(); + + for (int i = 0; i < frameCount; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + frame = new MovieClip.Frame(); + frameRect.x = buffer.ReadInt(); + frameRect.y = buffer.ReadInt(); + frameRect.width = buffer.ReadInt(); + frameRect.height = buffer.ReadInt(); + frame.addDelay = buffer.ReadInt() / 1000f; + spriteId = buffer.ReadS(); + + if (spriteId != null && _sprites.TryGetValue(spriteId, out sprite)) + { + frame.texture = new NTexture((NTexture)GetItemAsset(sprite.atlas), sprite.rect, sprite.rotated, + new Vector2(item.width, item.height), frameRect.position); + } + item.frames[i] = frame; + + buffer.position = nextPos; + } + } + + void LoadFont(PackageItem item) + { + BitmapFont font = new BitmapFont(); + font.name = URL_PREFIX + this.id + item.id; + item.bitmapFont = font; + ByteBuffer buffer = item.rawData; + + buffer.Seek(0, 0); + + bool ttf = buffer.ReadBool(); + font.canTint = buffer.ReadBool(); + font.resizable = buffer.ReadBool(); + font.hasChannel = buffer.ReadBool(); + int fontSize = buffer.ReadInt(); + int xadvance = buffer.ReadInt(); + int lineHeight = buffer.ReadInt(); + + float texScaleX = 1; + float texScaleY = 1; + int bgX; + int bgY; + int bgWidth; + int bgHeight; + + NTexture mainTexture = null; + AtlasSprite mainSprite = null; + if (ttf && _sprites.TryGetValue(item.id, out mainSprite)) + { + mainTexture = (NTexture)GetItemAsset(mainSprite.atlas); + texScaleX = mainTexture.root.uvRect.width / mainTexture.width; + texScaleY = mainTexture.root.uvRect.height / mainTexture.height; + } + + buffer.Seek(0, 1); + + BitmapFont.BMGlyph bg; + int cnt = buffer.ReadInt(); + for (int i = 0; i < cnt; i++) + { + int nextPos = buffer.ReadUshort(); + nextPos += buffer.position; + + bg = new BitmapFont.BMGlyph(); + char ch = buffer.ReadChar(); + font.AddChar(ch, bg); + + string img = buffer.ReadS(); + int bx = buffer.ReadInt(); + int by = buffer.ReadInt(); + bgX = buffer.ReadInt(); + bgY = buffer.ReadInt(); + bgWidth = buffer.ReadInt(); + bgHeight = buffer.ReadInt(); + bg.advance = buffer.ReadInt(); + bg.channel = buffer.ReadByte(); + //The texture channel where the character image is found (1 = blue, 2 = green, 4 = red, 8 = alpha, 15-all). + if (bg.channel == 1) + bg.channel = 2; + else if (bg.channel == 2) + bg.channel = 1; + else if (bg.channel == 4) + bg.channel = 0; + else if (bg.channel == 8) + bg.channel = 3; + + if (ttf) + { + if (mainSprite.rotated) + { + bg.uv[0] = new Vector2((float)(by + bgHeight + mainSprite.rect.x) * texScaleX, + 1 - (float)(mainSprite.rect.yMax - bx) * texScaleY); + bg.uv[1] = new Vector2(bg.uv[0].x - (float)bgHeight * texScaleX, bg.uv[0].y); + bg.uv[2] = new Vector2(bg.uv[1].x, bg.uv[0].y + (float)bgWidth * texScaleY); + bg.uv[3] = new Vector2(bg.uv[0].x, bg.uv[2].y); + } + else + { + bg.uv[0] = new Vector2((float)(bx + mainSprite.rect.x) * texScaleX, + 1 - (float)(by + bgHeight + mainSprite.rect.y) * texScaleY); + bg.uv[1] = new Vector2(bg.uv[0].x, bg.uv[0].y + (float)bgHeight * texScaleY); + bg.uv[2] = new Vector2(bg.uv[0].x + (float)bgWidth * texScaleX, bg.uv[1].y); + bg.uv[3] = new Vector2(bg.uv[2].x, bg.uv[0].y); + } + + bg.lineHeight = lineHeight; + bg.x = bgX; + bg.y = bgY; + bg.width = bgWidth; + bg.height = bgHeight; + } + else + { + PackageItem charImg; + if (_itemsById.TryGetValue(img, out charImg)) + { + charImg = charImg.getBranch(); + bgWidth = charImg.width; + bgHeight = charImg.height; + charImg = charImg.getHighResolution(); + GetItemAsset(charImg); + charImg.texture.GetUV(bg.uv); + + texScaleX = (float)bgWidth / charImg.width; + texScaleY = (float)bgHeight / charImg.height; + + bg.x = bgX + charImg.texture.offset.x * texScaleX; + bg.y = bgY + charImg.texture.offset.y * texScaleY; + bg.width = charImg.texture.width * texScaleX; + bg.height = charImg.texture.height * texScaleY; + + if (mainTexture == null) + mainTexture = charImg.texture.root; + } + + if (fontSize == 0) + fontSize = bgHeight; + + if (bg.advance == 0) + { + if (xadvance == 0) + bg.advance = bgX + bgWidth; + else + bg.advance = xadvance; + } + + bg.lineHeight = bgY < 0 ? bgHeight : (bgY + bgHeight); + if (bg.lineHeight < fontSize) + bg.lineHeight = fontSize; + } + + buffer.position = nextPos; + } + + font.size = fontSize; + font.mainTexture = mainTexture; + if (!font.hasChannel) + font.shader = ShaderConfig.imageShader; + } + + void LoadSpine(PackageItem item) + { +#if FAIRYGUI_SPINE + string ext = Path.GetExtension(item.file); + string fileName = item.file.Substring(0, item.file.Length - ext.Length); + int index = fileName.LastIndexOf(".skel"); + if (index > 0) + fileName = fileName.Substring(0, index); + + Spine.Unity.SkeletonDataAsset asset; + if (_resBundle != null) + asset = _resBundle.LoadAsset(fileName + "_SkeletonData"); + else + { + DestroyMethod dm; + asset = (Spine.Unity.SkeletonDataAsset)_loadFunc(fileName + "_SkeletonData", ".asset", typeof(Spine.Unity.SkeletonDataAsset), out dm); + } + if (asset == null) + Debug.LogWarning("FairyGUI: Failed to load " + fileName); + item.skeletonAsset = asset; +#else + Debug.LogWarning("To enable Spine support, add script define symbol: FAIRYGUI_SPINE"); +#endif + } + + void LoadDragonBones(PackageItem item) + { +#if FAIRYGUI_DRAGONBONES + string ext = Path.GetExtension(item.file); + string fileName = item.file.Substring(0, item.file.Length - ext.Length); + int index = fileName.LastIndexOf("_ske"); + if (index > 0) + fileName = fileName.Substring(0, index); + index = fileName.LastIndexOf(".dbbin"); + if (index > 0) + fileName = fileName.Substring(0, index); + + DragonBones.UnityDragonBonesData asset; + if (_resBundle != null) + asset = _resBundle.LoadAsset(fileName + "_Data"); + else + { + DestroyMethod dm; + asset = (DragonBones.UnityDragonBonesData)_loadFunc(fileName + "_Data", ".asset", typeof(DragonBones.UnityDragonBonesData), out dm); + } + if (asset != null) + { + foreach (var atlas in asset.textureAtlas) + { + if (atlas.material == null) + { + atlas.material = new Material(ShaderConfig.GetShader(ShaderConfig.imageShader)); + atlas.material.mainTexture = atlas.texture; + } + } + item.skeletonAsset = DragonBones.UnityFactory.factory.LoadData(asset); + } + else + Debug.LogWarning("FairyGUI: Failed to load " + fileName); +#else + Debug.LogWarning("To enable DragonBones support, add script define symbol: FAIRYGUI_DRAGONBONES"); +#endif + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs.meta new file mode 100644 index 00000000..0a5bcdd0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPackage.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7177aa7a57b8cc0439fde7785099f11c +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs new file mode 100644 index 00000000..d7e9130e --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs @@ -0,0 +1,335 @@ +using System; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// + /// + [ExecuteInEditMode] + [AddComponentMenu("FairyGUI/UI Painter")] + [RequireComponent(typeof(MeshCollider), typeof(MeshRenderer))] + public class UIPainter : MonoBehaviour, EMRenderTarget + { + /// + /// + /// + public Container container { get; private set; } + + /// + /// + /// + public string packageName; + + /// + /// + /// + public string componentName; + + /// + /// + /// + public int sortingOrder; + + [SerializeField] + string packagePath; + [SerializeField] + Camera renderCamera = null; + [SerializeField] + bool fairyBatching = false; + [SerializeField] + bool touchDisabled = false; + + GComponent _ui; + [NonSerialized] + bool _created; + [NonSerialized] + bool _captured; + [NonSerialized] + Renderer _renderer; + + [NonSerialized] + RenderTexture _texture; + + Action _captureDelegate; + + void OnEnable() + { + if (Application.isPlaying) + { + if (this.container == null) + { + CreateContainer(); + + if (!string.IsNullOrEmpty(packagePath) && UIPackage.GetByName(packageName) == null) + UIPackage.AddPackage(packagePath); + } + } + else + { + EMRenderSupport.Add(this); + } + } + + void OnDisable() + { + if (!Application.isPlaying) + EMRenderSupport.Remove(this); + } + + void OnGUI() + { + if (!Application.isPlaying) + EM_BeforeUpdate(); + } + + void Start() + { + useGUILayout = false; + + if (!_created && Application.isPlaying) + CreateUI(); + } + + void OnDestroy() + { + if (Application.isPlaying) + { + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + } + + container.Dispose(); + container = null; + } + else + { + EMRenderSupport.Remove(this); + } + + DestroyTexture(); + } + + void CreateContainer() + { + this.container = new Container("UIPainter"); + this.container.renderMode = RenderMode.WorldSpace; + this.container.renderCamera = renderCamera; + this.container.touchable = !touchDisabled; + this.container.fairyBatching = fairyBatching; + this.container._panelOrder = sortingOrder; + this.container.hitArea = new MeshColliderHitTest(this.gameObject.GetComponent()); + SetSortingOrder(this.sortingOrder, true); + this.container.layer = CaptureCamera.hiddenLayer; + } + + /// + /// Change the sorting order of the panel in runtime. + /// + /// sorting order value + /// false if you dont want the default sorting behavior. + public void SetSortingOrder(int value, bool apply) + { + this.sortingOrder = value; + container._panelOrder = value; + + if (apply) + Stage.inst.ApplyPanelOrder(container); + } + + /// + /// + /// + public GComponent ui + { + get + { + if (!_created && Application.isPlaying) + CreateUI(); + + return _ui; + } + } + + /// + /// + /// + public void CreateUI() + { + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + DestroyTexture(); + } + + _created = true; + + if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(componentName)) + return; + + _ui = (GComponent)UIPackage.CreateObject(packageName, componentName); + if (_ui != null) + { + this.container.AddChild(_ui.displayObject); + this.container.size = _ui.size; + _texture = CaptureCamera.CreateRenderTexture(Mathf.RoundToInt(_ui.width), Mathf.RoundToInt(_ui.height), UIConfig.depthSupportForPaintingMode); + _renderer = this.GetComponent(); + if (_renderer != null) + { + _renderer.sharedMaterial.mainTexture = _texture; + _captureDelegate = Capture; + if (_renderer.sharedMaterial.renderQueue == 3000) //Set in transpare queue only + { + this.container.onUpdate += () => + { + UpdateContext.OnEnd += _captureDelegate; + }; + } + } + } + else + Debug.LogError("Create " + componentName + "@" + packageName + " failed!"); + } + + void Capture() + { + CaptureCamera.Capture(this.container, _texture, this.container.size.y, Vector2.zero); + if (_renderer != null) + _renderer.sortingOrder = container.renderingOrder; + } + + void DestroyTexture() + { + if (_texture != null) + { + if (Application.isPlaying) + RenderTexture.Destroy(_texture); + else + RenderTexture.DestroyImmediate(_texture); + _texture = null; + + if (_renderer != null) + _renderer.sharedMaterial.mainTexture = null; + } + } + + #region edit mode functions + + void CaptureInEditMode() + { + if (!EMRenderSupport.packageListReady || UIPackage.GetByName(packageName) == null) + return; + + _captured = true; + + DisplayObject.hideFlags = HideFlags.DontSaveInEditor; + GComponent view = (GComponent)UIPackage.CreateObject(packageName, componentName); + + if (view != null) + { + DestroyTexture(); + + _texture = CaptureCamera.CreateRenderTexture(Mathf.RoundToInt(view.width), Mathf.RoundToInt(view.height), false); + + Container root = (Container)view.displayObject; + root.layer = CaptureCamera.layer; + root.gameObject.hideFlags = HideFlags.None; + root.gameObject.SetActive(true); + + GameObject cameraObject = new GameObject("Temp Capture Camera"); + Camera camera = cameraObject.AddComponent(); + camera.depth = 0; + camera.cullingMask = 1 << CaptureCamera.layer; + camera.clearFlags = CameraClearFlags.Depth; + camera.orthographic = true; + camera.nearClipPlane = -30; + camera.farClipPlane = 30; + camera.enabled = false; + camera.targetTexture = _texture; + + float halfHeight = (float)_texture.height / 2; + camera.orthographicSize = halfHeight; + cameraObject.transform.localPosition = root.cachedTransform.TransformPoint(halfHeight * camera.aspect, -halfHeight, 0); + + UpdateContext context = new UpdateContext(); + //run two times + context.Begin(); + view.displayObject.Update(context); + context.End(); + + context.Begin(); + view.displayObject.Update(context); + context.End(); + + RenderTexture old = RenderTexture.active; + RenderTexture.active = _texture; + GL.Clear(true, true, Color.clear); + camera.Render(); + RenderTexture.active = old; + + camera.targetTexture = null; + view.Dispose(); + GameObject.DestroyImmediate(cameraObject); + + if (_renderer != null) + _renderer.sharedMaterial.mainTexture = _texture; + } + } + + public void ApplyModifiedProperties(bool sortingOrderChanged) + { + if (sortingOrderChanged) + { + if (Application.isPlaying) + SetSortingOrder(sortingOrder, true); + else + EMRenderSupport.orderChanged = true; + } + } + + public void OnUpdateSource(object[] data) + { + if (Application.isPlaying) + return; + + this.packageName = (string)data[0]; + this.packagePath = (string)data[1]; + this.componentName = (string)data[2]; + + if ((bool)data[3]) + _captured = false; + } + + public int EM_sortingOrder + { + get { return sortingOrder; } + } + + public void EM_BeforeUpdate() + { + if (_renderer == null) + _renderer = this.GetComponent(); + if (_renderer != null && _renderer.sharedMaterial.mainTexture != _texture) + _renderer.sharedMaterial.mainTexture = _texture; + + if (packageName != null && componentName != null && !_captured) + CaptureInEditMode(); + } + + public void EM_Update(UpdateContext context) + { + if (_renderer != null) + _renderer.sortingOrder = context.renderingOrder++; + } + + public void EM_Reload() + { + _captured = false; + } + + #endregion + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs.meta new file mode 100644 index 00000000..24152680 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPainter.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2ca66c39de4dce2499306801170a139f +timeCreated: 1461566422 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs new file mode 100644 index 00000000..ce29190a --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs @@ -0,0 +1,622 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FairyGUI +{ + /// + /// + /// + public enum FitScreen + { + None, + FitSize, + FitWidthAndSetMiddle, + FitHeightAndSetCenter + } + + /// + /// + /// + [ExecuteInEditMode] + [AddComponentMenu("FairyGUI/UI Panel")] + public class UIPanel : MonoBehaviour, EMRenderTarget + { + /// + /// + /// + public Container container { get; private set; } + + /// + /// + /// + public string packageName; + + /// + /// + /// + public string componentName; + + /// + /// + /// + public FitScreen fitScreen; + + /// + /// + /// + public int sortingOrder; + + [SerializeField] + string packagePath; + [SerializeField] + RenderMode renderMode = RenderMode.ScreenSpaceOverlay; + [SerializeField] + Camera renderCamera = null; + [SerializeField] + Vector3 position; + [SerializeField] + Vector3 scale = new Vector3(1, 1, 1); + [SerializeField] + Vector3 rotation = new Vector3(0, 0, 0); + [SerializeField] + bool fairyBatching = false; + [SerializeField] + bool touchDisabled = false; + [SerializeField] + Vector2 cachedUISize; + [SerializeField] + HitTestMode hitTestMode = HitTestMode.Default; + [SerializeField] + bool setNativeChildrenOrder = false; + + [System.NonSerialized] + int screenSizeVer; + [System.NonSerialized] + Rect uiBounds; //Track bounds even when UI is not created, edit mode + + GComponent _ui; + [NonSerialized] + bool _created; + + List _renders; + + void OnEnable() + { + if (Application.isPlaying) + { + if (this.container == null) + { + CreateContainer(); + + if (!string.IsNullOrEmpty(packagePath) && UIPackage.GetByName(packageName) == null) + UIPackage.AddPackage(packagePath); + } + } + else + { + //ä¸åœ¨æ’­æ”¾çŠ¶æ€æ—¶æˆ‘们ä¸åœ¨OnEnable创建,因为Prefab也会调用OnEnable,延迟到Update里创建(Prefabä¸è°ƒç”¨Update) + //æ¯æ¬¡æ’­æ”¾å‰éƒ½ä¼šdisable/enable一次。。。 + if (container != null)//如果ä¸ä¸ºnull,å¯èƒ½æ˜¯å› ä¸ºPrefab revert, è€Œä¸æ˜¯å› ä¸ºAssembly reload, + OnDestroy(); + + EMRenderSupport.Add(this); + screenSizeVer = 0; + uiBounds.position = position; + uiBounds.size = cachedUISize; + if (uiBounds.size == Vector2.zero) + uiBounds.size = new Vector2(30, 30); + } + } + + void OnDisable() + { + if (!Application.isPlaying) + EMRenderSupport.Remove(this); + } + + void Start() + { + if (!_created && Application.isPlaying) + CreateUI_PlayMode(); + } + + void Update() + { + if (screenSizeVer != StageCamera.screenSizeVer) + HandleScreenSizeChanged(); + } + + void OnDestroy() + { + if (container != null) + { + if (!Application.isPlaying) + EMRenderSupport.Remove(this); + + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + } + + container.Dispose(); + container = null; + } + + _renders = null; + } + + void CreateContainer() + { + if (!Application.isPlaying) + { + Transform t = this.transform; + int cnt = t.childCount; + while (cnt > 0) + { + GameObject go = t.GetChild(cnt - 1).gameObject; + if (go.name == "UI(AutoGenerated)") + { +#if (UNITY_2018_3_OR_NEWER && UNITY_EDITOR) + if (PrefabUtility.IsPartOfPrefabInstance(go)) + PrefabUtility.UnpackPrefabInstance(PrefabUtility.GetOutermostPrefabInstanceRoot(gameObject), PrefabUnpackMode.Completely, InteractionMode.AutomatedAction); +#endif + UnityEngine.Object.DestroyImmediate(go); + } + cnt--; + } + } + + this.container = new Container(this.gameObject); + this.container.renderMode = renderMode; + this.container.renderCamera = renderCamera; + this.container.touchable = !touchDisabled; + this.container._panelOrder = sortingOrder; + this.container.fairyBatching = fairyBatching; + if (Application.isPlaying) + { + SetSortingOrder(this.sortingOrder, true); + if (this.hitTestMode == HitTestMode.Raycast) + { + ColliderHitTest hitArea = new ColliderHitTest(); + hitArea.collider = this.gameObject.AddComponent(); + this.container.hitArea = hitArea; + } + + if (setNativeChildrenOrder) + { + CacheNativeChildrenRenderers(); + + this.container.onUpdate += () => + { + int cnt = _renders.Count; + int sv = UpdateContext.current.renderingOrder++; + for (int i = 0; i < cnt; i++) + { + Renderer r = _renders[i]; + if (r != null) + _renders[i].sortingOrder = sv; + } + }; + } + } + } + + /// + /// + /// + public GComponent ui + { + get + { + if (!_created && Application.isPlaying) + { + if (!string.IsNullOrEmpty(packagePath) && UIPackage.GetByName(packageName) == null) + UIPackage.AddPackage(packagePath); + + CreateUI_PlayMode(); + } + + return _ui; + } + } + + /// + /// + /// + public void CreateUI() + { + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + } + + CreateUI_PlayMode(); + } + + /// + /// Change the sorting order of the panel in runtime. + /// + /// sorting order value + /// false if you dont want the default sorting behavior. e.g. call Stage.SortWorldSpacePanelsByZOrder later. + public void SetSortingOrder(int value, bool apply) + { + this.sortingOrder = value; + container._panelOrder = value; + + if (apply) + Stage.inst.ApplyPanelOrder(container); + } + + /// + /// + /// + /// + public void SetHitTestMode(HitTestMode value) + { + if (this.hitTestMode != value) + { + this.hitTestMode = value; + BoxCollider collider = this.gameObject.GetComponent(); + if (this.hitTestMode == HitTestMode.Raycast) + { + if (collider == null) + collider = this.gameObject.AddComponent(); + ColliderHitTest hitArea = new ColliderHitTest(); + hitArea.collider = collider; + this.container.hitArea = hitArea; + if (_ui != null) + UpdateHitArea(); + } + else + { + this.container.hitArea = null; + if (collider != null) + Component.Destroy(collider); + } + } + } + + /// + /// + /// + public void CacheNativeChildrenRenderers() + { + if (_renders == null) + _renders = new List(); + else + _renders.Clear(); + + Transform t = this.container.cachedTransform; + int cnt = t.childCount; + for (int i = 0; i < cnt; i++) + { + GameObject go = t.GetChild(i).gameObject; + if (go.name != "GComponent") + _renders.AddRange(go.GetComponentsInChildren(true)); + } + + cnt = _renders.Count; + for (int i = 0; i < cnt; i++) + { + Renderer r = _renders[i]; + if ((r is SkinnedMeshRenderer) || (r is MeshRenderer)) + { + //Set the object rendering in Transparent Queue as UI objects + if (r.sharedMaterial != null) + r.sharedMaterial.renderQueue = 3000; + } + } + } + + void CreateUI_PlayMode() + { + _created = true; + + if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(componentName)) + return; + + _ui = (GComponent)UIPackage.CreateObject(packageName, componentName); + if (_ui != null) + { + _ui.position = position; + if (scale.x != 0 && scale.y != 0) + _ui.scale = scale; + _ui.rotationX = rotation.x; + _ui.rotationY = rotation.y; + _ui.rotation = rotation.z; + if (this.container.hitArea != null) + { + UpdateHitArea(); + _ui.onSizeChanged.Add(UpdateHitArea); + _ui.onPositionChanged.Add(UpdateHitArea); + } + this.container.AddChildAt(_ui.displayObject, 0); + + HandleScreenSizeChanged(); + } + else + Debug.LogError("Create " + packageName + "/" + componentName + " failed!"); + } + + void UpdateHitArea() + { + ColliderHitTest hitArea = this.container.hitArea as ColliderHitTest; + if (hitArea != null) + { + ((BoxCollider)hitArea.collider).center = new Vector3(_ui.xMin + _ui.width / 2, -_ui.yMin - _ui.height / 2); + ((BoxCollider)hitArea.collider).size = _ui.size; + } + } + + void CreateUI_EditMode() + { + if (!EMRenderSupport.packageListReady || UIPackage.GetByName(packageName) == null) + return; + + + DisplayObject.hideFlags = HideFlags.DontSaveInEditor; + GObject obj = UIPackage.CreateObject(packageName, componentName); + if (obj != null && !(obj is GComponent)) + { + obj.Dispose(); + Debug.LogWarning("Not a GComponnet: " + packageName + "/" + componentName); + return; + } + _ui = (GComponent)obj; + + if (_ui != null) + { + _ui.displayObject.gameObject.hideFlags |= HideFlags.HideInHierarchy; + _ui.gameObjectName = "UI(AutoGenerated)"; + + _ui.position = position; + if (scale.x != 0 && scale.y != 0) + _ui.scale = scale; + _ui.rotationX = rotation.x; + _ui.rotationY = rotation.y; + _ui.rotation = rotation.z; + this.container.AddChildAt(_ui.displayObject, 0); + + cachedUISize = _ui.size; + uiBounds.size = cachedUISize; + HandleScreenSizeChanged(); + } + } + + void HandleScreenSizeChanged() + { + if (!Application.isPlaying) + DisplayObject.hideFlags = HideFlags.DontSaveInEditor; + + screenSizeVer = StageCamera.screenSizeVer; + + int width = Screen.width; + int height = Screen.height; + if (this.container != null) + { + Camera cam = container.GetRenderCamera(); + if (cam.targetDisplay != 0 && cam.targetDisplay < Display.displays.Length) + { + width = Display.displays[cam.targetDisplay].renderingWidth; + height = Display.displays[cam.targetDisplay].renderingHeight; + } + + if (this.container.renderMode != RenderMode.WorldSpace) + { + StageCamera sc = cam.GetComponent(); + if (sc == null) + sc = StageCamera.main.GetComponent(); + this.container.scale = new Vector2(sc.unitsPerPixel * UIContentScaler.scaleFactor, sc.unitsPerPixel * UIContentScaler.scaleFactor); + } + } + + width = Mathf.CeilToInt(width / UIContentScaler.scaleFactor); + height = Mathf.CeilToInt(height / UIContentScaler.scaleFactor); + if (_ui != null) + { + switch (fitScreen) + { + case FitScreen.FitSize: + _ui.SetSize(width, height); + _ui.SetXY(0, 0, true); + break; + + case FitScreen.FitWidthAndSetMiddle: + _ui.SetSize(width, _ui.sourceHeight); + _ui.SetXY(0, (int)((height - _ui.sourceHeight) / 2), true); + break; + + case FitScreen.FitHeightAndSetCenter: + _ui.SetSize(_ui.sourceWidth, height); + _ui.SetXY((int)((width - _ui.sourceWidth) / 2), 0, true); + break; + } + + UpdateHitArea(); + } + else + { + switch (fitScreen) + { + case FitScreen.FitSize: + uiBounds.position = new Vector2(0, 0); + uiBounds.size = new Vector2(width, height); + break; + + case FitScreen.FitWidthAndSetMiddle: + uiBounds.position = new Vector2(0, (int)((height - cachedUISize.y) / 2)); + uiBounds.size = new Vector2(width, cachedUISize.y); + break; + + case FitScreen.FitHeightAndSetCenter: + uiBounds.position = new Vector2((int)((width - cachedUISize.x) / 2), 0); + uiBounds.size = new Vector2(cachedUISize.x, height); + break; + } + } + } + + #region edit mode functions + + void OnUpdateSource(object[] data) + { + if (Application.isPlaying) + return; + + this.packageName = (string)data[0]; + this.packagePath = (string)data[1]; + this.componentName = (string)data[2]; + + if ((bool)data[3]) + { + if (container == null) + return; + + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + } + } + } + + public void ApplyModifiedProperties(bool sortingOrderChanged, bool fitScreenChanged) + { + if (container != null) + { + container.renderMode = renderMode; + container.renderCamera = renderCamera; + if (sortingOrderChanged) + { + container._panelOrder = sortingOrder; + if (Application.isPlaying) + SetSortingOrder(sortingOrder, true); + else + EMRenderSupport.orderChanged = true; + } + container.fairyBatching = fairyBatching; + } + + if (_ui != null) + { + if (fitScreen == FitScreen.None) + _ui.position = position; + if (scale.x != 0 && scale.y != 0) + _ui.scale = scale; + _ui.rotationX = rotation.x; + _ui.rotationY = rotation.y; + _ui.rotation = rotation.z; + } + if (fitScreen == FitScreen.None) + uiBounds.position = position; + screenSizeVer = 0;//force HandleScreenSizeChanged be called + + if (fitScreenChanged && this.fitScreen == FitScreen.None) + { + if (_ui != null) + _ui.SetSize(_ui.sourceWidth, _ui.sourceHeight); + uiBounds.size = cachedUISize; + } + } + + public void MoveUI(Vector3 delta) + { + if (fitScreen != FitScreen.None) + return; + + this.position += delta; + if (_ui != null) + _ui.position = position; + uiBounds.position = position; + } + + public Vector3 GetUIWorldPosition() + { + if (_ui != null) + return _ui.displayObject.cachedTransform.position; + else + return this.container.cachedTransform.TransformPoint(uiBounds.position); + } + + void OnDrawGizmos() + { + if (Application.isPlaying || this.container == null) + return; + + Vector3 pos, size; + if (_ui != null) + { + Gizmos.matrix = _ui.displayObject.cachedTransform.localToWorldMatrix; + pos = new Vector3(_ui.width / 2, -_ui.height / 2, 0); + size = new Vector3(_ui.width, _ui.height, 0); + } + else + { + Gizmos.matrix = this.container.cachedTransform.localToWorldMatrix; + pos = new Vector3(uiBounds.x + uiBounds.width / 2, -uiBounds.y - uiBounds.height / 2, 0); + size = new Vector3(uiBounds.width, uiBounds.height, 0); + } + + Gizmos.color = new Color(0, 0, 0, 0); + Gizmos.DrawCube(pos, size); + + Gizmos.color = Color.white; + Gizmos.DrawWireCube(pos, size); + } + + public int EM_sortingOrder + { + get { return sortingOrder; } + } + + public void EM_BeforeUpdate() + { + if (container == null) + CreateContainer(); + + if (packageName != null && componentName != null && _ui == null) + CreateUI_EditMode(); + + if (screenSizeVer != StageCamera.screenSizeVer) + HandleScreenSizeChanged(); + } + + public void EM_Update(UpdateContext context) + { + DisplayObject.hideFlags = HideFlags.DontSaveInEditor; + + container.Update(context); + + if (setNativeChildrenOrder) + { + CacheNativeChildrenRenderers(); + + int cnt = _renders.Count; + int sv = context.renderingOrder++; + for (int i = 0; i < cnt; i++) + { + Renderer r = _renders[i]; + if (r != null) + r.sortingOrder = sv; + } + } + } + + public void EM_Reload() + { + if (_ui != null) + { + _ui.Dispose(); + _ui = null; + } + } + + #endregion + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs.meta new file mode 100644 index 00000000..96c7b7c7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/UIPanel.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 024553ecf96a65649b929ee08c9214fd +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs new file mode 100644 index 00000000..8a4b6e65 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs @@ -0,0 +1,555 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI +{ + /// + /// Window class. + /// 窗å£ä½¿ç”¨å‰é¦–å…ˆè¦è®¾ç½®çª—å£ä¸­éœ€è¦æ˜¾ç¤ºçš„内容,这通常是在编辑器里制作好的,å¯ä»¥ç›´æŽ¥ä½¿ç”¨Window.contentPane进行设置。 + /// 建议把设置contentPaneç­‰åˆå§‹åŒ–æ“作放置到Window.onInit方法中。 + /// å¦å¤–,FairyGUI还æä¾›äº†ä¸€å¥—机制用于窗å£åЍæ€åˆ›å»ºã€‚动æ€åˆ›å»ºæ˜¯æŒ‡åˆå§‹æ—¶ä»…指定窗å£éœ€è¦ä½¿ç”¨çš„资æºï¼Œç­‰çª—å£éœ€è¦æ˜¾ç¤ºæ—¶æ‰å®žé™…开始构建窗å£çš„内容。 + /// 首先需è¦åœ¨çª—å£çš„æž„造函数中调用Window.addUISource。这个方法需è¦ä¸€ä¸ªIUISourceç±»åž‹çš„å‚æ•°ï¼Œè€ŒIUISource是一个接å£ï¼Œ + /// 用户需è¦è‡ªè¡Œå®žçŽ°è½½å…¥ç›¸å…³UI包的逻辑。当窗å£ç¬¬ä¸€æ¬¡æ˜¾ç¤ºä¹‹å‰ï¼ŒIUISource的加载方法将会被调用,并等待载入完æˆåŽæ‰è¿”回执行Window.OnInit,然åŽçª—壿‰ä¼šæ˜¾ç¤ºã€‚ + /// + /// 如果你需è¦çª—壿˜¾ç¤ºæ—¶æ’­æ”¾åŠ¨ç”»æ•ˆæžœï¼Œé‚£ä¹ˆè¦†ç›–doShowAnimation编写你的动画代ç ï¼Œå¹¶ä¸”在动画结æŸåŽè°ƒç”¨onShown。覆盖onShown编写其他需è¦åœ¨çª—壿˜¾ç¤ºæ—¶å¤„ç†çš„业务逻辑。 + /// 如果你需è¦çª—å£éšè—时播放动画效果,那么覆盖doHideAnimation编写你的动画代ç ï¼Œå¹¶ä¸”åœ¨åŠ¨ç”»ç»“æŸæ—¶è°ƒç”¨Window.hideImmediately(注æ„䏿˜¯ç›´æŽ¥è°ƒç”¨onHideï¼ï¼‰ã€‚覆盖onHide编写其他需è¦åœ¨çª—å£éšè—时处ç†çš„业务逻辑。 + /// + public class Window : GComponent + { + /// + /// + /// + public bool bringToFontOnClick; + + GComponent _frame; + GComponent _contentPane; + GObject _modalWaitPane; + GObject _closeButton; + GObject _dragArea; + GObject _contentArea; + bool _modal; + + List _uiSources; + bool _inited; + bool _loading; + + protected int _requestingCmd; + +#if FAIRYGUI_PUERTS + public Action __onInit; + public Action __onShown; + public Action __onHide; + public Action __doShowAnimation; + public Action __doHideAnimation; +#endif + + public Window() + : base() + { + _uiSources = new List(); + this.tabStopChildren = true; + bringToFontOnClick = UIConfig.bringWindowToFrontOnClick; + + displayObject.onAddedToStage.Add(__addedToStage); + displayObject.onRemovedFromStage.Add(__removeFromStage); + displayObject.onTouchBegin.AddCapture(__touchBegin); + + this.gameObjectName = "Window"; + SetHome(GRoot.inst); + } + + /// + /// Set a UISource to this window. It must call before the window is shown. When the window is first time to show, + /// UISource.Load is called. Only after all UISource is loaded, the window will continue to init. + /// ä¸ºçª—å£æ·»åŠ ä¸€ä¸ªæºã€‚这个方法建议在构造函数调用。当窗å£ç¬¬ä¸€æ¬¡æ˜¾ç¤ºå‰ï¼ŒUISourceçš„Load方法将被调用,然åŽåªæœ‰æ‰€æœ‰çš„UISource + /// 都readyåŽï¼Œçª—壿‰ä¼šç»§ç»­åˆå§‹åŒ–和显示。 + /// + /// + public void AddUISource(IUISource source) + { + _uiSources.Add(source); + } + + /// + /// + /// + public GComponent contentPane + { + set + { + if (_contentPane != value) + { + if (_contentPane != null) + RemoveChild(_contentPane); + _contentPane = value; + if (_contentPane != null) + { + this.gameObjectName = "Window - " + _contentPane.gameObjectName; + _contentPane.gameObjectName = "ContentPane"; + + AddChild(_contentPane); + this.SetSize(_contentPane.width, _contentPane.height); + _contentPane.AddRelation(this, RelationType.Size); + _contentPane.fairyBatching = true; + _frame = _contentPane.GetChild("frame") as GComponent; + if (_frame != null) + { + this.closeButton = _frame.GetChild("closeButton"); + this.dragArea = _frame.GetChild("dragArea"); + this.contentArea = _frame.GetChild("contentArea"); + } + } + else + { + _frame = null; + this.gameObjectName = "Window"; + } + } + } + get + { + return _contentPane; + } + } + + /// + /// + /// + public GComponent frame + { + get { return _frame; } + } + + /// + /// + /// + public GObject closeButton + { + get { return _closeButton; } + set + { + if (_closeButton != null) + _closeButton.onClick.Remove(closeEventHandler); + _closeButton = value; + if (_closeButton != null) + _closeButton.onClick.Add(closeEventHandler); + } + } + + /// + /// + /// + public GObject dragArea + { + get { return _dragArea; } + set + { + if (_dragArea != value) + { + if (_dragArea != null) + { + _dragArea.draggable = false; + _dragArea.onDragStart.Remove(__dragStart); + } + + _dragArea = value; + if (_dragArea != null) + { + GGraph graph = _dragArea as GGraph; + if (graph != null && graph.shape.isEmpty) + graph.DrawRect(_dragArea.width, _dragArea.height, 0, Color.clear, Color.clear); + _dragArea.draggable = true; + _dragArea.onDragStart.Add(__dragStart); + } + } + } + } + + /// + /// + /// + public GObject contentArea + { + get { return _contentArea; } + set { _contentArea = value; } + } + + /// + /// + /// + public GObject modalWaitingPane + { + get { return _modalWaitPane; } + } + + /// + /// + /// + public void Show() + { + GRoot.inst.ShowWindow(this); + } + + /// + /// + /// + /// + public void ShowOn(GRoot r) + { + r.ShowWindow(this); + } + + /// + /// + /// + public void Hide() + { + if (this.isShowing) + DoHideAnimation(); + } + + /// + /// Hide window immediately, no OnHide will be called. + /// + public void HideImmediately() + { + this.root.HideWindowImmediately(this); + } + + /// + /// Make the window be center of the screen. + /// + /// + /// Add relations to ensure keeping center on screen size changed. + public void CenterOn(GRoot r, bool restraint) + { + this.SetXY((int)((r.width - this.width) / 2), (int)((r.height - this.height) / 2)); + if (restraint) + { + this.AddRelation(r, RelationType.Center_Center); + this.AddRelation(r, RelationType.Middle_Middle); + } + } + + /// + /// Switch show and hide status. + /// + public void ToggleStatus() + { + if (isTop) + Hide(); + else + Show(); + } + + /// + /// + /// + public bool isShowing + { + get { return parent != null; } + } + + /// + /// + /// + public bool isTop + { + get { return parent != null && parent.GetChildIndex(this) == parent.numChildren - 1; } + } + + /// + /// + /// + public bool modal + { + get { return _modal; } + set { _modal = value; } + } + + /// + /// + /// + public void BringToFront() + { + this.root.BringToFront(this); + } + + /// + /// + /// + public void ShowModalWait() + { + ShowModalWait(0); + } + + /// + /// Display a modal waiting sign in the front. + /// 显示一个等待标志在最å‰é¢ã€‚等待标志的资æºå¯ä»¥é€šè¿‡UIConfig.windowModalWaiting。等待标志组件会设置为å±å¹•大å°ï¼Œè¯·å†…部åšå¥½å…³è”。 + /// 还å¯ä»¥è®¾å®šä¸€ä¸ªrequestingCmd作为等待的命令字,在CloseModalWait里传入相åŒçš„命令字ModalWait将结æŸï¼Œå¦åˆ™CloseModalWait无效。 + /// + /// + public void ShowModalWait(int requestingCmd) + { + if (requestingCmd != 0) + _requestingCmd = requestingCmd; + + if (UIConfig.windowModalWaiting != null) + { + if (_modalWaitPane == null) + { + _modalWaitPane = UIPackage.CreateObjectFromURL(UIConfig.windowModalWaiting); + _modalWaitPane.SetHome(this); + } + + LayoutModalWaitPane(); + + AddChild(_modalWaitPane); + } + } + + virtual protected void LayoutModalWaitPane() + { + if (_contentArea != null) + { + Vector2 pt = _frame.LocalToGlobal(Vector2.zero); + pt = this.GlobalToLocal(pt); + _modalWaitPane.SetXY((int)pt.x + _contentArea.x, (int)pt.y + _contentArea.y); + _modalWaitPane.SetSize(_contentArea.width, _contentArea.height); + } + else + _modalWaitPane.SetSize(this.width, this.height); + } + + /// + /// + /// + /// + public bool CloseModalWait() + { + return CloseModalWait(0); + } + + /// + /// Close modal waiting. If rquestingCmd is equal to the value you transfer in ShowModalWait, mowal wait will be closed. + /// Otherwise, this function has no effect. + /// 关闭模å¼ç­‰å¾…。如果requestingCmdå’ŒShowModalWait传入的ä¸ç›¸åŒï¼Œåˆ™è¿™ä¸ªå‡½æ•°æ²¡æœ‰ä»»ä½•动作,立å³è¿”回。 + /// + /// + /// + public bool CloseModalWait(int requestingCmd) + { + if (requestingCmd != 0) + { + if (_requestingCmd != requestingCmd) + return false; + } + _requestingCmd = 0; + + if (_modalWaitPane != null && _modalWaitPane.parent != null) + RemoveChild(_modalWaitPane); + + return true; + } + + /// + /// + /// + public bool modalWaiting + { + get { return (_modalWaitPane != null) && _modalWaitPane.inContainer; } + } + + /// + /// + /// + public void Init() + { + if (_inited || _loading) + return; + + if (_uiSources.Count > 0) + { + _loading = false; + int cnt = _uiSources.Count; + for (int i = 0; i < cnt; i++) + { + IUISource lib = _uiSources[i]; + if (!lib.loaded) + { + lib.Load(__uiLoadComplete); + _loading = true; + } + } + + if (!_loading) + _init(); + } + else + _init(); + } + + /// + /// + /// + virtual protected void OnInit() + { +#if FAIRYGUI_TOLUA + CallLua("OnInit"); +#endif +#if FAIRYGUI_PUERTS + if (__onInit != null) + __onInit(); +#endif + } + + /// + /// + /// + virtual protected void OnShown() + { +#if FAIRYGUI_TOLUA + CallLua("OnShown"); +#endif +#if FAIRYGUI_PUERTS + if (__onShown != null) + __onShown(); +#endif + } + + /// + /// + /// + virtual protected void OnHide() + { +#if FAIRYGUI_TOLUA + CallLua("OnHide"); +#endif +#if FAIRYGUI_PUERTS + if (__onHide != null) + __onHide(); +#endif + } + + /// + /// + /// + virtual protected void DoShowAnimation() + { +#if FAIRYGUI_TOLUA + if (!CallLua("DoShowAnimation")) + OnShown(); +#elif FAIRYGUI_PUERTS + if (__doShowAnimation != null) + __doShowAnimation(); + else + OnShown(); +#else + OnShown(); +#endif + } + + /// + /// + /// + virtual protected void DoHideAnimation() + { +#if FAIRYGUI_TOLUA + if (!CallLua("DoHideAnimation")) + HideImmediately(); +#elif FAIRYGUI_PUERTS + if (__doHideAnimation != null) + __doHideAnimation(); + else + HideImmediately(); +#else + HideImmediately(); +#endif + } + + void __uiLoadComplete() + { + int cnt = _uiSources.Count; + for (int i = 0; i < cnt; i++) + { + IUISource lib = _uiSources[i]; + if (!lib.loaded) + return; + } + + _loading = false; + _init(); + } + + void _init() + { + _inited = true; + OnInit(); + + if (this.isShowing) + DoShowAnimation(); + } + + override public void Dispose() + { + if (_modalWaitPane != null && _modalWaitPane.parent == null) + _modalWaitPane.Dispose(); + + + //正在加载资æºçš„异步过程中å‘生æ„外关闭 åº”è¯¥å–æ¶ˆæ­£åœ¨åŠ è½½çš„load + if (_loading) + { + for (int i = 0; i < _uiSources.Count; ++i) + { + _uiSources[i].Cancel(); + } + } + + +#if FAIRYGUI_PUERTS + __onInit = null; + __onShown = null; + __onHide = null; + __doShowAnimation = null; + __doHideAnimation = null; +#endif + + base.Dispose(); + } + + virtual protected void closeEventHandler(EventContext context) + { + Hide(); + } + + void __addedToStage() + { + if (!_inited) + Init(); + else + DoShowAnimation(); + } + + void __removeFromStage() + { + CloseModalWait(); + OnHide(); + } + + private void __touchBegin(EventContext context) + { + if (this.isShowing && bringToFontOnClick) + { + BringToFront(); + } + } + + private void __dragStart(EventContext context) + { + context.PreventDefault(); + + this.StartDrag((int)context.data); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs.meta new file mode 100644 index 00000000..3ee82af1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/UI/Window.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c454632cb96595b4cbeeee678a5d9f0b +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils.meta new file mode 100644 index 00000000..90dbe8d0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d78e1a4b8ac1336498bfbbe945d16276 +folderAsset: yes +timeCreated: 1460480287 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs new file mode 100644 index 00000000..878be226 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs @@ -0,0 +1,455 @@ +using System; +using System.Text; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class ByteBuffer + { + /// + /// + /// + public bool littleEndian; + + /// + /// + /// + public string[] stringTable; + + /// + /// + /// + public int version; + + int _pointer; + int _offset; + int _length; + byte[] _data; + + static byte[] temp = new byte[8]; + + /// + /// + /// + /// + /// + /// + public ByteBuffer(byte[] data, int offset = 0, int length = -1) + { + _data = data; + _pointer = 0; + _offset = offset; + if (length < 0) + _length = data.Length - offset; + else + _length = length; + littleEndian = false; + } + + /// + /// + /// + public int position + { + get { return _pointer; } + set { _pointer = value; } + } + + /// + /// + /// + public int length + { + get { return _length; } + } + + /// + /// + /// + public bool bytesAvailable + { + get { return _pointer < _length; } + } + + /// + /// + /// + public byte[] buffer + { + get { return _data; } + set + { + _data = value; + _pointer = 0; + _offset = 0; + _length = _data.Length; + } + } + + /// + /// + /// + /// + /// + public int Skip(int count) + { + _pointer += count; + return _pointer; + } + + /// + /// + /// + /// + public byte ReadByte() + { + return _data[_offset + _pointer++]; + } + + /// + /// + /// + /// + /// + /// + /// + public byte[] ReadBytes(byte[] output, int destIndex, int count) + { + if (count > _length - _pointer) + throw new ArgumentOutOfRangeException(); + + Array.Copy(_data, _offset + _pointer, output, destIndex, count); + _pointer += count; + return output; + } + + /// + /// + /// + /// + /// + public byte[] ReadBytes(int count) + { + if (count > _length - _pointer) + throw new ArgumentOutOfRangeException(); + + byte[] result = new byte[count]; + Array.Copy(_data, _offset + _pointer, result, 0, count); + _pointer += count; + return result; + } + + /// + /// + /// + /// + public ByteBuffer ReadBuffer() + { + int count = ReadInt(); + ByteBuffer ba = new ByteBuffer(_data, _pointer, count); + ba.stringTable = stringTable; + ba.version = version; + _pointer += count; + return ba; + } + + /// + /// + /// + /// + public char ReadChar() + { + return (char)ReadShort(); + } + + /// + /// + /// + /// + public bool ReadBool() + { + bool result = _data[_offset + _pointer] == 1; + _pointer++; + return result; + } + + /// + /// + /// + /// + public short ReadShort() + { + int startIndex = _offset + _pointer; + _pointer += 2; + if (littleEndian) + return (short)(_data[startIndex] | (_data[startIndex + 1] << 8)); + else + return (short)((_data[startIndex] << 8) | _data[startIndex + 1]); + } + + /// + /// + /// + /// + public ushort ReadUshort() + { + return (ushort)ReadShort(); + } + + /// + /// + /// + /// + public int ReadInt() + { + int startIndex = _offset + _pointer; + _pointer += 4; + if (littleEndian) + return (_data[startIndex]) | (_data[startIndex + 1] << 8) | (_data[startIndex + 2] << 16) | (_data[startIndex + 3] << 24); + else + return (_data[startIndex] << 24) | (_data[startIndex + 1] << 16) | (_data[startIndex + 2] << 8) | (_data[startIndex + 3]); + } + + /// + /// + /// + /// + public uint ReadUint() + { + return (uint)ReadInt(); + } + + /// + /// + /// + /// + public float ReadFloat() + { + int startIndex = _offset + _pointer; + _pointer += 4; + if (littleEndian == BitConverter.IsLittleEndian) + return BitConverter.ToSingle(_data, startIndex); + else + { + temp[3] = _data[startIndex]; + temp[2] = _data[startIndex + 1]; + temp[1] = _data[startIndex + 2]; + temp[0] = _data[startIndex + 3]; + return BitConverter.ToSingle(temp, 0); + } + } + + /// + /// + /// + /// + public long ReadLong() + { + int startIndex = _offset + _pointer; + _pointer += 8; + if (littleEndian) + { + int i1 = (_data[startIndex]) | (_data[startIndex + 1] << 8) | (_data[startIndex + 2] << 16) | (_data[startIndex + 3] << 24); + int i2 = (_data[startIndex + 4]) | (_data[startIndex + 5] << 8) | (_data[startIndex + 6] << 16) | (_data[startIndex + 7] << 24); + return (uint)i1 | ((long)i2 << 32); + } + else + { + int i1 = (_data[startIndex] << 24) | (_data[startIndex + 1] << 16) | (_data[startIndex + 2] << 8) | (_data[startIndex + 3]); + int i2 = (_data[startIndex + 4] << 24) | (_data[startIndex + 5] << 16) | (_data[startIndex + 6] << 8) | (_data[startIndex + 7]); + return (uint)i2 | ((long)i1 << 32); + } + } + + /// + /// + /// + /// + public double ReadDouble() + { + int startIndex = _offset + _pointer; + _pointer += 8; + if (littleEndian == BitConverter.IsLittleEndian) + return BitConverter.ToDouble(_data, startIndex); + else + { + temp[7] = _data[startIndex]; + temp[6] = _data[startIndex + 1]; + temp[5] = _data[startIndex + 2]; + temp[4] = _data[startIndex + 3]; + temp[3] = _data[startIndex + 4]; + temp[2] = _data[startIndex + 5]; + temp[1] = _data[startIndex + 6]; + temp[0] = _data[startIndex + 7]; + return BitConverter.ToSingle(temp, 0); + } + } + + /// + /// + /// + /// + public string ReadString() + { + ushort len = ReadUshort(); + string result = Encoding.UTF8.GetString(_data, _offset + _pointer, len); + _pointer += len; + return result; + } + + /// + /// + /// + /// + /// + public string ReadString(int len) + { + string result = Encoding.UTF8.GetString(_data, _offset + _pointer, len); + _pointer += len; + return result; + } + + /// + /// + /// + /// + public string ReadS() + { + int index = ReadUshort(); + if (index == 65534) //null + return null; + else if (index == 65533) + return string.Empty; + else + return stringTable[index]; + } + + /// + /// + /// + /// + /// + public string[] ReadSArray(int cnt) + { + string[] ret = new string[cnt]; + for (int i = 0; i < cnt; i++) + ret[i] = ReadS(); + + return ret; + } + + private static List helperPoints = new List(); + + /// + /// + /// + /// + public List ReadPath() + { + helperPoints.Clear(); + + int len = ReadInt(); + if (len == 0) + return helperPoints; + + for (int i = 0; i < len; i++) + { + GPathPoint.CurveType curveType = (GPathPoint.CurveType)ReadByte(); + switch (curveType) + { + case GPathPoint.CurveType.Bezier: + helperPoints.Add(new GPathPoint(new Vector3(ReadFloat(), ReadFloat(), 0), + new Vector3(ReadFloat(), ReadFloat(), 0))); + break; + + case GPathPoint.CurveType.CubicBezier: + helperPoints.Add(new GPathPoint(new Vector3(ReadFloat(), ReadFloat(), 0), + new Vector3(ReadFloat(), ReadFloat(), 0), + new Vector3(ReadFloat(), ReadFloat(), 0))); + break; + + default: + helperPoints.Add(new GPathPoint(new Vector3(ReadFloat(), ReadFloat(), 0), curveType)); + break; + } + } + + return helperPoints; + } + + /// + /// + /// + /// + public void WriteS(string value) + { + int index = ReadUshort(); + if (index != 65534 && index != 65533) + stringTable[index] = value; + } + + /// + /// + /// + /// + public Color ReadColor() + { + int startIndex = _offset + _pointer; + byte r = _data[startIndex]; + byte g = _data[startIndex + 1]; + byte b = _data[startIndex + 2]; + byte a = _data[startIndex + 3]; + _pointer += 4; + + return new Color32(r, g, b, a); + } + + /// + /// + /// + /// + /// + /// + public bool Seek(int indexTablePos, int blockIndex) + { + int tmp = _pointer; + _pointer = indexTablePos; + int segCount = _data[_offset + _pointer++]; + if (blockIndex < segCount) + { + bool useShort = _data[_offset + _pointer++] == 1; + int newPos; + if (useShort) + { + _pointer += 2 * blockIndex; + newPos = ReadShort(); + } + else + { + _pointer += 4 * blockIndex; + newPos = ReadInt(); + } + + if (newPos > 0) + { + _pointer = indexTablePos + newPos; + return true; + } + else + { + _pointer = tmp; + return false; + } + } + else + { + _pointer = tmp; + return false; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs.meta new file mode 100644 index 00000000..89768f0d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ByteBuffer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f72828fa75e491f4d95f92a46b01956a +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html.meta new file mode 100644 index 00000000..c44c4555 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: da6063debdf749748bac0a0029b709e5 +folderAsset: yes +timeCreated: 1461773298 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs new file mode 100644 index 00000000..ab9a3292 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlButton : IHtmlObject + { + public GComponent button { get; private set; } + + public const string CLICK_EVENT = "OnHtmlButtonClick"; + + public static string resource; + + RichTextField _owner; + HtmlElement _element; + EventCallback1 _clickHandler; + + public HtmlButton() + { + if (resource != null) + { + button = UIPackage.CreateObjectFromURL(resource).asCom; + _clickHandler = (EventContext context) => + { + _owner.DispatchEvent(CLICK_EVENT, context.data, this); + }; + } + else + Debug.LogWarning("FairyGUI: Set HtmlButton.resource first"); + } + + public DisplayObject displayObject + { + get { return button != null ? button.displayObject : null; } + } + + public HtmlElement element + { + get { return _element; } + } + + public float width + { + get { return button != null ? button.width : 0; } + } + + public float height + { + get { return button != null ? button.height : 0; } + } + + public void Create(RichTextField owner, HtmlElement element) + { + _owner = owner; + _element = element; + + if (button == null) + return; + + button.onClick.Add(_clickHandler); + int width = element.GetInt("width", button.sourceWidth); + int height = element.GetInt("height", button.sourceHeight); + button.SetSize(width, height); + button.text = element.GetString("value"); + } + + public void SetPosition(float x, float y) + { + if (button != null) + button.SetXY(x, y); + } + + public void Add() + { + if (button != null) + _owner.AddChild(button.displayObject); + } + + public void Remove() + { + if (button != null && button.displayObject.parent != null) + _owner.RemoveChild(button.displayObject); + } + + public void Release() + { + if (button != null) + button.RemoveEventListeners(); + + _owner = null; + _element = null; + } + + public void Dispose() + { + if (button != null) + button.Dispose(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs.meta new file mode 100644 index 00000000..81507015 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlButton.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 268c2d7ad77b66449b4e0e39a6d0ca15 +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs new file mode 100644 index 00000000..4ec38ff1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs @@ -0,0 +1,207 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public enum HtmlElementType + { + Text, + Link, + Image, + Input, + Select, + Object, + + //internal + LinkEnd, + } + + /// + /// + /// + public class HtmlElement + { + public HtmlElementType type; + public string name; + public string text; + public TextFormat format; + public int charIndex; + + public IHtmlObject htmlObject; + public int status; //1 hidden 2 clipped 4 added + public int space; + public Vector2 position; + + Hashtable attributes; + + public HtmlElement() + { + format = new TextFormat(); + } + + public object Get(string attrName) + { + if (attributes == null) + return null; + + return attributes[attrName]; + } + + public void Set(string attrName, object attrValue) + { + if (attributes == null) + attributes = new Hashtable(); + + attributes[attrName] = attrValue; + } + + public string GetString(string attrName) + { + return GetString(attrName, null); + } + + public string GetString(string attrName, string defValue) + { + if (attributes == null) + return defValue; + + object ret = attributes[attrName]; + if (ret != null) + return ret.ToString(); + else + return defValue; + } + + public int GetInt(string attrName) + { + return GetInt(attrName, 0); + } + + public int GetInt(string attrName, int defValue) + { + string value = GetString(attrName); + if (value == null || value.Length == 0) + return defValue; + + if (value[value.Length - 1] == '%') + { + int ret; + if (int.TryParse(value.Substring(0, value.Length - 1), out ret)) + return Mathf.CeilToInt(ret / 100.0f * defValue); + else + return defValue; + } + else + { + int ret; + if (int.TryParse(value, out ret)) + return ret; + else + return defValue; + } + } + + public float GetFloat(string attrName) + { + return GetFloat(attrName, 0); + } + + public float GetFloat(string attrName, float defValue) + { + string value = GetString(attrName); + if (value == null || value.Length == 0) + return defValue; + + float ret; + if (float.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public bool GetBool(string attrName) + { + return GetBool(attrName, false); + } + + public bool GetBool(string attrName, bool defValue) + { + string value = GetString(attrName); + if (value == null || value.Length == 0) + return defValue; + + bool ret; + if (bool.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public Color GetColor(string attrName, Color defValue) + { + string value = GetString(attrName); + if (value == null || value.Length == 0) + return defValue; + + return ToolSet.ConvertFromHtmlColor(value); + } + + public void FetchAttributes() + { + attributes = XMLIterator.GetAttributes(attributes); + } + + + public bool isEntity + { + get { return type == HtmlElementType.Image || type == HtmlElementType.Select || type == HtmlElementType.Input || type == HtmlElementType.Object; } + } + + #region Pool Support + + static Stack elementPool = new Stack(); + + public static HtmlElement GetElement(HtmlElementType type) + { + HtmlElement ret; + if (elementPool.Count > 0) + ret = elementPool.Pop(); + else + ret = new HtmlElement(); + ret.type = type; + + if (type != HtmlElementType.Text && ret.attributes == null) + ret.attributes = new Hashtable(); + + return ret; + } + + public static void ReturnElement(HtmlElement element) + { + element.name = null; + element.text = null; + element.htmlObject = null; + element.status = 0; + if (element.attributes != null) + element.attributes.Clear(); + elementPool.Push(element); + } + + public static void ReturnElements(List elements) + { + int count = elements.Count; + for (int i = 0; i < count; i++) + { + HtmlElement element = elements[i]; + ReturnElement(element); + } + elements.Clear(); + } + + #endregion + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs.meta new file mode 100644 index 00000000..57e911e6 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlElement.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7d92c6025bf750145af0e456a7fd3f33 +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs new file mode 100644 index 00000000..1882480f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlImage : IHtmlObject + { + public GLoader loader { get; private set; } + + RichTextField _owner; + HtmlElement _element; + bool _externalTexture; + + public HtmlImage() + { + loader = (GLoader)UIObjectFactory.NewObject(ObjectType.Loader); + loader.gameObjectName = "HtmlImage"; + loader.fill = FillType.ScaleFree; + loader.touchable = false; + } + + public DisplayObject displayObject + { + get { return loader.displayObject; } + } + + public HtmlElement element + { + get { return _element; } + } + + public float width + { + get { return loader.width; } + } + + public float height + { + get { return loader.height; } + } + + public void Create(RichTextField owner, HtmlElement element) + { + _owner = owner; + _element = element; + + int sourceWidth = 0; + int sourceHeight = 0; + NTexture texture = owner.htmlPageContext.GetImageTexture(this); + if (texture != null) + { + sourceWidth = texture.width; + sourceHeight = texture.height; + + loader.texture = texture; + _externalTexture = true; + } + else + { + string src = element.GetString("src"); + if (src != null) + { + PackageItem pi = UIPackage.GetItemByURL(src); + if (pi != null) + { + sourceWidth = pi.width; + sourceHeight = pi.height; + } + } + + loader.url = src; + _externalTexture = false; + } + + int width = element.GetInt("width", sourceWidth); + int height = element.GetInt("height", sourceHeight); + + if (width == 0) + width = 5; + if (height == 0) + height = 10; + loader.SetSize(width, height); + } + + public void SetPosition(float x, float y) + { + loader.SetXY(x, y); + } + + public void Add() + { + _owner.AddChild(loader.displayObject); + } + + public void Remove() + { + if (loader.displayObject.parent != null) + _owner.RemoveChild(loader.displayObject); + } + + public void Release() + { + loader.RemoveEventListeners(); + if (_externalTexture) + { + _owner.htmlPageContext.FreeImageTexture(this, loader.texture); + _externalTexture = false; + } + + loader.url = null; + _owner = null; + _element = null; + } + + public void Dispose() + { + if (_externalTexture) + _owner.htmlPageContext.FreeImageTexture(this, loader.texture); + loader.Dispose(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs.meta new file mode 100644 index 00000000..4b71c8ef --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlImage.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 81871e13cb458ab4da28358d5634e082 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs new file mode 100644 index 00000000..dcd6b784 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs @@ -0,0 +1,117 @@ +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlInput : IHtmlObject + { + public GTextInput textInput { get; private set; } + + RichTextField _owner; + HtmlElement _element; + bool _hidden; + + public static int defaultBorderSize = 2; + public static Color defaultBorderColor = ToolSet.ColorFromRGB(0xA9A9A9); + public static Color defaultBackgroundColor = Color.clear; + + public HtmlInput() + { + textInput = (GTextInput)UIObjectFactory.NewObject(ObjectType.InputText); + textInput.gameObjectName = "HtmlInput"; + textInput.verticalAlign = VertAlignType.Middle; + } + + public DisplayObject displayObject + { + get { return textInput.displayObject; } + } + + public HtmlElement element + { + get { return _element; } + } + + public float width + { + get { return _hidden ? 0 : textInput.width; } + } + + public float height + { + get { return _hidden ? 0 : textInput.height; } + } + + public void Create(RichTextField owner, HtmlElement element) + { + _owner = owner; + _element = element; + + string type = element.GetString("type"); + if (type != null) + type = type.ToLower(); + + _hidden = type == "hidden"; + if (!_hidden) + { + int width = element.GetInt("width", 0); + int height = element.GetInt("height", 0); + int borderSize = element.GetInt("border", defaultBorderSize); + Color borderColor = element.GetColor("border-color", defaultBorderColor); + Color backgroundColor = element.GetColor("background-color", defaultBackgroundColor); + + if (width == 0) + { + width = element.space; + if (width > _owner.width / 2 || width < 100) + width = (int)_owner.width / 2; + } + if (height == 0) + height = element.format.size + 10; + + textInput.textFormat = element.format; + textInput.displayAsPassword = type == "password"; + textInput.maxLength = element.GetInt("maxlength", int.MaxValue); + textInput.border = borderSize; + textInput.borderColor = borderColor; + textInput.backgroundColor = backgroundColor; + textInput.SetSize(width, height); + } + textInput.text = element.GetString("value"); + } + + public void SetPosition(float x, float y) + { + if (!_hidden) + textInput.SetXY(x, y); + } + + public void Add() + { + if (!_hidden) + _owner.AddChild(textInput.displayObject); + } + + public void Remove() + { + if (!_hidden && textInput.displayObject.parent != null) + _owner.RemoveChild(textInput.displayObject); + } + + public void Release() + { + textInput.RemoveEventListeners(); + textInput.text = null; + + _owner = null; + _element = null; + } + + public void Dispose() + { + textInput.Dispose(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs.meta new file mode 100644 index 00000000..e449ea64 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlInput.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e1c8ffa51408aef45839b1d00198b819 +timeCreated: 1535374215 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs new file mode 100644 index 00000000..6875fab5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs @@ -0,0 +1,113 @@ + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlLink : IHtmlObject + { + RichTextField _owner; + HtmlElement _element; + SelectionShape _shape; + + EventCallback1 _clickHandler; + EventCallback1 _rolloverHandler; + EventCallback0 _rolloutHandler; + + public HtmlLink() + { + _shape = new SelectionShape(); + _shape.gameObject.name = "HtmlLink"; + _shape.cursor = "text-link"; + + _clickHandler = (EventContext context) => + { + _owner.BubbleEvent("onClickLink", _element.GetString("href")); + }; + _rolloverHandler = (EventContext context) => + { + if (_owner.htmlParseOptions.linkHoverBgColor.a > 0) + _shape.color = _owner.htmlParseOptions.linkHoverBgColor; + }; + _rolloutHandler = () => + { + if (_owner.htmlParseOptions.linkHoverBgColor.a > 0) + _shape.color = _owner.htmlParseOptions.linkBgColor; + }; + } + + public DisplayObject displayObject + { + get { return _shape; } + } + + public HtmlElement element + { + get { return _element; } + } + + public float width + { + get { return 0; } + } + + public float height + { + get { return 0; } + } + + public void Create(RichTextField owner, HtmlElement element) + { + _owner = owner; + _element = element; + _shape.onClick.Add(_clickHandler); + _shape.onRollOver.Add(_rolloverHandler); + _shape.onRollOut.Add(_rolloutHandler); + _shape.color = _owner.htmlParseOptions.linkBgColor; + } + + public void SetArea(int startLine, float startCharX, int endLine, float endCharX) + { + if (startLine == endLine && startCharX > endCharX) + { + float tmp = startCharX; + startCharX = endCharX; + endCharX = tmp; + } + _shape.rects.Clear(); + _owner.textField.GetLinesShape(startLine, startCharX, endLine, endCharX, true, _shape.rects); + _shape.Refresh(); + } + + public void SetPosition(float x, float y) + { + _shape.SetXY(x, y); + } + + public void Add() + { + //add below _shape + _owner.AddChildAt(_shape, 0); + } + + public void Remove() + { + if (_shape.parent != null) + _owner.RemoveChild(_shape); + } + + public void Release() + { + _shape.RemoveEventListeners(); + + _owner = null; + _element = null; + } + + public void Dispose() + { + _shape.Dispose(); + _shape = null; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs.meta new file mode 100644 index 00000000..695f08d0 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlLink.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b2132a66ecae9cc4c99c6fbe37051723 +timeCreated: 1470116309 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs new file mode 100644 index 00000000..483fa4c2 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs @@ -0,0 +1,150 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlPageContext : IHtmlPageContext + { + Stack _imagePool; + Stack _inputPool; + Stack _buttonPool; + Stack _selectPool; + Stack _linkPool; + + public static HtmlPageContext inst = new HtmlPageContext(); + + static Transform _poolManager; + + public HtmlPageContext() + { + _imagePool = new Stack(); + _inputPool = new Stack(); + _buttonPool = new Stack(); + _selectPool = new Stack(); + _linkPool = new Stack(); + + if (Application.isPlaying && _poolManager == null) + _poolManager = Stage.inst.CreatePoolManager("HtmlObjectPool"); + } + + virtual public IHtmlObject CreateObject(RichTextField owner, HtmlElement element) + { + IHtmlObject ret = null; + bool fromPool = false; + if (element.type == HtmlElementType.Image) + { + if (_imagePool.Count > 0 && _poolManager != null) + { + ret = _imagePool.Pop(); + fromPool = true; + } + else + ret = new HtmlImage(); + } + else if (element.type == HtmlElementType.Link) + { + if (_linkPool.Count > 0 && _poolManager != null) + { + ret = _linkPool.Pop(); + fromPool = true; + } + else + ret = new HtmlLink(); + } + else if (element.type == HtmlElementType.Input) + { + string type = element.GetString("type"); + if (type != null) + type = type.ToLower(); + if (type == "button" || type == "submit") + { + if (_buttonPool.Count > 0 && _poolManager != null) + { + ret = _buttonPool.Pop(); + fromPool = true; + } + else + ret = new HtmlButton(); + } + else + { + if (_inputPool.Count > 0 && _poolManager != null) + { + ret = _inputPool.Pop(); + fromPool = true; + } + else + ret = new HtmlInput(); + } + } + else if (element.type == HtmlElementType.Select) + { + if (_selectPool.Count > 0 && _poolManager != null) + { + ret = _selectPool.Pop(); + fromPool = true; + } + else + ret = new HtmlSelect(); + } + + //Debug.Log("from=" + fromPool); + if (ret != null) + { + //å¯èƒ½å·²ç»è¢«GameObject tree deleted了,ä¸å†ä½¿ç”¨ + if (fromPool && ret.displayObject != null && ret.displayObject.isDisposed) + { + ret.Dispose(); + return CreateObject(owner, element); + + } + ret.Create(owner, element); + if (ret.displayObject != null) + ret.displayObject.home = owner.cachedTransform; + } + + return ret; + } + + virtual public void FreeObject(IHtmlObject obj) + { + if (_poolManager == null) + { + obj.Dispose(); + return; + } + + //å¯èƒ½å·²ç»è¢«GameObject tree deleted了,ä¸å†å›žæ”¶ + if (obj.displayObject != null && obj.displayObject.isDisposed) + { + obj.Dispose(); + return; + } + + obj.Release(); + if (obj is HtmlImage) + _imagePool.Push(obj); + else if (obj is HtmlInput) + _inputPool.Push(obj); + else if (obj is HtmlButton) + _buttonPool.Push(obj); + else if (obj is HtmlLink) + _linkPool.Push(obj); + + if (obj.displayObject != null) + obj.displayObject.cachedTransform.SetParent(_poolManager, false); + } + + virtual public NTexture GetImageTexture(HtmlImage image) + { + return null; + } + + virtual public void FreeImageTexture(HtmlImage image, NTexture texture) + { + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs.meta new file mode 100644 index 00000000..c8eb5caa --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlPageContext.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5454bca8f43f9094ea66614837a2c0be +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs new file mode 100644 index 00000000..3c378a33 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlParseOptions + { + /// + /// + /// + public bool linkUnderline; + + /// + /// + /// + public Color linkColor; + + /// + /// + /// + public Color linkBgColor; + + /// + /// + /// + public Color linkHoverBgColor; + + /// + /// + /// + public bool ignoreWhiteSpace; + + /// + /// + /// + public static bool DefaultLinkUnderline = true; + + /// + /// + /// + public static Color DefaultLinkColor = new Color32(0x3A, 0x67, 0xCC, 0xFF); + + /// + /// + /// + public static Color DefaultLinkBgColor = Color.clear; + + /// + /// + /// + public static Color DefaultLinkHoverBgColor = Color.clear; + + public HtmlParseOptions() + { + linkUnderline = DefaultLinkUnderline; + linkColor = DefaultLinkColor; + linkBgColor = DefaultLinkBgColor; + linkHoverBgColor = DefaultLinkHoverBgColor; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs.meta new file mode 100644 index 00000000..3ad7d320 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParseOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8e3e6e98345b46a43a4181a0790d4f30 +timeCreated: 1470231110 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs new file mode 100644 index 00000000..3a550130 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs @@ -0,0 +1,387 @@ +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlParser + { + public static HtmlParser inst = new HtmlParser(); + + protected class TextFormat2 : TextFormat + { + public bool colorChanged; + } + + protected List _textFormatStack; + protected int _textFormatStackTop; + protected TextFormat2 _format; + protected List _elements; + protected HtmlParseOptions _defaultOptions; + + static List sHelperList1 = new List(); + static List sHelperList2 = new List(); + + public HtmlParser() + { + _textFormatStack = new List(); + _format = new TextFormat2(); + _defaultOptions = new HtmlParseOptions(); + } + + virtual public void Parse(string aSource, TextFormat defaultFormat, List elements, HtmlParseOptions parseOptions) + { + if (parseOptions == null) + parseOptions = _defaultOptions; + + _elements = elements; + _textFormatStackTop = 0; + _format.CopyFrom(defaultFormat); + _format.colorChanged = false; + int skipText = 0; + bool ignoreWhiteSpace = parseOptions.ignoreWhiteSpace; + bool skipNextCR = false; + string text; + + XMLIterator.Begin(aSource, true); + while (XMLIterator.NextTag()) + { + if (skipText == 0) + { + text = XMLIterator.GetText(ignoreWhiteSpace); + if (text.Length > 0) + { + if (skipNextCR && text[0] == '\n') + text = text.Substring(1); + AppendText(text); + } + } + + skipNextCR = false; + switch (XMLIterator.tagName) + { + case "b": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.bold = true; + } + else + PopTextFormat(); + break; + + case "i": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.italic = true; + } + else + PopTextFormat(); + break; + + case "u": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.underline = true; + } + else + PopTextFormat(); + break; + + case "strike": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.strikethrough = true; + } + else + PopTextFormat(); + break; + + case "sub": + { + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.specialStyle = TextFormat.SpecialStyle.Subscript; + } + else + PopTextFormat(); + } + break; + + case "sup": + { + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + _format.specialStyle = TextFormat.SpecialStyle.Superscript; + } + else + PopTextFormat(); + } + break; + + case "font": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + + _format.size = XMLIterator.GetAttributeInt("size", _format.size); + string color = XMLIterator.GetAttribute("color"); + if (color != null) + { + string[] parts = color.Split(','); + if (parts.Length == 1) + { + _format.color = ToolSet.ConvertFromHtmlColor(color); + _format.gradientColor = null; + _format.colorChanged = true; + } + else + { + if (_format.gradientColor == null) + _format.gradientColor = new Color32[4]; + _format.gradientColor[0] = ToolSet.ConvertFromHtmlColor(parts[0]); + _format.gradientColor[1] = ToolSet.ConvertFromHtmlColor(parts[1]); + if (parts.Length > 2) + { + _format.gradientColor[2] = ToolSet.ConvertFromHtmlColor(parts[2]); + if (parts.Length > 3) + _format.gradientColor[3] = ToolSet.ConvertFromHtmlColor(parts[3]); + else + _format.gradientColor[3] = _format.gradientColor[2]; + } + else + { + _format.gradientColor[2] = _format.gradientColor[0]; + _format.gradientColor[3] = _format.gradientColor[1]; + } + } + } + } + else if (XMLIterator.tagType == XMLTagType.End) + PopTextFormat(); + break; + + case "br": + AppendText("\n"); + break; + + case "img": + if (XMLIterator.tagType == XMLTagType.Start || XMLIterator.tagType == XMLTagType.Void) + { + HtmlElement element = HtmlElement.GetElement(HtmlElementType.Image); + element.FetchAttributes(); + element.name = element.GetString("name"); + element.format.align = _format.align; + _elements.Add(element); + } + break; + + case "a": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + + _format.underline = _format.underline || parseOptions.linkUnderline; + if (!_format.colorChanged && parseOptions.linkColor.a != 0) + _format.color = parseOptions.linkColor; + + HtmlElement element = HtmlElement.GetElement(HtmlElementType.Link); + element.FetchAttributes(); + element.name = element.GetString("name"); + element.format.align = _format.align; + _elements.Add(element); + } + else if (XMLIterator.tagType == XMLTagType.End) + { + PopTextFormat(); + + HtmlElement element = HtmlElement.GetElement(HtmlElementType.LinkEnd); + _elements.Add(element); + } + break; + + case "input": + { + HtmlElement element = HtmlElement.GetElement(HtmlElementType.Input); + element.FetchAttributes(); + element.name = element.GetString("name"); + element.format.CopyFrom(_format); + _elements.Add(element); + } + break; + + case "select": + { + if (XMLIterator.tagType == XMLTagType.Start || XMLIterator.tagType == XMLTagType.Void) + { + HtmlElement element = HtmlElement.GetElement(HtmlElementType.Select); + element.FetchAttributes(); + if (XMLIterator.tagType == XMLTagType.Start) + { + sHelperList1.Clear(); + sHelperList2.Clear(); + while (XMLIterator.NextTag()) + { + if (XMLIterator.tagName == "select") + break; + + if (XMLIterator.tagName == "option") + { + if (XMLIterator.tagType == XMLTagType.Start || XMLIterator.tagType == XMLTagType.Void) + sHelperList2.Add(XMLIterator.GetAttribute("value", string.Empty)); + else + sHelperList1.Add(XMLIterator.GetText()); + } + } + element.Set("items", sHelperList1.ToArray()); + element.Set("values", sHelperList2.ToArray()); + } + element.name = element.GetString("name"); + element.format.CopyFrom(_format); + _elements.Add(element); + } + } + break; + + case "p": + if (XMLIterator.tagType == XMLTagType.Start) + { + PushTextFormat(); + string align = XMLIterator.GetAttribute("align"); + switch (align) + { + case "center": + _format.align = AlignType.Center; + break; + case "right": + _format.align = AlignType.Right; + break; + } + if (!IsNewLine()) + AppendText("\n"); + } + else if (XMLIterator.tagType == XMLTagType.End) + { + AppendText("\n"); + skipNextCR = true; + + PopTextFormat(); + } + break; + + case "ui": + case "div": + case "li": + if (XMLIterator.tagType == XMLTagType.Start) + { + if (!IsNewLine()) + AppendText("\n"); + } + else + { + AppendText("\n"); + skipNextCR = true; + } + break; + + case "html": + case "body": + //full html + ignoreWhiteSpace = true; + break; + + case "head": + case "style": + case "script": + case "form": + if (XMLIterator.tagType == XMLTagType.Start) + skipText++; + else if (XMLIterator.tagType == XMLTagType.End) + skipText--; + break; + } + } + + if (skipText == 0) + { + text = XMLIterator.GetText(ignoreWhiteSpace); + if (text.Length > 0) + { + if (skipNextCR && text[0] == '\n') + text = text.Substring(1); + AppendText(text); + } + } + + _elements = null; + } + + protected void PushTextFormat() + { + TextFormat2 tf; + if (_textFormatStack.Count <= _textFormatStackTop) + { + tf = new TextFormat2(); + _textFormatStack.Add(tf); + } + else + tf = _textFormatStack[_textFormatStackTop]; + tf.CopyFrom(_format); + tf.colorChanged = _format.colorChanged; + _textFormatStackTop++; + } + + protected void PopTextFormat() + { + if (_textFormatStackTop > 0) + { + TextFormat2 tf = _textFormatStack[_textFormatStackTop - 1]; + _format.CopyFrom(tf); + _format.colorChanged = tf.colorChanged; + _textFormatStackTop--; + } + } + + protected bool IsNewLine() + { + if (_elements.Count > 0) + { + HtmlElement element = _elements[_elements.Count - 1]; + if (element != null && element.type == HtmlElementType.Text) + return element.text.EndsWith("\n"); + else + return false; + } + + return true; + } + + protected void AppendText(string text) + { + HtmlElement element; + if (_elements.Count > 0) + { + element = _elements[_elements.Count - 1]; + if (element.type == HtmlElementType.Text && element.format.EqualStyle(_format)) + { + element.text += text; + return; + } + } + + element = HtmlElement.GetElement(HtmlElementType.Text); + element.text = text; + element.format.CopyFrom(_format); + _elements.Add(element); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs.meta new file mode 100644 index 00000000..f11e03bd --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlParser.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7ddf5eb218ff0cf438894e2ceb54f494 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs new file mode 100644 index 00000000..dcbcccb7 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class HtmlSelect : IHtmlObject + { + public GComboBox comboBox { get; private set; } + + public const string CHANGED_EVENT = "OnHtmlSelectChanged"; + + public static string resource; + + RichTextField _owner; + HtmlElement _element; + EventCallback0 _changeHandler; + + public HtmlSelect() + { + if (resource != null) + { + comboBox = UIPackage.CreateObjectFromURL(resource).asComboBox; + _changeHandler = () => + { + _owner.DispatchEvent(CHANGED_EVENT, null, this); + }; + } + else + Debug.LogWarning("FairyGUI: Set HtmlSelect.resource first"); + } + + public DisplayObject displayObject + { + get { return comboBox.displayObject; } + } + + public HtmlElement element + { + get { return _element; } + } + + public float width + { + get { return comboBox != null ? comboBox.width : 0; } + } + + public float height + { + get { return comboBox != null ? comboBox.height : 0; } + } + + public void Create(RichTextField owner, HtmlElement element) + { + _owner = owner; + _element = element; + + if (comboBox == null) + return; + + comboBox.onChanged.Add(_changeHandler); + + int width = element.GetInt("width", comboBox.sourceWidth); + int height = element.GetInt("height", comboBox.sourceHeight); + comboBox.SetSize(width, height); + comboBox.items = (string[])element.Get("items"); + comboBox.values = (string[])element.Get("values"); + comboBox.value = element.GetString("value"); + } + + public void SetPosition(float x, float y) + { + if (comboBox != null) + comboBox.SetXY(x, y); + } + + public void Add() + { + if (comboBox != null) + _owner.AddChild(comboBox.displayObject); + } + + public void Remove() + { + if (comboBox != null && comboBox.displayObject.parent != null) + _owner.RemoveChild(comboBox.displayObject); + } + + public void Release() + { + if (comboBox != null) + comboBox.RemoveEventListeners(); + + _owner = null; + _element = null; + } + + public void Dispose() + { + if (comboBox != null) + comboBox.Dispose(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs.meta new file mode 100644 index 00000000..5746580d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/HtmlSelect.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a9047de8f5e36634b9cb9d7270dfb1e8 +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs new file mode 100644 index 00000000..cfe2d9ab --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// Create->SetPosition->(Add<->Remove)->Release->Dispose + /// + public interface IHtmlObject + { + float width { get; } + float height { get; } + DisplayObject displayObject { get; } + HtmlElement element { get; } + + void Create(RichTextField owner, HtmlElement element); + void SetPosition(float x, float y); + void Add(); + void Remove(); + void Release(); + void Dispose(); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs.meta new file mode 100644 index 00000000..3aa44a07 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlObject.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d5a416822d3ee0a4d80e32f6a03ba56f +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs new file mode 100644 index 00000000..8073e751 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs @@ -0,0 +1,15 @@ + +namespace FairyGUI.Utils +{ + /// + /// + /// + public interface IHtmlPageContext + { + IHtmlObject CreateObject(RichTextField owner, HtmlElement element); + void FreeObject(IHtmlObject obj); + + NTexture GetImageTexture(HtmlImage image); + void FreeImageTexture(HtmlImage image, NTexture texture); + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs.meta new file mode 100644 index 00000000..fe9f6d07 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Html/IHtmlPageContext.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0f24771f8977b674aa4fbf86f45e2105 +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs new file mode 100644 index 00000000..f070f1bc --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs @@ -0,0 +1,274 @@ +using System.Collections.Generic; +using System.Collections; +using UnityEngine; + +namespace FairyGUI +{ + public delegate void TimerCallback(object param); + + /// + /// + /// + public class Timers + { + public static int repeat; + public static float time; + + public static bool catchCallbackExceptions = false; + + Dictionary _items; + Dictionary _toAdd; + List _toRemove; + List _pool; + + TimersEngine _engine; + GameObject gameObject; + + private static Timers _inst; + public static Timers inst + { + get + { + if (_inst == null) + _inst = new Timers(); + return _inst; + } + } + + public Timers() + { + _inst = this; + gameObject = new GameObject("[FairyGUI.Timers]"); + gameObject.hideFlags = HideFlags.HideInHierarchy; + gameObject.SetActive(true); + Object.DontDestroyOnLoad(gameObject); + + _engine = gameObject.AddComponent(); + + _items = new Dictionary(); + _toAdd = new Dictionary(); + _toRemove = new List(); + _pool = new List(100); + } + + public void Add(float interval, int repeat, TimerCallback callback) + { + Add(interval, repeat, callback, null); + } + + /** + * @interval in seconds + * @repeat 0 indicate loop infinitely, otherwise the run count + **/ + public void Add(float interval, int repeat, TimerCallback callback, object callbackParam) + { + if (callback == null) + { + Debug.LogWarning("timer callback is null, " + interval + "," + repeat); + return; + } + + Anymous_T t; + if (_items.TryGetValue(callback, out t)) + { + t.set(interval, repeat, callback, callbackParam); + t.elapsed = 0; + t.deleted = false; + return; + } + + if (_toAdd.TryGetValue(callback, out t)) + { + t.set(interval, repeat, callback, callbackParam); + return; + } + + t = GetFromPool(); + t.interval = interval; + t.repeat = repeat; + t.callback = callback; + t.param = callbackParam; + _toAdd[callback] = t; + } + + public void CallLater(TimerCallback callback) + { + Add(0.001f, 1, callback); + } + + public void CallLater(TimerCallback callback, object callbackParam) + { + Add(0.001f, 1, callback, callbackParam); + } + + public void AddUpdate(TimerCallback callback) + { + Add(0.001f, 0, callback); + } + + public void AddUpdate(TimerCallback callback, object callbackParam) + { + Add(0.001f, 0, callback, callbackParam); + } + + public void StartCoroutine(IEnumerator routine) + { + _engine.StartCoroutine(routine); + } + + public bool Exists(TimerCallback callback) + { + if (_toAdd.ContainsKey(callback)) + return true; + + Anymous_T at; + if (_items.TryGetValue(callback, out at)) + return !at.deleted; + + return false; + } + + public void Remove(TimerCallback callback) + { + Anymous_T t; + if (_toAdd.TryGetValue(callback, out t)) + { + _toAdd.Remove(callback); + ReturnToPool(t); + } + + if (_items.TryGetValue(callback, out t)) + t.deleted = true; + } + + private Anymous_T GetFromPool() + { + Anymous_T t; + int cnt = _pool.Count; + if (cnt > 0) + { + t = _pool[cnt - 1]; + _pool.RemoveAt(cnt - 1); + t.deleted = false; + t.elapsed = 0; + } + else + t = new Anymous_T(); + return t; + } + + private void ReturnToPool(Anymous_T t) + { + t.callback = null; + _pool.Add(t); + } + + public void Update() + { + float dt = Time.unscaledDeltaTime; + Dictionary.Enumerator iter; + + if (_items.Count > 0) + { + iter = _items.GetEnumerator(); + while (iter.MoveNext()) + { + Anymous_T i = iter.Current.Value; + if (i.deleted) + { + _toRemove.Add(i); + continue; + } + + i.elapsed += dt; + if (i.elapsed < i.interval) + continue; + + i.elapsed -= i.interval; + if (i.elapsed < 0 || i.elapsed > 0.03f) + i.elapsed = 0; + + if (i.repeat > 0) + { + i.repeat--; + if (i.repeat == 0) + { + i.deleted = true; + _toRemove.Add(i); + } + } + repeat = i.repeat; + if (i.callback != null) + { + if (catchCallbackExceptions) + { + try + { + i.callback(i.param); + } + catch (System.Exception e) + { + i.deleted = true; + Debug.LogWarning("FairyGUI: timer(internal=" + i.interval + ", repeat=" + i.repeat + ") callback error > " + e.Message); + } + } + else + i.callback(i.param); + } + } + iter.Dispose(); + } + + int len = _toRemove.Count; + if (len > 0) + { + for (int k = 0; k < len; k++) + { + Anymous_T i = _toRemove[k]; + if (i.deleted && i.callback != null) + { + _items.Remove(i.callback); + ReturnToPool(i); + } + } + _toRemove.Clear(); + } + + if (_toAdd.Count > 0) + { + iter = _toAdd.GetEnumerator(); + while (iter.MoveNext()) + _items.Add(iter.Current.Key, iter.Current.Value); + iter.Dispose(); + _toAdd.Clear(); + } + } + } + + class Anymous_T + { + public float interval; + public int repeat; + public TimerCallback callback; + public object param; + + public float elapsed; + public bool deleted; + + public void set(float interval, int repeat, TimerCallback callback, object param) + { + this.interval = interval; + this.repeat = repeat; + this.callback = callback; + this.param = param; + } + } + + class TimersEngine : MonoBehaviour + { + void Update() + { + Timers.inst.Update(); + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs.meta new file mode 100644 index 00000000..b83a794b --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/Timers.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ae007a032c404234b875df43f3129117 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs new file mode 100644 index 00000000..ca06b666 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs @@ -0,0 +1,136 @@ +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public static class ToolSet + { + public static Color ConvertFromHtmlColor(string str) + { + if (str.Length < 7 || str[0] != '#') + return Color.black; + + if (str.Length == 9) + { + //optimize:avoid using Convert.ToByte and Substring + //return new Color32(Convert.ToByte(str.Substring(3, 2), 16), Convert.ToByte(str.Substring(5, 2), 16), + // Convert.ToByte(str.Substring(7, 2), 16), Convert.ToByte(str.Substring(1, 2), 16)); + + return new Color32((byte)(CharToHex(str[3]) * 16 + CharToHex(str[4])), + (byte)(CharToHex(str[5]) * 16 + CharToHex(str[6])), + (byte)(CharToHex(str[7]) * 16 + CharToHex(str[8])), + (byte)(CharToHex(str[1]) * 16 + CharToHex(str[2]))); + } + else + { + //return new Color32(Convert.ToByte(str.Substring(1, 2), 16), Convert.ToByte(str.Substring(3, 2), 16), + //Convert.ToByte(str.Substring(5, 2), 16), 255); + + return new Color32((byte)(CharToHex(str[1]) * 16 + CharToHex(str[2])), + (byte)(CharToHex(str[3]) * 16 + CharToHex(str[4])), + (byte)(CharToHex(str[5]) * 16 + CharToHex(str[6])), + 255); + } + } + + public static Color ColorFromRGB(int value) + { + return new Color(((value >> 16) & 0xFF) / 255f, ((value >> 8) & 0xFF) / 255f, (value & 0xFF) / 255f, 1); + } + + public static Color ColorFromRGBA(uint value) + { + return new Color(((value >> 16) & 0xFF) / 255f, ((value >> 8) & 0xFF) / 255f, (value & 0xFF) / 255f, ((value >> 24) & 0xFF) / 255f); + } + + public static int CharToHex(char c) + { + if (c >= '0' && c <= '9') + return (int)c - 48; + if (c >= 'A' && c <= 'F') + return 10 + (int)c - 65; + else if (c >= 'a' && c <= 'f') + return 10 + (int)c - 97; + else + return 0; + } + + public static Rect Intersection(ref Rect rect1, ref Rect rect2) + { + if (rect1.width == 0 || rect1.height == 0 || rect2.width == 0 || rect2.height == 0) + return new Rect(0, 0, 0, 0); + + float left = rect1.xMin > rect2.xMin ? rect1.xMin : rect2.xMin; + float right = rect1.xMax < rect2.xMax ? rect1.xMax : rect2.xMax; + float top = rect1.yMin > rect2.yMin ? rect1.yMin : rect2.yMin; + float bottom = rect1.yMax < rect2.yMax ? rect1.yMax : rect2.yMax; + + if (left > right || top > bottom) + return new Rect(0, 0, 0, 0); + else + return Rect.MinMaxRect(left, top, right, bottom); + } + + public static Rect Union(ref Rect rect1, ref Rect rect2) + { + if (rect2.width == 0 || rect2.height == 0) + return rect1; + + if (rect1.width == 0 || rect1.height == 0) + return rect2; + + float x = Mathf.Min(rect1.x, rect2.x); + float y = Mathf.Min(rect1.y, rect2.y); + return new Rect(x, y, Mathf.Max(rect1.xMax, rect2.xMax) - x, Mathf.Max(rect1.yMax, rect2.yMax) - y); + } + + public static void SkewMatrix(ref Matrix4x4 matrix, float skewX, float skewY) + { + skewX = -skewX * Mathf.Deg2Rad; + skewY = -skewY * Mathf.Deg2Rad; + float sinX = Mathf.Sin(skewX); + float cosX = Mathf.Cos(skewX); + float sinY = Mathf.Sin(skewY); + float cosY = Mathf.Cos(skewY); + + float m00 = matrix.m00 * cosY - matrix.m10 * sinX; + float m10 = matrix.m00 * sinY + matrix.m10 * cosX; + float m01 = matrix.m01 * cosY - matrix.m11 * sinX; + float m11 = matrix.m01 * sinY + matrix.m11 * cosX; + float m02 = matrix.m02 * cosY - matrix.m12 * sinX; + float m12 = matrix.m02 * sinY + matrix.m12 * cosX; + + matrix.m00 = m00; + matrix.m10 = m10; + matrix.m01 = m01; + matrix.m11 = m11; + matrix.m02 = m02; + matrix.m12 = m12; + } + + public static void RotateUV(Vector2[] uv, ref Rect baseUVRect) + { + int vertCount = uv.Length; + float xMin = Mathf.Min(baseUVRect.xMin, baseUVRect.xMax); + float yMin = baseUVRect.yMin; + float yMax = baseUVRect.yMax; + if (yMin > yMax) + { + yMin = yMax; + yMax = baseUVRect.yMin; + } + + float tmp; + for (int i = 0; i < vertCount; i++) + { + Vector2 m = uv[i]; + tmp = m.y; + m.y = yMin + m.x - xMin; + m.x = xMin + yMax - tmp; + uv[i] = m; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs.meta new file mode 100644 index 00000000..4dddb8a8 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ToolSet.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 54357cad16a6ccb4ea698f76bb43527c +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs new file mode 100644 index 00000000..dcbbff23 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs @@ -0,0 +1,226 @@ +using System.Collections.Generic; +using System.Text; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class UBBParser + { + public static UBBParser inst = new UBBParser(); + + string _text; + int _readPos; + + public TagHandler defaultTagHandler; + public Dictionary handlers; + + public int defaultImgWidth = 0; + public int defaultImgHeight = 0; + + public delegate string TagHandler(string tagName, bool end, string attr); + + public UBBParser() + { + handlers = new Dictionary(); + handlers["url"] = onTag_URL; + handlers["img"] = onTag_IMG; + handlers["b"] = onTag_Simple; + handlers["i"] = onTag_Simple; + handlers["u"] = onTag_Simple; + handlers["sup"] = onTag_Simple; + handlers["sub"] = onTag_Simple; + handlers["color"] = onTag_COLOR; + handlers["font"] = onTag_FONT; + handlers["size"] = onTag_SIZE; + handlers["align"] = onTag_ALIGN; + handlers["strike"] = onTag_Simple; + } + + protected string onTag_URL(string tagName, bool end, string attr) + { + if (!end) + { + if (attr != null) + return ""; + else + { + string href = GetTagText(false); + return ""; + } + } + else + return ""; + } + + protected string onTag_IMG(string tagName, bool end, string attr) + { + if (!end) + { + string src = GetTagText(true); + if (src == null || src.Length == 0) + return null; + + if (defaultImgWidth != 0) + return ""; + else + return ""; + } + else + return null; + } + + protected string onTag_Simple(string tagName, bool end, string attr) + { + return end ? ("") : ("<" + tagName + ">"); + } + + protected string onTag_COLOR(string tagName, bool end, string attr) + { + if (!end) + return ""; + else + return ""; + } + + protected string onTag_FONT(string tagName, bool end, string attr) + { + if (!end) + return ""; + else + return ""; + } + + protected string onTag_SIZE(string tagName, bool end, string attr) + { + if (!end) + return ""; + else + return ""; + } + + protected string onTag_ALIGN(string tagName, bool end, string attr) + { + if (!end) + return "

"; + else + return "

"; + } + + public string GetTagText(bool remove) + { + int pos1 = _readPos; + int pos2; + StringBuilder buffer = null; + while ((pos2 = _text.IndexOf('[', pos1)) != -1) + { + if (buffer == null) + buffer = new StringBuilder(); + + if (_text[pos2 - 1] == '\\') + { + buffer.Append(_text, pos1, pos2 - pos1 - 1); + buffer.Append('['); + pos1 = pos2 + 1; + } + else + { + buffer.Append(_text, pos1, pos2 - pos1); + break; + } + } + if (pos2 == -1) + return null; + + if (remove) + _readPos = pos2; + + return buffer.ToString(); + } + + public string Parse(string text) + { + _text = text; + int pos1 = 0, pos2, pos3; + bool end; + string tag, attr; + string repl; + StringBuilder buffer = null; + TagHandler func; + while ((pos2 = _text.IndexOf('[', pos1)) != -1) + { + if (buffer == null) + buffer = new StringBuilder(); + + if (pos2 > 0 && _text[pos2 - 1] == '\\') + { + buffer.Append(_text, pos1, pos2 - pos1 - 1); + buffer.Append('['); + pos1 = pos2 + 1; + continue; + } + + buffer.Append(_text, pos1, pos2 - pos1); + pos1 = pos2; + pos2 = _text.IndexOf(']', pos1); + if (pos2 == -1) + break; + + if (pos2 == pos1 + 1) + { + buffer.Append(_text, pos1, 2); + pos1 = pos2 + 1; + continue; + } + + end = _text[pos1 + 1] == '/'; + pos3 = end ? pos1 + 2 : pos1 + 1; + tag = _text.Substring(pos3, pos2 - pos3); + _readPos = pos2 + 1; + attr = null; + repl = null; + pos3 = tag.IndexOf('='); + if (pos3 != -1) + { + attr = tag.Substring(pos3 + 1); + tag = tag.Substring(0, pos3); + } + tag = tag.ToLower(); + if (handlers.TryGetValue(tag, out func)) + { + repl = func(tag, end, attr); + if (repl != null) + buffer.Append(repl); + } + else if (defaultTagHandler != null) + { + repl = defaultTagHandler(tag, end, attr); + if (repl != null) + buffer.Append(repl); + else + buffer.Append(_text, pos1, pos2 - pos1 + 1); + } + else + { + buffer.Append(_text, pos1, pos2 - pos1 + 1); + } + pos1 = _readPos; + } + + if (buffer == null) + { + _text = null; + return text; + } + else + { + if (pos1 < _text.Length) + buffer.Append(_text, pos1, _text.Length - pos1); + + _text = null; + return buffer.ToString(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs.meta new file mode 100644 index 00000000..da551ff5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/UBBParser.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 916709794f601f949962dffdb251b946 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs new file mode 100644 index 00000000..788b7c6d --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs @@ -0,0 +1,427 @@ +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; + +namespace FairyGUI.Utils +{ + /// + /// A simplest and readonly XML class + /// + public class XML + { + public string name; + public string text; + + Dictionary _attributes; + XMLList _children; + + public static XML Create(string tag) + { + XML xml = new XML(); + xml.name = tag; + return xml; + } + + public XML(string XmlString) + { + Parse(XmlString); + } + + private XML() + { + } + + public Dictionary attributes + { + get + { + if (_attributes == null) + _attributes = new Dictionary(); + return _attributes; + } + } + + public bool HasAttribute(string attrName) + { + if (_attributes == null) + return false; + + return _attributes.ContainsKey(attrName); + } + + public string GetAttribute(string attrName) + { + return GetAttribute(attrName, null); + } + + public string GetAttribute(string attrName, string defValue) + { + if (_attributes == null) + return defValue; + + string ret; + if (_attributes.TryGetValue(attrName, out ret)) + return ret; + else + return defValue; + } + + public int GetAttributeInt(string attrName) + { + return GetAttributeInt(attrName, 0); + } + + public int GetAttributeInt(string attrName, int defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + int ret; + if (int.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public float GetAttributeFloat(string attrName) + { + return GetAttributeFloat(attrName, 0); + } + + public float GetAttributeFloat(string attrName, float defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + float ret; + if (float.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public bool GetAttributeBool(string attrName) + { + return GetAttributeBool(attrName, false); + } + + public bool GetAttributeBool(string attrName, bool defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + bool ret; + if (bool.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public string[] GetAttributeArray(string attrName) + { + string value = GetAttribute(attrName); + if (value != null) + { + if (value.Length == 0) + return new string[] { }; + else + return value.Split(','); + } + else + return null; + } + + public string[] GetAttributeArray(string attrName, char seperator) + { + string value = GetAttribute(attrName); + if (value != null) + { + if (value.Length == 0) + return new string[] { }; + else + return value.Split(seperator); + } + else + return null; + } + + public Color GetAttributeColor(string attrName, Color defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + return ToolSet.ConvertFromHtmlColor(value); + } + + public Vector2 GetAttributeVector(string attrName) + { + string value = GetAttribute(attrName); + if (value != null) + { + string[] arr = value.Split(','); + return new Vector2(float.Parse(arr[0]), float.Parse(arr[1])); + } + else + return Vector2.zero; + } + + public void SetAttribute(string attrName, string attrValue) + { + if (_attributes == null) + _attributes = new Dictionary(); + + _attributes[attrName] = attrValue; + } + + public void SetAttribute(string attrName, bool attrValue) + { + if (_attributes == null) + _attributes = new Dictionary(); + + _attributes[attrName] = attrValue ? "true" : "false"; + } + + public void SetAttribute(string attrName, int attrValue) + { + if (_attributes == null) + _attributes = new Dictionary(); + + _attributes[attrName] = attrValue.ToString(); + } + + public void SetAttribute(string attrName, float attrValue) + { + if (_attributes == null) + _attributes = new Dictionary(); + + _attributes[attrName] = string.Format("{0:#.####}", attrValue); + } + + public void RemoveAttribute(string attrName) + { + if (_attributes != null) + _attributes.Remove(attrName); + } + + public XML GetNode(string selector) + { + if (_children == null) + return null; + else + return _children.Find(selector); + } + + public XMLList elements + { + get + { + if (_children == null) + _children = new XMLList(); + return _children; + } + } + + public XMLList Elements() + { + if (_children == null) + _children = new XMLList(); + return _children; + } + + public XMLList Elements(string selector) + { + if (_children == null) + _children = new XMLList(); + return _children.Filter(selector); + } + + public XMLList.Enumerator GetEnumerator() + { + if (_children == null) + return new XMLList.Enumerator(null, null); + else + return new XMLList.Enumerator(_children.rawList, null); + } + + public XMLList.Enumerator GetEnumerator(string selector) + { + if (_children == null) + return new XMLList.Enumerator(null, selector); + else + return new XMLList.Enumerator(_children.rawList, selector); + } + + public void AppendChild(XML child) + { + this.elements.Add(child); + } + + public void RemoveChild(XML child) + { + if (_children == null) + return; + + this._children.rawList.Remove(child); + } + + public void RemoveChildren(string selector) + { + if (_children == null) + return; + + if (string.IsNullOrEmpty(selector)) + _children.Clear(); + else + _children.RemoveAll(selector); + } + + static Stack sNodeStack = new Stack(); + public void Parse(string aSource) + { + Reset(); + + XML lastOpenNode = null; + sNodeStack.Clear(); + + XMLIterator.Begin(aSource); + while (XMLIterator.NextTag()) + { + if (XMLIterator.tagType == XMLTagType.Start || XMLIterator.tagType == XMLTagType.Void) + { + XML childNode; + if (lastOpenNode != null) + childNode = new XML(); + else + { + if (this.name != null) + { + Reset(); + throw new Exception("Invalid xml format - no root node."); + } + childNode = this; + } + + childNode.name = XMLIterator.tagName; + childNode._attributes = XMLIterator.GetAttributes(childNode._attributes); + + if (lastOpenNode != null) + { + if (XMLIterator.tagType != XMLTagType.Void) + sNodeStack.Push(lastOpenNode); + if (lastOpenNode._children == null) + lastOpenNode._children = new XMLList(); + lastOpenNode._children.Add(childNode); + } + if (XMLIterator.tagType != XMLTagType.Void) + lastOpenNode = childNode; + } + else if (XMLIterator.tagType == XMLTagType.End) + { + if (lastOpenNode == null || lastOpenNode.name != XMLIterator.tagName) + { + Reset(); + throw new Exception("Invalid xml format - <" + XMLIterator.tagName + "> dismatched."); + } + + if (lastOpenNode._children == null || lastOpenNode._children.Count == 0) + { + lastOpenNode.text = XMLIterator.GetText(); + } + + if (sNodeStack.Count > 0) + lastOpenNode = sNodeStack.Pop(); + else + lastOpenNode = null; + } + } + } + + public void Reset() + { + if (_attributes != null) + _attributes.Clear(); + if (_children != null) + _children.Clear(); + this.text = null; + } + + public string ToXMLString(bool includeHeader) + { + StringBuilder sb = new StringBuilder(); + if (includeHeader) + sb.Append("\n"); + ToXMLString(sb, 0); + return sb.ToString(); + } + + void ToXMLString(StringBuilder sb, int tabs) + { + if (tabs > 0) + sb.Append(' ', tabs * 2); + + if (name == "!") + { + sb.Append(""); + return; + } + + sb.Append('<').Append(name); + if (_attributes != null) + { + foreach (KeyValuePair kv in _attributes) + { + sb.Append(' '); + sb.Append(kv.Key).Append('=').Append('\"'); + int c = sb.Length; + sb.Append(kv.Value); + XMLUtils.EncodeString(sb, c, true); + sb.Append("\""); + } + } + + int numChildren = _children != null ? _children.Count : 0; + + if (string.IsNullOrEmpty(text) && numChildren == 0) + sb.Append("/>"); + else + { + sb.Append('>'); + + if (!string.IsNullOrEmpty(text)) + { + int c = sb.Length; + sb.Append(text); + XMLUtils.EncodeString(sb, c); + } + + if (numChildren > 0) + { + sb.Append('\n'); + int ctabs = tabs + 1; + for (int i = 0; i < numChildren; i++) + { + _children[i].ToXMLString(sb, ctabs); + sb.Append('\n'); + } + + if (tabs > 0) + sb.Append(' ', tabs * 2); + } + + sb.Append(""); + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs.meta new file mode 100644 index 00000000..298268d1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XML.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8375f35e0c0dbc4429287ee8578f3cf1 +timeCreated: 1460480288 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs new file mode 100644 index 00000000..34151703 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs @@ -0,0 +1,485 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace FairyGUI.Utils +{ + public enum XMLTagType + { + Start, + End, + Void, + CDATA, + Comment, + Instruction + } + + /// + /// + /// + public class XMLIterator + { + public static string tagName; + public static XMLTagType tagType; + public static string lastTagName; + + static string source; + static int sourceLen; + static int parsePos; + static int tagPos; + static int tagLength; + static int lastTagEnd; + static bool attrParsed; + static bool lowerCaseName; + static StringBuilder buffer = new StringBuilder(); + static Dictionary attributes = new Dictionary(); + + const string CDATA_START = ""; + const string COMMENT_START = ""; + + public static void Begin(string source, bool lowerCaseName = false) + { + XMLIterator.source = source; + XMLIterator.lowerCaseName = lowerCaseName; + sourceLen = source.Length; + parsePos = 0; + lastTagEnd = 0; + tagPos = 0; + tagLength = 0; + tagName = null; + } + + public static bool NextTag() + { + int pos; + char c; + tagType = XMLTagType.Start; + buffer.Length = 0; + lastTagEnd = parsePos; + attrParsed = false; + lastTagName = tagName; + + while ((pos = source.IndexOf('<', parsePos)) != -1) + { + parsePos = pos; + pos++; + + if (pos == sourceLen) + break; + + c = source[pos]; + if (c == '!') + { + if (sourceLen > pos + 7 && source.Substring(pos - 1, 9) == CDATA_START) + { + pos = source.IndexOf(CDATA_END, pos); + tagType = XMLTagType.CDATA; + tagName = string.Empty; + tagPos = parsePos; + if (pos == -1) + tagLength = sourceLen - parsePos; + else + tagLength = pos + 3 - parsePos; + parsePos += tagLength; + return true; + } + else if (sourceLen > pos + 2 && source.Substring(pos - 1, 4) == COMMENT_START) + { + pos = source.IndexOf(COMMENT_END, pos); + tagType = XMLTagType.Comment; + tagName = string.Empty; + tagPos = parsePos; + if (pos == -1) + tagLength = sourceLen - parsePos; + else + tagLength = pos + 3 - parsePos; + parsePos += tagLength; + return true; + } + else + { + pos++; + tagType = XMLTagType.Instruction; + } + } + else if (c == '/') + { + pos++; + tagType = XMLTagType.End; + } + else if (c == '?') + { + pos++; + tagType = XMLTagType.Instruction; + } + + for (; pos < sourceLen; pos++) + { + c = source[pos]; + if (Char.IsWhiteSpace(c) || c == '>' || c == '/') + break; + } + if (pos == sourceLen) + break; + + buffer.Append(source, parsePos + 1, pos - parsePos - 1); + if (buffer.Length > 0 && buffer[0] == '/') + buffer.Remove(0, 1); + + bool singleQuoted = false, doubleQuoted = false; + int possibleEnd = -1; + for (; pos < sourceLen; pos++) + { + c = source[pos]; + if (c == '"') + { + if (!singleQuoted) + doubleQuoted = !doubleQuoted; + } + else if (c == '\'') + { + if (!doubleQuoted) + singleQuoted = !singleQuoted; + } + + if (c == '>') + { + if (!(singleQuoted || doubleQuoted)) + { + possibleEnd = -1; + break; + } + + possibleEnd = pos; + } + else if (c == '<') + break; + } + if (possibleEnd != -1) + pos = possibleEnd; + + if (pos == sourceLen) + break; + + if (source[pos - 1] == '/') + tagType = XMLTagType.Void; + + tagName = buffer.ToString(); + if (lowerCaseName) + tagName = tagName.ToLower(); + tagPos = parsePos; + tagLength = pos + 1 - parsePos; + parsePos += tagLength; + + return true; + } + + tagPos = sourceLen; + tagLength = 0; + tagName = null; + return false; + } + + public static string GetTagSource() + { + return source.Substring(tagPos, tagLength); + } + + public static string GetRawText(bool trim = false) + { + if (lastTagEnd == tagPos) + return string.Empty; + else if (trim) + { + int i = lastTagEnd; + for (; i < tagPos; i++) + { + char c = source[i]; + if (!char.IsWhiteSpace(c)) + break; + } + + if (i == tagPos) + return string.Empty; + else + return source.Substring(i, tagPos - i).TrimEnd(); + } + else + return source.Substring(lastTagEnd, tagPos - lastTagEnd); + } + + public static string GetText(bool trim = false) + { + if (lastTagEnd == tagPos) + return string.Empty; + else if (trim) + { + int i = lastTagEnd; + for (; i < tagPos; i++) + { + char c = source[i]; + if (!char.IsWhiteSpace(c)) + break; + } + + if (i == tagPos) + return string.Empty; + else + return XMLUtils.DecodeString(source.Substring(i, tagPos - i).TrimEnd()); + } + else + return XMLUtils.DecodeString(source.Substring(lastTagEnd, tagPos - lastTagEnd)); + } + + public static bool HasAttribute(string attrName) + { + if (!attrParsed) + { + attributes.Clear(); + ParseAttributes(attributes); + attrParsed = true; + } + + return attributes.ContainsKey(attrName); + } + + public static string GetAttribute(string attrName) + { + if (!attrParsed) + { + attributes.Clear(); + ParseAttributes(attributes); + attrParsed = true; + } + + string value; + if (attributes.TryGetValue(attrName, out value)) + return value; + else + return null; + } + + public static string GetAttribute(string attrName, string defValue) + { + string ret = GetAttribute(attrName); + if (ret != null) + return ret; + else + return defValue; + } + + public static int GetAttributeInt(string attrName) + { + return GetAttributeInt(attrName, 0); + } + + public static int GetAttributeInt(string attrName, int defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + int ret; + if (int.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public static float GetAttributeFloat(string attrName) + { + return GetAttributeFloat(attrName, 0); + } + + public static float GetAttributeFloat(string attrName, float defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + float ret; + if (float.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public static bool GetAttributeBool(string attrName) + { + return GetAttributeBool(attrName, false); + } + + public static bool GetAttributeBool(string attrName, bool defValue) + { + string value = GetAttribute(attrName); + if (value == null || value.Length == 0) + return defValue; + + bool ret; + if (bool.TryParse(value, out ret)) + return ret; + else + return defValue; + } + + public static Dictionary GetAttributes(Dictionary result) + { + if (result == null) + result = new Dictionary(); + + if (attrParsed) + { + foreach (KeyValuePair kv in attributes) + result[kv.Key] = kv.Value; + } + else //这里没有先ParseAttributeså†èµ‹å€¼ç»™result是为了节çœå¤åˆ¶çš„æ“ä½œ + ParseAttributes(result); + + return result; + } + + public static Hashtable GetAttributes(Hashtable result) + { + if (result == null) + result = new Hashtable(); + + if (attrParsed) + { + foreach (KeyValuePair kv in attributes) + result[kv.Key] = kv.Value; + } + else //这里没有先ParseAttributeså†èµ‹å€¼ç»™result是为了节çœå¤åˆ¶çš„æ“ä½œ + ParseAttributes(result); + + return result; + } + + static void ParseAttributes(IDictionary attrs) + { + string attrName; + int valueStart; + int valueEnd; + bool waitValue = false; + int quoted; + buffer.Length = 0; + int i = tagPos; + int attrEnd = tagPos + tagLength; + + if (i < attrEnd && source[i] == '<') + { + for (; i < attrEnd; i++) + { + char c = source[i]; + if (Char.IsWhiteSpace(c) || c == '>' || c == '/') + break; + } + } + + for (; i < attrEnd; i++) + { + char c = source[i]; + if (c == '=') + { + valueStart = -1; + valueEnd = -1; + quoted = 0; + for (int j = i + 1; j < attrEnd; j++) + { + char c2 = source[j]; + if (Char.IsWhiteSpace(c2)) + { + if (valueStart != -1 && quoted == 0) + { + valueEnd = j - 1; + break; + } + } + else if (c2 == '>') + { + if (quoted == 0) + { + valueEnd = j - 1; + break; + } + } + else if (c2 == '"') + { + if (valueStart != -1) + { + if (quoted != 1) + { + valueEnd = j - 1; + break; + } + } + else + { + quoted = 2; + valueStart = j + 1; + } + } + else if (c2 == '\'') + { + if (valueStart != -1) + { + if (quoted != 2) + { + valueEnd = j - 1; + break; + } + } + else + { + quoted = 1; + valueStart = j + 1; + } + } + else if (valueStart == -1) + { + valueStart = j; + } + } + + if (valueStart != -1 && valueEnd != -1) + { + attrName = buffer.ToString(); + if (lowerCaseName) + attrName = attrName.ToLower(); + buffer.Length = 0; + attrs[attrName] = XMLUtils.DecodeString(source.Substring(valueStart, valueEnd - valueStart + 1)); + i = valueEnd + 1; + } + else + break; + } + else if (!Char.IsWhiteSpace(c)) + { + if (waitValue || c == '/' || c == '>') + { + if (buffer.Length > 0) + { + attrName = buffer.ToString(); + if (lowerCaseName) + attrName = attrName.ToLower(); + attrs[attrName] = string.Empty; + buffer.Length = 0; + } + + waitValue = false; + } + + if (c != '/' && c != '>') + buffer.Append(c); + } + else + { + if (buffer.Length > 0) + waitValue = true; + } + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs.meta new file mode 100644 index 00000000..3bded97c --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLIterator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 35c75485c4f537341bbc16207588f75d +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs new file mode 100644 index 00000000..c4710ee5 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class XMLList + { + public List rawList; + + public XMLList() + { + rawList = new List(); + } + + public XMLList(List list) + { + rawList = list; + } + + public void Add(XML xml) + { + rawList.Add(xml); + } + + public void Clear() + { + rawList.Clear(); + } + + public int Count + { + get { return rawList.Count; } + } + + public XML this[int index] + { + get { return rawList[index]; } + } + + public Enumerator GetEnumerator() + { + return new Enumerator(rawList, null); + } + + public Enumerator GetEnumerator(string selector) + { + return new Enumerator(rawList, selector); + } + + static List _tmpList = new List(); + public XMLList Filter(string selector) + { + bool allFit = true; + _tmpList.Clear(); + int cnt = rawList.Count; + for (int i = 0; i < cnt; i++) + { + XML xml = rawList[i]; + if (xml.name == selector) + _tmpList.Add(xml); + else + allFit = false; + } + + if (allFit) + return this; + else + { + XMLList ret = new XMLList(_tmpList); + _tmpList = new List(); + return ret; + } + } + + public XML Find(string selector) + { + int cnt = rawList.Count; + for (int i = 0; i < cnt; i++) + { + XML xml = rawList[i]; + if (xml.name == selector) + return xml; + } + return null; + } + + public void RemoveAll(string selector) + { + rawList.RemoveAll(xml => xml.name == selector); + } + + public struct Enumerator + { + List _source; + string _selector; + int _index; + int _total; + XML _current; + + public Enumerator(List source, string selector) + { + _source = source; + _selector = selector; + _index = -1; + if (_source != null) + _total = _source.Count; + else + _total = 0; + _current = null; + } + + public XML Current + { + get { return _current; } + } + + public bool MoveNext() + { + while (++_index < _total) + { + _current = _source[_index]; + if (_selector == null || _current.name == _selector) + return true; + } + + return false; + } + + public void Erase() + { + _source.RemoveAt(_index); + _total--; + } + + public void Reset() + { + _index = -1; + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs.meta new file mode 100644 index 00000000..b74ce1e1 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLList.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2f086b805cd249140987f7f3ec5b4567 +timeCreated: 1460480287 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs new file mode 100644 index 00000000..ce00722f --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs @@ -0,0 +1,133 @@ +using System; +using System.Text; + +namespace FairyGUI.Utils +{ + /// + /// + /// + public class XMLUtils + { + public static string DecodeString(string aSource) + { + int len = aSource.Length; + StringBuilder sb = new StringBuilder(); + int pos1 = 0, pos2 = 0; + + while (true) + { + pos2 = aSource.IndexOf('&', pos1); + if (pos2 == -1) + { + sb.Append(aSource.Substring(pos1)); + break; + } + sb.Append(aSource.Substring(pos1, pos2 - pos1)); + + pos1 = pos2 + 1; + pos2 = pos1; + int end = Math.Min(len, pos2 + 10); + for (; pos2 < end; pos2++) + { + if (aSource[pos2] == ';') + break; + } + if (pos2 < end && pos2 > pos1) + { + string entity = aSource.Substring(pos1, pos2 - pos1); + int u = 0; + if (entity[0] == '#') + { + if (entity.Length > 1) + { + if (entity[1] == 'x') + u = Convert.ToInt16(entity.Substring(2), 16); + else + u = Convert.ToInt16(entity.Substring(1)); + sb.Append((char)u); + pos1 = pos2 + 1; + } + else + sb.Append('&'); + } + else + { + switch (entity) + { + case "amp": + u = 38; + break; + + case "apos": + u = 39; + break; + + case "gt": + u = 62; + break; + + case "lt": + u = 60; + break; + + case "nbsp": + u = 32; + break; + + case "quot": + u = 34; + break; + } + if (u > 0) + { + sb.Append((char)u); + pos1 = pos2 + 1; + } + else + sb.Append('&'); + } + } + else + { + sb.Append('&'); + } + } + + return sb.ToString(); + } + + private static string[] ESCAPES = new string[] { + "&", "&", + "<", "<", + ">", ">", + + "'", "'", + "\"", """, + "\t", " ", + "\n", " ", + "\r", " " + }; + public static void EncodeString(StringBuilder sb, int start, bool isAttribute = false) + { + int count; + int len = isAttribute ? ESCAPES.Length : 6; + for (int i = 0; i < len; i += 2) + { + count = sb.Length - start; + sb.Replace(ESCAPES[i], ESCAPES[i + 1], start, count); + } + } + + public static string EncodeString(string str, bool isAttribute = false) + { + if (string.IsNullOrEmpty(str)) + return ""; + else + { + StringBuilder sb = new StringBuilder(str); + EncodeString(sb, 0); + return sb.ToString(); + } + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs.meta new file mode 100644 index 00000000..93230524 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/XMLUtils.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 11312ca9745d52c4eb8e31630ad5ec7c +timeCreated: 1461773298 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs new file mode 100644 index 00000000..014eaa21 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs @@ -0,0 +1,114 @@ +namespace FairyGUI.Utils +{ + /// + /// 一个简å•çš„Zip文件处ç†ç±»ã€‚ä¸å¤„ç†è§£åŽ‹ã€‚ + /// + public class ZipReader + { + /// + /// + /// + public class ZipEntry + { + public string name; + public int compress; + public uint crc; + public int size; + public int sourceSize; + public int offset; + public bool isDirectory; + } + + ByteBuffer _stream; + int _entryCount; + int _pos; + int _index; + + /// + /// + /// + /// + public ZipReader(byte[] data) + { + _stream = new ByteBuffer(data); + _stream.littleEndian = true; + + int pos = _stream.length - 22; + _stream.position = pos + 10; + _entryCount = _stream.ReadShort(); + _stream.position = pos + 16; + _pos = _stream.ReadInt(); + } + + /// + /// + /// + public int entryCount + { + get { return _entryCount; } + } + + /// + /// + /// + /// + public bool GetNextEntry(ZipEntry entry) + { + if (_index >= _entryCount) + return false; + + _stream.position = _pos + 28; + int len = _stream.ReadUshort(); + int len2 = _stream.ReadUshort() + _stream.ReadUshort(); + + _stream.position = _pos + 46; + string name = _stream.ReadString(len); + name = name.Replace("\\", "/"); + + entry.name = name; + if (name[name.Length - 1] == '/') //directory + { + entry.isDirectory = true; + entry.compress = 0; + entry.crc = 0; + entry.size = entry.sourceSize = 0; + entry.offset = 0; + } + else + { + entry.isDirectory = false; + _stream.position = _pos + 10; + entry.compress = _stream.ReadUshort(); + _stream.position = _pos + 16; + entry.crc = _stream.ReadUint(); + entry.size = _stream.ReadInt(); + entry.sourceSize = _stream.ReadInt(); + _stream.position = _pos + 42; + entry.offset = _stream.ReadInt() + 30 + len; + } + + _pos += 46 + len + len2; + _index++; + + return true; + } + + + /// + /// + /// + /// + /// + public byte[] GetEntryData(ZipEntry entry) + { + byte[] data = new byte[entry.size]; + if (entry.size > 0) + { + _stream.position = entry.offset; + _stream.ReadBytes(data, 0, entry.size); + } + + return data; + } + } +} diff --git a/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs.meta b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs.meta new file mode 100644 index 00000000..a5dd7397 --- /dev/null +++ b/JNFrame2/Assets/Plugins/FairyGUI/Runtime/Scripts/Utils/ZipReader.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8dc25ae9114bda14f998652db54f3af9 +timeCreated: 1535374214 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/SHFrameModule.cs b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/SHFrameModule.cs index 44e36a3b..b4a5797f 100644 --- a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/SHFrameModule.cs +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/SHFrameModule.cs @@ -43,6 +43,12 @@ namespace SHFrame public static ProcedureModule Procedure => _procedure ??= Get(); private static ProcedureModule _procedure; + /// + /// 获å–UI模å—。 + /// + public static UIModule UI => _ui ??= Get(); + private static UIModule _ui; + #endregion /// diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule.meta b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule.meta new file mode 100644 index 00000000..469f0d9a --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 91ae8771f1ed4d36bdf225c58fafae69 +timeCreated: 1728993220 \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs new file mode 100644 index 00000000..9de2e47f --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs @@ -0,0 +1,139 @@ +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using FairyGUI; +using UnityEngine; +using YooAsset; + +namespace SHFrame +{ + public class FairyGUILoader + { + /// + /// 资æºå¥æŸ„列表 + /// + private Dictionary _handles = new Dictionary(); + + // /// + // /// 加载方法 + // /// + // /// + // /// + // /// + // /// + // /// + // private object LoadFuncSync(string name, string extension, System.Type type, out DestroyMethod method) + // { + // method = DestroyMethod.None; //注æ„:这里一定è¦è®¾ç½®ä¸ºNone + // var package = YooAssets.GetPackage("DefaultPackage"); + // var handle = package.LoadAssetSync(name, type); + // _handles.Add(name, handle); + // return handle.AssetObject; + // } + + // public bool AddPackageSync(string packageName) + // { + // string location = $"{packageName}_fui"; + // + // bool isValid = YooAssets.CheckLocationValid(location); + // //Debug.Log($"检查资æºå®šä½åœ°å€æ˜¯å¦æœ‰æ•ˆ:{location}:{isValid}"); + // + // if (isValid == false) return false; + // + // if (_handles.ContainsKey(packageName)) + // { + // return true; + // } + // + // // 执行FairyGUI的添加包函数 + // UIPackage.AddPackage(packageName, LoadFuncSync); + // return true; + // } + + private void LoadFuncAsync(string location, string extension, System.Type type, PackageItem item) + { + bool isValid = YooAssets.CheckLocationValid(location); + + if (isValid == false) + { + return; + } + + if (_handles.ContainsKey(location)) + { + Debug.LogWarning($"LoadAysnc--_handleså·²ç»æ·»åŠ è¿‡:{location}"); + return; + } + + var handle = YooAssets.LoadAssetAsync(location, type); + _handles.Add(location, handle); + + handle.Completed += onCompleted; + + void onCompleted(AssetHandle handle) + { + handle.Completed -= onCompleted; + //destroyMethod 指示返回的资æºåº”该怎样释放。例如å¤åˆ¶çš„资æºå®žä¾‹å¯ä»¥ç”¨Destroy,共享的资æºå®žä¾‹éœ€è¦ç”¨Unload,ä¸éœ€è¦åº•层处ç†åˆ™ä¼ None。 + item.owner.SetItemAsset(item, handle.AssetObject, DestroyMethod.None); + } + } + + public async UniTask AddPackageAsync(string packageName) + { + string location = $"{packageName}_fui"; + bool isValid = YooAssets.CheckLocationValid(location); + + if (isValid == false) + { + return false; + } + + if (_handles.ContainsKey(location)) + { + return true; + } + + AssetHandle handle = YooAssets.LoadAssetAsync(location); + + _handles.Add(location, handle); + + await handle.ToUniTask(); + + //异步加载方å¼ï¼Œé€‚用于Addressable。注æ„ï¼Œè¿™ç§æ–¹å¼å¿…须是异步,ä¸èƒ½åœ¨å›žè°ƒå‡½æ•°é‡Œç›´æŽ¥è®¾ç½®ç»“果。 + //descData是包的æè¿°æ•°æ®ï¼Œéœ€è¦è‡ªè¡ŒåŠ è½½å‡ºæ¥ä¼ å…¥ + //assetNamePrefix傿•°åº•层ä¸ä½¿ç”¨ï¼Œä½†åœ¨å›žè°ƒä¸­name傿•°ä¼šå¸¦ä¸ŠassetPath作为å‰ç¼€ã€‚ + UIPackage.AddPackage((handle.AssetObject as TextAsset).bytes, packageName, LoadFuncAsync); + return true; + } + + public GComponent CreateGComponent(string packageName, string componentName) + { + return (GComponent)UIPackage.CreateObject(packageName, componentName); + } + + public UniTask CreateObjectAsync(string packageName, string componentName) + { + var utcs = new UniTaskCompletionSource(); + UIPackage.CreateObjectAsync(packageName, componentName, MyCreateObjectCallback); + + void MyCreateObjectCallback(GObject obj) + { + utcs.TrySetResult((GComponent)obj); + } + + return utcs.Task; //本质上就是返回了一个UniTask + } + + /// + /// 释放资æºå¥æŸ„列表 + /// + private void ReleaseHandles() + { + foreach (var handle in _handles) + { + handle.Value.Release(); + } + + _handles.Clear(); + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs.meta b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs.meta new file mode 100644 index 00000000..d2fcbc93 --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/FairyGUILoader.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8f70f254db9c4496b328039cdbaf7848 +timeCreated: 1728993226 \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs new file mode 100644 index 00000000..5b1aea63 --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs @@ -0,0 +1,56 @@ +using FairyGUI; + +namespace SHFrame +{ + public abstract class UIBase + { + public string PanelName { get; set; } + + /// + /// UIçš„object + /// + public GComponent View { get; set; } + + /// + /// 实例化时调用 + /// + public abstract void OnInit(); + + /// + /// æ‰“å¼€é¢æ¿æ—¶è°ƒç”¨ + /// + public abstract void OnOpen(params object[] param); + + /// + /// 添加监å¬äº‹ä»¶ï¼Œåœ¨OnOpenåŽè°ƒç”¨ + /// + public abstract void AddListener(); + + /// + /// 关闭颿¿æ—¶è°ƒç”¨ + /// + public abstract void OnClose(); + + /// + /// 移除监å¬äº‹ä»¶ï¼Œåœ¨OnCloseåŽè°ƒç”¨ + /// + public abstract void RemoveListener(); + + /// + /// 在RemoveListeneråŽè°ƒç”¨,è°ƒç”¨çˆ¶ç±»æ–¹æ³•é”€é­‚ä¼šé”€æ¯æ˜¾ç¤ºå¯¹è±¡VIew + /// + public virtual void OnDispose() + { + if (View != null) + { + if (View.parent != null) + { + View.parent.RemoveChild(View); + } + + View.Dispose(); + View = null; + } + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs.meta b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs.meta new file mode 100644 index 00000000..a3ca5c36 --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b35298b8478d4ae4810b7c27ebb75dee +timeCreated: 1728993226 \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs new file mode 100644 index 00000000..3db27d82 --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Cysharp.Threading.Tasks; +using FairyGUI; + +namespace SHFrame +{ + public enum UILayerEnum + { + Root, //添加到根节点 + View, + Window, + Pop, + Guide + } + + public class UIModule : Module + { + public readonly Dictionary UIMap = new(); + private FairyGUILoader m_FguiLoader; + public string CurKey { private set; get; } = ""; + + private GComponent ViewRoot { get; set; } + private GComponent WindowRoot { get; set; } + private GComponent PopRoot { get; set; } + private GComponent GuideRoot { get; set; } + + /// + /// æ¸¸æˆæ¡†æž¶æ¨¡å—åˆå§‹åŒ–。 + /// + protected override void Awake() + { + base.Awake(); + m_FguiLoader = new FairyGUILoader(); + } + + // public float ScaleT { get; private set; } + + public void InitScaleT() + { + // UIContentScaler scaler = Stage.inst.gameObject.GetComponent(); + // float scaleX = GRoot.inst.width / scaler.designResolutionX; + // float scaleY = GRoot.inst.height / scaler.designResolutionY; + // ScaleT = Mathf.Min(scaleX, scaleY); + } + + public void InitUIModule(GComponent view, GComponent window, GComponent pop, GComponent guide) + { + ViewRoot = view; + WindowRoot = window; + PopRoot = pop; + GuideRoot = guide; + } + + public void MakeFullScreen(GObject gObject) + { + // gObject.SetSize(GRoot.inst.width / ScaleT, GRoot.inst.height / ScaleT); + gObject.MakeFullScreen(); + } + + // public bool AddPackageSync(string packageName) + // { + // return m_FguiLoader.AddPackageSync(packageName); + // } + public UniTask AddPackageASync(string packageName) + { + return m_FguiLoader.AddPackageAsync(packageName); + } + + /// + /// 通过UIManager打开UI + /// + /// ui的类å + /// uiçš„pkgName + /// uiçš„resName + /// + /// + public async UniTask Open(string pkgName, string resName, UILayerEnum layer, params object[] param) + where TClassType : UIBase, new() + { + var key = pkgName + "/" + resName; + + UIMap.TryGetValue(key, out var uiClass); + + if (uiClass == null) + { + uiClass = new TClassType(); + UIMap.Add(key, uiClass); + } + + if (uiClass.View == null) + { + await SHFrameModule.UI.AddPackageASync(pkgName); + uiClass.View = await m_FguiLoader.CreateObjectAsync(pkgName, resName); + // uiClass.View.SetScale(ScaleT, ScaleT); + // uiClass.View.SetSize(GRoot.inst.width / ScaleT, GRoot.inst.height / ScaleT); + uiClass.View.MakeFullScreen(); + UIMap[key].OnInit(); + } + + GComponent root; + switch (layer) + { + case UILayerEnum.Root: + root = GRoot.inst; + break; + + case UILayerEnum.View: + root = ViewRoot; + break; + + case UILayerEnum.Window: + root = WindowRoot; + break; + case UILayerEnum.Guide: + root = GuideRoot; + break; + default: + throw new ArgumentOutOfRangeException(nameof(layer), layer, null); + } + + // root.RemoveChildren(); + // root.visible = true; + // if (root.parent != null) + // { + // root.parent.visible = true; + // } + + try + { + root.AddChild(uiClass.View); + uiClass.View.x = 0; + uiClass.View.y = 0; + uiClass.View.name = resName; + uiClass.OnOpen(param); + // uiClass.RemoveListener(); + uiClass.AddListener(); + CurKey = key; + } + catch (Exception e) + { + Log.Error(e); + throw; + } + } + + /// + /// 关闭通过UIManager打开的UI + /// + public void Close(string pkgName, string resName) + { + var key = pkgName + "/" + resName; + + if (key == "" || !UIMap.ContainsKey(key)) return; + + Close(key); + } + + public void Close() + { + Close(CurKey); + } + + public void Close(string key) + { + if (key == "" || !UIMap.ContainsKey(key)) return; + + if (UIMap[key].View == null || UIMap[key].View.parent == null) return; + + UIMap[key].View.parent.RemoveChild(UIMap[key].View); + UIMap[key].OnClose(); + UIMap[key].RemoveListener(); + UIMap[key].OnDispose(); + UIMap.Remove(key); + } + + public void CloseAll() + { + // var list = ReferencePool.Acquire(); + // list.Value.AddRange(UIMap.Keys); + // foreach (var key in list.Value) + var list = new List(); + list.AddRange(UIMap.Keys); + foreach (var key in list){ + if (key == "" || !UIMap.ContainsKey(key)) return; + Close(key); + } + // ReferencePool.Release(list); + } + } +} \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs.meta b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs.meta new file mode 100644 index 00000000..f714fd53 --- /dev/null +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/Modules/UIModule/UIModule.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a847b1151d044df183a7ab4fe052112f +timeCreated: 1728993226 \ No newline at end of file diff --git a/JNFrame2/Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef b/JNFrame2/Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef index dc02cc95..4a869051 100644 --- a/JNFrame2/Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef +++ b/JNFrame2/Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef @@ -3,7 +3,8 @@ "rootNamespace": "", "references": [ "GUID:f51ebe6a0ceec4240a699833d6309b23", - "GUID:e34a5702dd353724aa315fb8011f08c3" + "GUID:e34a5702dd353724aa315fb8011f08c3", + "GUID:f4270d81837019d47b93f11421168dae" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/JNFrame2/FairyGUI.Editor.csproj b/JNFrame2/FairyGUI.Editor.csproj new file mode 100644 index 00000000..5d68e5a9 --- /dev/null +++ b/JNFrame2/FairyGUI.Editor.csproj @@ -0,0 +1,866 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {44b47b38-a33f-7d44-f2e0-a6c5f272d235} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + FairyGUI.Editor + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\FairyGUI.Editor\ + UNITY_2022_3_1;UNITY_2022_3;UNITY_2022;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_NAVIGATION_PACKAGE_DEBUG_VISUALIZATION;ENABLE_NAVIGATION_HEIGHTMESH_RUNTIME_SUPPORT;ENABLE_NAVIGATION_UI_REQUIRES_PACKAGE;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;PLATFORM_INITIALIZES_MEMORY_MANAGER_EXPLICITLY;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;DOTWEEN;ENABLE_LOG;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER;UNITY_EDITOR_ONLY_COMPILATION + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ContentLoadModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.NVIDIAModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PropertiesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.EditorToolbarModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.PresetsUIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.SceneViewModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2022.3.1f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.Generator.Unity.Editor.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Threading.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\TCPeasy\TCPeasy.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Newtonsoft.Json.13.0.3\lib\netstandard2.0\Newtonsoft.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Caching.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Text.Encodings.Web.6.0.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Serialization.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny\Jenny.Plugins.Unity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Demigiant\DOTween\Editor\DOTweenEditor.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.2.0.16\lib\netstandard2.1\TouchSocket.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.Formatters.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Text.Json.6.0.0\lib\netstandard2.0\System.Text.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Demigiant\DOTween\DOTween.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Extensions.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.Http.2.0.16\lib\netstandard2.1\TouchSocket.Http.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.code-philosophy.hybridclr@64a6d26fa3\Plugins\dnlib.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.code-philosophy.hybridclr@64a6d26fa3\Plugins\LZ4.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny\Jenny.Plugins.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Reflection.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\NuGet\Editor\NugetForUnity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\Editor\DesperateDevs.Unity.Editor.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.Appenders.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.Core.2.0.16\lib\netstandard2.1\TouchSocket.Core.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.Generator.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Unity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Google.Protobuf.3.18.3\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.ext.nunit@1.0.6\net35\unity-custom\nunit.framework.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Core.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Runtime.Serialization.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.Linq.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.Vectors.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Net.Http.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.DataSetExtensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Drawing.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.FileSystem.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.ComponentModel.Composition.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Transactions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\Microsoft.Win32.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\netstandard.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.AppContext.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Buffers.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Concurrent.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.NonGeneric.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Specialized.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Annotations.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Console.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Data.Common.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Contracts.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Debug.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Process.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.StackTrace.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Tools.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TraceSource.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Drawing.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Dynamic.Runtime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Calendars.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Compression.ZipFile.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.IsolatedStorage.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Pipes.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Expressions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Parallel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Queryable.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Memory.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Http.Rtc.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NameResolution.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NetworkInformation.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Ping.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Requests.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Security.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Sockets.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebHeaderCollection.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.Client.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ObjectModel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.DispatchProxy.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Reader.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.ResourceManager.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Writer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Handles.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Numerics.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Json.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Claims.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Csp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Principal.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.SecureString.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Duplex.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Http.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.NetTcp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Security.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.RegularExpressions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Overlapped.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Thread.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.ThreadPool.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Timer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ValueTuple.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.ReaderWriter.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XDocument.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlDocument.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlSerializer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.XDocument.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEngine.UI.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEditor.TestRunner.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEngine.TestRunner.dll + + + + + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c} + FairyGUI.Runtime + + + + + diff --git a/JNFrame2/FairyGUI.Runtime.csproj b/JNFrame2/FairyGUI.Runtime.csproj new file mode 100644 index 00000000..79401959 --- /dev/null +++ b/JNFrame2/FairyGUI.Runtime.csproj @@ -0,0 +1,1004 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + FairyGUI.Runtime + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\FairyGUI.Runtime\ + UNITY_2022_3_1;UNITY_2022_3;UNITY_2022;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_NAVIGATION_PACKAGE_DEBUG_VISUALIZATION;ENABLE_NAVIGATION_HEIGHTMESH_RUNTIME_SUPPORT;ENABLE_NAVIGATION_UI_REQUIRES_PACKAGE;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;PLATFORM_INITIALIZES_MEMORY_MANAGER_EXPLICITLY;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;DOTWEEN;ENABLE_LOG;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ContentLoadModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PropertiesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.EditorToolbarModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.PresetsUIModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.SceneViewModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2022.3.1f1\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2022.3.1f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.Generator.Unity.Editor.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Threading.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\TCPeasy\TCPeasy.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Newtonsoft.Json.13.0.3\lib\netstandard2.0\Newtonsoft.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Caching.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Text.Encodings.Web.6.0.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Serialization.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny\Jenny.Plugins.Unity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Demigiant\DOTween\Editor\DOTweenEditor.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.2.0.16\lib\netstandard2.1\TouchSocket.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.Formatters.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\System.Text.Json.6.0.0\lib\netstandard2.0\System.Text.Json.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Demigiant\DOTween\DOTween.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Extensions.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.Http.2.0.16\lib\netstandard2.1\TouchSocket.Http.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.code-philosophy.hybridclr@64a6d26fa3\Plugins\dnlib.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.code-philosophy.hybridclr@64a6d26fa3\Plugins\LZ4.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny\Jenny.Plugins.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll + + + D:\myproject\JisolGame\JNFrame2\Library\PackageCache\com.unity.visualscripting@1.9.1\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Reflection.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\NuGet\Editor\NugetForUnity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\Editor\DesperateDevs.Unity.Editor.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Sherlog\Sherlog.Appenders.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\TouchSocket.Core.2.0.16\lib\netstandard2.1\TouchSocket.Core.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\Jenny\Editor\Jenny.Generator.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Plugins\DLL\DesperateDevs\DesperateDevs.Unity.dll + + + D:\myproject\JisolGame\JNFrame2\Assets\Packages\Google.Protobuf.3.18.3\lib\netstandard2.0\Google.Protobuf.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Core.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Runtime.Serialization.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.Linq.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.Vectors.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Net.Http.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.DataSetExtensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Drawing.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.FileSystem.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.ComponentModel.Composition.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Transactions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\Microsoft.Win32.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\netstandard.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.AppContext.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Buffers.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Concurrent.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.NonGeneric.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Specialized.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Annotations.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Console.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Data.Common.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Contracts.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Debug.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Process.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.StackTrace.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Tools.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TraceSource.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Drawing.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Dynamic.Runtime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Calendars.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Compression.ZipFile.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.IsolatedStorage.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Pipes.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Expressions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Parallel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Queryable.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Memory.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Http.Rtc.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NameResolution.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NetworkInformation.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Ping.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Requests.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Security.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Sockets.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebHeaderCollection.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.Client.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ObjectModel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.DispatchProxy.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Reader.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.ResourceManager.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Writer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Handles.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Numerics.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Json.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Claims.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Csp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Principal.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.SecureString.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Duplex.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Http.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.NetTcp.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Primitives.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Security.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.RegularExpressions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Overlapped.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Thread.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.ThreadPool.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Timer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ValueTuple.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.ReaderWriter.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XDocument.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlDocument.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlSerializer.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.dll + + + D:\Unity\2022.3.1f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.XDocument.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\JisolGame\JNFrame2\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + + + diff --git a/JNFrame2/JNFrame2.sln b/JNFrame2/JNFrame2.sln index aeb874ea..52de633a 100644 --- a/JNFrame2/JNFrame2.sln +++ b/JNFrame2/JNFrame2.sln @@ -7,10 +7,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JNGame", "JNGame.csproj", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StompyRobot.SRF", "StompyRobot.SRF.csproj", "{356a0975-52a0-edee-67e5-a8751d23d388}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FairyGUI.Runtime", "FairyGUI.Runtime.csproj", "{65d6cac9-6d7d-4b93-ff92-1a5fc94f680c}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JNGame.Editor", "JNGame.Editor.csproj", "{17b58f54-5d7b-7430-a784-74a4540f4c68}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.Linq", "UniTask.Linq.csproj", "{168b694c-7d58-d228-f9a3-02235c192fc5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FairyGUI.Editor", "FairyGUI.Editor.csproj", "{44b47b38-a33f-7d44-f2e0-a6c5f272d235}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask", "UniTask.csproj", "{bf8742e6-eee2-4cf6-3e82-d12e15802154}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StompyRobot.SRDebugger", "StompyRobot.SRDebugger.csproj", "{786227ef-f2d4-16aa-9b5e-f745e7520e98}" @@ -48,10 +52,14 @@ Global {3a48b384-1ba1-8d63-b01a-1777c52cfdc1}.Debug|Any CPU.Build.0 = Debug|Any CPU {356a0975-52a0-edee-67e5-a8751d23d388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {356a0975-52a0-edee-67e5-a8751d23d388}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c}.Debug|Any CPU.Build.0 = Debug|Any CPU {17b58f54-5d7b-7430-a784-74a4540f4c68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17b58f54-5d7b-7430-a784-74a4540f4c68}.Debug|Any CPU.Build.0 = Debug|Any CPU {168b694c-7d58-d228-f9a3-02235c192fc5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {168b694c-7d58-d228-f9a3-02235c192fc5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44b47b38-a33f-7d44-f2e0-a6c5f272d235}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44b47b38-a33f-7d44-f2e0-a6c5f272d235}.Debug|Any CPU.Build.0 = Debug|Any CPU {bf8742e6-eee2-4cf6-3e82-d12e15802154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {bf8742e6-eee2-4cf6-3e82-d12e15802154}.Debug|Any CPU.Build.0 = Debug|Any CPU {786227ef-f2d4-16aa-9b5e-f745e7520e98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/JNFrame2/Logs/AssetImportWorker0-prev.log b/JNFrame2/Logs/AssetImportWorker0-prev.log new file mode 100644 index 00000000..58e05b35 --- /dev/null +++ b/JNFrame2/Logs/AssetImportWorker0-prev.log @@ -0,0 +1,2308 @@ +Using pre-set license +Built from '2022.3/staging' branch; Version is '2022.3.1f1 (f18e0c1b5784) revision 15830540'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22631) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2022.3.1f1\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker0 +-projectPath +D:/myproject/JisolGame/JNFrame2 +-logFile +Logs/AssetImportWorker0.log +-srvPort +64818 +Successfully changed project path to: D:/myproject/JisolGame/JNFrame2 +D:/myproject/JisolGame/JNFrame2 +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-allocator-temp-initial-block-size-main=262144" + "memorysetup-allocator-temp-initial-block-size-worker=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [213912] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 1869204652 [EditorId] 1869204652 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [213912] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 1869204652 [EditorId] 1869204652 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +Refreshing native plugins compatible for Editor in 117.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2022.3.1f1 (f18e0c1b5784) +[Subsystems] Discovering subsystems at path D:/Unity/2022.3.1f1/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/JisolGame/JNFrame2/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2022.3.1f1/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56132 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.009421 seconds. +- Loaded All Assemblies, in 0.522 seconds +Native extension for WindowsStandalone target not found +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 0.325 seconds +Domain Reload Profiling: 844ms + BeginReloadAssembly (184ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + RebuildCommonClasses (44ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (78ms) + LoadAllAssembliesAndSetupDomain (199ms) + LoadAssemblies (180ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (188ms) + TypeCache.Refresh (187ms) + TypeCache.ScanAssembly (168ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (1ms) + FinalizeReload (325ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (3ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (63ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +======================================================================== +Worker process is ready to serve import requests +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.841 seconds +Refreshing native plugins compatible for Editor in 29.45 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +Package Manager log level set to [2] +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.228 seconds +Domain Reload Profiling: 3065ms + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (29ms) + RebuildCommonClasses (45ms) + RebuildNativeTypeToScriptingClass (15ms) + initialDomainReloadingComplete (62ms) + LoadAllAssembliesAndSetupDomain (1551ms) + LoadAssemblies (1041ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (580ms) + TypeCache.Refresh (522ms) + TypeCache.ScanAssembly (492ms) + ScanForSourceGeneratedMonoScriptInfo (42ms) + ResolveRequiredComponents (16ms) + FinalizeReload (1229ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (974ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (10ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (182ms) + ProcessInitializeOnLoadAttributes (719ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Launched and connected shader compiler UnityShaderCompiler.exe after 0.10 seconds +Refreshing native plugins compatible for Editor in 34.34 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5016 Unused Serialized files (Serialized files now loaded: 0) +Unloading 133 unused Assets / (163.6 KB). Loaded Objects now: 5443. +Memory consumption went from 171.0 MB to 170.8 MB. +Total: 6.377900 ms (FindLiveObjects: 0.698300 ms CreateObjectMapping: 0.534900 ms MarkObjects: 4.824500 ms DeleteObjects: 0.317400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 19208.880044 seconds. + path: Assets/HotAssets/HotDlls/HotSamples.dll.bytes + artifactKey: Guid(31ecfccf5f58fcd4e82c0039b5c0433e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotAssets/HotDlls/HotSamples.dll.bytes using Guid(31ecfccf5f58fcd4e82c0039b5c0433e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '5c560588ec1e60132db3bba0c7a53c1e') in 0.026024 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.278 seconds +Refreshing native plugins compatible for Editor in 17.83 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.148 seconds +Domain Reload Profiling: 2418ms + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + RebuildCommonClasses (30ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (55ms) + LoadAllAssembliesAndSetupDomain (995ms) + LoadAssemblies (686ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (378ms) + TypeCache.Refresh (369ms) + TypeCache.ScanAssembly (348ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1149ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (562ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (115ms) + ProcessInitializeOnLoadAttributes (402ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Refreshing native plugins compatible for Editor in 63.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (133.8 KB). Loaded Objects now: 5461. +Memory consumption went from 168.7 MB to 168.6 MB. +Total: 91.445600 ms (FindLiveObjects: 5.555800 ms CreateObjectMapping: 13.445800 ms MarkObjects: 72.035500 ms DeleteObjects: 0.404900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.346 seconds +Refreshing native plugins compatible for Editor in 19.15 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.209 seconds +Domain Reload Profiling: 2549ms + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + RebuildCommonClasses (28ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (48ms) + LoadAllAssembliesAndSetupDomain (1067ms) + LoadAssemblies (730ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (407ms) + TypeCache.Refresh (399ms) + TypeCache.ScanAssembly (374ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1209ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (581ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (119ms) + ProcessInitializeOnLoadAttributes (406ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 37.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5476. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 8.281900 ms (FindLiveObjects: 0.726700 ms CreateObjectMapping: 1.093600 ms MarkObjects: 6.111400 ms DeleteObjects: 0.348400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.253 seconds +Refreshing native plugins compatible for Editor in 22.05 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.329 seconds +Domain Reload Profiling: 2578ms + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (3ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + RebuildCommonClasses (28ms) + RebuildNativeTypeToScriptingClass (9ms) + initialDomainReloadingComplete (55ms) + LoadAllAssembliesAndSetupDomain (999ms) + LoadAssemblies (705ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (350ms) + TypeCache.Refresh (341ms) + TypeCache.ScanAssembly (313ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (9ms) + FinalizeReload (1329ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (593ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (145ms) + ProcessInitializeOnLoadAttributes (378ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Refreshing native plugins compatible for Editor in 30.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5491. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 6.723600 ms (FindLiveObjects: 0.843600 ms CreateObjectMapping: 0.601600 ms MarkObjects: 4.743600 ms DeleteObjects: 0.531500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.297 seconds +Refreshing native plugins compatible for Editor in 21.65 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.033 seconds +Domain Reload Profiling: 2322ms + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + RebuildCommonClasses (36ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (66ms) + LoadAllAssembliesAndSetupDomain (1016ms) + LoadAssemblies (667ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (402ms) + TypeCache.Refresh (393ms) + TypeCache.ScanAssembly (372ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1033ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (475ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (110ms) + ProcessInitializeOnLoadAttributes (322ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Refreshing native plugins compatible for Editor in 27.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5506. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 6.601200 ms (FindLiveObjects: 1.068000 ms CreateObjectMapping: 1.019700 ms MarkObjects: 4.235000 ms DeleteObjects: 0.274900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.403 seconds +Refreshing native plugins compatible for Editor in 34.74 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.230 seconds +Domain Reload Profiling: 2627ms + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + RebuildCommonClasses (38ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (50ms) + LoadAllAssembliesAndSetupDomain (1131ms) + LoadAssemblies (675ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (515ms) + TypeCache.Refresh (503ms) + TypeCache.ScanAssembly (474ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (13ms) + FinalizeReload (1230ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (519ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (111ms) + ProcessInitializeOnLoadAttributes (353ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 33.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5521. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 44.018200 ms (FindLiveObjects: 1.560600 ms CreateObjectMapping: 1.421500 ms MarkObjects: 40.647200 ms DeleteObjects: 0.384400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.521 seconds +Refreshing native plugins compatible for Editor in 15.34 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.036 seconds +Domain Reload Profiling: 2553ms + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + RebuildCommonClasses (40ms) + RebuildNativeTypeToScriptingClass (12ms) + initialDomainReloadingComplete (59ms) + LoadAllAssembliesAndSetupDomain (1236ms) + LoadAssemblies (847ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (434ms) + TypeCache.Refresh (424ms) + TypeCache.ScanAssembly (399ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1037ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (484ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (102ms) + ProcessInitializeOnLoadAttributes (321ms) + ProcessInitializeOnLoadMethodAttributes (42ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Refreshing native plugins compatible for Editor in 38.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5536. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 8.033800 ms (FindLiveObjects: 0.629700 ms CreateObjectMapping: 1.213000 ms MarkObjects: 5.856700 ms DeleteObjects: 0.332500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.321 seconds +Refreshing native plugins compatible for Editor in 16.40 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 0.994 seconds +Domain Reload Profiling: 2308ms + BeginReloadAssembly (269ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (115ms) + RebuildCommonClasses (47ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (57ms) + LoadAllAssembliesAndSetupDomain (925ms) + LoadAssemblies (696ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (317ms) + TypeCache.Refresh (307ms) + TypeCache.ScanAssembly (294ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (995ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (448ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (112ms) + ProcessInitializeOnLoadAttributes (297ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Refreshing native plugins compatible for Editor in 30.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5551. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 5.656600 ms (FindLiveObjects: 0.662700 ms CreateObjectMapping: 0.879500 ms MarkObjects: 3.939900 ms DeleteObjects: 0.173200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.745 seconds +Refreshing native plugins compatible for Editor in 25.83 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.415 seconds +Domain Reload Profiling: 3155ms + BeginReloadAssembly (217ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (73ms) + RebuildCommonClasses (31ms) + RebuildNativeTypeToScriptingClass (10ms) + initialDomainReloadingComplete (68ms) + LoadAllAssembliesAndSetupDomain (1415ms) + LoadAssemblies (822ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (665ms) + TypeCache.Refresh (653ms) + TypeCache.ScanAssembly (622ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (12ms) + FinalizeReload (1415ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (541ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (118ms) + ProcessInitializeOnLoadAttributes (372ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 31.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5566. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 8.803800 ms (FindLiveObjects: 1.573000 ms CreateObjectMapping: 1.121600 ms MarkObjects: 4.703600 ms DeleteObjects: 1.403000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 2757.691989 seconds. + path: Assets/HotAssets/Resource/HotPrefab.prefab + artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e1e524682208842f37209631add5e310') in 0.206575 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 10 +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.042 seconds +Refreshing native plugins compatible for Editor in 39.69 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.522 seconds +Domain Reload Profiling: 3553ms + BeginReloadAssembly (288ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (117ms) + RebuildCommonClasses (58ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (97ms) + LoadAllAssembliesAndSetupDomain (1570ms) + LoadAssemblies (1105ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (563ms) + TypeCache.Refresh (546ms) + TypeCache.ScanAssembly (508ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (18ms) + FinalizeReload (1522ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (656ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (142ms) + ProcessInitializeOnLoadAttributes (454ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Refreshing native plugins compatible for Editor in 42.23 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5590. +Memory consumption went from 173.1 MB to 173.0 MB. +Total: 9.034200 ms (FindLiveObjects: 0.793000 ms CreateObjectMapping: 0.796900 ms MarkObjects: 6.743200 ms DeleteObjects: 0.698900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 4017.348593 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage + artifactKey: Guid(1a83070ee231cef4fa6e7cd6ad759ac5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage using Guid(1a83070ee231cef4fa6e7cd6ad759ac5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '35685d0c359c75a0cd48e9d7df8c415a') in 0.110682 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Import Request. + Time since last request: 1.282593 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage.version + artifactKey: Guid(022f876642a319a48bba9160aa34dc3e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage.version using Guid(022f876642a319a48bba9160aa34dc3e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c94309c36927e6bc6bca99772566d75c') in 0.103414 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 0.498837 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.bytes + artifactKey: Guid(87a1fb271c7f63a46ac4c113f9225de5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.bytes using Guid(87a1fb271c7f63a46ac4c113f9225de5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c87684ef42a558d9aa9b67cc14300c08') in 0.003953 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 0.368195 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.hash + artifactKey: Guid(a9674dff3d6102349a3c38405d57135f) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.hash using Guid(a9674dff3d6102349a3c38405d57135f) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '9258a3d8ee2007ac3856f97eb001785b') in 0.003264 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 1.203896 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/79fed19d1f8259b979898e24fa6f6bfb.rawfile + artifactKey: Guid(c5992a68cbdfc984c9bdc6f48639d1bc) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/79fed19d1f8259b979898e24fa6f6bfb.rawfile using Guid(c5992a68cbdfc984c9bdc6f48639d1bc) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3c71349ffc01b87a76d846bcfe9f2853') in 0.002057 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 0.401000 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/35a3cb8929f188fd948a376f07dc7189.rawfile + artifactKey: Guid(5d8da02feee275e44b1830c325be6c92) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/35a3cb8929f188fd948a376f07dc7189.rawfile using Guid(5d8da02feee275e44b1830c325be6c92) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e1873476cd8158f9faf59bb859a26317') in 0.001511 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 0.390707 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/20cb526248ed8fbc2a222e07849f4c64.rawfile + artifactKey: Guid(465ede1251ba0bd47aac80dd35883eec) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/20cb526248ed8fbc2a222e07849f4c64.rawfile using Guid(465ede1251ba0bd47aac80dd35883eec) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '4274e646614231b506f7796bf778b15d') in 0.001838 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 0.391510 seconds. + path: Assets/StreamingAssets/yoo/RawFilePackage/4e1f435ea2f1bfd9b23da97f5b2e2e63.rawfile + artifactKey: Guid(452e5bfcc5b1540499a40f24643eae55) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/StreamingAssets/yoo/RawFilePackage/4e1f435ea2f1bfd9b23da97f5b2e2e63.rawfile using Guid(452e5bfcc5b1540499a40f24643eae55) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3b6b383416f8e4837b9f7cf0321aa3ab') in 0.001362 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.571 seconds +Refreshing native plugins compatible for Editor in 46.99 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.678 seconds +Domain Reload Profiling: 4245ms + BeginReloadAssembly (584ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (23ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (338ms) + RebuildCommonClasses (55ms) + RebuildNativeTypeToScriptingClass (15ms) + initialDomainReloadingComplete (78ms) + LoadAllAssembliesAndSetupDomain (1835ms) + LoadAssemblies (1239ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (705ms) + TypeCache.Refresh (688ms) + TypeCache.ScanAssembly (612ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1679ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (765ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (186ms) + ProcessInitializeOnLoadAttributes (492ms) + ProcessInitializeOnLoadMethodAttributes (59ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 42.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5605. +Memory consumption went from 173.1 MB to 173.0 MB. +Total: 6.507200 ms (FindLiveObjects: 0.753200 ms CreateObjectMapping: 0.620200 ms MarkObjects: 4.945100 ms DeleteObjects: 0.186200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.150 seconds +Refreshing native plugins compatible for Editor in 22.18 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.168 seconds +Domain Reload Profiling: 3308ms + BeginReloadAssembly (410ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (86ms) + RebuildCommonClasses (133ms) + RebuildNativeTypeToScriptingClass (24ms) + initialDomainReloadingComplete (152ms) + LoadAllAssembliesAndSetupDomain (1420ms) + LoadAssemblies (1261ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (408ms) + TypeCache.Refresh (394ms) + TypeCache.ScanAssembly (369ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1169ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (534ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (137ms) + ProcessInitializeOnLoadAttributes (345ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (9ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 56.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5620. +Memory consumption went from 173.1 MB to 173.0 MB. +Total: 9.222500 ms (FindLiveObjects: 1.367400 ms CreateObjectMapping: 2.201900 ms MarkObjects: 5.412600 ms DeleteObjects: 0.237700 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.627 seconds +Refreshing native plugins compatible for Editor in 30.44 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.564 seconds +Domain Reload Profiling: 3182ms + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + RebuildCommonClasses (35ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (69ms) + LoadAllAssembliesAndSetupDomain (1318ms) + LoadAssemblies (839ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (541ms) + TypeCache.Refresh (526ms) + TypeCache.ScanAssembly (479ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (14ms) + FinalizeReload (1565ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (734ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (168ms) + ProcessInitializeOnLoadAttributes (494ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 32.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5635. +Memory consumption went from 173.2 MB to 173.1 MB. +Total: 10.410900 ms (FindLiveObjects: 0.960200 ms CreateObjectMapping: 4.118900 ms MarkObjects: 5.093800 ms DeleteObjects: 0.234400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.742 seconds +Refreshing native plugins compatible for Editor in 27.03 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.525 seconds +Domain Reload Profiling: 3256ms + BeginReloadAssembly (299ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (115ms) + RebuildCommonClasses (66ms) + RebuildNativeTypeToScriptingClass (17ms) + initialDomainReloadingComplete (72ms) + LoadAllAssembliesAndSetupDomain (1277ms) + LoadAssemblies (965ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (428ms) + TypeCache.Refresh (417ms) + TypeCache.ScanAssembly (387ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (10ms) + FinalizeReload (1526ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (678ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (144ms) + ProcessInitializeOnLoadAttributes (445ms) + ProcessInitializeOnLoadMethodAttributes (60ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (19ms) +Refreshing native plugins compatible for Editor in 38.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5650. +Memory consumption went from 173.2 MB to 173.1 MB. +Total: 3.221400 ms (FindLiveObjects: 0.739100 ms CreateObjectMapping: 0.243700 ms MarkObjects: 2.105300 ms DeleteObjects: 0.132400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.586 seconds +Refreshing native plugins compatible for Editor in 20.95 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.586 seconds +Domain Reload Profiling: 3167ms + BeginReloadAssembly (279ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (108ms) + RebuildCommonClasses (59ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (63ms) + LoadAllAssembliesAndSetupDomain (1165ms) + LoadAssemblies (790ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (475ms) + TypeCache.Refresh (461ms) + TypeCache.ScanAssembly (434ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (12ms) + FinalizeReload (1587ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (845ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (177ms) + ProcessInitializeOnLoadAttributes (601ms) + ProcessInitializeOnLoadMethodAttributes (39ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Refreshing native plugins compatible for Editor in 34.35 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5665. +Memory consumption went from 173.2 MB to 173.1 MB. +Total: 7.063100 ms (FindLiveObjects: 0.929400 ms CreateObjectMapping: 0.991700 ms MarkObjects: 4.800200 ms DeleteObjects: 0.339600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 33.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 1 Unused Serialized files (Serialized files now loaded: 0) +Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5665. +Memory consumption went from 95.3 MB to 95.2 MB. +Total: 59.636000 ms (FindLiveObjects: 45.134000 ms CreateObjectMapping: 1.027200 ms MarkObjects: 13.350400 ms DeleteObjects: 0.116400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.969 seconds +Refreshing native plugins compatible for Editor in 28.15 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.175 seconds +Domain Reload Profiling: 5137ms + BeginReloadAssembly (304ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (124ms) + RebuildCommonClasses (60ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (90ms) + LoadAllAssembliesAndSetupDomain (1492ms) + LoadAssemblies (1072ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (527ms) + TypeCache.Refresh (512ms) + TypeCache.ScanAssembly (481ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (11ms) + FinalizeReload (3176ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (799ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (203ms) + ProcessInitializeOnLoadAttributes (531ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 77.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.1 KB). Loaded Objects now: 5683. +Memory consumption went from 173.3 MB to 173.2 MB. +Total: 14.226400 ms (FindLiveObjects: 1.535600 ms CreateObjectMapping: 1.037300 ms MarkObjects: 11.098300 ms DeleteObjects: 0.550500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.038 seconds +Refreshing native plugins compatible for Editor in 27.30 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.961 seconds +Domain Reload Profiling: 3978ms + BeginReloadAssembly (280ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (100ms) + RebuildCommonClasses (87ms) + RebuildNativeTypeToScriptingClass (25ms) + initialDomainReloadingComplete (124ms) + LoadAllAssembliesAndSetupDomain (1498ms) + LoadAssemblies (1074ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (535ms) + TypeCache.Refresh (519ms) + TypeCache.ScanAssembly (489ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (13ms) + FinalizeReload (1962ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (1141ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (209ms) + ProcessInitializeOnLoadAttributes (821ms) + ProcessInitializeOnLoadMethodAttributes (75ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Refreshing native plugins compatible for Editor in 46.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5698. +Memory consumption went from 173.3 MB to 173.2 MB. +Total: 12.770000 ms (FindLiveObjects: 1.196100 ms CreateObjectMapping: 3.042900 ms MarkObjects: 6.507000 ms DeleteObjects: 2.019100 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 89.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 1 Unused Serialized files (Serialized files now loaded: 0) +Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5698. +Memory consumption went from 95.3 MB to 95.2 MB. +Total: 6.218600 ms (FindLiveObjects: 0.492500 ms CreateObjectMapping: 0.866300 ms MarkObjects: 4.710700 ms DeleteObjects: 0.146000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.223 seconds +Refreshing native plugins compatible for Editor in 43.15 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.944 seconds +Domain Reload Profiling: 4156ms + BeginReloadAssembly (313ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (135ms) + RebuildCommonClasses (57ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (102ms) + LoadAllAssembliesAndSetupDomain (1722ms) + LoadAssemblies (1207ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (600ms) + TypeCache.Refresh (584ms) + TypeCache.ScanAssembly (542ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (16ms) + FinalizeReload (1945ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (954ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (12ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (199ms) + ProcessInitializeOnLoadAttributes (648ms) + ProcessInitializeOnLoadMethodAttributes (69ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (19ms) +Refreshing native plugins compatible for Editor in 59.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.4 KB). Loaded Objects now: 5713. +Memory consumption went from 173.3 MB to 173.2 MB. +Total: 86.374000 ms (FindLiveObjects: 2.561200 ms CreateObjectMapping: 55.740500 ms MarkObjects: 27.679300 ms DeleteObjects: 0.389900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.884 seconds +Refreshing native plugins compatible for Editor in 35.39 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.113 seconds +Domain Reload Profiling: 3987ms + BeginReloadAssembly (254ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (88ms) + RebuildCommonClasses (53ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (91ms) + LoadAllAssembliesAndSetupDomain (1463ms) + LoadAssemblies (977ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (576ms) + TypeCache.Refresh (564ms) + TypeCache.ScanAssembly (533ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (12ms) + FinalizeReload (2113ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (932ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (211ms) + ProcessInitializeOnLoadAttributes (642ms) + ProcessInitializeOnLoadMethodAttributes (46ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (18ms) +Refreshing native plugins compatible for Editor in 44.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5728. +Memory consumption went from 173.3 MB to 173.2 MB. +Total: 6.509000 ms (FindLiveObjects: 0.897200 ms CreateObjectMapping: 0.604900 ms MarkObjects: 4.702300 ms DeleteObjects: 0.301800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.080 seconds +Refreshing native plugins compatible for Editor in 42.90 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.838 seconds +Domain Reload Profiling: 3912ms + BeginReloadAssembly (252ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (86ms) + RebuildCommonClasses (45ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (79ms) + LoadAllAssembliesAndSetupDomain (1683ms) + LoadAssemblies (1024ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (748ms) + TypeCache.Refresh (726ms) + TypeCache.ScanAssembly (669ms) + ScanForSourceGeneratedMonoScriptInfo (5ms) + ResolveRequiredComponents (18ms) + FinalizeReload (1839ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (793ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (168ms) + ProcessInitializeOnLoadAttributes (552ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 38.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5743. +Memory consumption went from 173.3 MB to 173.2 MB. +Total: 140.902800 ms (FindLiveObjects: 94.433500 ms CreateObjectMapping: 3.281400 ms MarkObjects: 42.817400 ms DeleteObjects: 0.367500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.022 seconds +Refreshing native plugins compatible for Editor in 58.59 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.938 seconds +Domain Reload Profiling: 3955ms + BeginReloadAssembly (337ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (129ms) + RebuildCommonClasses (63ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (83ms) + LoadAllAssembliesAndSetupDomain (1515ms) + LoadAssemblies (1067ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (568ms) + TypeCache.Refresh (548ms) + TypeCache.ScanAssembly (509ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (19ms) + FinalizeReload (1940ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (769ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (12ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (175ms) + ProcessInitializeOnLoadAttributes (524ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 36.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5758. +Memory consumption went from 173.4 MB to 173.3 MB. +Total: 26.243200 ms (FindLiveObjects: 8.150200 ms CreateObjectMapping: 4.622900 ms MarkObjects: 12.406100 ms DeleteObjects: 1.061200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.725 seconds +Refreshing native plugins compatible for Editor in 32.77 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.841 seconds +Domain Reload Profiling: 4552ms + BeginReloadAssembly (306ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (125ms) + RebuildCommonClasses (81ms) + RebuildNativeTypeToScriptingClass (43ms) + initialDomainReloadingComplete (209ms) + LoadAllAssembliesAndSetupDomain (2070ms) + LoadAssemblies (1538ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (629ms) + TypeCache.Refresh (603ms) + TypeCache.ScanAssembly (566ms) + ScanForSourceGeneratedMonoScriptInfo (9ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1842ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (823ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (168ms) + ProcessInitializeOnLoadAttributes (563ms) + ProcessInitializeOnLoadMethodAttributes (56ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Refreshing native plugins compatible for Editor in 112.35 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5773. +Memory consumption went from 173.4 MB to 173.3 MB. +Total: 10.820400 ms (FindLiveObjects: 2.322800 ms CreateObjectMapping: 2.615500 ms MarkObjects: 5.586300 ms DeleteObjects: 0.289600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.125 seconds +Refreshing native plugins compatible for Editor in 31.77 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.954 seconds +Domain Reload Profiling: 4072ms + BeginReloadAssembly (312ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (114ms) + RebuildCommonClasses (64ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (80ms) + LoadAllAssembliesAndSetupDomain (1643ms) + LoadAssemblies (1059ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (701ms) + TypeCache.Refresh (684ms) + TypeCache.ScanAssembly (644ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1955ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (919ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (182ms) + ProcessInitializeOnLoadAttributes (642ms) + ProcessInitializeOnLoadMethodAttributes (61ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (30ms) +Refreshing native plugins compatible for Editor in 50.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5788. +Memory consumption went from 173.4 MB to 173.3 MB. +Total: 29.236100 ms (FindLiveObjects: 1.744100 ms CreateObjectMapping: 1.381500 ms MarkObjects: 23.439200 ms DeleteObjects: 2.647600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.220 seconds +Refreshing native plugins compatible for Editor in 29.55 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.667 seconds +Domain Reload Profiling: 3881ms + BeginReloadAssembly (308ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (110ms) + RebuildCommonClasses (60ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (86ms) + LoadAllAssembliesAndSetupDomain (1743ms) + LoadAssemblies (1054ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (792ms) + TypeCache.Refresh (768ms) + TypeCache.ScanAssembly (715ms) + ScanForSourceGeneratedMonoScriptInfo (6ms) + ResolveRequiredComponents (19ms) + FinalizeReload (1668ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (715ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (157ms) + ProcessInitializeOnLoadAttributes (484ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Refreshing native plugins compatible for Editor in 39.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5803. +Memory consumption went from 173.4 MB to 173.3 MB. +Total: 21.043200 ms (FindLiveObjects: 1.000400 ms CreateObjectMapping: 5.662200 ms MarkObjects: 14.203300 ms DeleteObjects: 0.175400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.064 seconds +Refreshing native plugins compatible for Editor in 43.68 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.115 seconds +Domain Reload Profiling: 4170ms + BeginReloadAssembly (281ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (104ms) + RebuildCommonClasses (67ms) + RebuildNativeTypeToScriptingClass (19ms) + initialDomainReloadingComplete (132ms) + LoadAllAssembliesAndSetupDomain (1554ms) + LoadAssemblies (1096ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (560ms) + TypeCache.Refresh (542ms) + TypeCache.ScanAssembly (502ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (18ms) + FinalizeReload (2116ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (936ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (220ms) + ProcessInitializeOnLoadAttributes (626ms) + ProcessInitializeOnLoadMethodAttributes (53ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 86.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5818. +Memory consumption went from 173.4 MB to 173.3 MB. +Total: 32.135000 ms (FindLiveObjects: 2.102200 ms CreateObjectMapping: 1.399200 ms MarkObjects: 28.154700 ms DeleteObjects: 0.474000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 42.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 1 Unused Serialized files (Serialized files now loaded: 0) +Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5818. +Memory consumption went from 95.4 MB to 95.3 MB. +Total: 11.013400 ms (FindLiveObjects: 3.047500 ms CreateObjectMapping: 1.389300 ms MarkObjects: 6.511900 ms DeleteObjects: 0.062600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.072 seconds +Refreshing native plugins compatible for Editor in 48.97 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.674 seconds +Domain Reload Profiling: 5739ms + BeginReloadAssembly (289ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (112ms) + RebuildCommonClasses (50ms) + RebuildNativeTypeToScriptingClass (15ms) + initialDomainReloadingComplete (87ms) + LoadAllAssembliesAndSetupDomain (1622ms) + LoadAssemblies (1103ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (606ms) + TypeCache.Refresh (589ms) + TypeCache.ScanAssembly (561ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (14ms) + FinalizeReload (3675ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (851ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (208ms) + ProcessInitializeOnLoadAttributes (564ms) + ProcessInitializeOnLoadMethodAttributes (47ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 62.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.6 KB). Loaded Objects now: 5833. +Memory consumption went from 173.5 MB to 173.3 MB. +Total: 7.574200 ms (FindLiveObjects: 1.344600 ms CreateObjectMapping: 1.441200 ms MarkObjects: 4.468400 ms DeleteObjects: 0.316400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.185 seconds +Refreshing native plugins compatible for Editor in 34.63 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.168 seconds +Domain Reload Profiling: 4345ms + BeginReloadAssembly (309ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (106ms) + RebuildCommonClasses (60ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (99ms) + LoadAllAssembliesAndSetupDomain (1691ms) + LoadAssemblies (1126ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (669ms) + TypeCache.Refresh (650ms) + TypeCache.ScanAssembly (617ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (19ms) + FinalizeReload (2169ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (1097ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (191ms) + ProcessInitializeOnLoadAttributes (809ms) + ProcessInitializeOnLoadMethodAttributes (55ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (25ms) +Refreshing native plugins compatible for Editor in 57.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.7 KB). Loaded Objects now: 5848. +Memory consumption went from 173.5 MB to 173.3 MB. +Total: 55.590000 ms (FindLiveObjects: 4.655700 ms CreateObjectMapping: 4.017500 ms MarkObjects: 38.276800 ms DeleteObjects: 8.602400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 48.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 1 Unused Serialized files (Serialized files now loaded: 0) +Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5848. +Memory consumption went from 95.4 MB to 95.4 MB. +Total: 23.347300 ms (FindLiveObjects: 1.141400 ms CreateObjectMapping: 2.173600 ms MarkObjects: 19.967900 ms DeleteObjects: 0.062400 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.154 seconds +Refreshing native plugins compatible for Editor in 31.36 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.835 seconds +Domain Reload Profiling: 4982ms + BeginReloadAssembly (277ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (78ms) + RebuildCommonClasses (66ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (72ms) + LoadAllAssembliesAndSetupDomain (1714ms) + LoadAssemblies (1083ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (751ms) + TypeCache.Refresh (732ms) + TypeCache.ScanAssembly (689ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (17ms) + FinalizeReload (2835ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (651ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (157ms) + ProcessInitializeOnLoadAttributes (424ms) + ProcessInitializeOnLoadMethodAttributes (39ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Refreshing native plugins compatible for Editor in 37.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.7 KB). Loaded Objects now: 5863. +Memory consumption went from 173.5 MB to 173.4 MB. +Total: 5.245900 ms (FindLiveObjects: 0.627200 ms CreateObjectMapping: 0.867100 ms MarkObjects: 3.489500 ms DeleteObjects: 0.259800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.785 seconds +Refreshing native plugins compatible for Editor in 22.19 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.875 seconds +Domain Reload Profiling: 3651ms + BeginReloadAssembly (248ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (82ms) + RebuildCommonClasses (57ms) + RebuildNativeTypeToScriptingClass (15ms) + initialDomainReloadingComplete (91ms) + LoadAllAssembliesAndSetupDomain (1364ms) + LoadAssemblies (977ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (477ms) + TypeCache.Refresh (464ms) + TypeCache.ScanAssembly (440ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1876ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (921ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (14ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (177ms) + ProcessInitializeOnLoadAttributes (656ms) + ProcessInitializeOnLoadMethodAttributes (48ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Refreshing native plugins compatible for Editor in 39.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5878. +Memory consumption went from 173.5 MB to 173.4 MB. +Total: 9.710800 ms (FindLiveObjects: 0.881500 ms CreateObjectMapping: 0.661000 ms MarkObjects: 7.843300 ms DeleteObjects: 0.321500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 47.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 1 Unused Serialized files (Serialized files now loaded: 0) +Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5878. +Memory consumption went from 95.5 MB to 95.4 MB. +Total: 8.307200 ms (FindLiveObjects: 1.307100 ms CreateObjectMapping: 1.717600 ms MarkObjects: 5.211100 ms DeleteObjects: 0.068300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 3.239 seconds +Refreshing native plugins compatible for Editor in 25.30 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.021 seconds +Domain Reload Profiling: 6234ms + BeginReloadAssembly (616ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (189ms) + RebuildCommonClasses (186ms) + RebuildNativeTypeToScriptingClass (32ms) + initialDomainReloadingComplete (163ms) + LoadAllAssembliesAndSetupDomain (2217ms) + LoadAssemblies (1897ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (641ms) + TypeCache.Refresh (625ms) + TypeCache.ScanAssembly (592ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (13ms) + FinalizeReload (3021ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (691ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (150ms) + ProcessInitializeOnLoadAttributes (457ms) + ProcessInitializeOnLoadMethodAttributes (52ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 59.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.6 KB). Loaded Objects now: 5893. +Memory consumption went from 173.5 MB to 173.3 MB. +Total: 9.173800 ms (FindLiveObjects: 0.818100 ms CreateObjectMapping: 0.814900 ms MarkObjects: 7.217700 ms DeleteObjects: 0.319000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 5127.793790 seconds. + path: Assets/Resources/BuildinFileManifest.asset + artifactKey: Guid(f158672a438d7024c82155e424606457) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Resources/BuildinFileManifest.asset using Guid(f158672a438d7024c82155e424606457) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '8c7c69f4cc6a6ac223b5f54b7ad82cbe') in 0.048183 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Import Request. + Time since last request: 218.017248 seconds. + path: Assets/HotAssets/Resource/HotPrefab.prefab + artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '74b56fd89583724cebd000432083c8f0') in 0.135573 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 10 +======================================================================== +Received Import Request. + Time since last request: 37.847326 seconds. + path: Assets/HotResources + artifactKey: Guid(9cf7250c4c4b62c4ea6c677e2007ec5a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotResources using Guid(9cf7250c4c4b62c4ea6c677e2007ec5a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'd722b8b6ca948e7adb5d6880e0705869') in 0.001088 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Import Request. + Time since last request: 21.424137 seconds. + path: Assets/HotScripts + artifactKey: Guid(35d982e86da74af4e95e0c2607885eb0) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotScripts using Guid(35d982e86da74af4e95e0c2607885eb0) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '20853789cee45c630ded17693e3d9126') in 0.001985 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Prepare +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.094 seconds +Refreshing native plugins compatible for Editor in 35.28 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.965 seconds +Domain Reload Profiling: 4053ms + BeginReloadAssembly (372ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (165ms) + RebuildCommonClasses (63ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (82ms) + LoadAllAssembliesAndSetupDomain (1551ms) + LoadAssemblies (1055ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (615ms) + TypeCache.Refresh (593ms) + TypeCache.ScanAssembly (550ms) + ScanForSourceGeneratedMonoScriptInfo (5ms) + ResolveRequiredComponents (18ms) + FinalizeReload (1966ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (813ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (189ms) + ProcessInitializeOnLoadAttributes (538ms) + ProcessInitializeOnLoadMethodAttributes (52ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 33.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) +Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5908. +Memory consumption went from 173.6 MB to 173.5 MB. +Total: 33.962700 ms (FindLiveObjects: 3.592400 ms CreateObjectMapping: 12.530900 ms MarkObjects: 15.911100 ms DeleteObjects: 1.924900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 29.595573 seconds. + path: Assets/HotAssets/Resource/HotPrefab.prefab + artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '136e85e9cc649029ad32c1d1b51ab95c') in 0.147692 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 10 +======================================================================== +Received Import Request. + Time since last request: 38.260650 seconds. + path: Assets/Plugins/JNGame + artifactKey: Guid(262a8509f1a5bf741b5f85a2139411fe) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/JNGame using Guid(262a8509f1a5bf741b5f85a2139411fe) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e66c98ff3f3c4bc2bc4849a0e5139a49') in 0.003436 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +TcpMessagingSession - receive error +AssetImportWorkerClient::OnTransportError - code=10054 error=Ô¶³ÌÖ÷»úÇ¿ÆÈ¹Ø±ÕÁËÒ»¸öÏÖÓеÄÁ¬½Ó¡£ diff --git a/JNFrame2/Logs/AssetImportWorker0.log b/JNFrame2/Logs/AssetImportWorker0.log index 56a5b77d..4dcbf128 100644 --- a/JNFrame2/Logs/AssetImportWorker0.log +++ b/JNFrame2/Logs/AssetImportWorker0.log @@ -15,7 +15,7 @@ D:/myproject/JisolGame/JNFrame2 -logFile Logs/AssetImportWorker0.log -srvPort -64818 +63956 Successfully changed project path to: D:/myproject/JisolGame/JNFrame2 D:/myproject/JisolGame/JNFrame2 [UnityMemory] Configuration Parameters - Can be set up in boot.config @@ -49,11 +49,11 @@ D:/myproject/JisolGame/JNFrame2 "memorysetup-temp-allocator-size-cloud-worker=32768" "memorysetup-temp-allocator-size-gi-baking-worker=262144" "memorysetup-temp-allocator-size-gfx=262144" -Player connection [213912] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 1869204652 [EditorId] 1869204652 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... +Player connection [246660] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 4063488845 [EditorId] 4063488845 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... -Player connection [213912] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 1869204652 [EditorId] 1869204652 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... +Player connection [246660] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 4063488845 [EditorId] 4063488845 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... -Refreshing native plugins compatible for Editor in 117.88 ms, found 3 plugins. +Refreshing native plugins compatible for Editor in 74.62 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. Initialize engine version: 2022.3.1f1 (f18e0c1b5784) [Subsystems] Discovering subsystems at path D:/Unity/2022.3.1f1/Editor/Data/Resources/UnitySubsystems @@ -63,50 +63,50 @@ Direct3D: Version: Direct3D 11.0 [level 11.1] Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) Vendor: NVIDIA - VRAM: 5980 MB - Driver: 31.0.15.3623 + VRAM: 5966 MB + Driver: 32.0.15.6094 Initialize mono Mono path[0] = 'D:/Unity/2022.3.1f1/Editor/Data/Managed' Mono path[1] = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' Mono config path = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/etc' -Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56132 +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56736 Begin MonoManager ReloadAssembly Registering precompiled unity dll's ... Register platform support module: D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll -Registered in 0.009421 seconds. -- Loaded All Assemblies, in 0.522 seconds +Registered in 0.009146 seconds. +- Loaded All Assemblies, in 0.505 seconds Native extension for WindowsStandalone target not found Mono: successfully reloaded assembly -- Finished resetting the current domain, in 0.325 seconds -Domain Reload Profiling: 844ms - BeginReloadAssembly (184ms) +- Finished resetting the current domain, in 0.383 seconds +Domain Reload Profiling: 885ms + BeginReloadAssembly (133ms) ExecutionOrderSort (0ms) DisableScriptedObjects (0ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) CreateAndSetChildDomain (1ms) - RebuildCommonClasses (44ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (78ms) - LoadAllAssembliesAndSetupDomain (199ms) - LoadAssemblies (180ms) + RebuildCommonClasses (38ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (92ms) + LoadAllAssembliesAndSetupDomain (226ms) + LoadAssemblies (130ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (188ms) - TypeCache.Refresh (187ms) - TypeCache.ScanAssembly (168ms) + AnalyzeDomain (217ms) + TypeCache.Refresh (216ms) + TypeCache.ScanAssembly (197ms) ScanForSourceGeneratedMonoScriptInfo (0ms) ResolveRequiredComponents (1ms) - FinalizeReload (325ms) + FinalizeReload (384ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (256ms) + SetupLoadedEditorAssemblies (309ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (9ms) + InitializePlatformSupportModulesInManaged (12ms) + SetLoadedEditorAssemblies (10ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (3ms) - ProcessInitializeOnLoadAttributes (168ms) - ProcessInitializeOnLoadMethodAttributes (63ms) + BeforeProcessingInitializeOnLoad (2ms) + ProcessInitializeOnLoadAttributes (215ms) + ProcessInitializeOnLoadMethodAttributes (69ms) AfterProcessingInitializeOnLoad (0ms) EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) @@ -114,55 +114,55 @@ Domain Reload Profiling: 844ms ======================================================================== Worker process is ready to serve import requests Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.841 seconds -Refreshing native plugins compatible for Editor in 29.45 ms, found 3 plugins. +- Loaded All Assemblies, in 1.976 seconds +Refreshing native plugins compatible for Editor in 28.57 ms, found 3 plugins. Native extension for WindowsStandalone target not found Package Manager log level set to [2] [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.228 seconds -Domain Reload Profiling: 3065ms - BeginReloadAssembly (165ms) +- Finished resetting the current domain, in 2.236 seconds +Domain Reload Profiling: 4206ms + BeginReloadAssembly (137ms) ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) + DisableScriptedObjects (5ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (29ms) - RebuildCommonClasses (45ms) - RebuildNativeTypeToScriptingClass (15ms) - initialDomainReloadingComplete (62ms) - LoadAllAssembliesAndSetupDomain (1551ms) - LoadAssemblies (1041ms) + CreateAndSetChildDomain (24ms) + RebuildCommonClasses (36ms) + RebuildNativeTypeToScriptingClass (12ms) + initialDomainReloadingComplete (68ms) + LoadAllAssembliesAndSetupDomain (1716ms) + LoadAssemblies (1058ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (580ms) - TypeCache.Refresh (522ms) - TypeCache.ScanAssembly (492ms) - ScanForSourceGeneratedMonoScriptInfo (42ms) - ResolveRequiredComponents (16ms) - FinalizeReload (1229ms) + AnalyzeDomain (712ms) + TypeCache.Refresh (672ms) + TypeCache.ScanAssembly (613ms) + ScanForSourceGeneratedMonoScriptInfo (32ms) + ResolveRequiredComponents (8ms) + FinalizeReload (2237ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (974ms) + SetupLoadedEditorAssemblies (1480ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (14ms) - SetLoadedEditorAssemblies (10ms) + InitializePlatformSupportModulesInManaged (19ms) + SetLoadedEditorAssemblies (13ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (182ms) - ProcessInitializeOnLoadAttributes (719ms) - ProcessInitializeOnLoadMethodAttributes (37ms) - AfterProcessingInitializeOnLoad (11ms) - EditorAssembliesLoaded (0ms) + BeforeProcessingInitializeOnLoad (279ms) + ProcessInitializeOnLoadAttributes (1081ms) + ProcessInitializeOnLoadMethodAttributes (55ms) + AfterProcessingInitializeOnLoad (33ms) + EditorAssembliesLoaded (1ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Launched and connected shader compiler UnityShaderCompiler.exe after 0.10 seconds -Refreshing native plugins compatible for Editor in 34.34 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (22ms) +Launched and connected shader compiler UnityShaderCompiler.exe after 0.13 seconds +Refreshing native plugins compatible for Editor in 33.81 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5016 Unused Serialized files (Serialized files now loaded: 0) -Unloading 133 unused Assets / (163.6 KB). Loaded Objects now: 5443. -Memory consumption went from 171.0 MB to 170.8 MB. -Total: 6.377900 ms (FindLiveObjects: 0.698300 ms CreateObjectMapping: 0.534900 ms MarkObjects: 4.824500 ms DeleteObjects: 0.317400 ms) +Unloading 5022 Unused Serialized files (Serialized files now loaded: 0) +Unloading 134 unused Assets / (164.1 KB). Loaded Objects now: 5448. +Memory consumption went from 171.2 MB to 171.0 MB. +Total: 6.790300 ms (FindLiveObjects: 1.187100 ms CreateObjectMapping: 0.738300 ms MarkObjects: 4.571500 ms DeleteObjects: 0.290800 ms) AssetImportParameters requested are different than current active one (requested -> active): custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> @@ -177,1856 +177,88 @@ AssetImportParameters requested are different than current active one (requested custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> ======================================================================== Received Import Request. - Time since last request: 19208.880044 seconds. - path: Assets/HotAssets/HotDlls/HotSamples.dll.bytes - artifactKey: Guid(31ecfccf5f58fcd4e82c0039b5c0433e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotAssets/HotDlls/HotSamples.dll.bytes using Guid(31ecfccf5f58fcd4e82c0039b5c0433e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '5c560588ec1e60132db3bba0c7a53c1e') in 0.026024 seconds + Time since last request: 35846.462802 seconds. + path: Assets/AssetBundleCollectorSetting.asset + artifactKey: Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/AssetBundleCollectorSetting.asset using Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '21ca4d8f891a1347e90b69c9ce9df2c0') in 0.045208 seconds Number of updated asset objects reloaded before import = 0 Number of asset objects unloaded after import = 1 ======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.278 seconds -Refreshing native plugins compatible for Editor in 17.83 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.148 seconds -Domain Reload Profiling: 2418ms - BeginReloadAssembly (176ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (48ms) - RebuildCommonClasses (30ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (55ms) - LoadAllAssembliesAndSetupDomain (995ms) - LoadAssemblies (686ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (378ms) - TypeCache.Refresh (369ms) - TypeCache.ScanAssembly (348ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (1149ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (562ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (115ms) - ProcessInitializeOnLoadAttributes (402ms) - ProcessInitializeOnLoadMethodAttributes (25ms) - AfterProcessingInitializeOnLoad (8ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (9ms) -Refreshing native plugins compatible for Editor in 63.22 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (133.8 KB). Loaded Objects now: 5461. -Memory consumption went from 168.7 MB to 168.6 MB. -Total: 91.445600 ms (FindLiveObjects: 5.555800 ms CreateObjectMapping: 13.445800 ms MarkObjects: 72.035500 ms DeleteObjects: 0.404900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +Received Import Request. + Time since last request: 484.474702 seconds. + path: Assets/Plugins/FairyGUI + artifactKey: Guid(53bdd28b74e5cb144ac7165c06a5f286) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/FairyGUI using Guid(53bdd28b74e5cb144ac7165c06a5f286) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '260bd861473cd8d23e0319e072d2c444') in 0.001351 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Import Request. + Time since last request: 1.142707 seconds. + path: Assets/Plugins/FairyGUI/Runtime + artifactKey: Guid(301fdc52d1f18da46a6b39888abab570) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/FairyGUI/Runtime using Guid(301fdc52d1f18da46a6b39888abab570) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '124c9bacc79dae3a0752254e84db9188') in 0.001007 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Import Request. + Time since last request: 0.047767 seconds. + path: Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef + artifactKey: Guid(f4270d81837019d47b93f11421168dae) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/FairyGUI/Runtime/FairyGUI.Runtime.asmdef using Guid(f4270d81837019d47b93f11421168dae) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '77168e4dfe244f073138d2217d0b8453') in 0.000847 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 ======================================================================== Received Prepare Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.346 seconds -Refreshing native plugins compatible for Editor in 19.15 ms, found 3 plugins. +- Loaded All Assemblies, in 1.152 seconds +Refreshing native plugins compatible for Editor in 25.48 ms, found 3 plugins. Native extension for WindowsStandalone target not found [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.209 seconds -Domain Reload Profiling: 2549ms - BeginReloadAssembly (186ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (62ms) - RebuildCommonClasses (28ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (48ms) - LoadAllAssembliesAndSetupDomain (1067ms) - LoadAssemblies (730ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (407ms) - TypeCache.Refresh (399ms) - TypeCache.ScanAssembly (374ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1209ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (581ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (6ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (119ms) - ProcessInitializeOnLoadAttributes (406ms) - ProcessInitializeOnLoadMethodAttributes (33ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 37.87 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5476. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 8.281900 ms (FindLiveObjects: 0.726700 ms CreateObjectMapping: 1.093600 ms MarkObjects: 6.111400 ms DeleteObjects: 0.348400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.253 seconds -Refreshing native plugins compatible for Editor in 22.05 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.329 seconds -Domain Reload Profiling: 2578ms - BeginReloadAssembly (158ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (3ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (51ms) - RebuildCommonClasses (28ms) - RebuildNativeTypeToScriptingClass (9ms) - initialDomainReloadingComplete (55ms) - LoadAllAssembliesAndSetupDomain (999ms) - LoadAssemblies (705ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (350ms) - TypeCache.Refresh (341ms) - TypeCache.ScanAssembly (313ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (9ms) - FinalizeReload (1329ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (593ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (145ms) - ProcessInitializeOnLoadAttributes (378ms) - ProcessInitializeOnLoadMethodAttributes (40ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (15ms) -Refreshing native plugins compatible for Editor in 30.82 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5491. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 6.723600 ms (FindLiveObjects: 0.843600 ms CreateObjectMapping: 0.601600 ms MarkObjects: 4.743600 ms DeleteObjects: 0.531500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.297 seconds -Refreshing native plugins compatible for Editor in 21.65 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.033 seconds -Domain Reload Profiling: 2322ms +- Finished resetting the current domain, in 1.153 seconds +Domain Reload Profiling: 2301ms BeginReloadAssembly (160ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (5ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (49ms) - RebuildCommonClasses (36ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (66ms) - LoadAllAssembliesAndSetupDomain (1016ms) - LoadAssemblies (667ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (402ms) - TypeCache.Refresh (393ms) - TypeCache.ScanAssembly (372ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (1033ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (475ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (6ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (110ms) - ProcessInitializeOnLoadAttributes (322ms) - ProcessInitializeOnLoadMethodAttributes (23ms) - AfterProcessingInitializeOnLoad (8ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (10ms) -Refreshing native plugins compatible for Editor in 27.39 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5506. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 6.601200 ms (FindLiveObjects: 1.068000 ms CreateObjectMapping: 1.019700 ms MarkObjects: 4.235000 ms DeleteObjects: 0.274900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.403 seconds -Refreshing native plugins compatible for Editor in 34.74 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.230 seconds -Domain Reload Profiling: 2627ms - BeginReloadAssembly (168ms) ExecutionOrderSort (0ms) DisableScriptedObjects (4ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) CreateAndSetChildDomain (55ms) - RebuildCommonClasses (38ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (50ms) - LoadAllAssembliesAndSetupDomain (1131ms) - LoadAssemblies (675ms) + RebuildCommonClasses (27ms) + RebuildNativeTypeToScriptingClass (9ms) + initialDomainReloadingComplete (49ms) + LoadAllAssembliesAndSetupDomain (901ms) + LoadAssemblies (656ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (515ms) - TypeCache.Refresh (503ms) - TypeCache.ScanAssembly (474ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (13ms) - FinalizeReload (1230ms) + AnalyzeDomain (301ms) + TypeCache.Refresh (290ms) + TypeCache.ScanAssembly (275ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1154ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (519ms) + SetupLoadedEditorAssemblies (480ms) LogAssemblyErrors (0ms) InitializePlatformSupportModulesInManaged (6ms) SetLoadedEditorAssemblies (4ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (111ms) - ProcessInitializeOnLoadAttributes (353ms) - ProcessInitializeOnLoadMethodAttributes (34ms) - AfterProcessingInitializeOnLoad (10ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 33.90 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5521. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 44.018200 ms (FindLiveObjects: 1.560600 ms CreateObjectMapping: 1.421500 ms MarkObjects: 40.647200 ms DeleteObjects: 0.384400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.521 seconds -Refreshing native plugins compatible for Editor in 15.34 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.036 seconds -Domain Reload Profiling: 2553ms - BeginReloadAssembly (169ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (64ms) - RebuildCommonClasses (40ms) - RebuildNativeTypeToScriptingClass (12ms) - initialDomainReloadingComplete (59ms) - LoadAllAssembliesAndSetupDomain (1236ms) - LoadAssemblies (847ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (434ms) - TypeCache.Refresh (424ms) - TypeCache.ScanAssembly (399ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (1037ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (484ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (102ms) - ProcessInitializeOnLoadAttributes (321ms) - ProcessInitializeOnLoadMethodAttributes (42ms) - AfterProcessingInitializeOnLoad (11ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (15ms) -Refreshing native plugins compatible for Editor in 38.62 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5536. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 8.033800 ms (FindLiveObjects: 0.629700 ms CreateObjectMapping: 1.213000 ms MarkObjects: 5.856700 ms DeleteObjects: 0.332500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.321 seconds -Refreshing native plugins compatible for Editor in 16.40 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 0.994 seconds -Domain Reload Profiling: 2308ms - BeginReloadAssembly (269ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (115ms) - RebuildCommonClasses (47ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (57ms) - LoadAllAssembliesAndSetupDomain (925ms) - LoadAssemblies (696ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (317ms) - TypeCache.Refresh (307ms) - TypeCache.ScanAssembly (294ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (995ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (448ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (112ms) - ProcessInitializeOnLoadAttributes (297ms) - ProcessInitializeOnLoadMethodAttributes (22ms) - AfterProcessingInitializeOnLoad (8ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (9ms) -Refreshing native plugins compatible for Editor in 30.92 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5551. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 5.656600 ms (FindLiveObjects: 0.662700 ms CreateObjectMapping: 0.879500 ms MarkObjects: 3.939900 ms DeleteObjects: 0.173200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.745 seconds -Refreshing native plugins compatible for Editor in 25.83 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.415 seconds -Domain Reload Profiling: 3155ms - BeginReloadAssembly (217ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (73ms) - RebuildCommonClasses (31ms) - RebuildNativeTypeToScriptingClass (10ms) - initialDomainReloadingComplete (68ms) - LoadAllAssembliesAndSetupDomain (1415ms) - LoadAssemblies (822ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (665ms) - TypeCache.Refresh (653ms) - TypeCache.ScanAssembly (622ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (12ms) - FinalizeReload (1415ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (541ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (118ms) - ProcessInitializeOnLoadAttributes (372ms) + BeforeProcessingInitializeOnLoad (116ms) + ProcessInitializeOnLoadAttributes (313ms) ProcessInitializeOnLoadMethodAttributes (29ms) - AfterProcessingInitializeOnLoad (10ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 31.44 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5566. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 8.803800 ms (FindLiveObjects: 1.573000 ms CreateObjectMapping: 1.121600 ms MarkObjects: 4.703600 ms DeleteObjects: 1.403000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Import Request. - Time since last request: 2757.691989 seconds. - path: Assets/HotAssets/Resource/HotPrefab.prefab - artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e1e524682208842f37209631add5e310') in 0.206575 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 10 -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.042 seconds -Refreshing native plugins compatible for Editor in 39.69 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.522 seconds -Domain Reload Profiling: 3553ms - BeginReloadAssembly (288ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (117ms) - RebuildCommonClasses (58ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (97ms) - LoadAllAssembliesAndSetupDomain (1570ms) - LoadAssemblies (1105ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (563ms) - TypeCache.Refresh (546ms) - TypeCache.ScanAssembly (508ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (18ms) - FinalizeReload (1522ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (656ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (142ms) - ProcessInitializeOnLoadAttributes (454ms) - ProcessInitializeOnLoadMethodAttributes (34ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (17ms) -Refreshing native plugins compatible for Editor in 42.23 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5590. -Memory consumption went from 173.1 MB to 173.0 MB. -Total: 9.034200 ms (FindLiveObjects: 0.793000 ms CreateObjectMapping: 0.796900 ms MarkObjects: 6.743200 ms DeleteObjects: 0.698900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Import Request. - Time since last request: 4017.348593 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage - artifactKey: Guid(1a83070ee231cef4fa6e7cd6ad759ac5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage using Guid(1a83070ee231cef4fa6e7cd6ad759ac5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '35685d0c359c75a0cd48e9d7df8c415a') in 0.110682 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 0 -======================================================================== -Received Import Request. - Time since last request: 1.282593 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage.version - artifactKey: Guid(022f876642a319a48bba9160aa34dc3e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage.version using Guid(022f876642a319a48bba9160aa34dc3e) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c94309c36927e6bc6bca99772566d75c') in 0.103414 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 0.498837 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.bytes - artifactKey: Guid(87a1fb271c7f63a46ac4c113f9225de5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.bytes using Guid(87a1fb271c7f63a46ac4c113f9225de5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c87684ef42a558d9aa9b67cc14300c08') in 0.003953 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 0.368195 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.hash - artifactKey: Guid(a9674dff3d6102349a3c38405d57135f) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/PackageManifest_RawFilePackage_2024-10-15-131.hash using Guid(a9674dff3d6102349a3c38405d57135f) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '9258a3d8ee2007ac3856f97eb001785b') in 0.003264 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 1.203896 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/79fed19d1f8259b979898e24fa6f6bfb.rawfile - artifactKey: Guid(c5992a68cbdfc984c9bdc6f48639d1bc) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/79fed19d1f8259b979898e24fa6f6bfb.rawfile using Guid(c5992a68cbdfc984c9bdc6f48639d1bc) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3c71349ffc01b87a76d846bcfe9f2853') in 0.002057 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 0.401000 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/35a3cb8929f188fd948a376f07dc7189.rawfile - artifactKey: Guid(5d8da02feee275e44b1830c325be6c92) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/35a3cb8929f188fd948a376f07dc7189.rawfile using Guid(5d8da02feee275e44b1830c325be6c92) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e1873476cd8158f9faf59bb859a26317') in 0.001511 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 0.390707 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/20cb526248ed8fbc2a222e07849f4c64.rawfile - artifactKey: Guid(465ede1251ba0bd47aac80dd35883eec) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/20cb526248ed8fbc2a222e07849f4c64.rawfile using Guid(465ede1251ba0bd47aac80dd35883eec) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '4274e646614231b506f7796bf778b15d') in 0.001838 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 0.391510 seconds. - path: Assets/StreamingAssets/yoo/RawFilePackage/4e1f435ea2f1bfd9b23da97f5b2e2e63.rawfile - artifactKey: Guid(452e5bfcc5b1540499a40f24643eae55) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/StreamingAssets/yoo/RawFilePackage/4e1f435ea2f1bfd9b23da97f5b2e2e63.rawfile using Guid(452e5bfcc5b1540499a40f24643eae55) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3b6b383416f8e4837b9f7cf0321aa3ab') in 0.001362 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.571 seconds -Refreshing native plugins compatible for Editor in 46.99 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.678 seconds -Domain Reload Profiling: 4245ms - BeginReloadAssembly (584ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (23ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (338ms) - RebuildCommonClasses (55ms) - RebuildNativeTypeToScriptingClass (15ms) - initialDomainReloadingComplete (78ms) - LoadAllAssembliesAndSetupDomain (1835ms) - LoadAssemblies (1239ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (705ms) - TypeCache.Refresh (688ms) - TypeCache.ScanAssembly (612ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1679ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (765ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (186ms) - ProcessInitializeOnLoadAttributes (492ms) - ProcessInitializeOnLoadMethodAttributes (59ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 42.82 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5605. -Memory consumption went from 173.1 MB to 173.0 MB. -Total: 6.507200 ms (FindLiveObjects: 0.753200 ms CreateObjectMapping: 0.620200 ms MarkObjects: 4.945100 ms DeleteObjects: 0.186200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.150 seconds -Refreshing native plugins compatible for Editor in 22.18 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.168 seconds -Domain Reload Profiling: 3308ms - BeginReloadAssembly (410ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (86ms) - RebuildCommonClasses (133ms) - RebuildNativeTypeToScriptingClass (24ms) - initialDomainReloadingComplete (152ms) - LoadAllAssembliesAndSetupDomain (1420ms) - LoadAssemblies (1261ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (408ms) - TypeCache.Refresh (394ms) - TypeCache.ScanAssembly (369ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (11ms) - FinalizeReload (1169ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (534ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (137ms) - ProcessInitializeOnLoadAttributes (345ms) - ProcessInitializeOnLoadMethodAttributes (28ms) - AfterProcessingInitializeOnLoad (9ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 56.20 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5620. -Memory consumption went from 173.1 MB to 173.0 MB. -Total: 9.222500 ms (FindLiveObjects: 1.367400 ms CreateObjectMapping: 2.201900 ms MarkObjects: 5.412600 ms DeleteObjects: 0.237700 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.627 seconds -Refreshing native plugins compatible for Editor in 30.44 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.564 seconds -Domain Reload Profiling: 3182ms - BeginReloadAssembly (182ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (61ms) - RebuildCommonClasses (35ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (69ms) - LoadAllAssembliesAndSetupDomain (1318ms) - LoadAssemblies (839ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (541ms) - TypeCache.Refresh (526ms) - TypeCache.ScanAssembly (479ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (14ms) - FinalizeReload (1565ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (734ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (168ms) - ProcessInitializeOnLoadAttributes (494ms) - ProcessInitializeOnLoadMethodAttributes (43ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 32.92 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5635. -Memory consumption went from 173.2 MB to 173.1 MB. -Total: 10.410900 ms (FindLiveObjects: 0.960200 ms CreateObjectMapping: 4.118900 ms MarkObjects: 5.093800 ms DeleteObjects: 0.234400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.742 seconds -Refreshing native plugins compatible for Editor in 27.03 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.525 seconds -Domain Reload Profiling: 3256ms - BeginReloadAssembly (299ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (115ms) - RebuildCommonClasses (66ms) - RebuildNativeTypeToScriptingClass (17ms) - initialDomainReloadingComplete (72ms) - LoadAllAssembliesAndSetupDomain (1277ms) - LoadAssemblies (965ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (428ms) - TypeCache.Refresh (417ms) - TypeCache.ScanAssembly (387ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (10ms) - FinalizeReload (1526ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (678ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (144ms) - ProcessInitializeOnLoadAttributes (445ms) - ProcessInitializeOnLoadMethodAttributes (60ms) - AfterProcessingInitializeOnLoad (16ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (19ms) -Refreshing native plugins compatible for Editor in 38.75 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5650. -Memory consumption went from 173.2 MB to 173.1 MB. -Total: 3.221400 ms (FindLiveObjects: 0.739100 ms CreateObjectMapping: 0.243700 ms MarkObjects: 2.105300 ms DeleteObjects: 0.132400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.586 seconds -Refreshing native plugins compatible for Editor in 20.95 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.586 seconds -Domain Reload Profiling: 3167ms - BeginReloadAssembly (279ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (108ms) - RebuildCommonClasses (59ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (63ms) - LoadAllAssembliesAndSetupDomain (1165ms) - LoadAssemblies (790ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (475ms) - TypeCache.Refresh (461ms) - TypeCache.ScanAssembly (434ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (12ms) - FinalizeReload (1587ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (845ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (177ms) - ProcessInitializeOnLoadAttributes (601ms) - ProcessInitializeOnLoadMethodAttributes (39ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (15ms) -Refreshing native plugins compatible for Editor in 34.35 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.4 KB). Loaded Objects now: 5665. -Memory consumption went from 173.2 MB to 173.1 MB. -Total: 7.063100 ms (FindLiveObjects: 0.929400 ms CreateObjectMapping: 0.991700 ms MarkObjects: 4.800200 ms DeleteObjects: 0.339600 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 33.44 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 1 Unused Serialized files (Serialized files now loaded: 0) -Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5665. -Memory consumption went from 95.3 MB to 95.2 MB. -Total: 59.636000 ms (FindLiveObjects: 45.134000 ms CreateObjectMapping: 1.027200 ms MarkObjects: 13.350400 ms DeleteObjects: 0.116400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.969 seconds -Refreshing native plugins compatible for Editor in 28.15 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.175 seconds -Domain Reload Profiling: 5137ms - BeginReloadAssembly (304ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (124ms) - RebuildCommonClasses (60ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (90ms) - LoadAllAssembliesAndSetupDomain (1492ms) - LoadAssemblies (1072ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (527ms) - TypeCache.Refresh (512ms) - TypeCache.ScanAssembly (481ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (11ms) - FinalizeReload (3176ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (799ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (203ms) - ProcessInitializeOnLoadAttributes (531ms) - ProcessInitializeOnLoadMethodAttributes (37ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 77.36 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.1 KB). Loaded Objects now: 5683. -Memory consumption went from 173.3 MB to 173.2 MB. -Total: 14.226400 ms (FindLiveObjects: 1.535600 ms CreateObjectMapping: 1.037300 ms MarkObjects: 11.098300 ms DeleteObjects: 0.550500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.038 seconds -Refreshing native plugins compatible for Editor in 27.30 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.961 seconds -Domain Reload Profiling: 3978ms - BeginReloadAssembly (280ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (100ms) - RebuildCommonClasses (87ms) - RebuildNativeTypeToScriptingClass (25ms) - initialDomainReloadingComplete (124ms) - LoadAllAssembliesAndSetupDomain (1498ms) - LoadAssemblies (1074ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (535ms) - TypeCache.Refresh (519ms) - TypeCache.ScanAssembly (489ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (13ms) - FinalizeReload (1962ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (1141ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (209ms) - ProcessInitializeOnLoadAttributes (821ms) - ProcessInitializeOnLoadMethodAttributes (75ms) - AfterProcessingInitializeOnLoad (16ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (17ms) -Refreshing native plugins compatible for Editor in 46.66 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.2 KB). Loaded Objects now: 5698. -Memory consumption went from 173.3 MB to 173.2 MB. -Total: 12.770000 ms (FindLiveObjects: 1.196100 ms CreateObjectMapping: 3.042900 ms MarkObjects: 6.507000 ms DeleteObjects: 2.019100 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 89.98 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 1 Unused Serialized files (Serialized files now loaded: 0) -Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5698. -Memory consumption went from 95.3 MB to 95.2 MB. -Total: 6.218600 ms (FindLiveObjects: 0.492500 ms CreateObjectMapping: 0.866300 ms MarkObjects: 4.710700 ms DeleteObjects: 0.146000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.223 seconds -Refreshing native plugins compatible for Editor in 43.15 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.944 seconds -Domain Reload Profiling: 4156ms - BeginReloadAssembly (313ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (135ms) - RebuildCommonClasses (57ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (102ms) - LoadAllAssembliesAndSetupDomain (1722ms) - LoadAssemblies (1207ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (600ms) - TypeCache.Refresh (584ms) - TypeCache.ScanAssembly (542ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (16ms) - FinalizeReload (1945ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (954ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (12ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (199ms) - ProcessInitializeOnLoadAttributes (648ms) - ProcessInitializeOnLoadMethodAttributes (69ms) - AfterProcessingInitializeOnLoad (17ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (19ms) -Refreshing native plugins compatible for Editor in 59.00 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.4 KB). Loaded Objects now: 5713. -Memory consumption went from 173.3 MB to 173.2 MB. -Total: 86.374000 ms (FindLiveObjects: 2.561200 ms CreateObjectMapping: 55.740500 ms MarkObjects: 27.679300 ms DeleteObjects: 0.389900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.884 seconds -Refreshing native plugins compatible for Editor in 35.39 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.113 seconds -Domain Reload Profiling: 3987ms - BeginReloadAssembly (254ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (88ms) - RebuildCommonClasses (53ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (91ms) - LoadAllAssembliesAndSetupDomain (1463ms) - LoadAssemblies (977ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (576ms) - TypeCache.Refresh (564ms) - TypeCache.ScanAssembly (533ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (12ms) - FinalizeReload (2113ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (932ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (211ms) - ProcessInitializeOnLoadAttributes (642ms) - ProcessInitializeOnLoadMethodAttributes (46ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (18ms) -Refreshing native plugins compatible for Editor in 44.19 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5728. -Memory consumption went from 173.3 MB to 173.2 MB. -Total: 6.509000 ms (FindLiveObjects: 0.897200 ms CreateObjectMapping: 0.604900 ms MarkObjects: 4.702300 ms DeleteObjects: 0.301800 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.080 seconds -Refreshing native plugins compatible for Editor in 42.90 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.838 seconds -Domain Reload Profiling: 3912ms - BeginReloadAssembly (252ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (86ms) - RebuildCommonClasses (45ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (79ms) - LoadAllAssembliesAndSetupDomain (1683ms) - LoadAssemblies (1024ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (748ms) - TypeCache.Refresh (726ms) - TypeCache.ScanAssembly (669ms) - ScanForSourceGeneratedMonoScriptInfo (5ms) - ResolveRequiredComponents (18ms) - FinalizeReload (1839ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (793ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (168ms) - ProcessInitializeOnLoadAttributes (552ms) - ProcessInitializeOnLoadMethodAttributes (44ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 38.44 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5743. -Memory consumption went from 173.3 MB to 173.2 MB. -Total: 140.902800 ms (FindLiveObjects: 94.433500 ms CreateObjectMapping: 3.281400 ms MarkObjects: 42.817400 ms DeleteObjects: 0.367500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.022 seconds -Refreshing native plugins compatible for Editor in 58.59 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.938 seconds -Domain Reload Profiling: 3955ms - BeginReloadAssembly (337ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (129ms) - RebuildCommonClasses (63ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (83ms) - LoadAllAssembliesAndSetupDomain (1515ms) - LoadAssemblies (1067ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (568ms) - TypeCache.Refresh (548ms) - TypeCache.ScanAssembly (509ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (19ms) - FinalizeReload (1940ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (769ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (12ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (175ms) - ProcessInitializeOnLoadAttributes (524ms) - ProcessInitializeOnLoadMethodAttributes (40ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 36.08 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5758. -Memory consumption went from 173.4 MB to 173.3 MB. -Total: 26.243200 ms (FindLiveObjects: 8.150200 ms CreateObjectMapping: 4.622900 ms MarkObjects: 12.406100 ms DeleteObjects: 1.061200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.725 seconds -Refreshing native plugins compatible for Editor in 32.77 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.841 seconds -Domain Reload Profiling: 4552ms - BeginReloadAssembly (306ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (125ms) - RebuildCommonClasses (81ms) - RebuildNativeTypeToScriptingClass (43ms) - initialDomainReloadingComplete (209ms) - LoadAllAssembliesAndSetupDomain (2070ms) - LoadAssemblies (1538ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (629ms) - TypeCache.Refresh (603ms) - TypeCache.ScanAssembly (566ms) - ScanForSourceGeneratedMonoScriptInfo (9ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1842ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (823ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (168ms) - ProcessInitializeOnLoadAttributes (563ms) - ProcessInitializeOnLoadMethodAttributes (56ms) - AfterProcessingInitializeOnLoad (16ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (20ms) -Refreshing native plugins compatible for Editor in 112.35 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5773. -Memory consumption went from 173.4 MB to 173.3 MB. -Total: 10.820400 ms (FindLiveObjects: 2.322800 ms CreateObjectMapping: 2.615500 ms MarkObjects: 5.586300 ms DeleteObjects: 0.289600 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.125 seconds -Refreshing native plugins compatible for Editor in 31.77 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.954 seconds -Domain Reload Profiling: 4072ms - BeginReloadAssembly (312ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (114ms) - RebuildCommonClasses (64ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (80ms) - LoadAllAssembliesAndSetupDomain (1643ms) - LoadAssemblies (1059ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (701ms) - TypeCache.Refresh (684ms) - TypeCache.ScanAssembly (644ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1955ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (919ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (182ms) - ProcessInitializeOnLoadAttributes (642ms) - ProcessInitializeOnLoadMethodAttributes (61ms) - AfterProcessingInitializeOnLoad (16ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (30ms) -Refreshing native plugins compatible for Editor in 50.84 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.9 KB). Loaded Objects now: 5788. -Memory consumption went from 173.4 MB to 173.3 MB. -Total: 29.236100 ms (FindLiveObjects: 1.744100 ms CreateObjectMapping: 1.381500 ms MarkObjects: 23.439200 ms DeleteObjects: 2.647600 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.220 seconds -Refreshing native plugins compatible for Editor in 29.55 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.667 seconds -Domain Reload Profiling: 3881ms - BeginReloadAssembly (308ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (12ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (110ms) - RebuildCommonClasses (60ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (86ms) - LoadAllAssembliesAndSetupDomain (1743ms) - LoadAssemblies (1054ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (792ms) - TypeCache.Refresh (768ms) - TypeCache.ScanAssembly (715ms) - ScanForSourceGeneratedMonoScriptInfo (6ms) - ResolveRequiredComponents (19ms) - FinalizeReload (1668ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (715ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (157ms) - ProcessInitializeOnLoadAttributes (484ms) - ProcessInitializeOnLoadMethodAttributes (44ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Refreshing native plugins compatible for Editor in 39.24 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5803. -Memory consumption went from 173.4 MB to 173.3 MB. -Total: 21.043200 ms (FindLiveObjects: 1.000400 ms CreateObjectMapping: 5.662200 ms MarkObjects: 14.203300 ms DeleteObjects: 0.175400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.064 seconds -Refreshing native plugins compatible for Editor in 43.68 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.115 seconds -Domain Reload Profiling: 4170ms - BeginReloadAssembly (281ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (104ms) - RebuildCommonClasses (67ms) - RebuildNativeTypeToScriptingClass (19ms) - initialDomainReloadingComplete (132ms) - LoadAllAssembliesAndSetupDomain (1554ms) - LoadAssemblies (1096ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (560ms) - TypeCache.Refresh (542ms) - TypeCache.ScanAssembly (502ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (18ms) - FinalizeReload (2116ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (936ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (14ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (220ms) - ProcessInitializeOnLoadAttributes (626ms) - ProcessInitializeOnLoadMethodAttributes (53ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 86.37 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5818. -Memory consumption went from 173.4 MB to 173.3 MB. -Total: 32.135000 ms (FindLiveObjects: 2.102200 ms CreateObjectMapping: 1.399200 ms MarkObjects: 28.154700 ms DeleteObjects: 0.474000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 42.72 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 1 Unused Serialized files (Serialized files now loaded: 0) -Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5818. -Memory consumption went from 95.4 MB to 95.3 MB. -Total: 11.013400 ms (FindLiveObjects: 3.047500 ms CreateObjectMapping: 1.389300 ms MarkObjects: 6.511900 ms DeleteObjects: 0.062600 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.072 seconds -Refreshing native plugins compatible for Editor in 48.97 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.674 seconds -Domain Reload Profiling: 5739ms - BeginReloadAssembly (289ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (12ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (112ms) - RebuildCommonClasses (50ms) - RebuildNativeTypeToScriptingClass (15ms) - initialDomainReloadingComplete (87ms) - LoadAllAssembliesAndSetupDomain (1622ms) - LoadAssemblies (1103ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (606ms) - TypeCache.Refresh (589ms) - TypeCache.ScanAssembly (561ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (14ms) - FinalizeReload (3675ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (851ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (208ms) - ProcessInitializeOnLoadAttributes (564ms) - ProcessInitializeOnLoadMethodAttributes (47ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 62.38 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.6 KB). Loaded Objects now: 5833. -Memory consumption went from 173.5 MB to 173.3 MB. -Total: 7.574200 ms (FindLiveObjects: 1.344600 ms CreateObjectMapping: 1.441200 ms MarkObjects: 4.468400 ms DeleteObjects: 0.316400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.185 seconds -Refreshing native plugins compatible for Editor in 34.63 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.168 seconds -Domain Reload Profiling: 4345ms - BeginReloadAssembly (309ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (10ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (106ms) - RebuildCommonClasses (60ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (99ms) - LoadAllAssembliesAndSetupDomain (1691ms) - LoadAssemblies (1126ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (669ms) - TypeCache.Refresh (650ms) - TypeCache.ScanAssembly (617ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (19ms) - FinalizeReload (2169ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (1097ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (14ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (191ms) - ProcessInitializeOnLoadAttributes (809ms) - ProcessInitializeOnLoadMethodAttributes (55ms) - AfterProcessingInitializeOnLoad (18ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (25ms) -Refreshing native plugins compatible for Editor in 57.38 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.7 KB). Loaded Objects now: 5848. -Memory consumption went from 173.5 MB to 173.3 MB. -Total: 55.590000 ms (FindLiveObjects: 4.655700 ms CreateObjectMapping: 4.017500 ms MarkObjects: 38.276800 ms DeleteObjects: 8.602400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 48.29 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 1 Unused Serialized files (Serialized files now loaded: 0) -Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5848. -Memory consumption went from 95.4 MB to 95.4 MB. -Total: 23.347300 ms (FindLiveObjects: 1.141400 ms CreateObjectMapping: 2.173600 ms MarkObjects: 19.967900 ms DeleteObjects: 0.062400 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.154 seconds -Refreshing native plugins compatible for Editor in 31.36 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.835 seconds -Domain Reload Profiling: 4982ms - BeginReloadAssembly (277ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (78ms) - RebuildCommonClasses (66ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (72ms) - LoadAllAssembliesAndSetupDomain (1714ms) - LoadAssemblies (1083ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (751ms) - TypeCache.Refresh (732ms) - TypeCache.ScanAssembly (689ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (17ms) - FinalizeReload (2835ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (651ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (157ms) - ProcessInitializeOnLoadAttributes (424ms) - ProcessInitializeOnLoadMethodAttributes (39ms) AfterProcessingInitializeOnLoad (11ms) EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (15ms) -Refreshing native plugins compatible for Editor in 37.97 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (10ms) +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 21.31 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.7 KB). Loaded Objects now: 5863. -Memory consumption went from 173.5 MB to 173.4 MB. -Total: 5.245900 ms (FindLiveObjects: 0.627200 ms CreateObjectMapping: 0.867100 ms MarkObjects: 3.489500 ms DeleteObjects: 0.259800 ms) +Unloading 5181 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (313.2 KB). Loaded Objects now: 5629. +Memory consumption went from 174.6 MB to 174.3 MB. +Total: 2.527900 ms (FindLiveObjects: 0.323900 ms CreateObjectMapping: 0.179900 ms MarkObjects: 1.820800 ms DeleteObjects: 0.202600 ms) Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): @@ -2041,139 +273,73 @@ AssetImportParameters requested are different than current active one (requested custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> ======================================================================== +Received Import Request. + Time since last request: 525.385791 seconds. + path: Assets/Plugins/SHFrame/Runtime + artifactKey: Guid(6f8f1e0db70b81f47a0f19fa43c4aab5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/SHFrame/Runtime using Guid(6f8f1e0db70b81f47a0f19fa43c4aab5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '620ad5b748a9ff844b71bb63939d160b') in 0.006402 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== +Received Import Request. + Time since last request: 12.520413 seconds. + path: Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef + artifactKey: Guid(23aed7c57bb0a5d49aeaef92abb5bfff) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/SHFrame/Runtime/SHFrame.Runtime.asmdef using Guid(23aed7c57bb0a5d49aeaef92abb5bfff) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'ae32d24d831388df224090ed22ce2f31') in 0.000927 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 0 +======================================================================== Received Prepare Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.785 seconds -Refreshing native plugins compatible for Editor in 22.19 ms, found 3 plugins. +- Loaded All Assemblies, in 1.932 seconds +Refreshing native plugins compatible for Editor in 31.47 ms, found 3 plugins. Native extension for WindowsStandalone target not found [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.875 seconds -Domain Reload Profiling: 3651ms - BeginReloadAssembly (248ms) +- Finished resetting the current domain, in 1.418 seconds +Domain Reload Profiling: 3340ms + BeginReloadAssembly (228ms) ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) + DisableScriptedObjects (7ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (82ms) - RebuildCommonClasses (57ms) + CreateAndSetChildDomain (84ms) + RebuildCommonClasses (44ms) RebuildNativeTypeToScriptingClass (15ms) - initialDomainReloadingComplete (91ms) - LoadAllAssembliesAndSetupDomain (1364ms) - LoadAssemblies (977ms) + initialDomainReloadingComplete (92ms) + LoadAllAssembliesAndSetupDomain (1542ms) + LoadAssemblies (1010ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (477ms) - TypeCache.Refresh (464ms) - TypeCache.ScanAssembly (440ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (11ms) - FinalizeReload (1876ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (921ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (14ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (177ms) - ProcessInitializeOnLoadAttributes (656ms) - ProcessInitializeOnLoadMethodAttributes (48ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (17ms) -Refreshing native plugins compatible for Editor in 39.53 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5878. -Memory consumption went from 173.5 MB to 173.4 MB. -Total: 9.710800 ms (FindLiveObjects: 0.881500 ms CreateObjectMapping: 0.661000 ms MarkObjects: 7.843300 ms DeleteObjects: 0.321500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 47.26 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 1 Unused Serialized files (Serialized files now loaded: 0) -Unloading 1 unused Assets / (73.4 KB). Loaded Objects now: 5878. -Memory consumption went from 95.5 MB to 95.4 MB. -Total: 8.307200 ms (FindLiveObjects: 1.307100 ms CreateObjectMapping: 1.717600 ms MarkObjects: 5.211100 ms DeleteObjects: 0.068300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 3.239 seconds -Refreshing native plugins compatible for Editor in 25.30 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.021 seconds -Domain Reload Profiling: 6234ms - BeginReloadAssembly (616ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (11ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (189ms) - RebuildCommonClasses (186ms) - RebuildNativeTypeToScriptingClass (32ms) - initialDomainReloadingComplete (163ms) - LoadAllAssembliesAndSetupDomain (2217ms) - LoadAssemblies (1897ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (641ms) - TypeCache.Refresh (625ms) - TypeCache.ScanAssembly (592ms) + AnalyzeDomain (614ms) + TypeCache.Refresh (597ms) + TypeCache.ScanAssembly (567ms) ScanForSourceGeneratedMonoScriptInfo (3ms) ResolveRequiredComponents (13ms) - FinalizeReload (3021ms) + FinalizeReload (1419ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (691ms) + SetupLoadedEditorAssemblies (580ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (9ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (7ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (150ms) - ProcessInitializeOnLoadAttributes (457ms) - ProcessInitializeOnLoadMethodAttributes (52ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (0ms) + BeforeProcessingInitializeOnLoad (135ms) + ProcessInitializeOnLoadAttributes (394ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (1ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 59.24 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (12ms) +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 38.83 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.6 KB). Loaded Objects now: 5893. -Memory consumption went from 173.5 MB to 173.3 MB. -Total: 9.173800 ms (FindLiveObjects: 0.818100 ms CreateObjectMapping: 0.814900 ms MarkObjects: 7.217700 ms DeleteObjects: 0.319000 ms) +Unloading 5181 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (313.5 KB). Loaded Objects now: 5644. +Memory consumption went from 174.7 MB to 174.3 MB. +Total: 5.569100 ms (FindLiveObjects: 0.668000 ms CreateObjectMapping: 0.496400 ms MarkObjects: 3.903200 ms DeleteObjects: 0.499500 ms) Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): @@ -2188,93 +354,57 @@ AssetImportParameters requested are different than current active one (requested custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> ======================================================================== -Received Import Request. - Time since last request: 5127.793790 seconds. - path: Assets/Resources/BuildinFileManifest.asset - artifactKey: Guid(f158672a438d7024c82155e424606457) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/Resources/BuildinFileManifest.asset using Guid(f158672a438d7024c82155e424606457) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '8c7c69f4cc6a6ac223b5f54b7ad82cbe') in 0.048183 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 -======================================================================== -Received Import Request. - Time since last request: 218.017248 seconds. - path: Assets/HotAssets/Resource/HotPrefab.prefab - artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '74b56fd89583724cebd000432083c8f0') in 0.135573 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 10 -======================================================================== -Received Import Request. - Time since last request: 37.847326 seconds. - path: Assets/HotResources - artifactKey: Guid(9cf7250c4c4b62c4ea6c677e2007ec5a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotResources using Guid(9cf7250c4c4b62c4ea6c677e2007ec5a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'd722b8b6ca948e7adb5d6880e0705869') in 0.001088 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 0 -======================================================================== -Received Import Request. - Time since last request: 21.424137 seconds. - path: Assets/HotScripts - artifactKey: Guid(35d982e86da74af4e95e0c2607885eb0) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotScripts using Guid(35d982e86da74af4e95e0c2607885eb0) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '20853789cee45c630ded17693e3d9126') in 0.001985 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 0 -======================================================================== Received Prepare -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.094 seconds -Refreshing native plugins compatible for Editor in 35.28 ms, found 3 plugins. +- Loaded All Assemblies, in 1.214 seconds +Refreshing native plugins compatible for Editor in 20.20 ms, found 3 plugins. Native extension for WindowsStandalone target not found -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.965 seconds -Domain Reload Profiling: 4053ms - BeginReloadAssembly (372ms) +- Finished resetting the current domain, in 1.077 seconds +Domain Reload Profiling: 2284ms + BeginReloadAssembly (167ms) ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) + DisableScriptedObjects (4ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (165ms) - RebuildCommonClasses (63ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (82ms) - LoadAllAssembliesAndSetupDomain (1551ms) - LoadAssemblies (1055ms) + CreateAndSetChildDomain (56ms) + RebuildCommonClasses (38ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (61ms) + LoadAllAssembliesAndSetupDomain (930ms) + LoadAssemblies (688ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (615ms) - TypeCache.Refresh (593ms) - TypeCache.ScanAssembly (550ms) - ScanForSourceGeneratedMonoScriptInfo (5ms) - ResolveRequiredComponents (18ms) - FinalizeReload (1966ms) + AnalyzeDomain (303ms) + TypeCache.Refresh (292ms) + TypeCache.ScanAssembly (276ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (9ms) + FinalizeReload (1077ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (813ms) + SetupLoadedEditorAssemblies (459ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (9ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (4ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (189ms) - ProcessInitializeOnLoadAttributes (538ms) - ProcessInitializeOnLoadMethodAttributes (52ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (1ms) + BeforeProcessingInitializeOnLoad (108ms) + ProcessInitializeOnLoadAttributes (310ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (7ms) + EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 33.84 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (10ms) +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 15.68 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5009 Unused Serialized files (Serialized files now loaded: 0) -Unloading 89 unused Assets / (132.8 KB). Loaded Objects now: 5908. -Memory consumption went from 173.6 MB to 173.5 MB. -Total: 33.962700 ms (FindLiveObjects: 3.592400 ms CreateObjectMapping: 12.530900 ms MarkObjects: 15.911100 ms DeleteObjects: 1.924900 ms) +Unloading 5185 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (321.3 KB). Loaded Objects now: 5662. +Memory consumption went from 175.0 MB to 174.7 MB. +Total: 3.258400 ms (FindLiveObjects: 0.563800 ms CreateObjectMapping: 0.244400 ms MarkObjects: 2.239500 ms DeleteObjects: 0.209600 ms) Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): @@ -2288,19 +418,3 @@ AssetImportParameters requested are different than current active one (requested custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Import Request. - Time since last request: 29.595573 seconds. - path: Assets/HotAssets/Resource/HotPrefab.prefab - artifactKey: Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/HotAssets/Resource/HotPrefab.prefab using Guid(053771d6a5f02174db227bd70d962ea5) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '136e85e9cc649029ad32c1d1b51ab95c') in 0.147692 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 10 -======================================================================== -Received Import Request. - Time since last request: 38.260650 seconds. - path: Assets/Plugins/JNGame - artifactKey: Guid(262a8509f1a5bf741b5f85a2139411fe) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/Plugins/JNGame using Guid(262a8509f1a5bf741b5f85a2139411fe) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e66c98ff3f3c4bc2bc4849a0e5139a49') in 0.003436 seconds -Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 0 diff --git a/JNFrame2/Logs/AssetImportWorker1-prev.log b/JNFrame2/Logs/AssetImportWorker1-prev.log new file mode 100644 index 00000000..b87593b6 --- /dev/null +++ b/JNFrame2/Logs/AssetImportWorker1-prev.log @@ -0,0 +1,2188 @@ +Using pre-set license +Built from '2022.3/staging' branch; Version is '2022.3.1f1 (f18e0c1b5784) revision 15830540'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22631) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2022.3.1f1\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker1 +-projectPath +D:/myproject/JisolGame/JNFrame2 +-logFile +Logs/AssetImportWorker1.log +-srvPort +64818 +Successfully changed project path to: D:/myproject/JisolGame/JNFrame2 +D:/myproject/JisolGame/JNFrame2 +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-allocator-temp-initial-block-size-main=262144" + "memorysetup-allocator-temp-initial-block-size-worker=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [206220] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 518402225 [EditorId] 518402225 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [206220] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 518402225 [EditorId] 518402225 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +Refreshing native plugins compatible for Editor in 46.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2022.3.1f1 (f18e0c1b5784) +[Subsystems] Discovering subsystems at path D:/Unity/2022.3.1f1/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/JisolGame/JNFrame2/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2022.3.1f1/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56084 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.007045 seconds. +- Loaded All Assemblies, in 0.451 seconds +Native extension for WindowsStandalone target not found +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 0.315 seconds +Domain Reload Profiling: 763ms + BeginReloadAssembly (111ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + RebuildCommonClasses (54ms) + RebuildNativeTypeToScriptingClass (12ms) + initialDomainReloadingComplete (76ms) + LoadAllAssembliesAndSetupDomain (194ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (184ms) + TypeCache.Refresh (183ms) + TypeCache.ScanAssembly (162ms) + ScanForSourceGeneratedMonoScriptInfo (1ms) + ResolveRequiredComponents (1ms) + FinalizeReload (316ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (242ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (2ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (67ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +======================================================================== +Worker process is ready to serve import requests +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.838 seconds +Refreshing native plugins compatible for Editor in 29.55 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +Package Manager log level set to [2] +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.228 seconds +Domain Reload Profiling: 3060ms + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (29ms) + RebuildCommonClasses (43ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (63ms) + LoadAllAssembliesAndSetupDomain (1545ms) + LoadAssemblies (1044ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (577ms) + TypeCache.Refresh (524ms) + TypeCache.ScanAssembly (491ms) + ScanForSourceGeneratedMonoScriptInfo (39ms) + ResolveRequiredComponents (13ms) + FinalizeReload (1228ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (975ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (186ms) + ProcessInitializeOnLoadAttributes (721ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Launched and connected shader compiler UnityShaderCompiler.exe after 0.12 seconds +Refreshing native plugins compatible for Editor in 34.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5016 Unused Serialized files (Serialized files now loaded: 0) +Unloading 133 unused Assets / (163.5 KB). Loaded Objects now: 5443. +Memory consumption went from 171.0 MB to 170.9 MB. +Total: 6.447600 ms (FindLiveObjects: 0.900400 ms CreateObjectMapping: 0.504400 ms MarkObjects: 4.691600 ms DeleteObjects: 0.348700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 19208.883404 seconds. + path: Assets/AssetBundleCollectorSetting.asset + artifactKey: Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/AssetBundleCollectorSetting.asset using Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e55cfc364d0d0dac972cec3c0ab2153f') in 0.029933 seconds +Number of updated asset objects reloaded before import = 0 +Number of asset objects unloaded after import = 1 +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.294 seconds +Refreshing native plugins compatible for Editor in 18.09 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.158 seconds +Domain Reload Profiling: 2447ms + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + RebuildCommonClasses (34ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (55ms) + LoadAllAssembliesAndSetupDomain (1001ms) + LoadAssemblies (701ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (376ms) + TypeCache.Refresh (365ms) + TypeCache.ScanAssembly (345ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1159ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (566ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (110ms) + ProcessInitializeOnLoadAttributes (410ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (7ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Refreshing native plugins compatible for Editor in 38.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (133.8 KB). Loaded Objects now: 5461. +Memory consumption went from 168.8 MB to 168.6 MB. +Total: 36.336500 ms (FindLiveObjects: 2.993700 ms CreateObjectMapping: 0.635600 ms MarkObjects: 32.255600 ms DeleteObjects: 0.447600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.345 seconds +Refreshing native plugins compatible for Editor in 17.41 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.213 seconds +Domain Reload Profiling: 2552ms + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + RebuildCommonClasses (29ms) + RebuildNativeTypeToScriptingClass (9ms) + initialDomainReloadingComplete (54ms) + LoadAllAssembliesAndSetupDomain (1069ms) + LoadAssemblies (724ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (411ms) + TypeCache.Refresh (403ms) + TypeCache.ScanAssembly (381ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1214ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (585ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (118ms) + ProcessInitializeOnLoadAttributes (407ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 30.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5476. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 7.724600 ms (FindLiveObjects: 0.823300 ms CreateObjectMapping: 0.513500 ms MarkObjects: 5.718000 ms DeleteObjects: 0.666200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.263 seconds +Refreshing native plugins compatible for Editor in 20.82 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.323 seconds +Domain Reload Profiling: 2581ms + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (58ms) + RebuildCommonClasses (30ms) + RebuildNativeTypeToScriptingClass (9ms) + initialDomainReloadingComplete (51ms) + LoadAllAssembliesAndSetupDomain (1003ms) + LoadAssemblies (709ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (351ms) + TypeCache.Refresh (343ms) + TypeCache.ScanAssembly (317ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1324ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (604ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (16ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (146ms) + ProcessInitializeOnLoadAttributes (381ms) + ProcessInitializeOnLoadMethodAttributes (39ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 31.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5491. +Memory consumption went from 169.0 MB to 168.9 MB. +Total: 6.852600 ms (FindLiveObjects: 0.883600 ms CreateObjectMapping: 0.711700 ms MarkObjects: 5.055900 ms DeleteObjects: 0.199900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.306 seconds +Refreshing native plugins compatible for Editor in 21.06 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.038 seconds +Domain Reload Profiling: 2335ms + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + RebuildCommonClasses (31ms) + RebuildNativeTypeToScriptingClass (13ms) + initialDomainReloadingComplete (59ms) + LoadAllAssembliesAndSetupDomain (1036ms) + LoadAssemblies (671ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (426ms) + TypeCache.Refresh (417ms) + TypeCache.ScanAssembly (397ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1038ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (482ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (112ms) + ProcessInitializeOnLoadAttributes (322ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Refreshing native plugins compatible for Editor in 31.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5506. +Memory consumption went from 169.1 MB to 168.9 MB. +Total: 8.976800 ms (FindLiveObjects: 1.439900 ms CreateObjectMapping: 1.066700 ms MarkObjects: 6.051100 ms DeleteObjects: 0.415800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.409 seconds +Refreshing native plugins compatible for Editor in 32.46 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.225 seconds +Domain Reload Profiling: 2630ms + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + RebuildCommonClasses (35ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (50ms) + LoadAllAssembliesAndSetupDomain (1148ms) + LoadAssemblies (683ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (523ms) + TypeCache.Refresh (510ms) + TypeCache.ScanAssembly (482ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (13ms) + FinalizeReload (1226ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (520ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (110ms) + ProcessInitializeOnLoadAttributes (355ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 29.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5521. +Memory consumption went from 169.1 MB to 168.9 MB. +Total: 18.512300 ms (FindLiveObjects: 1.472700 ms CreateObjectMapping: 1.092800 ms MarkObjects: 15.745300 ms DeleteObjects: 0.199000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.542 seconds +Refreshing native plugins compatible for Editor in 15.75 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.022 seconds +Domain Reload Profiling: 2558ms + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (67ms) + RebuildCommonClasses (27ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (65ms) + LoadAllAssembliesAndSetupDomain (1259ms) + LoadAssemblies (871ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (442ms) + TypeCache.Refresh (432ms) + TypeCache.ScanAssembly (406ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1023ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (482ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (103ms) + ProcessInitializeOnLoadAttributes (319ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Refreshing native plugins compatible for Editor in 34.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5536. +Memory consumption went from 169.1 MB to 168.9 MB. +Total: 6.914400 ms (FindLiveObjects: 1.196400 ms CreateObjectMapping: 0.759900 ms MarkObjects: 4.767000 ms DeleteObjects: 0.188900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.318 seconds +Refreshing native plugins compatible for Editor in 16.30 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.016 seconds +Domain Reload Profiling: 2327ms + BeginReloadAssembly (270ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (112ms) + RebuildCommonClasses (41ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (62ms) + LoadAllAssembliesAndSetupDomain (926ms) + LoadAssemblies (695ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (332ms) + TypeCache.Refresh (322ms) + TypeCache.ScanAssembly (296ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1017ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (451ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (111ms) + ProcessInitializeOnLoadAttributes (300ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Refreshing native plugins compatible for Editor in 31.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5551. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 6.120000 ms (FindLiveObjects: 0.620700 ms CreateObjectMapping: 0.439100 ms MarkObjects: 4.846900 ms DeleteObjects: 0.210300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.736 seconds +Refreshing native plugins compatible for Editor in 21.22 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.436 seconds +Domain Reload Profiling: 3167ms + BeginReloadAssembly (207ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (80ms) + RebuildCommonClasses (39ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (56ms) + LoadAllAssembliesAndSetupDomain (1419ms) + LoadAssemblies (822ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (657ms) + TypeCache.Refresh (646ms) + TypeCache.ScanAssembly (620ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1436ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (549ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (121ms) + ProcessInitializeOnLoadAttributes (377ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Refreshing native plugins compatible for Editor in 27.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5566. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 12.268800 ms (FindLiveObjects: 2.365000 ms CreateObjectMapping: 0.808900 ms MarkObjects: 8.670000 ms DeleteObjects: 0.418800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.053 seconds +Refreshing native plugins compatible for Editor in 39.72 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.522 seconds +Domain Reload Profiling: 3563ms + BeginReloadAssembly (284ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (107ms) + RebuildCommonClasses (56ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (85ms) + LoadAllAssembliesAndSetupDomain (1598ms) + LoadAssemblies (1109ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (589ms) + TypeCache.Refresh (572ms) + TypeCache.ScanAssembly (532ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1522ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (657ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (140ms) + ProcessInitializeOnLoadAttributes (454ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Refreshing native plugins compatible for Editor in 130.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5581. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 13.617500 ms (FindLiveObjects: 1.093800 ms CreateObjectMapping: 0.996400 ms MarkObjects: 10.948400 ms DeleteObjects: 0.574600 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.537 seconds +Refreshing native plugins compatible for Editor in 23.46 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.714 seconds +Domain Reload Profiling: 4245ms + BeginReloadAssembly (524ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (20ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (283ms) + RebuildCommonClasses (48ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (74ms) + LoadAllAssembliesAndSetupDomain (1870ms) + LoadAssemblies (1264ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (720ms) + TypeCache.Refresh (708ms) + TypeCache.ScanAssembly (647ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (12ms) + FinalizeReload (1715ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (732ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (139ms) + ProcessInitializeOnLoadAttributes (526ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 34.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5596. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 6.075000 ms (FindLiveObjects: 0.661700 ms CreateObjectMapping: 0.385300 ms MarkObjects: 4.694000 ms DeleteObjects: 0.330700 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.152 seconds +Refreshing native plugins compatible for Editor in 22.67 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.166 seconds +Domain Reload Profiling: 3308ms + BeginReloadAssembly (399ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (90ms) + RebuildCommonClasses (107ms) + RebuildNativeTypeToScriptingClass (26ms) + initialDomainReloadingComplete (168ms) + LoadAllAssembliesAndSetupDomain (1441ms) + LoadAssemblies (1264ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (410ms) + TypeCache.Refresh (400ms) + TypeCache.ScanAssembly (371ms) + ScanForSourceGeneratedMonoScriptInfo (2ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1167ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (529ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (134ms) + ProcessInitializeOnLoadAttributes (344ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Refreshing native plugins compatible for Editor in 54.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5611. +Memory consumption went from 169.1 MB to 169.0 MB. +Total: 14.977600 ms (FindLiveObjects: 3.007700 ms CreateObjectMapping: 4.350900 ms MarkObjects: 7.299200 ms DeleteObjects: 0.316900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.616 seconds +Refreshing native plugins compatible for Editor in 33.10 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.593 seconds +Domain Reload Profiling: 3200ms + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (65ms) + RebuildCommonClasses (39ms) + RebuildNativeTypeToScriptingClass (11ms) + initialDomainReloadingComplete (65ms) + LoadAllAssembliesAndSetupDomain (1307ms) + LoadAssemblies (828ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (538ms) + TypeCache.Refresh (520ms) + TypeCache.ScanAssembly (477ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1594ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (753ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (171ms) + ProcessInitializeOnLoadAttributes (507ms) + ProcessInitializeOnLoadMethodAttributes (48ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Refreshing native plugins compatible for Editor in 44.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.3 KB). Loaded Objects now: 5626. +Memory consumption went from 169.3 MB to 169.1 MB. +Total: 9.653300 ms (FindLiveObjects: 1.634300 ms CreateObjectMapping: 1.200100 ms MarkObjects: 6.579300 ms DeleteObjects: 0.235800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.707 seconds +Refreshing native plugins compatible for Editor in 29.46 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.519 seconds +Domain Reload Profiling: 3219ms + BeginReloadAssembly (256ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (73ms) + RebuildCommonClasses (63ms) + RebuildNativeTypeToScriptingClass (17ms) + initialDomainReloadingComplete (83ms) + LoadAllAssembliesAndSetupDomain (1280ms) + LoadAssemblies (972ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (426ms) + TypeCache.Refresh (409ms) + TypeCache.ScanAssembly (382ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (17ms) + FinalizeReload (1521ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (644ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (6ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (146ms) + ProcessInitializeOnLoadAttributes (433ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 36.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5641. +Memory consumption went from 169.3 MB to 169.2 MB. +Total: 6.604300 ms (FindLiveObjects: 0.694900 ms CreateObjectMapping: 0.993300 ms MarkObjects: 4.737200 ms DeleteObjects: 0.176200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.629 seconds +Refreshing native plugins compatible for Editor in 23.90 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.588 seconds +Domain Reload Profiling: 3212ms + BeginReloadAssembly (263ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (101ms) + RebuildCommonClasses (62ms) + RebuildNativeTypeToScriptingClass (22ms) + initialDomainReloadingComplete (70ms) + LoadAllAssembliesAndSetupDomain (1206ms) + LoadAssemblies (796ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (503ms) + TypeCache.Refresh (490ms) + TypeCache.ScanAssembly (460ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1589ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (853ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (179ms) + ProcessInitializeOnLoadAttributes (604ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 29.18 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5656. +Memory consumption went from 169.3 MB to 169.2 MB. +Total: 6.408200 ms (FindLiveObjects: 0.728800 ms CreateObjectMapping: 0.759500 ms MarkObjects: 4.621200 ms DeleteObjects: 0.297100 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 34.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 2 Unused Serialized files (Serialized files now loaded: 0) +Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5656. +Memory consumption went from 91.3 MB to 91.2 MB. +Total: 312.258900 ms (FindLiveObjects: 222.860200 ms CreateObjectMapping: 1.786400 ms MarkObjects: 87.222300 ms DeleteObjects: 0.387500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.009 seconds +Refreshing native plugins compatible for Editor in 26.54 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.162 seconds +Domain Reload Profiling: 5160ms + BeginReloadAssembly (298ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (120ms) + RebuildCommonClasses (64ms) + RebuildNativeTypeToScriptingClass (16ms) + initialDomainReloadingComplete (93ms) + LoadAllAssembliesAndSetupDomain (1527ms) + LoadAssemblies (1091ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (537ms) + TypeCache.Refresh (521ms) + TypeCache.ScanAssembly (489ms) + ScanForSourceGeneratedMonoScriptInfo (4ms) + ResolveRequiredComponents (12ms) + FinalizeReload (3163ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (797ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (190ms) + ProcessInitializeOnLoadAttributes (542ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Refreshing native plugins compatible for Editor in 42.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5011 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5674. +Memory consumption went from 169.4 MB to 169.2 MB. +Total: 19.166800 ms (FindLiveObjects: 1.701400 ms CreateObjectMapping: 1.621900 ms MarkObjects: 15.356700 ms DeleteObjects: 0.483500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.043 seconds +Refreshing native plugins compatible for Editor in 27.78 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.991 seconds +Domain Reload Profiling: 4007ms + BeginReloadAssembly (291ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (102ms) + RebuildCommonClasses (81ms) + RebuildNativeTypeToScriptingClass (26ms) + initialDomainReloadingComplete (133ms) + LoadAllAssembliesAndSetupDomain (1484ms) + LoadAssemblies (1073ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (525ms) + TypeCache.Refresh (510ms) + TypeCache.ScanAssembly (480ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (12ms) + FinalizeReload (1992ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (1160ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (215ms) + ProcessInitializeOnLoadAttributes (838ms) + ProcessInitializeOnLoadMethodAttributes (70ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 51.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5011 Unused Serialized files (Serialized files now loaded: 0) +Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5689. +Memory consumption went from 169.4 MB to 169.2 MB. +Total: 38.748600 ms (FindLiveObjects: 18.164200 ms CreateObjectMapping: 1.207200 ms MarkObjects: 18.250300 ms DeleteObjects: 1.124200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 37.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 2 Unused Serialized files (Serialized files now loaded: 0) +Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5689. +Memory consumption went from 91.3 MB to 91.3 MB. +Total: 27.844100 ms (FindLiveObjects: 2.598800 ms CreateObjectMapping: 10.660600 ms MarkObjects: 14.492300 ms DeleteObjects: 0.088100 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.238 seconds +Refreshing native plugins compatible for Editor in 39.30 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.964 seconds +Domain Reload Profiling: 4195ms + BeginReloadAssembly (314ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (134ms) + RebuildCommonClasses (57ms) + RebuildNativeTypeToScriptingClass (16ms) + initialDomainReloadingComplete (103ms) + LoadAllAssembliesAndSetupDomain (1739ms) + LoadAssemblies (1213ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (608ms) + TypeCache.Refresh (591ms) + TypeCache.ScanAssembly (546ms) + ScanForSourceGeneratedMonoScriptInfo (1ms) + ResolveRequiredComponents (16ms) + FinalizeReload (1965ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (957ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (12ms) + SetLoadedEditorAssemblies (11ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (197ms) + ProcessInitializeOnLoadAttributes (654ms) + ProcessInitializeOnLoadMethodAttributes (67ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 47.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5704. +Memory consumption went from 169.4 MB to 169.3 MB. +Total: 28.979500 ms (FindLiveObjects: 2.268800 ms CreateObjectMapping: 0.743700 ms MarkObjects: 25.548700 ms DeleteObjects: 0.415500 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.864 seconds +Refreshing native plugins compatible for Editor in 34.45 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.098 seconds +Domain Reload Profiling: 3954ms + BeginReloadAssembly (235ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (74ms) + RebuildCommonClasses (53ms) + RebuildNativeTypeToScriptingClass (17ms) + initialDomainReloadingComplete (75ms) + LoadAllAssembliesAndSetupDomain (1475ms) + LoadAssemblies (972ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (583ms) + TypeCache.Refresh (568ms) + TypeCache.ScanAssembly (540ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (14ms) + FinalizeReload (2099ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (965ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (11ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (201ms) + ProcessInitializeOnLoadAttributes (683ms) + ProcessInitializeOnLoadMethodAttributes (45ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Refreshing native plugins compatible for Editor in 60.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5719. +Memory consumption went from 169.4 MB to 169.3 MB. +Total: 23.213100 ms (FindLiveObjects: 3.956700 ms CreateObjectMapping: 3.278400 ms MarkObjects: 15.329800 ms DeleteObjects: 0.644900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.105 seconds +Refreshing native plugins compatible for Editor in 35.10 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.854 seconds +Domain Reload Profiling: 3952ms + BeginReloadAssembly (264ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (91ms) + RebuildCommonClasses (44ms) + RebuildNativeTypeToScriptingClass (12ms) + initialDomainReloadingComplete (83ms) + LoadAllAssembliesAndSetupDomain (1695ms) + LoadAssemblies (1035ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (761ms) + TypeCache.Refresh (731ms) + TypeCache.ScanAssembly (683ms) + ScanForSourceGeneratedMonoScriptInfo (5ms) + ResolveRequiredComponents (25ms) + FinalizeReload (1854ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (799ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (162ms) + ProcessInitializeOnLoadAttributes (561ms) + ProcessInitializeOnLoadMethodAttributes (46ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 34.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5734. +Memory consumption went from 169.5 MB to 169.3 MB. +Total: 134.795100 ms (FindLiveObjects: 1.364600 ms CreateObjectMapping: 4.623000 ms MarkObjects: 128.182700 ms DeleteObjects: 0.621900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.048 seconds +Refreshing native plugins compatible for Editor in 57.60 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.947 seconds +Domain Reload Profiling: 3988ms + BeginReloadAssembly (356ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (146ms) + RebuildCommonClasses (66ms) + RebuildNativeTypeToScriptingClass (20ms) + initialDomainReloadingComplete (88ms) + LoadAllAssembliesAndSetupDomain (1510ms) + LoadAssemblies (1074ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (561ms) + TypeCache.Refresh (547ms) + TypeCache.ScanAssembly (509ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (14ms) + FinalizeReload (1948ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (783ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (176ms) + ProcessInitializeOnLoadAttributes (530ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Refreshing native plugins compatible for Editor in 32.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5749. +Memory consumption went from 169.5 MB to 169.3 MB. +Total: 39.797100 ms (FindLiveObjects: 19.379800 ms CreateObjectMapping: 3.338900 ms MarkObjects: 16.459400 ms DeleteObjects: 0.615300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.724 seconds +Refreshing native plugins compatible for Editor in 44.37 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.817 seconds +Domain Reload Profiling: 4526ms + BeginReloadAssembly (300ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (117ms) + RebuildCommonClasses (56ms) + RebuildNativeTypeToScriptingClass (17ms) + initialDomainReloadingComplete (246ms) + LoadAllAssembliesAndSetupDomain (2089ms) + LoadAssemblies (1571ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (625ms) + TypeCache.Refresh (604ms) + TypeCache.ScanAssembly (571ms) + ScanForSourceGeneratedMonoScriptInfo (4ms) + ResolveRequiredComponents (16ms) + FinalizeReload (1818ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (832ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (180ms) + ProcessInitializeOnLoadAttributes (549ms) + ProcessInitializeOnLoadMethodAttributes (61ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (2ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Refreshing native plugins compatible for Editor in 144.33 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5764. +Memory consumption went from 169.4 MB to 169.3 MB. +Total: 15.861100 ms (FindLiveObjects: 3.635500 ms CreateObjectMapping: 2.041600 ms MarkObjects: 9.766800 ms DeleteObjects: 0.411100 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.134 seconds +Refreshing native plugins compatible for Editor in 29.84 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.945 seconds +Domain Reload Profiling: 4073ms + BeginReloadAssembly (319ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (118ms) + RebuildCommonClasses (65ms) + RebuildNativeTypeToScriptingClass (20ms) + initialDomainReloadingComplete (76ms) + LoadAllAssembliesAndSetupDomain (1648ms) + LoadAssemblies (1044ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (710ms) + TypeCache.Refresh (697ms) + TypeCache.ScanAssembly (655ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (13ms) + FinalizeReload (1946ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (907ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (178ms) + ProcessInitializeOnLoadAttributes (633ms) + ProcessInitializeOnLoadMethodAttributes (60ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (25ms) +Refreshing native plugins compatible for Editor in 66.43 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5779. +Memory consumption went from 169.4 MB to 169.3 MB. +Total: 10.960900 ms (FindLiveObjects: 0.901500 ms CreateObjectMapping: 0.506900 ms MarkObjects: 8.588800 ms DeleteObjects: 0.926100 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.205 seconds +Refreshing native plugins compatible for Editor in 34.66 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.669 seconds +Domain Reload Profiling: 3869ms + BeginReloadAssembly (301ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (110ms) + RebuildCommonClasses (59ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (86ms) + LoadAllAssembliesAndSetupDomain (1736ms) + LoadAssemblies (1057ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (778ms) + TypeCache.Refresh (749ms) + TypeCache.ScanAssembly (698ms) + ScanForSourceGeneratedMonoScriptInfo (7ms) + ResolveRequiredComponents (22ms) + FinalizeReload (1670ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (706ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (5ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (159ms) + ProcessInitializeOnLoadAttributes (480ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (10ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 32.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5794. +Memory consumption went from 169.4 MB to 169.3 MB. +Total: 34.654100 ms (FindLiveObjects: 1.262600 ms CreateObjectMapping: 6.839200 ms MarkObjects: 25.642600 ms DeleteObjects: 0.907200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.038 seconds +Refreshing native plugins compatible for Editor in 45.16 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.132 seconds +Domain Reload Profiling: 4154ms + BeginReloadAssembly (279ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (95ms) + RebuildCommonClasses (62ms) + RebuildNativeTypeToScriptingClass (22ms) + initialDomainReloadingComplete (121ms) + LoadAllAssembliesAndSetupDomain (1538ms) + LoadAssemblies (1089ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (560ms) + TypeCache.Refresh (544ms) + TypeCache.ScanAssembly (509ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (16ms) + FinalizeReload (2133ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (948ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (17ms) + SetLoadedEditorAssemblies (11ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (206ms) + ProcessInitializeOnLoadAttributes (636ms) + ProcessInitializeOnLoadMethodAttributes (63ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Refreshing native plugins compatible for Editor in 118.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.9 KB). Loaded Objects now: 5809. +Memory consumption went from 169.5 MB to 169.4 MB. +Total: 28.951100 ms (FindLiveObjects: 6.585400 ms CreateObjectMapping: 2.098300 ms MarkObjects: 19.971000 ms DeleteObjects: 0.293300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 37.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 2 Unused Serialized files (Serialized files now loaded: 0) +Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5809. +Memory consumption went from 91.5 MB to 91.4 MB. +Total: 13.248000 ms (FindLiveObjects: 0.974900 ms CreateObjectMapping: 0.497100 ms MarkObjects: 11.558300 ms DeleteObjects: 0.215000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.097 seconds +Refreshing native plugins compatible for Editor in 44.22 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.650 seconds +Domain Reload Profiling: 5737ms + BeginReloadAssembly (302ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (114ms) + RebuildCommonClasses (65ms) + RebuildNativeTypeToScriptingClass (16ms) + initialDomainReloadingComplete (79ms) + LoadAllAssembliesAndSetupDomain (1625ms) + LoadAssemblies (1092ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (620ms) + TypeCache.Refresh (591ms) + TypeCache.ScanAssembly (561ms) + ScanForSourceGeneratedMonoScriptInfo (9ms) + ResolveRequiredComponents (19ms) + FinalizeReload (3650ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (854ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (9ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (202ms) + ProcessInitializeOnLoadAttributes (570ms) + ProcessInitializeOnLoadMethodAttributes (47ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Refreshing native plugins compatible for Editor in 47.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5824. +Memory consumption went from 169.5 MB to 169.4 MB. +Total: 7.710600 ms (FindLiveObjects: 0.615300 ms CreateObjectMapping: 0.378500 ms MarkObjects: 6.414700 ms DeleteObjects: 0.299900 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.154 seconds +Refreshing native plugins compatible for Editor in 37.47 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.198 seconds +Domain Reload Profiling: 4346ms + BeginReloadAssembly (306ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (97ms) + RebuildCommonClasses (59ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (97ms) + LoadAllAssembliesAndSetupDomain (1666ms) + LoadAssemblies (1109ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (671ms) + TypeCache.Refresh (650ms) + TypeCache.ScanAssembly (620ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) + ResolveRequiredComponents (20ms) + FinalizeReload (2200ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (1098ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (15ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (193ms) + ProcessInitializeOnLoadAttributes (807ms) + ProcessInitializeOnLoadMethodAttributes (56ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (26ms) +Refreshing native plugins compatible for Editor in 62.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5839. +Memory consumption went from 169.5 MB to 169.4 MB. +Total: 57.102100 ms (FindLiveObjects: 12.762600 ms CreateObjectMapping: 1.364300 ms MarkObjects: 42.560100 ms DeleteObjects: 0.410200 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 35.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 2 Unused Serialized files (Serialized files now loaded: 0) +Unloading 2 unused Assets / (76.5 KB). Loaded Objects now: 5839. +Memory consumption went from 91.5 MB to 91.4 MB. +Total: 39.638600 ms (FindLiveObjects: 1.950700 ms CreateObjectMapping: 2.096200 ms MarkObjects: 35.425500 ms DeleteObjects: 0.164000 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.134 seconds +Refreshing native plugins compatible for Editor in 32.48 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 2.861 seconds +Domain Reload Profiling: 4989ms + BeginReloadAssembly (267ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (77ms) + RebuildCommonClasses (62ms) + RebuildNativeTypeToScriptingClass (18ms) + initialDomainReloadingComplete (73ms) + LoadAllAssembliesAndSetupDomain (1709ms) + LoadAssemblies (1078ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (747ms) + TypeCache.Refresh (726ms) + TypeCache.ScanAssembly (690ms) + ScanForSourceGeneratedMonoScriptInfo (5ms) + ResolveRequiredComponents (17ms) + FinalizeReload (2862ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (664ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (10ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (157ms) + ProcessInitializeOnLoadAttributes (429ms) + ProcessInitializeOnLoadMethodAttributes (45ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Refreshing native plugins compatible for Editor in 36.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5854. +Memory consumption went from 169.5 MB to 169.4 MB. +Total: 5.023100 ms (FindLiveObjects: 0.824500 ms CreateObjectMapping: 0.655900 ms MarkObjects: 3.289900 ms DeleteObjects: 0.249800 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.759 seconds +Refreshing native plugins compatible for Editor in 24.33 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.865 seconds +Domain Reload Profiling: 3616ms + BeginReloadAssembly (239ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (82ms) + RebuildCommonClasses (54ms) + RebuildNativeTypeToScriptingClass (14ms) + initialDomainReloadingComplete (91ms) + LoadAllAssembliesAndSetupDomain (1353ms) + LoadAssemblies (966ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (476ms) + TypeCache.Refresh (461ms) + TypeCache.ScanAssembly (437ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1866ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (917ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (15ms) + SetLoadedEditorAssemblies (10ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (185ms) + ProcessInitializeOnLoadAttributes (643ms) + ProcessInitializeOnLoadMethodAttributes (51ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 52.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.6 KB). Loaded Objects now: 5869. +Memory consumption went from 169.5 MB to 169.3 MB. +Total: 14.701200 ms (FindLiveObjects: 4.674400 ms CreateObjectMapping: 1.575900 ms MarkObjects: 7.574600 ms DeleteObjects: 0.873300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Refreshing native plugins compatible for Editor in 37.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 2 Unused Serialized files (Serialized files now loaded: 0) +Unloading 2 unused Assets / (76.5 KB). Loaded Objects now: 5869. +Memory consumption went from 91.5 MB to 91.4 MB. +Total: 21.419900 ms (FindLiveObjects: 3.741100 ms CreateObjectMapping: 3.075200 ms MarkObjects: 14.490600 ms DeleteObjects: 0.109300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 3.219 seconds +Refreshing native plugins compatible for Editor in 26.33 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 3.001 seconds +Domain Reload Profiling: 6204ms + BeginReloadAssembly (677ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (285ms) + RebuildCommonClasses (151ms) + RebuildNativeTypeToScriptingClass (21ms) + initialDomainReloadingComplete (172ms) + LoadAllAssembliesAndSetupDomain (2181ms) + LoadAssemblies (1782ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (639ms) + TypeCache.Refresh (623ms) + TypeCache.ScanAssembly (590ms) + ScanForSourceGeneratedMonoScriptInfo (4ms) + ResolveRequiredComponents (13ms) + FinalizeReload (3002ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (672ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (8ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (148ms) + ProcessInitializeOnLoadAttributes (447ms) + ProcessInitializeOnLoadMethodAttributes (49ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Refreshing native plugins compatible for Editor in 58.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5884. +Memory consumption went from 169.5 MB to 169.4 MB. +Total: 9.608900 ms (FindLiveObjects: 1.002700 ms CreateObjectMapping: 0.705100 ms MarkObjects: 7.460000 ms DeleteObjects: 0.439300 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 2.120 seconds +Refreshing native plugins compatible for Editor in 31.38 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) +Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.964 seconds +Domain Reload Profiling: 4076ms + BeginReloadAssembly (377ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (166ms) + RebuildCommonClasses (67ms) + RebuildNativeTypeToScriptingClass (17ms) + initialDomainReloadingComplete (79ms) + LoadAllAssembliesAndSetupDomain (1572ms) + LoadAssemblies (1061ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (623ms) + TypeCache.Refresh (597ms) + TypeCache.ScanAssembly (562ms) + ScanForSourceGeneratedMonoScriptInfo (7ms) + ResolveRequiredComponents (19ms) + FinalizeReload (1965ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (811ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (10ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (185ms) + ProcessInitializeOnLoadAttributes (534ms) + ProcessInitializeOnLoadMethodAttributes (55ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (19ms) +Refreshing native plugins compatible for Editor in 38.32 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) +Unloading 90 unused Assets / (133.6 KB). Loaded Objects now: 5899. +Memory consumption went from 169.6 MB to 169.5 MB. +Total: 42.573600 ms (FindLiveObjects: 3.701100 ms CreateObjectMapping: 1.286400 ms MarkObjects: 35.178500 ms DeleteObjects: 2.404700 ms) + +Prepare: number of updated asset objects reloaded= 0 +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +TcpMessagingSession - receive error +AssetImportWorkerClient::OnTransportError - code=10054 error=Ô¶³ÌÖ÷»úÇ¿ÆÈ¹Ø±ÕÁËÒ»¸öÏÖÓеÄÁ¬½Ó¡£ diff --git a/JNFrame2/Logs/AssetImportWorker1.log b/JNFrame2/Logs/AssetImportWorker1.log index 90e7fa58..1e8d1f0a 100644 --- a/JNFrame2/Logs/AssetImportWorker1.log +++ b/JNFrame2/Logs/AssetImportWorker1.log @@ -15,7 +15,7 @@ D:/myproject/JisolGame/JNFrame2 -logFile Logs/AssetImportWorker1.log -srvPort -64818 +63956 Successfully changed project path to: D:/myproject/JisolGame/JNFrame2 D:/myproject/JisolGame/JNFrame2 [UnityMemory] Configuration Parameters - Can be set up in boot.config @@ -49,11 +49,11 @@ D:/myproject/JisolGame/JNFrame2 "memorysetup-temp-allocator-size-cloud-worker=32768" "memorysetup-temp-allocator-size-gi-baking-worker=262144" "memorysetup-temp-allocator-size-gfx=262144" -Player connection [206220] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 518402225 [EditorId] 518402225 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... +Player connection [218672] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 2733801325 [EditorId] 2733801325 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... -Player connection [206220] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 518402225 [EditorId] 518402225 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... +Player connection [218672] Host "[IP] 192.168.1.115 [Port] 0 [Flags] 2 [Guid] 2733801325 [EditorId] 2733801325 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... -Refreshing native plugins compatible for Editor in 46.07 ms, found 3 plugins. +Refreshing native plugins compatible for Editor in 51.71 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. Initialize engine version: 2022.3.1f1 (f18e0c1b5784) [Subsystems] Discovering subsystems at path D:/Unity/2022.3.1f1/Editor/Data/Resources/UnitySubsystems @@ -63,50 +63,50 @@ Direct3D: Version: Direct3D 11.0 [level 11.1] Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) Vendor: NVIDIA - VRAM: 5980 MB - Driver: 31.0.15.3623 + VRAM: 5966 MB + Driver: 32.0.15.6094 Initialize mono Mono path[0] = 'D:/Unity/2022.3.1f1/Editor/Data/Managed' Mono path[1] = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' Mono config path = 'D:/Unity/2022.3.1f1/Editor/Data/MonoBleedingEdge/etc' -Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56084 +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56800 Begin MonoManager ReloadAssembly Registering precompiled unity dll's ... Register platform support module: D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll -Registered in 0.007045 seconds. -- Loaded All Assemblies, in 0.451 seconds +Registered in 0.007652 seconds. +- Loaded All Assemblies, in 0.471 seconds Native extension for WindowsStandalone target not found Mono: successfully reloaded assembly -- Finished resetting the current domain, in 0.315 seconds -Domain Reload Profiling: 763ms - BeginReloadAssembly (111ms) +- Finished resetting the current domain, in 0.391 seconds +Domain Reload Profiling: 859ms + BeginReloadAssembly (133ms) ExecutionOrderSort (0ms) DisableScriptedObjects (0ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) CreateAndSetChildDomain (1ms) - RebuildCommonClasses (54ms) - RebuildNativeTypeToScriptingClass (12ms) - initialDomainReloadingComplete (76ms) - LoadAllAssembliesAndSetupDomain (194ms) - LoadAssemblies (109ms) + RebuildCommonClasses (55ms) + RebuildNativeTypeToScriptingClass (15ms) + initialDomainReloadingComplete (93ms) + LoadAllAssembliesAndSetupDomain (171ms) + LoadAssemblies (131ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (184ms) - TypeCache.Refresh (183ms) - TypeCache.ScanAssembly (162ms) - ScanForSourceGeneratedMonoScriptInfo (1ms) + AnalyzeDomain (159ms) + TypeCache.Refresh (158ms) + TypeCache.ScanAssembly (143ms) + ScanForSourceGeneratedMonoScriptInfo (0ms) ResolveRequiredComponents (1ms) - FinalizeReload (316ms) + FinalizeReload (392ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (242ms) + SetupLoadedEditorAssemblies (294ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (9ms) + InitializePlatformSupportModulesInManaged (19ms) + SetLoadedEditorAssemblies (13ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (2ms) - ProcessInitializeOnLoadAttributes (154ms) - ProcessInitializeOnLoadMethodAttributes (67ms) + BeforeProcessingInitializeOnLoad (5ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (77ms) AfterProcessingInitializeOnLoad (0ms) EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) @@ -114,56 +114,121 @@ Domain Reload Profiling: 763ms ======================================================================== Worker process is ready to serve import requests Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.838 seconds -Refreshing native plugins compatible for Editor in 29.55 ms, found 3 plugins. +- Loaded All Assemblies, in 1.957 seconds +Refreshing native plugins compatible for Editor in 27.76 ms, found 3 plugins. Native extension for WindowsStandalone target not found Package Manager log level set to [2] [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.228 seconds -Domain Reload Profiling: 3060ms - BeginReloadAssembly (167ms) +- Finished resetting the current domain, in 2.284 seconds +Domain Reload Profiling: 4233ms + BeginReloadAssembly (149ms) ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) + DisableScriptedObjects (4ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (29ms) - RebuildCommonClasses (43ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (63ms) - LoadAllAssembliesAndSetupDomain (1545ms) - LoadAssemblies (1044ms) + CreateAndSetChildDomain (27ms) + RebuildCommonClasses (35ms) + RebuildNativeTypeToScriptingClass (10ms) + initialDomainReloadingComplete (61ms) + LoadAllAssembliesAndSetupDomain (1694ms) + LoadAssemblies (1076ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (577ms) - TypeCache.Refresh (524ms) - TypeCache.ScanAssembly (491ms) - ScanForSourceGeneratedMonoScriptInfo (39ms) - ResolveRequiredComponents (13ms) - FinalizeReload (1228ms) + AnalyzeDomain (681ms) + TypeCache.Refresh (639ms) + TypeCache.ScanAssembly (608ms) + ScanForSourceGeneratedMonoScriptInfo (32ms) + ResolveRequiredComponents (11ms) + FinalizeReload (2284ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (975ms) + SetupLoadedEditorAssemblies (1535ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (9ms) + InitializePlatformSupportModulesInManaged (75ms) + SetLoadedEditorAssemblies (12ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (186ms) - ProcessInitializeOnLoadAttributes (721ms) - ProcessInitializeOnLoadMethodAttributes (35ms) - AfterProcessingInitializeOnLoad (10ms) + BeforeProcessingInitializeOnLoad (171ms) + ProcessInitializeOnLoadAttributes (1210ms) + ProcessInitializeOnLoadMethodAttributes (52ms) + AfterProcessingInitializeOnLoad (14ms) EditorAssembliesLoaded (1ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Launched and connected shader compiler UnityShaderCompiler.exe after 0.12 seconds -Refreshing native plugins compatible for Editor in 34.94 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (17ms) +Launched and connected shader compiler UnityShaderCompiler.exe after 0.10 seconds +Refreshing native plugins compatible for Editor in 46.06 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5016 Unused Serialized files (Serialized files now loaded: 0) -Unloading 133 unused Assets / (163.5 KB). Loaded Objects now: 5443. -Memory consumption went from 171.0 MB to 170.9 MB. -Total: 6.447600 ms (FindLiveObjects: 0.900400 ms CreateObjectMapping: 0.504400 ms MarkObjects: 4.691600 ms DeleteObjects: 0.348700 ms) +Unloading 5022 Unused Serialized files (Serialized files now loaded: 0) +Unloading 134 unused Assets / (196.5 KB). Loaded Objects now: 5448. +Memory consumption went from 171.1 MB to 170.9 MB. +Total: 6.224400 ms (FindLiveObjects: 1.088800 ms CreateObjectMapping: 0.438500 ms MarkObjects: 3.760400 ms DeleteObjects: 0.933700 ms) +AssetImportParameters requested are different than current active one (requested -> active): + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Begin MonoManager ReloadAssembly +- Loaded All Assemblies, in 1.128 seconds +Refreshing native plugins compatible for Editor in 21.54 ms, found 3 plugins. +Native extension for WindowsStandalone target not found +[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument +[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). +[Package Manager] Cannot connect to Unity Package Manager local server +Mono: successfully reloaded assembly +- Finished resetting the current domain, in 1.154 seconds +Domain Reload Profiling: 2277ms + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + RebuildCommonClasses (27ms) + RebuildNativeTypeToScriptingClass (12ms) + initialDomainReloadingComplete (48ms) + LoadAllAssembliesAndSetupDomain (884ms) + LoadAssemblies (638ms) + RebuildTransferFunctionScriptingTraits (0ms) + AnalyzeDomain (304ms) + TypeCache.Refresh (294ms) + TypeCache.ScanAssembly (276ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (7ms) + FinalizeReload (1155ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (0ms) + SetupLoadedEditorAssemblies (498ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (0ms) + BeforeProcessingInitializeOnLoad (129ms) + ProcessInitializeOnLoadAttributes (320ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (8ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 22.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 5182 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (321.2 KB). Loaded Objects now: 5628. +Memory consumption went from 174.8 MB to 174.5 MB. +Total: 3.401200 ms (FindLiveObjects: 0.405400 ms CreateObjectMapping: 0.210300 ms MarkObjects: 2.506600 ms DeleteObjects: 0.277400 ms) + +Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> @@ -177,62 +242,64 @@ AssetImportParameters requested are different than current active one (requested custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> ======================================================================== Received Import Request. - Time since last request: 19208.883404 seconds. - path: Assets/AssetBundleCollectorSetting.asset - artifactKey: Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -Start importing Assets/AssetBundleCollectorSetting.asset using Guid(3cf588b650c043f41ac56ee8a5e7d801) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e55cfc364d0d0dac972cec3c0ab2153f') in 0.029933 seconds + Time since last request: 36343.928055 seconds. + path: Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef + artifactKey: Guid(19cba46ac204fdd48a96c9d9f1471d9c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Plugins/FairyGUI/Editor/FairyGUI.Editor.asmdef using Guid(19cba46ac204fdd48a96c9d9f1471d9c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'f8ffd5d41e53d934cf716854b6911730') in 0.003799 seconds Number of updated asset objects reloaded before import = 0 -Number of asset objects unloaded after import = 1 +Number of asset objects unloaded after import = 0 ======================================================================== Received Prepare Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.294 seconds -Refreshing native plugins compatible for Editor in 18.09 ms, found 3 plugins. +- Loaded All Assemblies, in 1.923 seconds +Refreshing native plugins compatible for Editor in 34.21 ms, found 3 plugins. Native extension for WindowsStandalone target not found [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.158 seconds -Domain Reload Profiling: 2447ms - BeginReloadAssembly (186ms) +- Finished resetting the current domain, in 1.364 seconds +Domain Reload Profiling: 3274ms + BeginReloadAssembly (235ms) ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) + DisableScriptedObjects (5ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (56ms) - RebuildCommonClasses (34ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (55ms) - LoadAllAssembliesAndSetupDomain (1001ms) - LoadAssemblies (701ms) + CreateAndSetChildDomain (89ms) + RebuildCommonClasses (35ms) + RebuildNativeTypeToScriptingClass (10ms) + initialDomainReloadingComplete (91ms) + LoadAllAssembliesAndSetupDomain (1538ms) + LoadAssemblies (1028ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (376ms) - TypeCache.Refresh (365ms) - TypeCache.ScanAssembly (345ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1159ms) + AnalyzeDomain (595ms) + TypeCache.Refresh (580ms) + TypeCache.ScanAssembly (553ms) + ScanForSourceGeneratedMonoScriptInfo (4ms) + ResolveRequiredComponents (11ms) + FinalizeReload (1364ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (566ms) + SetupLoadedEditorAssemblies (569ms) LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) + InitializePlatformSupportModulesInManaged (6ms) SetLoadedEditorAssemblies (5ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (110ms) - ProcessInitializeOnLoadAttributes (410ms) - ProcessInitializeOnLoadMethodAttributes (26ms) + BeforeProcessingInitializeOnLoad (124ms) + ProcessInitializeOnLoadAttributes (394ms) + ProcessInitializeOnLoadMethodAttributes (33ms) AfterProcessingInitializeOnLoad (7ms) EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) AwakeInstancesAfterBackupRestoration (9ms) -Refreshing native plugins compatible for Editor in 38.08 ms, found 3 plugins. +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 30.84 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5007 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (133.8 KB). Loaded Objects now: 5461. -Memory consumption went from 168.8 MB to 168.6 MB. -Total: 36.336500 ms (FindLiveObjects: 2.993700 ms CreateObjectMapping: 0.635600 ms MarkObjects: 32.255600 ms DeleteObjects: 0.447600 ms) +Unloading 5181 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (321.4 KB). Loaded Objects now: 5643. +Memory consumption went from 174.5 MB to 174.2 MB. +Total: 6.052800 ms (FindLiveObjects: 0.718800 ms CreateObjectMapping: 0.730700 ms MarkObjects: 4.100600 ms DeleteObjects: 0.500000 ms) Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): @@ -249,1928 +316,55 @@ AssetImportParameters requested are different than current active one (requested ======================================================================== Received Prepare Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.345 seconds -Refreshing native plugins compatible for Editor in 17.41 ms, found 3 plugins. +- Loaded All Assemblies, in 1.209 seconds +Refreshing native plugins compatible for Editor in 22.02 ms, found 3 plugins. Native extension for WindowsStandalone target not found [Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). [Package Manager] Cannot connect to Unity Package Manager local server Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.213 seconds -Domain Reload Profiling: 2552ms - BeginReloadAssembly (178ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (62ms) - RebuildCommonClasses (29ms) - RebuildNativeTypeToScriptingClass (9ms) - initialDomainReloadingComplete (54ms) - LoadAllAssembliesAndSetupDomain (1069ms) - LoadAssemblies (724ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (411ms) - TypeCache.Refresh (403ms) - TypeCache.ScanAssembly (381ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1214ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (585ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (6ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (118ms) - ProcessInitializeOnLoadAttributes (407ms) - ProcessInitializeOnLoadMethodAttributes (37ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 30.73 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5476. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 7.724600 ms (FindLiveObjects: 0.823300 ms CreateObjectMapping: 0.513500 ms MarkObjects: 5.718000 ms DeleteObjects: 0.666200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.263 seconds -Refreshing native plugins compatible for Editor in 20.82 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.323 seconds -Domain Reload Profiling: 2581ms - BeginReloadAssembly (163ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (58ms) - RebuildCommonClasses (30ms) - RebuildNativeTypeToScriptingClass (9ms) - initialDomainReloadingComplete (51ms) - LoadAllAssembliesAndSetupDomain (1003ms) - LoadAssemblies (709ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (351ms) - TypeCache.Refresh (343ms) - TypeCache.ScanAssembly (317ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1324ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (604ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (16ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (146ms) - ProcessInitializeOnLoadAttributes (381ms) - ProcessInitializeOnLoadMethodAttributes (39ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 31.59 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5491. -Memory consumption went from 169.0 MB to 168.9 MB. -Total: 6.852600 ms (FindLiveObjects: 0.883600 ms CreateObjectMapping: 0.711700 ms MarkObjects: 5.055900 ms DeleteObjects: 0.199900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.306 seconds -Refreshing native plugins compatible for Editor in 21.06 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.038 seconds -Domain Reload Profiling: 2335ms - BeginReloadAssembly (158ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (47ms) - RebuildCommonClasses (31ms) - RebuildNativeTypeToScriptingClass (13ms) - initialDomainReloadingComplete (59ms) - LoadAllAssembliesAndSetupDomain (1036ms) - LoadAssemblies (671ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (426ms) - TypeCache.Refresh (417ms) - TypeCache.ScanAssembly (397ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (1038ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (482ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (112ms) - ProcessInitializeOnLoadAttributes (322ms) - ProcessInitializeOnLoadMethodAttributes (26ms) - AfterProcessingInitializeOnLoad (11ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (10ms) -Refreshing native plugins compatible for Editor in 31.12 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5506. -Memory consumption went from 169.1 MB to 168.9 MB. -Total: 8.976800 ms (FindLiveObjects: 1.439900 ms CreateObjectMapping: 1.066700 ms MarkObjects: 6.051100 ms DeleteObjects: 0.415800 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.409 seconds -Refreshing native plugins compatible for Editor in 32.46 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.225 seconds -Domain Reload Profiling: 2630ms - BeginReloadAssembly (161ms) +- Finished resetting the current domain, in 1.046 seconds +Domain Reload Profiling: 2247ms + BeginReloadAssembly (169ms) ExecutionOrderSort (0ms) DisableScriptedObjects (5ms) BackupInstance (0ms) ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (48ms) + CreateAndSetChildDomain (60ms) RebuildCommonClasses (35ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (50ms) - LoadAllAssembliesAndSetupDomain (1148ms) - LoadAssemblies (683ms) + RebuildNativeTypeToScriptingClass (10ms) + initialDomainReloadingComplete (59ms) + LoadAllAssembliesAndSetupDomain (927ms) + LoadAssemblies (679ms) RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (523ms) - TypeCache.Refresh (510ms) - TypeCache.ScanAssembly (482ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (13ms) - FinalizeReload (1226ms) + AnalyzeDomain (301ms) + TypeCache.Refresh (290ms) + TypeCache.ScanAssembly (274ms) + ScanForSourceGeneratedMonoScriptInfo (3ms) + ResolveRequiredComponents (8ms) + FinalizeReload (1046ms) ReleaseScriptCaches (0ms) RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (520ms) + SetupLoadedEditorAssemblies (450ms) LogAssemblyErrors (0ms) InitializePlatformSupportModulesInManaged (5ms) SetLoadedEditorAssemblies (5ms) RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (110ms) - ProcessInitializeOnLoadAttributes (355ms) - ProcessInitializeOnLoadMethodAttributes (34ms) - AfterProcessingInitializeOnLoad (10ms) + BeforeProcessingInitializeOnLoad (102ms) + ProcessInitializeOnLoadAttributes (302ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (7ms) EditorAssembliesLoaded (0ms) ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 29.61 ms, found 3 plugins. + AwakeInstancesAfterBackupRestoration (8ms) +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Shader 'FairyGUI/TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found +Refreshing native plugins compatible for Editor in 22.70 ms, found 3 plugins. Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5521. -Memory consumption went from 169.1 MB to 168.9 MB. -Total: 18.512300 ms (FindLiveObjects: 1.472700 ms CreateObjectMapping: 1.092800 ms MarkObjects: 15.745300 ms DeleteObjects: 0.199000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.542 seconds -Refreshing native plugins compatible for Editor in 15.75 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.022 seconds -Domain Reload Profiling: 2558ms - BeginReloadAssembly (174ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (67ms) - RebuildCommonClasses (27ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (65ms) - LoadAllAssembliesAndSetupDomain (1259ms) - LoadAssemblies (871ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (442ms) - TypeCache.Refresh (432ms) - TypeCache.ScanAssembly (406ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1023ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (482ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (103ms) - ProcessInitializeOnLoadAttributes (319ms) - ProcessInitializeOnLoadMethodAttributes (38ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Refreshing native plugins compatible for Editor in 34.81 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5536. -Memory consumption went from 169.1 MB to 168.9 MB. -Total: 6.914400 ms (FindLiveObjects: 1.196400 ms CreateObjectMapping: 0.759900 ms MarkObjects: 4.767000 ms DeleteObjects: 0.188900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.318 seconds -Refreshing native plugins compatible for Editor in 16.30 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.016 seconds -Domain Reload Profiling: 2327ms - BeginReloadAssembly (270ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (112ms) - RebuildCommonClasses (41ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (62ms) - LoadAllAssembliesAndSetupDomain (926ms) - LoadAssemblies (695ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (332ms) - TypeCache.Refresh (322ms) - TypeCache.ScanAssembly (296ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (7ms) - FinalizeReload (1017ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (451ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (5ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (111ms) - ProcessInitializeOnLoadAttributes (300ms) - ProcessInitializeOnLoadMethodAttributes (22ms) - AfterProcessingInitializeOnLoad (8ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (9ms) -Refreshing native plugins compatible for Editor in 31.15 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5551. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 6.120000 ms (FindLiveObjects: 0.620700 ms CreateObjectMapping: 0.439100 ms MarkObjects: 4.846900 ms DeleteObjects: 0.210300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.736 seconds -Refreshing native plugins compatible for Editor in 21.22 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.436 seconds -Domain Reload Profiling: 3167ms - BeginReloadAssembly (207ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (80ms) - RebuildCommonClasses (39ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (56ms) - LoadAllAssembliesAndSetupDomain (1419ms) - LoadAssemblies (822ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (657ms) - TypeCache.Refresh (646ms) - TypeCache.ScanAssembly (620ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (11ms) - FinalizeReload (1436ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (549ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (6ms) - SetLoadedEditorAssemblies (4ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (121ms) - ProcessInitializeOnLoadAttributes (377ms) - ProcessInitializeOnLoadMethodAttributes (30ms) - AfterProcessingInitializeOnLoad (10ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (12ms) -Refreshing native plugins compatible for Editor in 27.79 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5566. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 12.268800 ms (FindLiveObjects: 2.365000 ms CreateObjectMapping: 0.808900 ms MarkObjects: 8.670000 ms DeleteObjects: 0.418800 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.053 seconds -Refreshing native plugins compatible for Editor in 39.72 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.522 seconds -Domain Reload Profiling: 3563ms - BeginReloadAssembly (284ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (107ms) - RebuildCommonClasses (56ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (85ms) - LoadAllAssembliesAndSetupDomain (1598ms) - LoadAssemblies (1109ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (589ms) - TypeCache.Refresh (572ms) - TypeCache.ScanAssembly (532ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1522ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (657ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (140ms) - ProcessInitializeOnLoadAttributes (454ms) - ProcessInitializeOnLoadMethodAttributes (37ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (15ms) -Refreshing native plugins compatible for Editor in 130.39 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.2 KB). Loaded Objects now: 5581. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 13.617500 ms (FindLiveObjects: 1.093800 ms CreateObjectMapping: 0.996400 ms MarkObjects: 10.948400 ms DeleteObjects: 0.574600 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.537 seconds -Refreshing native plugins compatible for Editor in 23.46 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.714 seconds -Domain Reload Profiling: 4245ms - BeginReloadAssembly (524ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (20ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (283ms) - RebuildCommonClasses (48ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (74ms) - LoadAllAssembliesAndSetupDomain (1870ms) - LoadAssemblies (1264ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (720ms) - TypeCache.Refresh (708ms) - TypeCache.ScanAssembly (647ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (12ms) - FinalizeReload (1715ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (732ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (139ms) - ProcessInitializeOnLoadAttributes (526ms) - ProcessInitializeOnLoadMethodAttributes (38ms) - AfterProcessingInitializeOnLoad (11ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 34.36 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.0 KB). Loaded Objects now: 5596. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 6.075000 ms (FindLiveObjects: 0.661700 ms CreateObjectMapping: 0.385300 ms MarkObjects: 4.694000 ms DeleteObjects: 0.330700 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.152 seconds -Refreshing native plugins compatible for Editor in 22.67 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.166 seconds -Domain Reload Profiling: 3308ms - BeginReloadAssembly (399ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (7ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (90ms) - RebuildCommonClasses (107ms) - RebuildNativeTypeToScriptingClass (26ms) - initialDomainReloadingComplete (168ms) - LoadAllAssembliesAndSetupDomain (1441ms) - LoadAssemblies (1264ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (410ms) - TypeCache.Refresh (400ms) - TypeCache.ScanAssembly (371ms) - ScanForSourceGeneratedMonoScriptInfo (2ms) - ResolveRequiredComponents (8ms) - FinalizeReload (1167ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (529ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (134ms) - ProcessInitializeOnLoadAttributes (344ms) - ProcessInitializeOnLoadMethodAttributes (27ms) - AfterProcessingInitializeOnLoad (10ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (10ms) -Refreshing native plugins compatible for Editor in 54.00 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5611. -Memory consumption went from 169.1 MB to 169.0 MB. -Total: 14.977600 ms (FindLiveObjects: 3.007700 ms CreateObjectMapping: 4.350900 ms MarkObjects: 7.299200 ms DeleteObjects: 0.316900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.616 seconds -Refreshing native plugins compatible for Editor in 33.10 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.593 seconds -Domain Reload Profiling: 3200ms - BeginReloadAssembly (185ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (5ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (65ms) - RebuildCommonClasses (39ms) - RebuildNativeTypeToScriptingClass (11ms) - initialDomainReloadingComplete (65ms) - LoadAllAssembliesAndSetupDomain (1307ms) - LoadAssemblies (828ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (538ms) - TypeCache.Refresh (520ms) - TypeCache.ScanAssembly (477ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1594ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (753ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (171ms) - ProcessInitializeOnLoadAttributes (507ms) - ProcessInitializeOnLoadMethodAttributes (48ms) - AfterProcessingInitializeOnLoad (8ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (10ms) -Refreshing native plugins compatible for Editor in 44.28 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.3 KB). Loaded Objects now: 5626. -Memory consumption went from 169.3 MB to 169.1 MB. -Total: 9.653300 ms (FindLiveObjects: 1.634300 ms CreateObjectMapping: 1.200100 ms MarkObjects: 6.579300 ms DeleteObjects: 0.235800 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.707 seconds -Refreshing native plugins compatible for Editor in 29.46 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.519 seconds -Domain Reload Profiling: 3219ms - BeginReloadAssembly (256ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (4ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (73ms) - RebuildCommonClasses (63ms) - RebuildNativeTypeToScriptingClass (17ms) - initialDomainReloadingComplete (83ms) - LoadAllAssembliesAndSetupDomain (1280ms) - LoadAssemblies (972ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (426ms) - TypeCache.Refresh (409ms) - TypeCache.ScanAssembly (382ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (17ms) - FinalizeReload (1521ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (644ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (7ms) - SetLoadedEditorAssemblies (6ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (146ms) - ProcessInitializeOnLoadAttributes (433ms) - ProcessInitializeOnLoadMethodAttributes (38ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 36.42 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5641. -Memory consumption went from 169.3 MB to 169.2 MB. -Total: 6.604300 ms (FindLiveObjects: 0.694900 ms CreateObjectMapping: 0.993300 ms MarkObjects: 4.737200 ms DeleteObjects: 0.176200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.629 seconds -Refreshing native plugins compatible for Editor in 23.90 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.588 seconds -Domain Reload Profiling: 3212ms - BeginReloadAssembly (263ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (5ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (101ms) - RebuildCommonClasses (62ms) - RebuildNativeTypeToScriptingClass (22ms) - initialDomainReloadingComplete (70ms) - LoadAllAssembliesAndSetupDomain (1206ms) - LoadAssemblies (796ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (503ms) - TypeCache.Refresh (490ms) - TypeCache.ScanAssembly (460ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (11ms) - FinalizeReload (1589ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (853ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (179ms) - ProcessInitializeOnLoadAttributes (604ms) - ProcessInitializeOnLoadMethodAttributes (40ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 29.18 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5008 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (134.1 KB). Loaded Objects now: 5656. -Memory consumption went from 169.3 MB to 169.2 MB. -Total: 6.408200 ms (FindLiveObjects: 0.728800 ms CreateObjectMapping: 0.759500 ms MarkObjects: 4.621200 ms DeleteObjects: 0.297100 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 34.14 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 2 Unused Serialized files (Serialized files now loaded: 0) -Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5656. -Memory consumption went from 91.3 MB to 91.2 MB. -Total: 312.258900 ms (FindLiveObjects: 222.860200 ms CreateObjectMapping: 1.786400 ms MarkObjects: 87.222300 ms DeleteObjects: 0.387500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.009 seconds -Refreshing native plugins compatible for Editor in 26.54 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.162 seconds -Domain Reload Profiling: 5160ms - BeginReloadAssembly (298ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (120ms) - RebuildCommonClasses (64ms) - RebuildNativeTypeToScriptingClass (16ms) - initialDomainReloadingComplete (93ms) - LoadAllAssembliesAndSetupDomain (1527ms) - LoadAssemblies (1091ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (537ms) - TypeCache.Refresh (521ms) - TypeCache.ScanAssembly (489ms) - ScanForSourceGeneratedMonoScriptInfo (4ms) - ResolveRequiredComponents (12ms) - FinalizeReload (3163ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (797ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (190ms) - ProcessInitializeOnLoadAttributes (542ms) - ProcessInitializeOnLoadMethodAttributes (38ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (13ms) -Refreshing native plugins compatible for Editor in 42.80 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5011 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5674. -Memory consumption went from 169.4 MB to 169.2 MB. -Total: 19.166800 ms (FindLiveObjects: 1.701400 ms CreateObjectMapping: 1.621900 ms MarkObjects: 15.356700 ms DeleteObjects: 0.483500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.043 seconds -Refreshing native plugins compatible for Editor in 27.78 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.991 seconds -Domain Reload Profiling: 4007ms - BeginReloadAssembly (291ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (102ms) - RebuildCommonClasses (81ms) - RebuildNativeTypeToScriptingClass (26ms) - initialDomainReloadingComplete (133ms) - LoadAllAssembliesAndSetupDomain (1484ms) - LoadAssemblies (1073ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (525ms) - TypeCache.Refresh (510ms) - TypeCache.ScanAssembly (480ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (12ms) - FinalizeReload (1992ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (1160ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (215ms) - ProcessInitializeOnLoadAttributes (838ms) - ProcessInitializeOnLoadMethodAttributes (70ms) - AfterProcessingInitializeOnLoad (17ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 51.06 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5011 Unused Serialized files (Serialized files now loaded: 0) -Unloading 91 unused Assets / (133.9 KB). Loaded Objects now: 5689. -Memory consumption went from 169.4 MB to 169.2 MB. -Total: 38.748600 ms (FindLiveObjects: 18.164200 ms CreateObjectMapping: 1.207200 ms MarkObjects: 18.250300 ms DeleteObjects: 1.124200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 37.19 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 2 Unused Serialized files (Serialized files now loaded: 0) -Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5689. -Memory consumption went from 91.3 MB to 91.3 MB. -Total: 27.844100 ms (FindLiveObjects: 2.598800 ms CreateObjectMapping: 10.660600 ms MarkObjects: 14.492300 ms DeleteObjects: 0.088100 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.238 seconds -Refreshing native plugins compatible for Editor in 39.30 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.964 seconds -Domain Reload Profiling: 4195ms - BeginReloadAssembly (314ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (134ms) - RebuildCommonClasses (57ms) - RebuildNativeTypeToScriptingClass (16ms) - initialDomainReloadingComplete (103ms) - LoadAllAssembliesAndSetupDomain (1739ms) - LoadAssemblies (1213ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (608ms) - TypeCache.Refresh (591ms) - TypeCache.ScanAssembly (546ms) - ScanForSourceGeneratedMonoScriptInfo (1ms) - ResolveRequiredComponents (16ms) - FinalizeReload (1965ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (957ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (12ms) - SetLoadedEditorAssemblies (11ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (197ms) - ProcessInitializeOnLoadAttributes (654ms) - ProcessInitializeOnLoadMethodAttributes (67ms) - AfterProcessingInitializeOnLoad (15ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 47.15 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5704. -Memory consumption went from 169.4 MB to 169.3 MB. -Total: 28.979500 ms (FindLiveObjects: 2.268800 ms CreateObjectMapping: 0.743700 ms MarkObjects: 25.548700 ms DeleteObjects: 0.415500 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.864 seconds -Refreshing native plugins compatible for Editor in 34.45 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.098 seconds -Domain Reload Profiling: 3954ms - BeginReloadAssembly (235ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (11ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (74ms) - RebuildCommonClasses (53ms) - RebuildNativeTypeToScriptingClass (17ms) - initialDomainReloadingComplete (75ms) - LoadAllAssembliesAndSetupDomain (1475ms) - LoadAssemblies (972ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (583ms) - TypeCache.Refresh (568ms) - TypeCache.ScanAssembly (540ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (14ms) - FinalizeReload (2099ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (965ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (11ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (201ms) - ProcessInitializeOnLoadAttributes (683ms) - ProcessInitializeOnLoadMethodAttributes (45ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Refreshing native plugins compatible for Editor in 60.13 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5719. -Memory consumption went from 169.4 MB to 169.3 MB. -Total: 23.213100 ms (FindLiveObjects: 3.956700 ms CreateObjectMapping: 3.278400 ms MarkObjects: 15.329800 ms DeleteObjects: 0.644900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.105 seconds -Refreshing native plugins compatible for Editor in 35.10 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.854 seconds -Domain Reload Profiling: 3952ms - BeginReloadAssembly (264ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (10ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (91ms) - RebuildCommonClasses (44ms) - RebuildNativeTypeToScriptingClass (12ms) - initialDomainReloadingComplete (83ms) - LoadAllAssembliesAndSetupDomain (1695ms) - LoadAssemblies (1035ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (761ms) - TypeCache.Refresh (731ms) - TypeCache.ScanAssembly (683ms) - ScanForSourceGeneratedMonoScriptInfo (5ms) - ResolveRequiredComponents (25ms) - FinalizeReload (1854ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (799ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (9ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (162ms) - ProcessInitializeOnLoadAttributes (561ms) - ProcessInitializeOnLoadMethodAttributes (46ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 34.02 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5734. -Memory consumption went from 169.5 MB to 169.3 MB. -Total: 134.795100 ms (FindLiveObjects: 1.364600 ms CreateObjectMapping: 4.623000 ms MarkObjects: 128.182700 ms DeleteObjects: 0.621900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.048 seconds -Refreshing native plugins compatible for Editor in 57.60 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.947 seconds -Domain Reload Profiling: 3988ms - BeginReloadAssembly (356ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (146ms) - RebuildCommonClasses (66ms) - RebuildNativeTypeToScriptingClass (20ms) - initialDomainReloadingComplete (88ms) - LoadAllAssembliesAndSetupDomain (1510ms) - LoadAssemblies (1074ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (561ms) - TypeCache.Refresh (547ms) - TypeCache.ScanAssembly (509ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (14ms) - FinalizeReload (1948ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (783ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (11ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (176ms) - ProcessInitializeOnLoadAttributes (530ms) - ProcessInitializeOnLoadMethodAttributes (43ms) - AfterProcessingInitializeOnLoad (14ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (17ms) -Refreshing native plugins compatible for Editor in 32.92 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5749. -Memory consumption went from 169.5 MB to 169.3 MB. -Total: 39.797100 ms (FindLiveObjects: 19.379800 ms CreateObjectMapping: 3.338900 ms MarkObjects: 16.459400 ms DeleteObjects: 0.615300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.724 seconds -Refreshing native plugins compatible for Editor in 44.37 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.817 seconds -Domain Reload Profiling: 4526ms - BeginReloadAssembly (300ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (117ms) - RebuildCommonClasses (56ms) - RebuildNativeTypeToScriptingClass (17ms) - initialDomainReloadingComplete (246ms) - LoadAllAssembliesAndSetupDomain (2089ms) - LoadAssemblies (1571ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (625ms) - TypeCache.Refresh (604ms) - TypeCache.ScanAssembly (571ms) - ScanForSourceGeneratedMonoScriptInfo (4ms) - ResolveRequiredComponents (16ms) - FinalizeReload (1818ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (832ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (180ms) - ProcessInitializeOnLoadAttributes (549ms) - ProcessInitializeOnLoadMethodAttributes (61ms) - AfterProcessingInitializeOnLoad (19ms) - EditorAssembliesLoaded (2ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (20ms) -Refreshing native plugins compatible for Editor in 144.33 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5764. -Memory consumption went from 169.4 MB to 169.3 MB. -Total: 15.861100 ms (FindLiveObjects: 3.635500 ms CreateObjectMapping: 2.041600 ms MarkObjects: 9.766800 ms DeleteObjects: 0.411100 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.134 seconds -Refreshing native plugins compatible for Editor in 29.84 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.945 seconds -Domain Reload Profiling: 4073ms - BeginReloadAssembly (319ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (118ms) - RebuildCommonClasses (65ms) - RebuildNativeTypeToScriptingClass (20ms) - initialDomainReloadingComplete (76ms) - LoadAllAssembliesAndSetupDomain (1648ms) - LoadAssemblies (1044ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (710ms) - TypeCache.Refresh (697ms) - TypeCache.ScanAssembly (655ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (13ms) - FinalizeReload (1946ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (907ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (7ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (178ms) - ProcessInitializeOnLoadAttributes (633ms) - ProcessInitializeOnLoadMethodAttributes (60ms) - AfterProcessingInitializeOnLoad (17ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (25ms) -Refreshing native plugins compatible for Editor in 66.43 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5779. -Memory consumption went from 169.4 MB to 169.3 MB. -Total: 10.960900 ms (FindLiveObjects: 0.901500 ms CreateObjectMapping: 0.506900 ms MarkObjects: 8.588800 ms DeleteObjects: 0.926100 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.205 seconds -Refreshing native plugins compatible for Editor in 34.66 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.669 seconds -Domain Reload Profiling: 3869ms - BeginReloadAssembly (301ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (11ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (110ms) - RebuildCommonClasses (59ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (86ms) - LoadAllAssembliesAndSetupDomain (1736ms) - LoadAssemblies (1057ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (778ms) - TypeCache.Refresh (749ms) - TypeCache.ScanAssembly (698ms) - ScanForSourceGeneratedMonoScriptInfo (7ms) - ResolveRequiredComponents (22ms) - FinalizeReload (1670ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (706ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (5ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (159ms) - ProcessInitializeOnLoadAttributes (480ms) - ProcessInitializeOnLoadMethodAttributes (43ms) - AfterProcessingInitializeOnLoad (10ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 32.39 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5794. -Memory consumption went from 169.4 MB to 169.3 MB. -Total: 34.654100 ms (FindLiveObjects: 1.262600 ms CreateObjectMapping: 6.839200 ms MarkObjects: 25.642600 ms DeleteObjects: 0.907200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.038 seconds -Refreshing native plugins compatible for Editor in 45.16 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.132 seconds -Domain Reload Profiling: 4154ms - BeginReloadAssembly (279ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (8ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (95ms) - RebuildCommonClasses (62ms) - RebuildNativeTypeToScriptingClass (22ms) - initialDomainReloadingComplete (121ms) - LoadAllAssembliesAndSetupDomain (1538ms) - LoadAssemblies (1089ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (560ms) - TypeCache.Refresh (544ms) - TypeCache.ScanAssembly (509ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (16ms) - FinalizeReload (2133ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (948ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (17ms) - SetLoadedEditorAssemblies (11ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (206ms) - ProcessInitializeOnLoadAttributes (636ms) - ProcessInitializeOnLoadMethodAttributes (63ms) - AfterProcessingInitializeOnLoad (15ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (17ms) -Refreshing native plugins compatible for Editor in 118.26 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.9 KB). Loaded Objects now: 5809. -Memory consumption went from 169.5 MB to 169.4 MB. -Total: 28.951100 ms (FindLiveObjects: 6.585400 ms CreateObjectMapping: 2.098300 ms MarkObjects: 19.971000 ms DeleteObjects: 0.293300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 37.12 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 2 Unused Serialized files (Serialized files now loaded: 0) -Unloading 2 unused Assets / (76.4 KB). Loaded Objects now: 5809. -Memory consumption went from 91.5 MB to 91.4 MB. -Total: 13.248000 ms (FindLiveObjects: 0.974900 ms CreateObjectMapping: 0.497100 ms MarkObjects: 11.558300 ms DeleteObjects: 0.215000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.097 seconds -Refreshing native plugins compatible for Editor in 44.22 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.650 seconds -Domain Reload Profiling: 5737ms - BeginReloadAssembly (302ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (12ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (114ms) - RebuildCommonClasses (65ms) - RebuildNativeTypeToScriptingClass (16ms) - initialDomainReloadingComplete (79ms) - LoadAllAssembliesAndSetupDomain (1625ms) - LoadAssemblies (1092ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (620ms) - TypeCache.Refresh (591ms) - TypeCache.ScanAssembly (561ms) - ScanForSourceGeneratedMonoScriptInfo (9ms) - ResolveRequiredComponents (19ms) - FinalizeReload (3650ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (854ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (13ms) - SetLoadedEditorAssemblies (9ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (202ms) - ProcessInitializeOnLoadAttributes (570ms) - ProcessInitializeOnLoadMethodAttributes (47ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Refreshing native plugins compatible for Editor in 47.46 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.5 KB). Loaded Objects now: 5824. -Memory consumption went from 169.5 MB to 169.4 MB. -Total: 7.710600 ms (FindLiveObjects: 0.615300 ms CreateObjectMapping: 0.378500 ms MarkObjects: 6.414700 ms DeleteObjects: 0.299900 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.154 seconds -Refreshing native plugins compatible for Editor in 37.47 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.198 seconds -Domain Reload Profiling: 4346ms - BeginReloadAssembly (306ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (97ms) - RebuildCommonClasses (59ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (97ms) - LoadAllAssembliesAndSetupDomain (1666ms) - LoadAssemblies (1109ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (671ms) - TypeCache.Refresh (650ms) - TypeCache.ScanAssembly (620ms) - ScanForSourceGeneratedMonoScriptInfo (0ms) - ResolveRequiredComponents (20ms) - FinalizeReload (2200ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (1098ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (15ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (193ms) - ProcessInitializeOnLoadAttributes (807ms) - ProcessInitializeOnLoadMethodAttributes (56ms) - AfterProcessingInitializeOnLoad (17ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (26ms) -Refreshing native plugins compatible for Editor in 62.39 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.8 KB). Loaded Objects now: 5839. -Memory consumption went from 169.5 MB to 169.4 MB. -Total: 57.102100 ms (FindLiveObjects: 12.762600 ms CreateObjectMapping: 1.364300 ms MarkObjects: 42.560100 ms DeleteObjects: 0.410200 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 35.59 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 2 Unused Serialized files (Serialized files now loaded: 0) -Unloading 2 unused Assets / (76.5 KB). Loaded Objects now: 5839. -Memory consumption went from 91.5 MB to 91.4 MB. -Total: 39.638600 ms (FindLiveObjects: 1.950700 ms CreateObjectMapping: 2.096200 ms MarkObjects: 35.425500 ms DeleteObjects: 0.164000 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.134 seconds -Refreshing native plugins compatible for Editor in 32.48 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 2.861 seconds -Domain Reload Profiling: 4989ms - BeginReloadAssembly (267ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (77ms) - RebuildCommonClasses (62ms) - RebuildNativeTypeToScriptingClass (18ms) - initialDomainReloadingComplete (73ms) - LoadAllAssembliesAndSetupDomain (1709ms) - LoadAssemblies (1078ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (747ms) - TypeCache.Refresh (726ms) - TypeCache.ScanAssembly (690ms) - ScanForSourceGeneratedMonoScriptInfo (5ms) - ResolveRequiredComponents (17ms) - FinalizeReload (2862ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (664ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (10ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (157ms) - ProcessInitializeOnLoadAttributes (429ms) - ProcessInitializeOnLoadMethodAttributes (45ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (14ms) -Refreshing native plugins compatible for Editor in 36.60 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5854. -Memory consumption went from 169.5 MB to 169.4 MB. -Total: 5.023100 ms (FindLiveObjects: 0.824500 ms CreateObjectMapping: 0.655900 ms MarkObjects: 3.289900 ms DeleteObjects: 0.249800 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 1.759 seconds -Refreshing native plugins compatible for Editor in 24.33 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.865 seconds -Domain Reload Profiling: 3616ms - BeginReloadAssembly (239ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (6ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (82ms) - RebuildCommonClasses (54ms) - RebuildNativeTypeToScriptingClass (14ms) - initialDomainReloadingComplete (91ms) - LoadAllAssembliesAndSetupDomain (1353ms) - LoadAssemblies (966ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (476ms) - TypeCache.Refresh (461ms) - TypeCache.ScanAssembly (437ms) - ScanForSourceGeneratedMonoScriptInfo (3ms) - ResolveRequiredComponents (11ms) - FinalizeReload (1866ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (917ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (15ms) - SetLoadedEditorAssemblies (10ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (185ms) - ProcessInitializeOnLoadAttributes (643ms) - ProcessInitializeOnLoadMethodAttributes (51ms) - AfterProcessingInitializeOnLoad (12ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 52.72 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.6 KB). Loaded Objects now: 5869. -Memory consumption went from 169.5 MB to 169.3 MB. -Total: 14.701200 ms (FindLiveObjects: 4.674400 ms CreateObjectMapping: 1.575900 ms MarkObjects: 7.574600 ms DeleteObjects: 0.873300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Refreshing native plugins compatible for Editor in 37.31 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 2 Unused Serialized files (Serialized files now loaded: 0) -Unloading 2 unused Assets / (76.5 KB). Loaded Objects now: 5869. -Memory consumption went from 91.5 MB to 91.4 MB. -Total: 21.419900 ms (FindLiveObjects: 3.741100 ms CreateObjectMapping: 3.075200 ms MarkObjects: 14.490600 ms DeleteObjects: 0.109300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 3.219 seconds -Refreshing native plugins compatible for Editor in 26.33 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 3.001 seconds -Domain Reload Profiling: 6204ms - BeginReloadAssembly (677ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (285ms) - RebuildCommonClasses (151ms) - RebuildNativeTypeToScriptingClass (21ms) - initialDomainReloadingComplete (172ms) - LoadAllAssembliesAndSetupDomain (2181ms) - LoadAssemblies (1782ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (639ms) - TypeCache.Refresh (623ms) - TypeCache.ScanAssembly (590ms) - ScanForSourceGeneratedMonoScriptInfo (4ms) - ResolveRequiredComponents (13ms) - FinalizeReload (3002ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (672ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (8ms) - SetLoadedEditorAssemblies (8ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (148ms) - ProcessInitializeOnLoadAttributes (447ms) - ProcessInitializeOnLoadMethodAttributes (49ms) - AfterProcessingInitializeOnLoad (13ms) - EditorAssembliesLoaded (0ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (16ms) -Refreshing native plugins compatible for Editor in 58.79 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.3 KB). Loaded Objects now: 5884. -Memory consumption went from 169.5 MB to 169.4 MB. -Total: 9.608900 ms (FindLiveObjects: 1.002700 ms CreateObjectMapping: 0.705100 ms MarkObjects: 7.460000 ms DeleteObjects: 0.439300 ms) - -Prepare: number of updated asset objects reloaded= 0 -AssetImportParameters requested are different than current active one (requested -> active): - custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> - custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> - custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> - custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> - custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> - custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> - custom:AudioImporter_EditorPlatform: d09bf68614088b80899f8185d706f6e7 -> - custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> - custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> - custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> -======================================================================== -Received Prepare -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) -Begin MonoManager ReloadAssembly -- Loaded All Assemblies, in 2.120 seconds -Refreshing native plugins compatible for Editor in 31.38 ms, found 3 plugins. -Native extension for WindowsStandalone target not found -Assembly with name 'HotSamples' already exists (Assets/Scripts/HotSamples/HotSamples.asmdef) -Assembly with name 'HotSamples' already exists (Assets/HotScripts/HotSamples/HotSamples.asmdef) -[Package Manager] Server::EnsureServerProcessIsRunning -- launch failed, reason: Unity was launched with the -noUpm command-line argument -[Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process). -[Package Manager] Cannot connect to Unity Package Manager local server -Mono: successfully reloaded assembly -- Finished resetting the current domain, in 1.964 seconds -Domain Reload Profiling: 4076ms - BeginReloadAssembly (377ms) - ExecutionOrderSort (0ms) - DisableScriptedObjects (9ms) - BackupInstance (0ms) - ReleaseScriptingObjects (0ms) - CreateAndSetChildDomain (166ms) - RebuildCommonClasses (67ms) - RebuildNativeTypeToScriptingClass (17ms) - initialDomainReloadingComplete (79ms) - LoadAllAssembliesAndSetupDomain (1572ms) - LoadAssemblies (1061ms) - RebuildTransferFunctionScriptingTraits (0ms) - AnalyzeDomain (623ms) - TypeCache.Refresh (597ms) - TypeCache.ScanAssembly (562ms) - ScanForSourceGeneratedMonoScriptInfo (7ms) - ResolveRequiredComponents (19ms) - FinalizeReload (1965ms) - ReleaseScriptCaches (0ms) - RebuildScriptCaches (0ms) - SetupLoadedEditorAssemblies (811ms) - LogAssemblyErrors (0ms) - InitializePlatformSupportModulesInManaged (10ms) - SetLoadedEditorAssemblies (10ms) - RefreshPlugins (0ms) - BeforeProcessingInitializeOnLoad (185ms) - ProcessInitializeOnLoadAttributes (534ms) - ProcessInitializeOnLoadMethodAttributes (55ms) - AfterProcessingInitializeOnLoad (15ms) - EditorAssembliesLoaded (1ms) - ExecutionOrderSort2 (0ms) - AwakeInstancesAfterBackupRestoration (19ms) -Refreshing native plugins compatible for Editor in 38.32 ms, found 3 plugins. -Preloading 0 native plugins for Editor in 0.00 ms. -Unloading 5010 Unused Serialized files (Serialized files now loaded: 0) -Unloading 90 unused Assets / (133.6 KB). Loaded Objects now: 5899. -Memory consumption went from 169.6 MB to 169.5 MB. -Total: 42.573600 ms (FindLiveObjects: 3.701100 ms CreateObjectMapping: 1.286400 ms MarkObjects: 35.178500 ms DeleteObjects: 2.404700 ms) +Unloading 5185 Unused Serialized files (Serialized files now loaded: 0) +Unloading 97 unused Assets / (313.1 KB). Loaded Objects now: 5661. +Memory consumption went from 174.9 MB to 174.6 MB. +Total: 3.400300 ms (FindLiveObjects: 0.387300 ms CreateObjectMapping: 0.340000 ms MarkObjects: 2.393600 ms DeleteObjects: 0.278100 ms) Prepare: number of updated asset objects reloaded= 0 AssetImportParameters requested are different than current active one (requested -> active): diff --git a/JNFrame2/Logs/shadercompiler-AssetImportWorker0.log b/JNFrame2/Logs/shadercompiler-AssetImportWorker0.log index e6016388..36198ded 100644 --- a/JNFrame2/Logs/shadercompiler-AssetImportWorker0.log +++ b/JNFrame2/Logs/shadercompiler-AssetImportWorker0.log @@ -1,3 +1,4 @@ Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' Cmd: initializeCompiler + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe0.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe0.log index e6016388..43d23933 100644 --- a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe0.log +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe0.log @@ -1,3 +1,24 @@ Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' Cmd: initializeCompiler + +Cmd: preprocess + insize=4821 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Text.shader surfaceOnly=0 buildPlatform=19 validAPIs=295472 pKW=SHADER_API_DESKTOP dKW=UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL ok=1 outsize=1396 + + +Cmd: preprocess + insize=6165 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-Image.shader surfaceOnly=0 buildPlatform=19 validAPIs=295472 pKW=SHADER_API_DESKTOP dKW=UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL ok=1 outsize=1430 + + +Cmd: preprocess + insize=1678 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI-BlurFilter.shader surfaceOnly=0 buildPlatform=19 validAPIs=295472 pKW=SHADER_API_DESKTOP dKW=UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL ok=1 outsize=336 + + +Cmd: preprocess + insize=4997 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI-BMFont.shader surfaceOnly=0 buildPlatform=19 validAPIs=295472 pKW=SHADER_API_DESKTOP dKW=UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL ok=1 outsize=1442 + + +Cmd: preprocess + insize=11688 file=Assets/Plugins/FairyGUI/Runtime/Extensions/TextMeshPro/Shaders/FairyGUI-TMP.shader surfaceOnly=0 buildPlatform=19 validAPIs=295472 pKW=SHADER_API_DESKTOP dKW=UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL error: 2 plat 26 at (128): Couldn't open include file 'Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc'. + ok=0 outsize=4010 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe1.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe1.log new file mode 100644 index 00000000..1efbe074 --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe1.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=5090 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/Image pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_COMBINED NOT_GRAYED NOT_CLIPPED dKW=COMBINED GRAYED COLOR_FILTER CLIPPED SOFT_CLIPPED ALPHA_MASK UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=918 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe2.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe2.log new file mode 100644 index 00000000..fd069c4e --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe2.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=5090 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/Image pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_COMBINED NOT_GRAYED NOT_CLIPPED dKW=COMBINED GRAYED COLOR_FILTER CLIPPED SOFT_CLIPPED ALPHA_MASK UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=434 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe3.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe3.log new file mode 100644 index 00000000..a9cc8004 --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe3.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1782 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI/BlurFilter pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=33 mask=6 start=13 ok=1 outsize=702 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe4.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe4.log new file mode 100644 index 00000000..5126d7e9 --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe4.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1782 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/AddOn/FairyGUI/BlurFilter pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=33 mask=6 start=13 ok=1 outsize=1094 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe5.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe5.log new file mode 100644 index 00000000..6b1267a7 --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe5.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=3812 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/Text pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_GRAYED NOT_CLIPPED dKW=GRAYED CLIPPED SOFT_CLIPPED UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=426 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe6.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe6.log new file mode 100644 index 00000000..a1a6111d --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe6.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=3812 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/Text pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_GRAYED NOT_CLIPPED dKW=GRAYED CLIPPED SOFT_CLIPPED UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=918 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe7.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe7.log new file mode 100644 index 00000000..919f1dfc --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe7.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=3940 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/BMFont pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_GRAYED NOT_CLIPPED dKW=GRAYED CLIPPED SOFT_CLIPPED UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=550 + diff --git a/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe8.log b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe8.log new file mode 100644 index 00000000..db789f69 --- /dev/null +++ b/JNFrame2/Logs/shadercompiler-UnityShaderCompiler.exe8.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2022.3.1f1/Editor/Data', plugins path 'D:/Unity/2022.3.1f1/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=3940 file=Assets/Plugins/FairyGUI/Runtime/Resources/Shaders/FairyGUI/BMFont pass= ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=NOT_GRAYED NOT_CLIPPED dKW=GRAYED CLIPPED SOFT_CLIPPED UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=33 mask=6 start=51 ok=1 outsize=918 + diff --git a/JNFrame2/Modules/FairyGUI/.gitignore b/JNFrame2/Modules/FairyGUI/.gitignore new file mode 100644 index 00000000..ec9c400c --- /dev/null +++ b/JNFrame2/Modules/FairyGUI/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +.objs/ diff --git a/JNFrame2/Modules/FairyGUI/FairyGUI.fairy b/JNFrame2/Modules/FairyGUI/FairyGUI.fairy new file mode 100644 index 00000000..eecfd22c --- /dev/null +++ b/JNFrame2/Modules/FairyGUI/FairyGUI.fairy @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/JNFrame2/Modules/FairyGUI/assets/Package1/Component1.xml b/JNFrame2/Modules/FairyGUI/assets/Package1/Component1.xml new file mode 100644 index 00000000..0fa08c69 --- /dev/null +++ b/JNFrame2/Modules/FairyGUI/assets/Package1/Component1.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/JNFrame2/Modules/FairyGUI/assets/Package1/ProgressBar1.xml b/JNFrame2/Modules/FairyGUI/assets/Package1/ProgressBar1.xml new file mode 100644 index 00000000..d347c612 --- /dev/null +++ b/JNFrame2/Modules/FairyGUI/assets/Package1/ProgressBar1.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame2/Modules/FairyGUI/assets/Package1/package.xml b/JNFrame2/Modules/FairyGUI/assets/Package1/package.xml new file mode 100644 index 00000000..6d216921 --- /dev/null +++ b/JNFrame2/Modules/FairyGUI/assets/Package1/package.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/JNFrame2/SHFrame.csproj b/JNFrame2/SHFrame.csproj index bd6c3e63..8e34af95 100644 --- a/JNFrame2/SHFrame.csproj +++ b/JNFrame2/SHFrame.csproj @@ -75,10 +75,12 @@ + + @@ -99,6 +101,7 @@ + @@ -958,6 +961,10 @@ {bf8742e6-eee2-4cf6-3e82-d12e15802154} UniTask + + {65d6cac9-6d7d-4b93-ff92-1a5fc94f680c} + FairyGUI.Runtime + >>;?5JgJ!yho*!(QK{>$X1hlcRlRmes)!HWUl}a9}FPJS?^3=j9ib zlxe|yEm)@Kmq3NE9%6B(Ku;DbjWl4piBjx2a%>bHP7?U~nY`u<0ACLu?u5D(-Htkv zN#Q~0#=q4KdB5c2C5bOazkmAt)_qScc*<^99SEJN=H$ z>)!eIg!lHoGNtpw$=|Pd=<>r({oU`L+&gMf>Bu*iEjemp(Ft1ad6S-NIC)t?yr_1N zcI@k2r!VZe^N|64dtbX_-}dX?%d3d)^=*Ir_(MJ%yma=Ddkz>j=d06(jr^NAg}A%V zOD}v-eNBh2ft0~URX+4^`6d3cg1n;4(9-hrN(1GA61}h}P*zsTh1R@G&_cnFYXaZQ z>4Q#TWcjTmKJsGQp2OMu!Dc3$q7xi(^!=TE5_9|Xq`jHPPiNQ~Zl-ehB&?9_EaE_v zUa3bytsyO%Y^t2mun64zf(8}qM`p=n#dY_;mORbKs~00_oCp4Zj2>_leH4AL(H3p?A* zZ*CuZ=dus_pEPLkS0#HUjrz|Y8g3nQ)6VGALzY}KtL(m^*K`yqs*InG>yhG0V_=JA`%Cg^9Z#>~8V@Utq-PinS z^~t3#__Ri2^$Ue5j8Fs|g|j!!bVQ;l&SShu%Bm>GPT~6OK@ZP&vUI`5xUFPXX>H@6-t>l#8QE_`dDD0o`i8Y7&g<> zrTI-H6&kQ|wx{-P`Mu#g`w`E5FtUap81KLjKgy2m??8p--o&dchSO7|`MD$&WVj1* zl3{|qWyNiaJN>s$Eor@Xadot!e(<5KllJa;^DlQ^JoKrvH_f{J?>&}Y7L1KqQ~c_2 z*G?N4_;%cY=LY^^-)qkfy}S3sA!84}<}bca0(+mjf6qh1pWSxYbH%IfY29(=@Rv_X z`cBX3>^NlI^OwEZyymcNKY#S1(kDhNe&M*I`US@|+|X~z=)=l-7e6$+@1KqCHoyEY zZ>@dng5c}XU;$cmUjZ!7}KOvra& z2-z`nAB)83kPt%s4St>Ab9uLi%N!B9Ad4A5HFDX@FCF^+Ro9mEytT*DBk$dEW$x3- zzkhb~&YSOhs&VtyKd1H#-}3mr*dN!tzWtKArNbLTc;~kHN&;EG+V_QdDcHfoXeER#P zTW@~jmgDapd}i$V_pkcP({HRg_0_iwP__L0h`;sw)%vr1(<~`$K*5x1KA41Mj+0AD z%JsZpuqCg#IbYKXG}AsHNke$+_1R_yvaGEz>nbh?wOg43w)~(f77Yc!V>~1fg%xJ` zURp^3YGMHMFd#JaXK+oC@7Era1x&6cP>9INm0nhXHQ`WIfy5FHMqY3G<*&aUTJ@tR zH#}G9`+CRmf9ik#6@R^T+l58z3U9t+ZStS%{=KSnX!M4>*Z+Fv`QtvkGcUUKPe1c* zoOtzZd1r0kw*7&t?`Zz+x4(Pmn`z%~_MQFm-%6G(o$%*vRmI2Oe*1~f4O*1AZLgjR z7Z2)p*V<8k-PJYr&p(~H>#wVquB`Mw`OEoz=RI@xZND;r{Mm+?5B>D4^O{gF!s-D@ zMdBM2=lIJq!&?tF>%}0uP+nA^ftB0}{YDIxW>C7?xwA2u7}um|FR# zB$MreGhc%g`@(C-d}U342e5xna1Oj^f02%SA^SeTi7@70#2McC@7zKEeDJUS+G|%= zCcggg_jhl&Zs9jKpEo*hN9y|7i;GuJTDIwfd(XIPOz4pr-}U&z#Z$+h7;Jrb>SJ{m zue@sLmyL5b)NWdSc*FFLJx{KkSWxuw?%jQFxc%r!znSzzBrs^=1IO0aUbMI1$2ShT z^TE$=dhxO4d8IcU|E=yzExlnv@marUDLo_g8zbJ^^XbSwy}r5OU0(w$vJD^cDX|{V zwSw}z(!8RU<}$F*42J}EN}Lf(j#FY-sWQ5~EfkI=V(o36{DfKbu5NzqtbyZ7AMg3djz!hiZ~v-%`_W5Ixp=~Z-yD11#+Q?4G^fs;lGyO4 zV@~@08LurJ_0s3hhm)^IYUXxrS~%_dx&Qt0%uAoGX?*jhw;t$s`|d4YPkw4}U31&_ z8z24t@GX7zKGN%v!!9i-EPt@D@~pkR@BDJx(o<&N_5QkhJN~(B*vDrLUfA=eT?T+^ zKM5>;;^WR+eNznPZPXO`jWlKEc|mcWUS3jITGm{mmzI{7+j$hi|0~*3U==Ypv9p{> z;n*U2PeDzE77jSfd7W0x?JWi7p7OMrFWt~sJ%=!auGLBQ{|6}w-s0_$>pg8 z3`h1hi(Eq`4wGM6GGer{maW;pPSe{UDg;x@LVrO)X?byGAUVx^GFG|D@i^5N6k&hU zZt;I-`NAD9DnuXmHnt!&EiD$-Nme zN6xS>D--4}jT2m32u@jK~Mq{Ptp3p=>Zpo$M+a zsm-#2w1L{#{AWHhfKaC=VyQR)w8KyhGcI6RhzfNxngRQ_Jutx>?sQXqqP4I1ELDQ<5;M

7#TuDR+ZCG)hx1Cv;m$J+KuDRRb`+pTQ5I(3S%TeyBtaQY`gLtD?=+IR^Hs^Ugq8 zKF*mOr%aH#;n#GPNB1{nLL~=@j2lwDGe?9SW;#>ZMuD+qRzcH&Bx2dsrSa{?6o^<{ z`rjk);?h90f`h399ZEJSS$1s+znjqSlr+X{wH}!7Ca|6{qr--xWU2{{SAy9=gA}=z zoEK|8Zg^X}=hmA2E_|H@(gZb}*T`xl@dF5fBodGIGr7Ya@g<@&khDl0!8`7 zT0u*3nI6OHkCT~H;yb5ZVdMmST zf_b&nJe49gS(K>ijQJ+kA5MK(N zW)q1TwNkKJQCw0C4wxzmmgE&dC9s|lo=}B50k6Y4W-U`j88MjY`lIk$u&FoCUjmQe zC@gL=o{bKq63JMk$$0EC56ak7&L_Ff}CX-VDmq}r~OxJr|pZJxbEV=zkIR&>W9Z2cg7vRC|Yyg zCyTmn88Pa}qyF>J-OFZOo7WUsKIo7KE~wvheb<0P``r4*=U-?qUH9xU9gEL+r}tZ* zE{r|vzv_wsJ2rguNxZAqyKk)i>!0?WKkeSRCtk7S`hU!Of7s~KQ=YkD(FHA!|Ma2V zx1>trcfEh_q{pXhnSH;3s?*E1^w#=R?)KF&VvwkUJGcaB47DI&sKgoZvtZ<~2kUMe1*ri*$6tRN7u_Gn%yVKg<%1+d$AjF(U0D zu~%?e613QSH?b6%Fyo~TPWa^apgEDSAuQ8@`dX5K$Aab&zQMtXKYsr~{AG4r(`}X& zsXpTkj839CtG+rEy@aR#{~Fh@-)qQ^r4yCj_$ zPmnnf%@1o1#D$=jLgqlt6q%!0?%0C3_0Ix}L@^?nOPFP-1vHjc&^!y&j3_KOhMBrx zfRbUpb8sCKc!7g*4+K5}=K@N0t~FpUC$9Bm1~=TBEgAzZXv-$FlR*!^QnMgM&XwY{ z3%=e{Fu~r%QYHxxV>u}E3Z2NYk?`mvV?>iPN2{7)9E%Dr6oV&!^G4ty7W`>SL8y?2 z9!VUBXJbFb?cM=)>>F!k0Wa z@ybN1EE^v6_w}qCBt%5BEdq{SatfdlBxrd37o`B;b3tGzN&#RFGe^!S1pu2Ii24P3 zXq#L|Y6u7asn?VA<`*^xaDwHB_$>rY)UGCE_WLcoC!K6furOtF*u3t;npL^ zMuPB3sDY0oTY_CZkV(7)F{yyl4$Czuyb%E0j}uLTE9CUB5edfj0ZOIIi?KXL4*bvS0*`hIGP$EEqB5 z$a2}%l7rZZ!Ih&6a^k6Rd7iVXX=s7{l5)}+vU)y(7O1*FH@NVy)Q@;>lwP8lF*FtW zo(7NX9*@97aAI)U1zE^|mV;~4P7NV~4G(aHlvqWA$U)yh$)3mZnV{|%+~Ammbw?bB zGcb+H@G}q|C^^c9N?7vXfS{7bk1${ku1tDEnjki8;LThhO)AH$Xlh_HA=Lt^jfg?& z&G_EPq`PAP`9KYp_1n>FBidzh>K}g zgOv(!ti8FbD*@&e(LgE=%G9{-2IYhJEijVM(cyg8vsf*X_`G@44QZAe;tNIN3?3gY z$0xzlSY-y$93ePk*`RbXK}3;)j^woo+Aq)o;yQSYMa+x0+53x}4FH*(oanJ03*1JOhf zXr0|R7!u5R6luKCkdR6d)RL;8MkRE|N29T%aj6p#wA*NNNazx+FyQ*a@ELsg(buJ_ z0p}`J7i26$Xn$}`1ku6?ld&cgPs1)>Y>R`ynvkqjUzBgc{)(~?ClEtrG_=SVUl>== zmf%C@pk%N1GKmG6Cy)9uRNg}i!{A6(Fb}VnQWDHlFq+r_ri>G`gdQ9Z&p_e@W~cE1 z$h5>TbDu;~_f9E^`7?^w1;OtrUxsdxrg7(IEWqGU+N?6sEkJZ%ph0Whj0WsR2K=Ch zb5EZx?bcD$X3wJz53RvFs-47~#N=v6w?M9;vt0*yGjQ22IQWg{`A*?`KB}D{@P5>- zz@s?yDE3+el&=VWigNn^Yl#>**?<$eq1?Vjf(KJ~Z>Bi6Px9-%K@$~#SyGTt0at*^ ziqaINT#X`0;B_PXf_ap3CCCiOAh^H?2Z#IAa**PbE5VRQ-A<$Bb_hvG=t$gV0S}5& z5a3sawAN@0-e_#B3MJ#9N{O4AKpTa*4X_8oFoKu@A9~hE9vY<}n&-0SQDC7B%v_mB zhzXvxC$f`AR(UFuiXcU()SFYSydmuv)R7208pIe{?lVQ%WvNU;f-gfCgt({XhD}at zW*{YPItWkVQS7!Rfx72epb7$P7psc4#CYf$!4aEjhH-{QMeNF`5s^HcN3jcI81$$k zLzz{w2QiY-*pn7)$u1J*UsW1V4OVrg-_A&znavhL*qiLeVgjwl=g({oo0Y zFrOU{fs~ekwdznJsYm(wt+P1Y%%Qp9V0tBa9jW5c)PYlv!Z9Ll3lf_WQyJYbS!jsG z!rZZyH(4-s9gF%^ z8nqz6WN+7GlO1V%c@$eX+mR-aB3OkK1#F#BEduIb(TRwhC847crf5LebVh&BeY(996d#?bflD&-QjgQ2TL zU63tLO%j_kD4oO`m?_Gtq)?QBWsae_Ak+@mDtKT+8CZS`?8My1M#ULeK5vFJnNK`J z8BhKnA;vOT!-b9ZA6pB!=Zz~Q^D3%O#dk;6WF>VMukPs5}ECTy%6iugSGgQXG znL%_Bf(<5=Ty$uHVdd_F6i=rdnDZ#W&~(Z{DjI6il8cH$VOj`YiqXaz3Wc58V6eHz zCyGO1C+<9oHWUgwiABRrEM^k$Y>FyFX(?uF$v_*qE^K2BRfcjKV4%5sHN};oT-H2_ zGE^DLm5GL!G>@iexdez%1@<^-Nj+E(Zj#ViiJ6v-FSJ~ePAv#7#mgn>e0daEXt^X^ zAVsi>Dx2+1*CVlb=X4ERI30u`K2b(s1M7G@{7j=4gjR?08DSb{9tGD$F3MH}FIo5A zFllYjJ!(Vkd`O`SOc0GAjAY+;!z8m2Hy(u!I(H3;p$IPO!uG~!M2mvaEogS;`ea!!7)>7ct}inE>II28St36xZS#6i5nN8%iCC5!~0~0O?_iqOI+f|0EI0-0Hv z8Cn|#FuaKkpChbz!=%8l2>`zXKakq^pYlDj?+IjPWCXWekckW>9|zYl`{=9;QwSO+ z@{Yl7Q4;{wpzBBLlEnFCHd@eCEF>Mq3^Wz|@W-pD+Q5h8$fJ%1ols1QLgPnTfsmq< zHRQZTi|BPaNL;7rieoC2b`{QQeurzn)wa zi!X%b1M!Gip3NyqL3L;R76!bacXEf9;<__FZytphs)OSTMZ!$t>|asp8p=>h-6m=K zER?!NG=iQ=aq1dz<5BRS)HM==gp0(@xQeD`2G^Xc&}`74sToa)q2pe{uXt)k^W;$g z&9x>kv@kS`$ArkQj|CQjn;3cMLC0ef zWCnN;aGWRnijT)681g7~(D9grBqVeIaD+CF2oymoD({Aj&(@o#=-`^zxPA2v4@RiG z+o1{eM>ux`aRol~<}=0R-44uo6ke#j+d(Q4Y7*B$6xG{WLLf&~5e`w;^Vy>vs<-7f zz%WDJ3&V{{Z!501<+A2ckfC~8u1qws zwA4nUNfC?`#Zxny7l4aIr^kZ)C4Ur85o8!Z?g;_K@f5+3N6~{~aY7OrI`UEhimD;& z^cL$DT7P9I(GGW&fJ0OlbEkEv8q%o^Mip5N3CBA+q*Awz%G9U#ZXmXo}#c=%NHxlIl=vTXK;O|21r6xF_4Ijj)!RT$%}jPw_!A-!Ugci2}h8rG8&2g0p@)akvxU6{;Xegn@ zm5GL!w4PzVXz!mT1ql_2X?;bTw~*>5 zx~3!0=B;#UK>#VECc`IEYMX*w}T4arCQ?zK%;ixgZT11oL@yt8E zLQUdec!f`GAkSjWk}ktO)O;qG%=}ldvvUu>uJ5McJ~P7}MQL)sEkgoV;;zIM-3;8> zp=dC+D1mw>$7hbtpc?uwV8DVYgYm(mG*wG|%?|`vnpuy6wSB)VLIYJ=>4&Psn-z)F zq#}Ae6yUCX;-v$I7Gn=%4q=eOp6aCohAWSP3@6?gacDS6%i}6eyn&!FWZ&R7$v7+m zM2lQ_v57aQwis^iV{>;U-kjLQo0E7n9;GFMlWOBfTAHbeSky3+;kfL|qLUd% zpWX^%(B0)-s`iv66g{N#=TYzlGb)~joj2W}U0%QgpSv5h+Zqr=E)Wj57>d-W`@^_F zn@x`*(cKN&;*od+PEb~Xuc{S&E2y9y#+(TEI8?l%@6^aZAVeLxr^P@bg+SFS`cCY5 z6nS_>-$^bKa`}SS84B!5SCnu@$1wOS!dfW84g65TnIXkvtUJ6EC!86kJPIn5aAu?- zp(OGCIz^KToB4QWdotD<*V@}U{o})}F>u&Q8y{O}G|kl302>0@4>y`-V$-AWL!)UX z@kl&^?Rp3KXv&wSBGGPGiJ4QN(bTaKc6TVILtnmWowLQY~nd9j*# zEMJU?(LgNda8%-H)|ASr3a$ zqfkR-edz*`u##AdrD$^@=HK{62ex&JeF!S8waI~97j(wLqyi#fx%|PxO?g2@YqYHB7 zsXaRLoK;Oi3jj+Nv=(*)w5BAJ+yu%oJZT{@hE-n+S9oZomLU?|2rDdu_dsQjh(tGm z^3agVmxihCa97|2!-fDCRa|#vl4D$1uyR;n?M`<^$l*O?aov?E5sfWr&{97l_IDqi|Yw5jDtu{wXhx6a~cT3OnF?-Va=l; zv*UV>Oo||;=vv$ceR0z7wt|4J#ia-_q})%*ReUWj#ga#%gicweWT7E+(4Uk`@$Pru zvWia1b!sDsEX60~I&tSwkfCKzC$UuFO;H49h*77vrovi0!v*mu0&{3$pbbtK@ubm; z_UU}8;t0%vIgf%3MPLq6kyy+3ODo|GsL4$rJ- z2p!3cz+Xpt{IK z*(AOsX5tl<)Z%X8Z_pA8xr^GUq?RESbWe&)Y8j?HiYK&DkCBFil1x{nXk!$^eTLW_ zZH#hmWgraIMnKnvVkzZa6@U|>eqXIebkhN z(Pu`?z4HFD$tOntb;&EM@72cTJh@MQW7wb zi}THq#@Dx_2&@ToN-=fkSo;(MDjk3tKjEMdPQNYBCL&8a75?#?6Gvt0wWh?*=mx^-lazbm&6e0FS zKj<1W#ga!+gw~iTSx5-U%v31~iVWT(VK)?^pok&GI70iov197apon40qewzQ5hD$a zC22RUDylcOm8box_+%0fkD`ITDf3lDI@X4OAdRI@{y11$rRaG&Ping(qtfy=iLAq&WCm z&{Q32j%)GGruslU)SeulNa&H~a7a%yHAX|p&WXWLG8XqYR$;GG^pj8G#e3d4)aUaZ zNt5^xI3Q5a2mX!*OFdChfH}*>oaG|UaxKnsS2)`Pi&PM3KhwuL{s38 z86SF?DqA&1TSHNuRO7?-K}L;;q?^@>!qNvK~E&X(Ueglt{RiS7OC@S z5(GA>pjt1Kicb6WgnFm*89a#8Y+9aX-q7D4e^$+?nI-LJHM6fzS2If?PtE@if-hN+ literal 0 HcmV?d00001 diff --git a/JNFrame2/obj/Debug/FairyGUI.Runtime.csproj.AssemblyReference.cache b/JNFrame2/obj/Debug/FairyGUI.Runtime.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..840d7db3e37ac2becfff10de9291d0cc07d48d18 GIT binary patch literal 123831 zcmdsg37izg_5TisD5zW_Dkz923bXeGc)%{l!m=!TaOfiT&h+jM%(3*$EG$Ss@j&B& z5DbdOH69rJdBj9xJP1UhQA7oQsCY!(*N-z*Sy+( z$G2a-_v%&E5x#G;va)<-<)a$vqoG85Ltai^oFDWn?q5R{Ifq84*PuICuQ|te8icJZy)LN`FiO;(4f`7f?ty#_>aD2;FoU8!5_fy zz9~(iusSL`JG*>Twmv%BVkg^RCmXVpZL(t!8IK_U4B63tVwP_l!NrK7GgK`eibc=M z@$3JM7+RJLCz6_aUQ|scG$lM@XmzqN912WP+v{TU)#!QAB=|}C$Jev10F27d$OQ4u(1_WW5HxtwKTV9Qg>5x#}PdH5h14v>qMy#J(tks6c%5Hl~QYXm1+`px>5-S zO@Pu$HNO|A)R`G0H4sqa@lazZ4E%$$euq%tNFBqe>bb)3o5}(KLm0p{<(nAp?0p<#4#1Eonq3AhPez7=} zQ;#P!UgN^0K!w+5tnheTO^i!MgJIQK&laTo8Z{bJHC1!g|EUa_=uw;| zPz0NRW`eN7th5{pG(^S|Xjv?pP@{>;m=bh00yTlAjNmkYun9DU0YdrI1e!u9Q1Mk6 zzX37LC1g3C0ud(VRP_vDSjSH$bUc;Kn?U8x%2>IY5^t$dTVq-x6m50}_E1U`#vo3G zUn)%D3?2y8&rHX!KqJ&-YJ~FI>WP}t>Jr49M2bU`b1MEKQHrOZPN;mkGmnRrvO}60 z0EJg)tkcS-$U9xx)YBc6O;HI{cE)Aci7qu2stk(=ITb9d42zyisFtc2qVEMNHRFQS zL?xn@fl$OP8l(zV_5qwq7FMvbKc7%GRj{(t2~>Krf5KvUIdnbHc|<(=mdDw$)9 z;WV7EWRAfCVH_%%V~`3oK*j~T+7?AqgB5U9C8~s7d>vJ=V~*l9g0O-elL^8MRKbo( zEYJ`c&o{NLS}37TRpRrVUju5su@B%>zp(kn{(M67)O=&76R7lzi+Bca02{3?&W9@E zrHtTIyRaf&3Il}RsUltqp+LoFoIBJeG*yYXw%$;=gN>e3>B4dc+v5q9Q@MkU?66XJ zvN4{31q)~ILMxo6?{tOJk9Sl!O(sy`nfr6VnqH%GnNw+hZX3XD&6`gT?-(<|JLOFw(s_(M~ajIQdeV@exp?#{p&!QD*gocdWh`K0I z20EK3fZlgw8@RI}PN&{ohk=~N2nusD4tx*>xtNFV!_g>pK(<3NihbZuWfVIf>5O8h z7ig4>>o<@$W21{}EKk*M7-Kk1A*_DGV1cj#Rli}73N%3G6Ej#4h$yYj{)wKLNor1| zi<_9qhZE|iCuWjJprSKw>2~WIq*}TWA*XtUwREHB5}Ku2y3zLnm6~yqR9`V3z!&s% z^Cn650h~$}mL%DqPbiy8lI(N>m7Z~HV11-fQ=Agl+)WmtBwn@sTiI$h*RalVt5u0gzl*ro<%Fr2pRY2(EOFfA`!PkH>e&R z=b@Yi5!R#Q%n4x@sz=9pgh1nD+(M{x3EIS?U`v{_C!$&iQ-^RGLs$!8DhGrSs20Lh zN`cDHxb|*vm(;?}nx{&^HhNCA3#+}`9#80;s=eFD1S@PF5=)?pg}TT^w!y(sW#TA3zEPr&hG)W=*=9(X$)bD z-b^M4Q&5ZEOk#nC2nu;KEJKWCoqS{*0BId#I6{|-d_`P-0H=AvLf;h^eh5ni4n_`v zMiUcR5i-&zDA~=G8d))iavDl(WX0r!Fi~n`#T+5fIF|~3qhR&QwX^DM7Zg&1IStez z=}n?|Axt!vmw$mq%6NT2=h=eN%$YNtryy#5!D%3;afGceIPpOkhFV{6q8DhCjMt85 zOqk_t1#0aWQ*x?Z*xE6EFrjB^?HCgXRBXnT(-}3+dZj9-h>%mQ!YZfexrA1!$|?F@ zpi(p53ot`%f!n}bs!P;yE;Ko(f`#n`pr1~tnc53LQwdad#ud{Up`glpmL);Usb*mn zQ{vHtj;V?%K_XDW7iAi?%m`_Tq!KnJdDoT1Vfs{JM*r+#oN8|r6{)bfAS^IDJ%mU!X`uXTtcnXWQe{O zsMHLuiO}zofUG)P6QO_4sX_tQL|}I4Ya;Z27O1ccUU7p%*xY0f%C6tj#k?rOJk`lg z%Be;Hueklm1QyL#+)g1-xfxU!4X(=7wopK=4Mmb+g>m4XrDwCc=rW2^-;-!~zYG!R`)|!I07%jm24uu$B?b-5m}iI1M0RcZUN5g!0YZ9S(#76`w&@n8BQJ zr%qig7H(8hwrX0cH@m_d$8aiNKv$R}3xxX3t}sVZfdLrML>%>4K?#hA#6mlza2tJRE8O;YCxzR{1S&jZ z-#$GV3e2xn6)li*e6Xc*%D1PC;8eOW-=4w%p?1o*rw|HMe8#@LHlRk;IyKS?f*Y3@ zlJf10F`UX5=Gz%85bCFVJA+i90W$XOI(rA<+imomiWlbFZI36EPWg5lnLveSuv%kG zJFqI{z8l2yIOb}N`#??;2w1Ig=Yz0?xmx2+e>fTi8i&0bB#lw*1Ai)`*!f6j6g#~@ zqh#!w>MO=2Lt$`X3uoAAqvte%FxO;zJfV5YHQC4nDm;V!dE-sBx0yo`>~W{L$(TKW zQ{@8s=h@FEbZ+*~v*`pXJ%e^WJ8!iL2!m4B;4IH$w)44;<1~SQc0N}&2uqmle6HjI z4U$1OvB@I5V%VXZ*s_J$P3$y;(+mQ-iJdqgEMRsMJ5dT${`m*DbZ2m+mlxtJXVcGE z>LSTF6+7Y3mgC4L5elqGKmB4%>GKn|9wW!#_cr7@ABdCO9QMESN z3hy3jAlXbI@{eBxuHJ$-OB1>t_iX(L<0fpgb<5Cz+h9%$EakO;O}gxqXPeTQcW0+( zkT9It&y{|RKy$*TyGVPh7MlmQBQ#77#baT3B}c>LstFqSJ+DFUON}>Fhm+uj@_0je zWo5%;H5zS4cbV&d@lOPau?8#tM&q{MsDk3RWY=k>@%^8_1Me^&>^8udzm40$@vqQ? z^rhxxqa9{G8#AAcn9nwt&o-IQ2Fz#ck4HD3yYWI8rq+$lGDdEuSD-)WOJ|MB5ZJ$_ zwKr6Q7YyDupafdfhCnRhPr`Y?-xi94R)Tmy3$?<#y)Ml4m-_Lo^E31>!I^BvmwuSn zHI%EZ@S4GB037z%Fk6X)%VUWu)qFYq_8}GlHf>hHV`JaW(oJjZ>2ew5>jq7U4Qu=% z)x3}Sh_}(zzNR{|Np)nWQ3tZUT{ftWY*HQBmbAv(>>?Qf7GtNF3#|p10>2KK5kt$8 zVc4pAUQ|scG$lM@XmzqN912WP+v{TU)#!QAWH@YUt7lsQfLVS{er{=&59aq+L7Z=I zxf%zDdx8QMSgQl?Gx;}vT?;sxDhQB+&3os&XQDTEpaU)EOG~Eom}kzHmU=QU5+MQ2 zv$^(M?2C{($vS|(Qj)xlPfTEn9mDO!|R@N`TACKq)egS{4sU4e}1>BGi{MTd0ftgz$ z+Wpnt{wp{3e(3vSKHdBMynQ!a^KI9*@QTV?SD*6e=ud9jz3ZJV@7}hvsQ;;5R`t@x z{CD}ItH%-^xk_`?;W zkk9C0e#hw}s(2kgLY5Jg=o7p7q-=s4(;J*`{*$G;jNkqUue#97U!^WgfLJ!xl<-fE z$D;n+eCWklueqHPzt4-m>7xvJ8@|uIZ8W}P43pwt^*I&Vcp3Pm+j0nZ@PG1PwTs?c z+v7~;S#PMFlJ`~oxANXumxX&(ENxts_xnEEUpYHkds+91r+@Qf$MI$3zdrZ;;Lzc3 z+<)}5({H}EKJWU;?_Aey)!M`$fCJ42{!9PT<>x5Df+n@7F;6K{R5b_;0Bu0Mbg*|6 zPlW=eZx{}ellL=Y@#H;#o)Jw-&exJ`7sdPvn7Rpm%~!RO$tIzHUiCXgOxLEJw$p^z z39xB00lGWl{y;3K24dj0FA#`>NITDbosC;Da6;5z`}8${4ftYygwe z*WEx4oV4&KHDx0ohJodYNrCEt?1By0$xNY~cx!qpr zebs{c`&Zw%aro!o_kHE52S;x>_J6Hkf$ zd%;Vq?@`8NJ#j#NeelcgZ~OTF0y!^q3>mwk{?0*Pp8nGCfzR#k|KYu3^GBWBefOrF z=ay{Kz4uE?`v16n-C{Run$O0XA>=XzTH|FLyH3fos!C(+kv4gJ_m5vt%5XtxW3+ z(zthULP1z*90>|yi`p;D15Q1s0gOP!E>Qi0EtR!pQ;q7S-~0#v*k~fG<>TBA`-C1> zUT79ajHM`t0luyPRLIf8Oobi5t>ShIX`Fnjl-Xbes*G4tnspBsDLVkO>Dp!3S>)X4%v*$M}2khR{)aAol)}1|cP42=c z*KTQhd+}M%>=^pb=9}Bz|Lqx1d^jv`+2{9O@{eEsY1PN0M=Wg_dcW=-_WLGWx8uPZ zkM|i>RtG~^P|Wwki77ArwA7TFlUq8K-_ zBR=ZCWaiJi_8C0u>oW!qf6quE?&|Tvb01c&Z1dHTGFYg}g&r=q$X}9|Q;;57N^VYZ zpfpgV<`)D?N{X4#nv)J%DEM(L;2Sl4@KWeiezS;=yx7joxO(5;sDx8=oHLGku-PY( z+ou-ojXHiR!{&4|nZYMvg-o-ELs5FU8VNOrlxU)%d|KT?aPteARLsBHmQ0pkci$_C zGxWOpF%(57s2j7IZ9W;z3=|{8>|RcNk*T7=r0XxtDb6d-@@1T^rOtF*^SP}6z;dNV zgDsv%Y$G^JGQ!ffR5`h3bQ{;)&UV|IyGGx!^uyjm`YrmpXy1ep|NV2_t^ID^6MbsH z;*~Q>?j5+YE&qviFFpO$uD|@aWbZ}uHvOt?PS5AJ=RbGD|1^KHXME1yVW;}~+&N(K zZzum^a7E88_1jOLwyop9Qx(4XRsXzd%_9R|d~D6qyZdTiUC{jMuim|<+Y{Ga+U0^H z&iUlzUjFiuKU8ix`2~GS|KnXN|GN6r;^%xyy}tT|!W5fO1RS}mH;tuAZb?a?q%oYW z@=jE!WLg(X23l%kf%$3z#^GSvOf8q@Hjq?k!pho}+`s)#y6@~oeD8yiHT=MM2Y%R5 zcI03uDwKN@k1`ofEs^GClT?u54#-KG1bh4P+ZMI^*H12LzGqQow5+!Ok0bEY%$~36uiM|{g25(~lSY|@L14GD)nR}Qd`U?pm)LZA*2|ibJdbrFGp#!p*22{hB zzWBnCA6$KHQP*3$EIIa`?N?<#mH7J?Yxk_Z_sRNgJ6=uh8@m0m1F^rXd2QE%nk7T) zZ-|xt{a?FYdB6S2v;T7Kvwd%=DSz~+XRqtB@%|Uy8m(P;aqNqK{C@a|f|;MTtxxP3 zzvcEv!smW6_t720F2DDxZ$JCfk{xSbzh%%}{m+g)`@z+3JoWmj(_el|2UXLrj(M-w zZ#SOfn_@~~0ScB>b3qc8K29zwDphlW!KR$X##}|oQw;lnA`RiKH)dKH$gsD<=&QIW z)M{1^?Cl2?v1lj&zQ$7m(O6-$@1?X9pdmUij{-tNe+JhS*?#R&QNUzs0)>cnxl-FI zuqGV3Dv(&*!N_YZzxmxa11o;^#HP*pzHfF9`fKm|uKe4rJ1;KSkiYi!b%}p%_|K~1 zfzcasUi;hG7moSpj-2Sazy8vRjY&3EpL?-eaw zGVax#6@`P=uRmpTzlHJJ_N&QoVZUB?t{d^Uy&a=p{l)aXe_Op|MY;cp-^}ef=jpp{ z`>hV-FE&ko@E7M?(13ywyB?5KB)&m&j=v;5ywzZ%S_rBOr3HBkSji1wcoUr<@GyP6 zG{d=+WX|z87?}X?^-d&I&1$)Oz5vH1{ZN!(k#UA7)TolbLU$4X2ba(w5PAyJ9*s#Pke%(<6COM?03NTIn7*s zc&)J1+9kHYBXnVHk5%wHfrHbgUv#m`r+OoH_;DxCZ=v5wzm{Y--)Cj3Z+g7D4MhL$* zjT%8ToM)TkW;|%ZkPjEyAe1e+h4{AkUkE3O{+RsHNu)mxVxT{pFD-xKS`=M{YN`R6@vSbzM4 z-%ofv66iPn{u67fFWH~>^PBqJ@xVWBe*V#AImI^*`d;-Vm)tO}@SI;a6`z&-y&muF z`)qiRZr|SUuCLB6vIQUhlvoX@N?vJBaZW)~V+mMjhEsw)B~FVa$CMa$s*G%H358?v zSZhnWzoorV3k3sV?ZTo0r6`zJ)THF&4*y^@9BRbQa^+|HUYz~DUP|e%f8*;07=z1| z=)+DnxB+A`o!Y|9!!+*fx0vpLe5IL9&+T$_QVUeyqGwvF?s%^_@=*}Fyv2Xy|QG)3;%dFoOmr#HM?W${3$=q{_d-@FMFn{ z{>_`;y1&=@&$oXw@yY%*jV(WJdF02VxA)lpaJPq#x-2ih^nv{HbM|+? z2OI8b``6OJpPbWwe%D`g=m4tzG_dILPug$wP12dSP*dR7%arN!g2EiNv?#y0q_IdX zE-o##>L`T&m$aq8Y+`P(XE_tXv4!-Wf~qnl9B{~aomS1QEd|D&@|4V%9;mOLLl{C> z_L>a=VCKM7`=jJ-1*S@}StIwf(2l^cINnL28-r&&w+= zEldw2r_3j9m#Y|$Q+ZJV_BUNV{S5h=uHfHs+yHBCb9BS9Ov~NbD#qKG44YBg81Pq1 z@%jR9p}#c$Ak|L1v+$e}oF{YU@~H`@ZAlje2XF4d>E|&ETJM|Wk zr;=bMIg@$)d8kli{DoqHfO|Rh1+8AL{#z$Zr|%F#3+5;!n;HseVB!Rw+v5UZ|JZnY zG*A%*RgxwJ?%HrjRdXBMhaq!h4gRV;ZtT)H*>wbG63gErWbYhweY#Uho15)E42szS zk(6deKD_eVOI?Msz$i4?l{8ZuZ3QV4wZ8e!_)Z5xjT(<7H2`RbsTx*Xzz#J7G}v1c zHELtKf67cvjpKANk|%0I>Xdm}FI2NM;xJQFk`bQEI6=T&5f+3Fy9B>RZ3=^}z#*_l z1^K9ZS2-p47BQ!3WhM9)BZMVv3BE;>srrco|4{1gRmq89hpqWyRwbL&1gL5oEeuHI zId`_BEmX%)6ngpv9V(oe(I<75&ZOk7vxjDB>fwZL%c(Ccg+kQ;Odn+MLnyTA5P~17 zkb@LU{iE5@X6PIPd({PJAuXTeOpZ$?NZs)FRFy{$wq!yT2Z@RsQoS=rgdL_kQ&~oV zv1LX<)1ee%?W;>;TlEx(SX}zwWANfqU$laQsW=@+7f;?q2Eah2vf+{GPxjOoCCx;7cie+PW^(u9&H zUUAJilmA#Yq-DGM(vW9Pe4*Q!3!fYO=TVo}&7E-MmH+Cvqu0R5V=IO(d97{3@Gn1H zcJx!%?B0|0>9K>d?tC-2qjcSl*Tz2Z#4SUvJng>Hi$5OlwkMgak zeW=%g-S-^${F2kUCdQ1|`}=X9-}6PbcHjCjA9nP*YhAebxGPHf#-7%TJFjmY@auoy z_?AXj2caAmeE6$_!Jl0Hy@c=pGn|hda?(f~n502Q_YhpVuMA2s!m&Pvirk{u~>6h_3L+wHYS@u#Vfaj zy{pC_STW(d?{-)8*_C}p?PZh8UcO+{z;~9G?b-JB)SLQ^ zd*|_I*3Uj-Q{t@~HZIkc|93&o|DAAGxW|+GPgt>jK;y0VTs7>!2RRbrss_%z(No$8IBf-_zDd|dJhH%FGE!*`HALcpm`1LJWIZtUz`AAn zi5f?uFL69>aAE|8I!_cxNEfK{mTmEd<2}Hek!vz|%cgkCMvvD+Su|P0$96OM&{hA3 z#SJq~EO`G~-xNe|=^Tb3Trpu|aj{YuC@jh?%`Z@MN~~1|B9MVukO-BVeFgaCv=n}X z@fD}K$@E8rx(UA0E4#v=mZa*mCkE>BG7w}#w|Piqdu1*exn=0L+F znWItc+=96E&j9uO7*Tg4%rejfnw^%@JoDttD0XgiGj+hoHcjp4@H)}$A_wIj3Vb+@ za1-oY!6~3d2O=XH$8WPqqr(O5u7h^cCqwuv^KWB(!wJ?;`wkR60ugpp+`q+tddPec10Y_j&wIyxJmFI~yML_qBF8NQm%O zTR0rO;1U3=iLu^aR04qCa{@zB2>^4L{#`{S0664O)X(vTwup74x^VE9S~WrMQ?S($@=&0`;b7;BeZy@*#{_Wdws}HS z?@&z2;k3hIO$rZh2UnRy6X3QlHLOR%v3Q8;nj;**six4*qd1M4kYiM5zBsKKOe>%y zvtAG!^siqXEFx`dmhtgf)-J5*5tG!L+P7vW5lRkC5l;9Cto z5HR}xR3$wm7ceBh9gqu8xffJWH>DtE!4)TgfLeV&bCq0YtN$}uIkwG*=2uASSFO`fF zQRMlVB7^2shCB)*lzhr^10f|GT1;M^WG!W$!tf5n5Kf@Aciv=3Fy~REv1UU;DoIdF z$buSG&>b6%#uEDdJ4DcKq0OP7ON_#R>j}eW@L@+^m&pd4t5hA3u{5Fm;gtxYg%exF znov9qyIj644jgMjqE>xTy$Sm(%0i4l47JhFB4d1ETtQoc4_$*2z1nLlEYLi8)Q_R| z9$FY1jzk6X@FpNB!8`?{@ogYw9H+$9;8=KE4J$A^gAG92NDMRgB$B!!NJ`9~R=f@f zeoy%_bm1?JJHO2WHXI7eD&w63ME3<6wAO9YfHg>mAM|kU<89&jpGE~&pH)&6o($gUK5A%CBaWpZ69DQ z9s`@u8KE1h?VBWcGIjT6l56`UzuucPQ3IGM1ql^!TcfBbO;X8KZ;}LFH^Oe1Mh2Sv-+w~LIYh& z%+dtfD9jvyJrITw#1#0@StEJAkA!HR$(l!jg*GrVWg;QQc`O>wP99P1skTxCDMGp0 zm~3WEX(yl;iNK>yjG^V8DT;1OwG|}TGIT(Qdnz|XcbKQhV}q2ibTBF3ZA}1u&oe+5 z1lTTC5p9aG&^3&KF557SGc+q=S4PcoATcVpp85jZw zM1iAine*jI&g44O(pMj3HHkVi=23{vah8aLmcWXGq~&k&9jQ%#bHYIvc7T}yqUCS) z2n;YdKfw>%mq}j!X7lDzjG^Ukwoo+8gslxNl|OmH)23%?AyCrNu~r$1C)6mrzI6`c zHFFrwIhkHX-W(}8A#mW-qi~Gy+k(WVz*0shBnx%1SeQAtvXTXz7~>8*Jj4Il^3YC9 z7AzS$AS<3q7A|Ii4BCW-l(1YuQnwH3vUMj{tKUeVzxg^&to{qs?c*>6!^=HKklgL# zz??@t8S3_Nkcx(yu-rh@woQAf!`uXITgtPc>_qflrBHJMO!Rh5d$A*hFOOmiS36P! zk_4-eq=2nGszg8^EIJX9u_San!W2!40p(sjTOhfrK{Mr1G@)a+%4un6D2Z#&moytr z496N_yQ|)W=m(eRsnMW9ZXrsY4IPGHY`HgCOP&oKnDZ#c&}`@+6^%7vZPua=pS8_~ zv=9uZb)4z6C_)S?cb6sl&{^9YNU`KmFrfxSN){SI;@p)cXX>MPC+flu)u~Y zuk}I%m-gIgB56@!%5YntU;4TE7J&7F0=`_gkB0vVl^mCL6-HK`0Gq@-A zLAjp6q5~GDR6bd_y!C-TbPb7!JPTYAEZ739W5{rf#U(Cee*(7y_(o)P+5`h+SUD(1J z>I`KLz(8~NYLYucnXGvfWvDZhDH9DbVIED=atRQj0_<^65^As(+$5ni6PcEUFSJ~e zO3eu_$;&0Fe0daEXt^X+AW5)_O3U`9s*#x1K2-sC0|#M8&c>36GX!aBhmNW*oxVR8;?Qd3hwV)6JPI!&Y-fr^!%bM&F8ZKZ z)4$@|;B3%Bw{GA&>)`k9LAk7hX6>AMuW*HK1A)pU;UTc(IZsY(q{CzUqE_>MC1zZN zE^o8b>fR?kY&5wsk)11#dL7hFVi!jeoFrAyb?&PbO#x?%64#YlGa9O(Q-pXL(|r{1 zL-==Uua)EqI>nMlQG_b!lq@8K1a1$NbW)Yh`t+o#wJVL}Qmcg_bW#;f$q6FKCsolr zc@#ycQG^yo5{yLM7ii1MjL=#)fbLB!_#9)#8wLf2O#t{E_<_{=|CH|$eNUh*BO|!& zfJ~%m`8d3e*+*w(7(&o65qAuBlbisk3SB>1lOWD7v(SRBVj<};W}vCyhdp0K)F=!9ZY6dFIm8iXX3tRd%BN<^(uLE$<{U(95I2$if;sWFt?Q!mLS>r}ox3Mf>v zP8EoTm9Ui%NquKJ|7v1kOq&ne2egRMp3P`UL49ZJ5jwn}cXEf9|avp8p=>j-6m=IEL6HiG@PDFa_Jgz<5BRS(lru;gp0t( zPEx@&v6^-D4a*6k_HKtE*dO8A5yTbv(3{UBw|6@*=TUf}_HGBMNT>;12a(ioYYKrJ zRarPhUC(FDcBtQ$IRL{9c`pn%s=O_^-1DHENT23$4FA6mNyQO28qiiV|Y0gHc6xL&Euv4yhz>Vshfn zqYy*gkWOOJcoWtQDd}EyLJG!ghwfFksB}m{2)Tz(lJ8Zw`0*%+(7o!GAS7%Au9HYQ zaLeM`KRyy7F3Gl{aCG37jTHMNnA*V)JN}k@;FgUkkD>_GzHQQwPy+P>Q56J9w@BHT z_g7Tvw;DUH@1k3z+{ST&O!6&KZX9|Pap)E)H_;@)PtrvRc1bEj%`J(AD*RQqk?x)> zuQtqFZgLsM2|mdeCAcu?QS6~(NL(b71U*RwEmDw0;8byVK?ifc0V-%Q2Vl72iPV@^ zZ9%@|f)QE01CdZJ4r)L&Hf}30~4Y#w7O!u%_x;gPFKO z_ZT}4!T@uh93|gl?8u%+k%sOuc9e^ToUln!x(72Zdg1e61}z5IVdB9E2|8dLm}cKh zj~xeQZhdI?S9klb+}Qh}?~nO(@Avce-E_^jUE9JdDsNqV%A=z{xo!8ZcecEH+s>l? zr*>J@OB?gwRdd-#xZasTW zsO|pFf_7xO~KTQcCPUq33z+pm+HX`acDRR^I(hRY@k7h(8F84!O1FGt*W(!;QTlv6i+JQG8VkfLTP0(ng~Ty zztdPwxLqOn-XJa!y@$VfoK}#8M@jc&BV#e@`{RnkikHeW_KLm}dmcp|UeR}wi-cS*=XHi0yV4~UoY651{<5$ViZBB|RB*PD;yKnG zUXlyWHl{oZDpYW`Nkc+O;Qe)yk_wA?t-Uo7Yu1$3mUjQxaB~bCw$j4J7Me}djn%=1 zfcDePrs>%9DE!cDnoc|tk6^prVLqF(r74TI>Q=Jl6lgYe9E9B+is{(#oaEWmkv)$h z56z~Ia*>b|SWjLgCy!-|F+LiI1s#q`Ji|<>+(&YPZ@J|1u{)CS7p zEn;~<_o>(#%ZWwVi7gw87MmVLqx)2Bi6;q->vk$b+ z#`hC+aKf3{eU_HJ&c?^AMi#a|j2~=0fHG?A#1UIhB+p z?_XuI=23j1{i{rwNQi-z3{lx`L{{pd@0~D?(kf53hSf#7QEYkcNjTa~A;-SU9bQSf zi)Ntq4flYg$k740^3)!kInJskp#^{?3R?3!0a}w131$K11eUar7{jWki7PxcQp*tW zPJ|Vf!F!;xW<=sOf%4Fh$`yvG&Tv=Y1jD)j6ID!iWsqZBnXqzLVC_tIMabbjWHH^9 zArXx&VbGG)_)g6rR>sVl4N>E}!w^o0Np5_1V9ui<7ixTWkV+ENq{a1w7sf#(qg&XD z>lp($VJ1DUXRzi`kXdm(LncWOlXNX^ow_LDcUwU~*Wyxy7*g)1dIbnW${cOlwoMu+rM926a=|YNdnh@bO#p*fF_R zAKE$#Nfu`w1=S@k$|mt8uo5q+r53*y{yHT-pSh@wT54^iobE|-ORbG5kKze!)U!!L zLP?~nlC&|(#(kRD9c_$q9;G7;^+rI~g<>l@o|3#V%9%fIuuZvo>$XL8>kFQI{G`z* zWPLFDhsS=muQV&sZ9vh654Y`JHn-a=y{}qOfB)(mHxB>&`@XL{_2B3Y$NsS4nY)LD z=iN};v+}jB-yAn-e)Q>Kv#+|ZWa25&e=m4x^*zd%tS1hruMd9t{cRurUm)j&jv-@L z)ZaPi%hO*PKJdBS{Xe{SZ2qW|yYJq#^W2hc`f+S8E$RQ`_L1*S_o0nZ&VrG+V$FHzQZb7P1IT^0lYFU|#SgbLI=td_RKc>4o3l#T^tfl0*mO9)|espv&v%u zaJW>Id6yGfW2OkPFZxN>m?@S#iXybeOvyq*NMxl-Qc$Gx9tpdl2n9tpQj8%=<$)k>m8w}UNILhHns2xG|IB}rZ<#_V_$JGJJL9+rc~j4(GOsYM;L z?H(JU7Ig->4kI+1!2}!qnO<#?+@j84%%gxpE$R%3NN5RMBAx;|5F+iZT5O&gNHk0i z#be=#NqX2W3jXBFkoMoGwW!pK+rXLGAGjQn} zPk&>nR97fZB_)~!KTQA7%T$@FG1?r8s-zkpstwxIh)6nFjp(tdYDC|NQ{(>wVara# literal 0 HcmV?d00001