浏览代码

add ios build support

/siyaoH-1.17-PlatformMessage
xingwei.zhu 4 年前
当前提交
e9b52deb
共有 21 个文件被更改,包括 138 次插入63 次删除
  1. 4
      Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/UIWidgetsEditorWindowSample.asmdef
  2. 52
      Samples/UIWidgetsSamples_2019_4/Assets/Scene/TextTest.unity
  3. 5
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs
  4. 12
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/search_demo.cs
  5. 5
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/backdrop.cs
  6. 14
      com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs
  7. 8
      com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs
  8. 4
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
  9. 6
      com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs
  10. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs
  11. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs
  12. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs
  13. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/ellipsis_search.g.cs
  14. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/event_add.g.cs
  15. 9
      com.unity.uiwidgets/Runtime/services/keyboard.cs
  16. 4
      com.unity.uiwidgets/Runtime/services/text_input.cs
  17. 12
      com.unity.uiwidgets/Runtime/ui2/hooks.cs
  18. 35
      engine/src/lib/ui/painting/color_filter.cc
  19. 3
      com.unity.uiwidgets/Runtime/service.meta
  20. 8
      com.unity.uiwidgets/Runtime/Plugins.meta

4
Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/UIWidgetsEditorWindowSample.asmdef


"UIWidgetsGallery"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,

52
Samples/UIWidgetsSamples_2019_4/Assets/Scene/TextTest.unity


m_GameObject: {fileID: 847097468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7e1083a82b756840b36958a76a3e6f3, type: 3}
m_Script: {fileID: 11500000, guid: 9c5c86936ca864ae684720ddcd50d759, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 945944095}
m_UVRect:
serializedVersion: 2
x: 0

fonts:
- family: CupertinoIcons
fonts:
- asset: CupertinoIcons.ttf
weight: 0
fonts: []
--- !u!222 &847097471
CanvasRenderer:
m_ObjectHideFlags: 0

m_GameObject: {fileID: 847097468}
m_CullTransparentMesh: 0
--- !u!28 &945944095
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &1548023132
GameObject:
m_ObjectHideFlags: 0

5
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs


{
new IconButton(
onPressed: this._toggleBackdropPanelVisibility,
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: this._controller.view
icon: new Icon(
icon: Icons.close
)
)
}

12
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/search_demo.cs


