浏览代码

Merge remote-tracking branch 'upstream/master' into dpi

/main
fzhangtj 6 年前
当前提交
c3f505cd
共有 11 个文件被更改,包括 56 次插入29 次删除
  1. 12
      README.md
  2. 2
      Runtime/async/coroutine.cs
  3. 2
      Runtime/async/microtask_queue.cs
  4. 4
      Runtime/async/timer.cs
  5. 4
      Runtime/engine/DisplayMetrics.cs
  6. 17
      Runtime/foundation/assertions.cs
  7. 31
      Runtime/foundation/debug.cs
  8. 2
      Runtime/gestures/binding.cs
  9. 2
      Runtime/gestures/pointer_router.cs
  10. 1
      Runtime/rendering/box.mixin.gen.cs
  11. 8
      Runtime/rendering/proxy_box.mixin.njk

12
README.md


3. **Refine Code Style Rules**: Edit the ".editorconfig" file under \<YourProjectPath\>/Packages/com.unity.uiwidgets/". Visit
https://www.jetbrains.com/help/rider/EditorConfig_Index.html for the detailed.
#### Generate njk Code
1. **Go to scripts Folder and Run npm install**:
```
cd <YourProjectPath>/Packages/com.unity.uiwidgets/scripts
npm install
```
2. **Run the codegen Command**:
```
node uiwidgets-cli.js codegen . generate mixin code
```

2
Runtime/async/coroutine.cs


callbackNode.callback();
}
catch (Exception ex) {
Debug.LogError("Failed to execute callback in BackgroundCallbacks: " + ex);
D.logError("Failed to execute callback in BackgroundCallbacks: ", ex);
}
if (!callbackNode.isDone) {

2
Runtime/async/microtask_queue.cs


action();
}
catch (Exception ex) {
Debug.LogError("Error to execute microtask: " + ex);
D.logError("Error to execute microtask: ", ex);
}
}
}

4
Runtime/async/timer.cs


callback();
}
catch (Exception ex) {
Debug.LogError("Error to execute runInMain callback: " + ex);
D.logError("Error to execute runInMain callback: ", ex);
}
}
}

this._callback();
}
catch (Exception ex) {
Debug.LogError("Error to execute timer callback: " + ex);
D.logError("Error to execute timer callback: ", ex);
}
if (this.periodic) {

4
Runtime/engine/DisplayMetrics.cs


using System;
#if UNITY_ANDROID
using System.Runtime.InteropServices;
#endif
namespace Unity.UIWidgets.engine {
public static class DisplayMetricsProvider {

17
Runtime/foundation/assertions.cs


}
}
public class UIWidgetsError : AssertionError {
public class UIWidgetsError : Exception {
static int _errorCount = 0;
public static void resetErrorCount() {
_errorCount = 0;
}
public static void dumpErrorToConsole(UIWidgetsErrorDetails details) {
dumpErrorToConsole(details, forceReport: false);

return;
}
if (_errorCount == 0 || forceReport) {
Debug.LogError(details.ToString());
}
else {
Debug.LogWarning("Another exception was thrown: " + details);
}
_errorCount += 1;
D.logError(details.ToString(), details.exception);
}
public static IEnumerable<string> defaultStackFilter(IEnumerable<string> frames) {

31
Runtime/foundation/debug.cs


using System.Diagnostics;
using System.Linq;
using Unity.UIWidgets.ui;
using Debug = UnityEngine.Debug;
public static void logError(string message, Exception ex = null) {
Debug.LogException(new ReportError(message, ex));
}
assert(result(), message);
if (!result()) {
throw new AssertionError(message);
}
}
[Conditional("UIWidgets_DEBUG")]

public override string StackTrace {
get {
var stackTrace = base.StackTrace;
var lines = stackTrace.Split('\n');
var strippedLines = lines.Skip(1);
return string.Join("\n", strippedLines);
}
}
}
public class ReportError : Exception {
Exception ex;
public ReportError(string message, Exception ex = null) : base(message) {
this.ex = ex;
}
public override string StackTrace {
get {
if (this.ex != null) {
return this.ex.StackTrace;
}
var stackTrace = base.StackTrace;
var lines = stackTrace.Split('\n');
var strippedLines = lines.Skip(1);

2
Runtime/gestures/binding.cs


entry.target.handleEvent(evt, entry);
}
catch (Exception ex) {
Debug.LogError("Error while dispatching a pointer event: " + ex);
D.logError("Error while dispatching a pointer event: ", ex);
}
}
}

2
Runtime/gestures/pointer_router.cs


route(evt);
}
catch (Exception ex) {
Debug.LogError("Error while routing a pointer event: " + ex);
D.logError("Error while routing a pointer event: ", ex);
}
}

1
Runtime/rendering/box.mixin.gen.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.ui;

8
Runtime/rendering/proxy_box.mixin.njk


return this.child.getMinIntrinsicWidth(height);
}
return 0.0;
return 0.0f;
}
protected override float computeMaxIntrinsicWidth(float height) {

return 0.0;
return 0.0f;
}
protected override float computeMinIntrinsicHeight(float width) {

return 0.0;
return 0.0f;
}
protected override float computeMaxIntrinsicHeight(float width) {

return 0.0;
return 0.0f;
}
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {

正在加载...
取消
保存