appBar: new AppBar(
leading: new IconButton(
tooltip: "Navigation menu",
icon: new AnimatedIcon(
icon: AnimatedIcons.arrow_menu,
color: Colors.white,
progress: this._delegate.transitionAnimation
icon: new Icon(
icon: Icons.menu,
color: Colors.white
),
onPressed: () => { this._scaffoldKey.currentState.openDrawer(); }
),

public override Widget buildLeading(BuildContext context) {
return new IconButton(
tooltip: "Back",
icon: new AnimatedIcon(
icon: AnimatedIcons.arrow_menu,
progress: this.transitionAnimation
icon: new Icon(
icon: Icons.menu
),
onPressed: () => { this.close(context, null); }
);

5
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/backdrop.cs


trailing: new IconButton(
onPressed: this._toggleFrontLayer,
tooltip: "Toggle options page",
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: this._controller
icon: new Icon(
icon: Icons.close
)
)
),

14
com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs


#endif
#if UNITY_IOS
this._devicePixelRatio = IOSDeviceScaleFactor();
//this._devicePixelRatio = IOSDeviceScaleFactor();
#endif
if (_devicePixelRatio <= 0) {

padding_bottom = 0
};
#elif UNITY_IOS
viewMetrics metrics = IOSGetViewportPadding();
this._viewMetrics = metrics;
//viewMetrics metrics = IOSGetViewportPadding();
//this._viewMetrics = metrics;
#else
_viewMetrics = new viewMetrics {
insets_bottom = 0,

#endif
#if UNITY_IOS
[DllImport("__Internal")]
static extern float IOSDeviceScaleFactor();
//[DllImport("__Internal")]
//static extern float IOSDeviceScaleFactor();
[DllImport("__Internal")]
static extern viewMetrics IOSGetViewportPadding();
//[DllImport("__Internal")]
//static extern viewMetrics IOSGetViewportPadding();
#endif
}
}

8
com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs


void UpdateNameIfNeed() {
#if UNITY_IOS || UNITY_ANDROID || UNITY_WEBGL
var name = gameObject.name;
/*var name = gameObject.name;
if (name != _lastObjectName) {
if (!Application.isEditor) {

}
}*/
#endif
}

}
#if UNITY_IOS || UNITY_WEBGL
[DllImport("__Internal")]
static extern void UIWidgetsMessageSetObjectName(string objectName);
//[DllImport("__Internal")]
//static extern void UIWidgetsMessageSetObjectName(string objectName);
#elif UNITY_ANDROID
static void UIWidgetsMessageSetObjectName(string objectName) {

4
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs


protected void OnEnable() {
base.OnEnable();
#if UNITY_IOS
//the hook API cannot be automatically called on IOS, so we need try hook it here
Hooks.tryHook();
#endif
D.assert(_wrapper == null);
_configurations = new Configurations();
_wrapper = new UIWidgetsPanelWrapper();

6
com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs


namespace Unity.UIWidgets.material {
public abstract class AnimatedIcons {
public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event;
//public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event;
public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu;
//public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu;
public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu;
//public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu;
// public readonly AnimatedIconData ellipsis_search = AnimatedIconsData._ellipsis_search;

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/ellipsis_search.g.cs


using Unity.UIWidgets.ui;
/*using Unity.UIWidgets.ui;
using System.Collections.Generic;
namespace Unity.UIWidgets.material

}
);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/event_add.g.cs


using Unity.UIWidgets.ui;
/*using Unity.UIWidgets.ui;
using System.Collections.Generic;
namespace Unity.UIWidgets.material {

}
);
}
}
}*/

9
com.unity.uiwidgets/Runtime/services/keyboard.cs


#endif
#if UNITY_IOS || UNITY_ANDROID
class UIWidgetsTouchScreenKeyboardDelegate : AbstractUIWidgetsKeyboardDelegate {
/*class UIWidgetsTouchScreenKeyboardDelegate : AbstractUIWidgetsKeyboardDelegate {
public override void show() {
UIWidgetsTextInputShow();

public override void clearClient() {
UIWidgetsTextInputClearTextInputClient();
}
}*/
/*
[DllImport ("__Internal")]
internal static extern void UIWidgetsTextInputShow();

internal static extern void UIWidgetsTextInputSetTextInputEditingState(string jsonText);
[DllImport ("__Internal")]
internal static extern void UIWidgetsTextInputClearTextInputClient();
internal static extern void UIWidgetsTextInputClearTextInputClient();*/
#elif UNITY_ANDROID
internal static void UIWidgetsTextInputShow() {
using (

}
}
#endif
}
//}
#endif
}

4
com.unity.uiwidgets/Runtime/services/text_input.cs


}
else {
#if UNITY_IOS || UNITY_ANDROID
if (configuration.unityTouchKeyboard) {
/*if (configuration.unityTouchKeyboard) {
}
}*/
#elif UNITY_WEBGL
keyboardDelegate = new UIWidgetsWebGLKeyboardDelegate();
#else

12
com.unity.uiwidgets/Runtime/ui2/hooks.cs


namespace Unity.UIWidgets.ui {
public static class Hooks {
static bool hooked = false;
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
#else

D.assert(!hooked);
hooked = true;
Mono_hook(
Mono_throwException,
Mono_shutdown);

Window_drawFrame,
ui_._dispatchPlatformMessage,
ui_._dispatchPointerDataPacket);
}
public static void tryHook() {
if (hooked) {
return;
}
hook();
}
delegate void Mono_ThrowExceptionCallback(IntPtr exception);

35
engine/src/lib/ui/painting/color_filter.cc


#include "color_filter.h"
#include "runtime/mono_api.h"
namespace uiwidgets {

ColorFilter::~ColorFilter() = default;
} // namespace uiwidgets
UIWIDGETS_API(ColorFilter*)
ColorFilter_constructor() {
const auto colorFilter = ColorFilter::Create();
colorFilter->AddRef();
return colorFilter.get();
}
UIWIDGETS_API(void)
ColorFilter_dispose(ColorFilter* ptr) {
ptr->Release();
}
UIWIDGETS_API(void)
ColorFilter_initMode(ColorFilter* ptr, int color, int blend_mode) {
ptr->initMode(color, blend_mode);
}
UIWIDGETS_API(void)
ColorFilter_initMatrix(ColorFilter* ptr, const float* color_matrix) {
ptr->initMatrix(color_matrix);
}
UIWIDGETS_API(void)
ColorFilter_initLinearToSrgbGamma(ColorFilter* ptr) {
ptr->initLinearToSrgbGamma();
}
UIWIDGETS_API(void)
ColorFilter_initSrgbToLinearGamma(ColorFilter* ptr) {
ptr->initSrgbToLinearGamma();
}
} // namespace uiwidgets

3
com.unity.uiwidgets/Runtime/service.meta


fileFormatVersion: 2
guid: 355cc83db152457b8eb6da935c588fbc
timeCreated: 1536566821

8
com.unity.uiwidgets/Runtime/Plugins.meta


fileFormatVersion: 2
guid: 748885407ae664e1093421099f1ad4b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存