浏览代码

Merge branch 'dev_1.17.5' into siyaoH/1.17/gestures

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
cfe4567d
共有 26 个文件被更改,包括 1738 次插入489 次删除
  1. 10
      com.unity.uiwidgets/Runtime/animation/animation.cs
  2. 61
      com.unity.uiwidgets/Runtime/animation/animation_controller.cs
  3. 466
      com.unity.uiwidgets/Runtime/animation/curves.cs
  4. 171
      com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.gen.cs
  5. 44
      com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.njk
  6. 14
      com.unity.uiwidgets/Runtime/animation/tween.cs
  7. 2
      com.unity.uiwidgets/Runtime/animation/tween_sequence.cs
  8. 7
      com.unity.uiwidgets/Runtime/services/asset_bundle.cs
  9. 2
      com.unity.uiwidgets/Runtime/services/binding.cs
  10. 986
      com.unity.uiwidgets/Runtime/services/keyboard_key.cs
  11. 2
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  12. 92
      com.unity.uiwidgets/Runtime/services/text_editing.cs
  13. 28
      com.unity.uiwidgets/Runtime/services/text_formatter.cs
  14. 326
      com.unity.uiwidgets/Runtime/services/text_input.cs
  15. 8
      com.unity.uiwidgets/Runtime/material.meta
  16. 8
      com.unity.uiwidgets/Runtime/ui33.meta
  17. 0
      /com.unity.uiwidgets/Runtime/services/text_editing.cs
  18. 0
      /com.unity.uiwidgets/Runtime/services/clipboard.cs
  19. 0
      /com.unity.uiwidgets/Runtime/services/keyboard.cs
  20. 0
      /com.unity.uiwidgets/Runtime/services/text_formatter.cs
  21. 0
      /com.unity.uiwidgets/Runtime/services/text_input.cs
  22. 0
      /com.unity.uiwidgets/Runtime/services/platform_channel.cs
  23. 0
      /com.unity.uiwidgets/Runtime/services/system_channels.cs
  24. 0
      /com.unity.uiwidgets/Runtime/services/raw_keyboard.cs
  25. 0
      /com.unity.uiwidgets/Runtime/services/system_chrome.cs

10
com.unity.uiwidgets/Runtime/animation/animation.cs


get { return status == AnimationStatus.completed; }
}
public Animation<U> drive<U>(Animatable<U> child) {
D.assert(this is Animation<float>);
return child.animate(this as Animation<float>);
}
public override string ToString() {
return $"{foundation_.describeIdentity(this)}({toStringDetails()})";
}

D.assert(icon != null);
return icon;
}
public Animation<U> drive<U>(Animatable<U> child) {
D.assert(this is Animation<float>);
return child.animate(this as Animation<float>);
}
}
}

61
com.unity.uiwidgets/Runtime/animation/animation_controller.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.physics;
using Unity.UIWidgets.scheduler2;

AnimationController(
float value = 0.0f,
TimeSpan? duration = null,
TimeSpan? reverseDuration = null,
string debugLabel = null,
TickerProvider vsync = null
) {

_direction = _AnimationDirection.forward;
this.duration = duration;
this.reverseDuration = reverseDuration;
this.debugLabel = debugLabel;
_ticker = vsync.createTicker(_tick);

public static AnimationController unbounded(
float value = 0.0f,
TimeSpan? duration = null,
TimeSpan? reverseDuration = null,
return new AnimationController(value, duration, debugLabel, vsync);
return new AnimationController(value, duration, reverseDuration, debugLabel, vsync);
}
public readonly float lowerBound;

D.assert(() => {
if (duration == null) {
throw new UIWidgetsError(
"AnimationController.forward() called with no default Duration.\n" +
"AnimationController.forward() called with no default duration.\n" +
"The \"duration\" property should be set, either in the constructor or later, before " +
"calling the forward() function."
);

public TickerFuture reverse(float? from = null) {
D.assert(() => {
if (duration == null) {
if (duration == null && reverseDuration == null) {
"AnimationController.reverse() called with no default Duration.\n" +
"The \"duration\" property should be set, either in the constructor or later, before " +
"AnimationController.reverse() called with no default duration or reverseDuration.\n" +
"The \"duration\" or \"reverseDuration\" property should be set, either in the constructor or later, before " +
"calling the reverse() function."
);
}

TimeSpan? simulationDuration = duration;
if (simulationDuration == null) {
D.assert(() => {
if (this.duration == null) {
if ((this.duration == null && _direction == _AnimationDirection.reverse && reverseDuration == null) ||
(this.duration == null && _direction == _AnimationDirection.forward)) {
"AnimationController.animateTo() called with no explicit Duration and no default Duration.\n" +
"AnimationController.animateTo() called with no explicit Duration and no default duration or reverseDuration.\n" +
"\"duration\" property should be set, either in the constructor or later, before " +
"\"duration\" and/or \"reverseDuration\" property should be set, either in the constructor or later, before " +
"calling the animateTo() function."
);
}

float range = upperBound - lowerBound;
float remainingFraction = range.isFinite() ? (target - _value).abs() / range : 1.0f;
simulationDuration = TimeSpan.FromTicks((long) (this.duration.Value.Ticks * remainingFraction));
TimeSpan directionDuration = (_direction == _AnimationDirection.reverse && reverseDuration != null)
? reverseDuration.Value
: this.duration.Value;
simulationDuration = TimeSpan.FromTicks((long) (directionDuration.Ticks * remainingFraction));
}
else if (target == value) {
simulationDuration = TimeSpan.Zero;

D.assert(max >= min);
D.assert(max <= upperBound && min >= lowerBound);
return animateWith(new _RepeatingSimulation(_value, min.Value, max.Value, reverse, period.Value));
stop();
return _startSimulation(new _RepeatingSimulation(_value, min.Value, max.Value, reverse, period.Value, _directionSetter));
}
void _directionSetter(_AnimationDirection direction) {
_direction = direction;
_status = (_direction == _AnimationDirection.forward) ? AnimationStatus.forward : AnimationStatus.reverse;
_checkStatusChanged();
}
public TickerFuture fling(float velocity = 1.0f) {

Simulation simulation = new SpringSimulation(_kFlingSpringDescription, value,
target, velocity);
simulation.tolerance = _kFlingTolerance;
return animateWith(simulation);
stop();
return _startSimulation(simulation);
}

"AnimationController methods should not be used after calling dispose."
);
stop();
_direction = _AnimationDirection.forward;
return _startSimulation(simulation);
}

public override void dispose() {
D.assert(() => {
if (_ticker == null) {
throw new UIWidgetsError(
"AnimationController.dispose() called more than once.\n" +
"A given " + GetType() + " cannot be disposed more than once.\n" +
"The following " + GetType() + " object was disposed multiple times:\n" +
" " + this);
throw new UIWidgetsError(new List<DiagnosticsNode>() {
new ErrorSummary("AnimationController.dispose() called more than once."),
new ErrorDescription($"A given {GetType()} cannot be disposed more than once.\n"),
new DiagnosticsProperty<AnimationController>(
$"The following {GetType()} object was disposed multiple times",
this,
style: DiagnosticsTreeStyle.errorProperty)
});
}
return true;

}
}
delegate void _DirectionSetter(_AnimationDirection direction);
internal _RepeatingSimulation(float initialValue, float min, float max, bool reverse, TimeSpan period) {
internal _RepeatingSimulation(float initialValue, float min, float max, bool reverse, TimeSpan period, _DirectionSetter directionSetter) {
_min = min;
_max = max;
_periodInSeconds = (float) period.Ticks / TimeSpan.TicksPerSecond;

this.directionSetter = directionSetter;
D.assert(_periodInSeconds > 0.0f);
D.assert(_initialT >= 0.0f);
}

readonly float _periodInSeconds;
readonly bool _reverse;
readonly float _initialT;
readonly _DirectionSetter directionSetter;
public override float x(float timeInSeconds) {
D.assert(timeInSeconds >= 0.0f);

if (_reverse && _isPlayingReverse) {
directionSetter(_AnimationDirection.reverse);
directionSetter(_AnimationDirection.forward);
return MathUtils.lerpFloat(_min, _max, t);
}
}

466
com.unity.uiwidgets/Runtime/animation/curves.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Random = System.Random;
public abstract class Curve {
public float transform(float t) {
D.assert(t >= 0.0f && t <= 1.0f);
public abstract class ParametricCurve<T> {
public virtual T transform(float t) {
D.assert(t >= 0.0f && t <= 1.0f, () => $"parametric value {t} is outside of [0, 1] range.");
return transformInternal(t);
}
protected virtual T transformInternal(float t) {
throw new NotImplementedException();
}
public override string ToString() {
return $"{GetType()}";
}
}
public abstract class Curve : ParametricCurve<float> {
public override float transform(float t) {
return transformInternal(t);
}
protected virtual float transformInternal(float t) {
throw new NotImplementedException();
return base.transform(t);
}
public override string ToString() {
return GetType().ToString();
}
}

public override string ToString() {
return $"{GetType()}({a:F2}, {b:F2}, {c:F2}, {d:F2})";
}
}
public abstract class Curve2D : ParametricCurve<Offset> {
internal IEnumerable<Curve2DSample> generateSamples(
float start = 0.0f,
float end = 1.0f,
float tolerance = 1e-10f) {
D.assert(end > start);
Random rand = new Random(samplingSeed);
bool isFlat(Offset p, Offset q, Offset r) {
Offset pr = p - r;
Offset qr = q - r;
float z = pr.dx * qr.dy - qr.dx * pr.dy;
return z * z < tolerance;
}
Curve2DSample first = new Curve2DSample(start, transform(start));
Curve2DSample last = new Curve2DSample(end, transform(end));
List<Curve2DSample> samples = new List<Curve2DSample>(){first};
void sample(Curve2DSample p, Curve2DSample q, bool forceSubdivide = false) {
float t = p.t + (0.45f + 0.1f * (float)rand.NextDouble() * (q.t - p.t));
Curve2DSample r = new Curve2DSample(t, transform(t));
if (!forceSubdivide && isFlat(p.value, q.value, r.value)) {
samples.Add(q);
}
else {
sample(p, r);
sample(r, q);
}
}
sample(first, last,
forceSubdivide: (first.value.dx - last.value.dx).abs() < tolerance &&
(first.value.dy - last.value.dy).abs() < tolerance);
return samples;
}
protected virtual int samplingSeed {
get { return 0; }
}
public float findInverse(float x) {
float start = 0.0f;
float end = 1.0f;
float mid = 0f;
float offsetToOrigin(float pos) {
return x - transform(pos).dx;
}
const float errorLimit = 1e-6f;
int count = 100;
float startValue = offsetToOrigin(start);
while ((end - start / 2.0f) > errorLimit && count > 0) {
mid = (end + start) / 2.0f;
float value = offsetToOrigin(mid);
if (value.sign() == startValue.sign()) {
start = mid;
}
else {
end = mid;
}
count--;
}
return mid;
}
}
internal class Curve2DSample {
public Curve2DSample(float t, Offset value) {
this.t = t;
this.value = value;
}
public readonly float t;
public readonly Offset value;
public override string ToString() {
return $"[{value.dx:F2}, {value.dy:F2}, {t:F2}]";
}
}
class CatmullRomSpline : Curve2D {
CatmullRomSpline(
List<Offset> controlPoints,
float? tension = 0.0f,
Offset startHandle = null,
Offset endHandle = null
) {
D.assert(controlPoints != null);
D.assert(tension != null);
D.assert(tension <= 1.0f, () => $"tension {tension} must not be greater than 1.0.");
D.assert(tension >= 0.0f, () => $"tension {tension} must not be negative.");
D.assert(controlPoints.Count > 3, () => "There must be at least four control points to create a CatmullRomSpline.");
_controlPoints = controlPoints;
_startHandle = startHandle;
_endHandle = endHandle;
_tension = tension;
_cubicSegments = new List<List<Offset>>();
}
internal CatmullRomSpline(
List<Offset> controlPoints,
float? tension = 0.0f,
Offset startHandle = null,
Offset endHandle = null,
List<List<Offset>> cubicSegments = null
) {
D.assert(cubicSegments != null);
_controlPoints = controlPoints;
_startHandle = startHandle;
_endHandle = endHandle;
_tension = tension;
_cubicSegments = new List<List<Offset>>();
}
public static CatmullRomSpline precompute(
List<Offset> controlPoints,
float? tension = 0.0f,
Offset startHandle = null,
Offset endHandle = null
) {
D.assert(controlPoints != null);
D.assert(tension != null);
D.assert(tension <= 1.0f, () => $"tension {tension} must not be greater than 1.0.");
D.assert(tension >= 0.0f, () => $"tension {tension} must not be negative.");
D.assert(controlPoints.Count > 3, () => "There must be at least four control points to create a CatmullRomSpline.");
return new CatmullRomSpline(
controlPoints: null,
tension: null,
startHandle: null,
endHandle: null,
cubicSegments: _computeSegments(controlPoints, tension, startHandle: startHandle, endHandle: endHandle)
);
}
static List<List<Offset>> _computeSegments(
List<Offset> controlPoints,
float? tension,
Offset startHandle,
Offset endHandle) {
startHandle = startHandle ?? controlPoints[0] * 2.0f - controlPoints[1];
endHandle = endHandle ?? controlPoints.last() * 2.0f - controlPoints[controlPoints.Count - 2];
List<Offset> allPoints = new List<Offset>();
allPoints.Add(startHandle);
allPoints.AddRange(controlPoints);
allPoints.Add(endHandle);
const float alpha = 0.5f;
float reverseTension = 1.0f - tension.Value;
List<List<Offset>> result = new List<List<Offset>>();
for (int i = 0; i < allPoints.Count - 3; ++i) {
List<Offset> curve = new List<Offset>{allPoints[i], allPoints[i + 1], allPoints[i + 2], allPoints[i + 3]};
Offset diffCurve10 = curve[1] - curve[0];
Offset diffCurve21 = curve[2] - curve[1];
Offset diffCurve32 = curve[3] - curve[2];
float t01 = Mathf.Pow(diffCurve10.distance, alpha);
float t12 = Mathf.Pow(diffCurve21.distance, alpha);
float t23 = Mathf.Pow(diffCurve32.distance, alpha);
Offset m1 = (diffCurve21 + (diffCurve10 / t01 - (curve[2] - curve[0]) / (t01 + t12)) * t12) * reverseTension;
Offset m2 = (diffCurve21 + (diffCurve32 / t23 - (curve[3] - curve[1]) / (t12 + t23)) * t12) * reverseTension;
Offset sumM12 = m1 + m2;
List<Offset> segment = new List<Offset> {
diffCurve21 * -2.0f + sumM12,
diffCurve21 * 3.0f - m1 - sumM12,
m1,
curve[1]
};
result.Add(segment);
}
return result;
}
readonly List<List<Offset>> _cubicSegments;
readonly List<Offset> _controlPoints;
readonly Offset _startHandle;
readonly Offset _endHandle;
readonly float? _tension;
void _initializeIfNeeded() {
if (_cubicSegments.isNotEmpty()) {
return;
}
_cubicSegments.AddRange(_computeSegments(_controlPoints, _tension, startHandle: _startHandle, endHandle: _endHandle));
}
protected override int samplingSeed {
get {
_initializeIfNeeded();
Offset seedPoint = _cubicSegments[0][1];
return ((seedPoint.dx + seedPoint.dy) * 10000).round();
}
}
protected override Offset transformInternal(float t) {
_initializeIfNeeded();
float length = _cubicSegments.Count;
float position;
float localT;
int index;
if (t < 1.0f) {
position = t * length;
localT = position - position.floor();
index = position.floor();
} else {
position = length;
localT = 1.0f;
index = _cubicSegments.Count - 1;
}
List<Offset> cubicControlPoints = _cubicSegments[index];
float localT2 = localT * localT;
return cubicControlPoints[0] * localT2 * localT
+ cubicControlPoints[1] * localT2
+ cubicControlPoints[2] * localT
+ cubicControlPoints[3];
}
}
public class CatmullRomCurve : Curve {
public CatmullRomCurve(
List<Offset> controlPoints,
float? tension = 0.0f) {
D.assert(tension != null);
this.controlPoints = controlPoints;
this.tension = tension;
D.assert(() => {
_debugAssertReasons.Clear();
return validateControlPoints(controlPoints,
tension: tension,
reasons: _debugAssertReasons);
}, () => $"control points {controlPoints} could not be validated:\n {string.Join("\n ", _debugAssertReasons)}");
_precomputedSamples = new List<Curve2DSample>();
}
internal CatmullRomCurve(
List<Offset> controlPoints,
float? tension = 0.0f,
List<Curve2DSample> precomputedSamples = null) {
D.assert(precomputedSamples != null);
D.assert(tension != null);
this.controlPoints = controlPoints;
this.tension = tension;
D.assert(() => {
_debugAssertReasons.Clear();
return validateControlPoints(controlPoints,
tension: tension,
reasons: _debugAssertReasons);
}, () => $"control points {controlPoints} could not be validated:\n {string.Join("\n ", _debugAssertReasons)}");
_precomputedSamples = precomputedSamples;
}
public static CatmullRomCurve precompute(
List<Offset> controlPoints, float? tension = 0.0f) {
return new CatmullRomCurve(
controlPoints,
tension,
_computeSamples(controlPoints, tension));
}
static List<Curve2DSample> _computeSamples(List<Offset> controlPoints, float? tension) {
List<Offset> _controlPoints = new List<Offset>();
_controlPoints.Add(Offset.zero);
_controlPoints.AddRange(controlPoints);
_controlPoints.Add(new Offset(1.0f, 1.0f));
return CatmullRomSpline.precompute(_controlPoints, tension: tension).generateSamples(
start: 0.0f, end: 1.0f, tolerance: 1e-12f).ToList();
}
static readonly List<String> _debugAssertReasons = new List<String>();
readonly List<Curve2DSample> _precomputedSamples;
public readonly List<Offset> controlPoints;
public readonly float? tension;
static bool validateControlPoints(
List<Offset> controlPoints,
float? tension = 0.0f,
List<string> reasons = null) {
D.assert(tension != null);
if (controlPoints == null) {
D.assert(() => {
reasons?.Add("Supplied control points cannot be null");
return true;
});
return false;
}
if (controlPoints.Count < 2) {
D.assert(() => {
reasons?.Add("There must be at least two points supplied to create a valid curve.");
return true;
});
return false;
}
List<Offset> _controlPoints = new List<Offset>();
_controlPoints.AddRange(controlPoints);
_controlPoints.Insert(0, Offset.zero);
_controlPoints.Add(new Offset(1.0f, 1.0f));
Offset startHandle = _controlPoints[0] * 2.0f - _controlPoints[1];
Offset endHandle = _controlPoints.last() * 2.0f - _controlPoints[_controlPoints.Count - 2];
_controlPoints.Insert(0, startHandle);
_controlPoints.Add(endHandle);
float lastX = -float.PositiveInfinity;
for (int i = 0; i < _controlPoints.Count; ++i) {
if (i > 1 &&
i < _controlPoints.Count - 2 &&
(_controlPoints[i].dx <= 0.0f || _controlPoints[i].dx >= 1.0f)) {
D.assert(() => {
reasons?.Add("Control points must have X values between 0.0 and 1.0, exclusive. " +
$"Point {i} has an x value ({_controlPoints[i].dx}) which is outside the range.");
return true;
});
return false;
}
if (_controlPoints[i].dx <= lastX) {
D.assert(() => {
reasons?.Add("Each X coordinate must be greater than the preceding X coordinate " +
$"(i.e. must be monotonically increasing in X). Point {i} has an x value of " +
$"{_controlPoints[i].dx}, which is not greater than {lastX}");
return true;
});
return false;
}
lastX = _controlPoints[i].dx;
}
bool success = true;
lastX = -float.PositiveInfinity;
const float tolerance = 1e-3f;
CatmullRomSpline testSpline = new CatmullRomSpline(_controlPoints, tension: tension);
float start = testSpline.findInverse(0.0f);
float end = testSpline.findInverse(1.0f);
IEnumerable<Curve2DSample> samplePoints = testSpline.generateSamples(start: start, end: end);
if (samplePoints.First().value.dy.abs() > tolerance ||
(1.0f - samplePoints.Last().value.dy).abs() > tolerance) {
bool bail = true;
success = false;
D.assert(() => {
reasons?.Add($"The curve has more than one Y value at X = {samplePoints.First().value.dx}. " +
"Try moving some control points further away from this value of X, or increasing " +
"the tension.");
bail = reasons == null;
return true;
});
if (bail) {
return false;
}
}
foreach (Curve2DSample sample in samplePoints) {
Offset point = sample.value;
float t = sample.t;
float x = point.dx;
if (t >= start && t <= end && (x < -1e-3f || x > 1.0f + 1e-3f)) {
bool bail = true;
success = false;
D.assert(() => {
reasons?.Add($"The resulting curve has an X value ({x}) which is outside " +
"the range [0.0, 1.0], inclusive.");
bail = reasons == null;
return true;
});
if (bail) {
return false;
}
}
if (x < lastX) {
bool bail = true;
success = false;
D.assert(() => {
reasons?.Add($"The curve has more than one Y value at x = {x}. Try moving " +
"some control points further apart in X, or increasing the tension.");
bail = reasons == null;
return true;
});
if (bail) {
return false;
}
}
lastX = x;
}
return success;
}
protected override float transformInternal(float t) {
if (_precomputedSamples.isEmpty()) {
// Compute the samples now if we were constructed lazily.
_precomputedSamples.AddRange(_computeSamples(controlPoints, tension));
}
int start = 0;
int end = _precomputedSamples.Count - 1;
int mid;
Offset value;
Offset startValue = _precomputedSamples[start].value;
Offset endValue = _precomputedSamples[end].value;
while (end - start > 1) {
mid = (end + start) / 2;
value = _precomputedSamples[mid].value;
if (t >= value.dx) {
start = mid;
startValue = value;
} else {
end = mid;
endValue = value;
}
}
float t2 = (t - startValue.dx) / (endValue.dx - startValue.dx);
return Mathf.Lerp(startValue.dy, endValue.dy, t2);
}
}

171
com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.gen.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.animation {
int _listenerCounter = 0;
int _listenerCounter;
protected void didRegisterListener() {
D.assert(_listenerCounter >= 0);

}
public abstract class AnimationEagerListenerMixinAnimation<T> : Animation<T> {
protected void didRegisterListener() {
}

}
public abstract class
AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> : AnimationLazyListenerMixinAnimation<T> {
public abstract class AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> : AnimationLazyListenerMixinAnimation<T> {
readonly ObserverList<VoidCallback> _listeners = new ObserverList<VoidCallback>();
public override void addListener(VoidCallback listener) {

public void notifyListeners() {
var localListeners = new List<VoidCallback>(_listeners);
foreach (VoidCallback listener in localListeners) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
}
catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<
AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
} catch (Exception exception) {
informationCollector: infoCollector
informationCollector: collector
));
}
}

public abstract class
AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> : AnimationEagerListenerMixinAnimation<T> {
public abstract class AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> : AnimationEagerListenerMixinAnimation<T> {
readonly ObserverList<VoidCallback> _listeners = new ObserverList<VoidCallback>();
public override void addListener(VoidCallback listener) {

public void notifyListeners() {
var localListeners = new List<VoidCallback>(_listeners);
foreach (VoidCallback listener in localListeners) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
}
catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<
AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
} catch (Exception exception) {
informationCollector: infoCollector
informationCollector: collector
));
}
}

public abstract class
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> :
AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> {
public abstract class AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> : AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T> {
readonly ObserverList<AnimationStatusListener> _statusListeners = new ObserverList<AnimationStatusListener>();
public override void addStatusListener(AnimationStatusListener listener) {

if (_statusListeners.Contains(listener)) {
listener(status);
}
}
catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation
<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
} catch (Exception exception) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
informationCollector: infoCollector
informationCollector: collector
));
}
}

public abstract class
AnimationLocalStatusListenersMixinAnimationLazyListenerMixinAnimation<T> : AnimationLazyListenerMixinAnimation<T
> {
public abstract class AnimationLocalStatusListenersMixinAnimationLazyListenerMixinAnimation<T> : AnimationLazyListenerMixinAnimation<T> {
readonly ObserverList<AnimationStatusListener> _statusListeners = new ObserverList<AnimationStatusListener>();
public override void addStatusListener(AnimationStatusListener listener) {

if (_statusListeners.Contains(listener)) {
listener(status);
}
}
catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<
AnimationLocalStatusListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
} catch (Exception exception) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
informationCollector: infoCollector
informationCollector: collector
));
}
}

public abstract class
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> :
AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> {
public abstract class AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> : AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T> {
readonly ObserverList<AnimationStatusListener> _statusListeners = new ObserverList<AnimationStatusListener>();
public override void addStatusListener(AnimationStatusListener listener) {

if (_statusListeners.Contains(listener)) {
listener(status);
}
}
catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation
<T>>(
"The " + GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
} catch (Exception exception) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
informationCollector: infoCollector
informationCollector: collector
}

44
com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.njk


public void notifyListeners() {
var localListeners = new List<VoidCallback>(this._listeners);
foreach (VoidCallback listener in localListeners) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
informationCollector: infoCollector
informationCollector: collector
));
}
}

listener(status);
}
} catch (Exception exception) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying status listeners was:",
this,
style: DiagnosticsTreeStyle.errorProperty
);
}
collector = infoCollector;
return true;
});
informationCollector: infoCollector
informationCollector: collector
));
}
}

14
com.unity.uiwidgets/Runtime/animation/tween.cs


return lerp(t);
}
/*public override T evaluate(Animation<float> animation) {
float t = animation.value;
if (t == 0.0) {
return begin;
}
if (t == 1.0) {
return end;
}
return lerp(t);
}*/
public override string ToString() {
return $"{GetType()}({begin} \u2192 {end})";
}

2
com.unity.uiwidgets/Runtime/animation/tween_sequence.cs


if (_intervals[index].contains(t))
return _evaluateAt(t, index);
}
D.assert(false, ()=>"TweenSequence.evaluate() could not find an interval for $t");
D.assert(false, ()=> $"TweenSequence.evaluate() could not find an interval for {t}");
return default(T);
}
public override string ToString(){

7
com.unity.uiwidgets/Runtime/services/asset_bundle.cs


throw new UIWidgetsError($"Unable to load asset: {key}");
if (data.Length < 10 * 1024) {
// 10KB takes about 3ms to parse on a Pixel 2 XL.
// See: https://github.com/dart-lang/sdk/issues/31954
return Encoding.UTF8.GetString(data);
}

yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError) {
completer.completeError(new Exception($"Failed to load from url \"{url}\": {www.error}"));
completer.completeError(new UIWidgetsError(new List<DiagnosticsNode>() {
new ErrorSummary($"Unable to load asset: {key}"),
new StringProperty("HTTP status code", www.error)
}));
yield break;
}

2
com.unity.uiwidgets/Runtime/services/binding.cs


_defaultBinaryMessenger = createBinaryMessenger();
window.onPlatformMessage = defaultBinaryMessenger.handlePlatformMessage;
//initLicenses();
//SystemChannels.system.setMessageHandler(handleSystemMessage);
}

services_.rootBundle.evict(asset);
}
}
class _DefaultBinaryMessenger : BinaryMessenger {
internal _DefaultBinaryMessenger() {

986
com.unity.uiwidgets/Runtime/services/keyboard_key.cs
文件差异内容过多而无法显示
查看文件

2
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


fontFamily: style.fontFamily,
fontSize: style.fontSize,
fontWeight: style.fontWeight,
textDirection: _textDirection,
textDirection: _textDirection.Value,
textAlign: widget.textAlign
);
_textInputConnection.setEditingState(localValue);

92
com.unity.uiwidgets/Runtime/services/text_editing.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.service {
// public class TextRange : IEquatable<TextRange> {
// public readonly int start;
// public readonly int end;
//
// public static TextRange collapsed(int offset) {
// D.assert(offset >= -1);
// return new TextRange(offset, offset);
// }
//
// public static readonly TextRange empty = new TextRange(-1, -1);
//
// public TextRange(int start, int end) {
// D.assert(start >= -1);
// D.assert(end >= -1);
// this.start = start;
// this.end = end;
// }
//
// public bool isValid {
// get { return start >= 0 && end >= 0; }
// }
//
// public bool isCollapsed {
// get { return start == end; }
// }
//
// public bool isNormalized {
// get { return start <= end; }
// }
//
// public string textBefore(string text) {
// D.assert(isNormalized);
// return text.Substring(0, start);
// }
//
// public string textAfter(string text) {
// D.assert(isNormalized);
// return text.Substring(end);
// }
//
// public string textInside(string text) {
// D.assert(isNormalized);
// return text.Substring(start, end - start);
// }
//
// public bool Equals(TextRange other) {
// if (ReferenceEquals(null, other)) {
// return false;
// }
//
// if (ReferenceEquals(this, other)) {
// return true;
// }
//
// return start == other.start && end == other.end;
// }
//
// public override bool Equals(object obj) {
// if (ReferenceEquals(null, obj)) {
// return false;
// }
//
// if (ReferenceEquals(this, obj)) {
// return true;
// }
//
// if (obj.GetType() != GetType()) {
// return false;
// }
//
// return Equals((TextRange) obj);
// }
//
// public override int GetHashCode() {
// unchecked {
// return (start * 397) ^ end;
// }
// }
//
// public static bool operator ==(TextRange left, TextRange right) {
// return Equals(left, right);
// }
//
// public static bool operator !=(TextRange left, TextRange right) {
// return !Equals(left, right);
// }
//
// public override string ToString() {
// return $"TextRange Start: {start}, End: {end}";
// }
// }
public class TextSelection : TextRange, IEquatable<TextSelection> {
public readonly int baseOffset;
public readonly int extentOffset;

28
com.unity.uiwidgets/Runtime/services/text_formatter.cs


public readonly int? maxLength;
internal static TextEditingValue truncate(TextEditingValue value, int maxLength) {
TextSelection newSelection = value.selection.copyWith(
baseOffset: Mathf.Min(value.selection.start, maxLength),
extentOffset: Mathf.Min(value.selection.end, maxLength));
string truncated = value.text.Substring(0, maxLength);
return new TextEditingValue(
text: truncated,
selection: newSelection,
composing: TextRange.empty
);
}
public override TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
if (maxLength != null && maxLength > 0 && newValue.text.Length > maxLength) {
if (Input.compositionString.Length > 0) {

TextSelection newSelection = newValue.selection.copyWith(
baseOffset: Mathf.Min(newValue.selection.start, maxLength.Value),
extentOffset: Mathf.Min(newValue.selection.end, maxLength.Value)
);
string truncated = newValue.text.Substring(0, maxLength.Value);
return new TextEditingValue(
text: truncated,
selection: newSelection,
composing: TextRange.empty
);
if (oldValue.text.Length == maxLength.Value) {
return oldValue;
}
return truncate(newValue, maxLength.Value);
}
return newValue;

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


using UnityEngine;
namespace Unity.UIWidgets.service {
public enum FloatingCursorDragState {
Start,
Update,
End
public enum SmartDashesType {
disabled,
enabled
public class RawFloatingCursorPoint {
public RawFloatingCursorPoint(
Offset offset = null,
FloatingCursorDragState? state = null
) {
D.assert(state != null);
D.assert(state != FloatingCursorDragState.Update || offset != null);
//D.assert(state == FloatingCursorDragState.Update ? offset != null : true);
this.offset = offset;
this.state = state;
}
public readonly Offset offset;
public readonly FloatingCursorDragState? state;
public enum SmartQuotesType {
disabled,
enabled
public class TextInputType : IEquatable<TextInputType> {
public readonly int index;
public readonly bool? signed;

}
public static readonly TextInputType text = new TextInputType(0);
public static readonly TextInputType multiline = new TextInputType(1);
public static readonly TextInputType number = numberWithOptions();

public static readonly TextInputType url = new TextInputType(6);
public static readonly TextInputType visiblePassword = new TextInputType(7);
public static readonly List<TextInputType> values = new List<TextInputType> {
text, multiline, number, phone, datetime, emailAddress, url, visiblePassword
};
"text", "multiline", "number", "phone", "datetime", "emailAddress", "url"
"text", "multiline", "number", "phone", "datetime", "emailAddress", "url", "visiblePassword"
};
public JSONNode toJson() {

return $"{GetType().FullName}(name: {_name}, signed: {signed}, decimal: {decimalNum})";
}
}
public enum TextInputAction {
none,
unspecified,
done,
go,
search,
send,
next,
previous,
continueAction,
join,
route,
emergencyCall,
newline
}
public enum TextCapitalization {
words,
sentences,
characters,
none
}
public class TextInputConfiguration {
public TextInputConfiguration(
TextInputType inputType = null,
bool obscureText = false,
bool autocorrect = true,
SmartDashesType? smartDashesType = null,
SmartQuotesType? smartQuotesType = null,
bool enableSuggestions = true,
string actionLabel = null,
TextInputAction inputAction = TextInputAction.done,
ui.Brightness keyboardAppearance = ui.Brightness.light,
TextCapitalization textCapitalization = TextCapitalization.none,
bool unityTouchKeyboard = false
) {
D.assert(inputType != null);
this.smartDashesType =
smartDashesType ?? (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled);
this.smartQuotesType =
smartQuotesType ?? (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled);
this.inputType = inputType ?? TextInputType.text;
this.obscureText = obscureText;
this.autocorrect = autocorrect;
this.enableSuggestions = enableSuggestions;
this.actionLabel = actionLabel;
this.inputAction = inputAction;
this.textCapitalization = textCapitalization;
this.keyboardAppearance = keyboardAppearance;
this.unityTouchKeyboard = unityTouchKeyboard;
}
public readonly TextInputType inputType;
public readonly bool obscureText;
public readonly bool autocorrect;
public readonly SmartDashesType smartDashesType;
public readonly SmartQuotesType smartQuotesType;
public readonly bool enableSuggestions;
public readonly string actionLabel;
public readonly TextInputAction inputAction;
public readonly TextCapitalization textCapitalization;
public readonly ui.Brightness keyboardAppearance;
public readonly bool unityTouchKeyboard;
public JSONNode toJson() {
var json = new JSONObject();
json["inputType"] = inputType.toJson();
json["obscureText"] = obscureText;
json["autocorrect"] = autocorrect;
json["smartDashesType"] = smartDashesType.ToString();
json["smartQuotesType"] = smartQuotesType.ToString();
json["enableSuggestions"] = enableSuggestions;
json["actionLabel"] = actionLabel;
json["inputAction"] = inputAction.ToString();
json["unityTouchKeyboard"] = unityTouchKeyboard;
json["textCapitalization"] = textCapitalization.ToString();
json["keyboardAppearance"] = keyboardAppearance.ToString();
return json;
}
}
static partial class TextInputUtils {
internal static TextAffinity? _toTextAffinity(string affinity) {
switch (affinity) {

return TextInputAction.newline;
}
throw new UIWidgetsError("Unknown text input action: $action");
throw new UIWidgetsError($"Unknown text input action: {action}");
}
public static FloatingCursorDragState _toTextCursorAction(string state) {

return FloatingCursorDragState.End;
}
throw new UIWidgetsError("Unknown text cursor action: $state");
throw new UIWidgetsError(new List<DiagnosticsNode>() {new ErrorSummary($"Unknown text cursor action: {state}")});
}
public static RawFloatingCursorPoint _toTextPoint(FloatingCursorDragState state,

}
}
public enum FloatingCursorDragState {
Start,
Update,
End
}
public class RawFloatingCursorPoint {
public RawFloatingCursorPoint(
Offset offset = null,
FloatingCursorDragState? state = null
) {
D.assert(state != null);
D.assert(state != FloatingCursorDragState.Update || offset != null);
this.offset = offset;
this.state = state;
}
public readonly Offset offset;
public readonly FloatingCursorDragState? state;
}
public readonly string text;
public readonly TextSelection selection;
public readonly TextRange composing;
static JSONNode defaultBoolNode = new JSONBool(false);
public TextEditingValue(
string text = "",

D.assert(text != null);
D.assert(selection != null);
D.assert(composing != null);
this.text = text;
this.composing = composing ?? TextRange.empty;

this.selection = selection.copyWith(start, end);
}
else {
this.selection = TextSelection.collapsed(-1);
this.selection = selection ?? TextSelection.collapsed(-1);
public static TextEditingValue fromJSON(JSONObject json) {
public static TextEditingValue fromJSON(JSONNode json) {
TextAffinity? affinity =
TextInputUtils._toTextAffinity(json["selectionAffinity"].Value);
return new TextEditingValue(

extentOffset: json.GetValueOrDefault("selectionExtent", defaultIndexNode).AsInt,
affinity: affinity != null ? affinity.Value : TextAffinity.downstream,
isDirectional: json["selectionIsDirectional"].AsBool
isDirectional: json.GetValueOrDefault("selectionIsDirectional", defaultBoolNode).AsBool
),
composing: new TextRange(
start: json.GetValueOrDefault("composingBase", defaultIndexNode).AsInt,

json["composingExtent"] = composing.end;
return json;
}
public readonly string text;
public readonly TextSelection selection;
public readonly TextRange composing;
public static readonly TextEditingValue empty = new TextEditingValue();
public TextEditingValue copyWith(
string text = null,

text ?? this.text,
selection ?? this.selection,
composing ?? this.composing
text: text ?? this.text,
selection: selection ?? this.selection,
composing: composing ?? this.composing
//unity-specific
public TextEditingValue insert(string text) {
string newText;
TextSelection newSelection;

);
}
//unity-specific
public TextEditingValue deleteSelection(bool backDelete = true) {
if (selection.isCollapsed) {
if (backDelete) {

}
}
//unity-specific
//unity-specific
//unity-specific
//unity-specific
//unity-specific
public TextEditingValue moveExtent(int move) {
int offset = selection.extentOffset + move;
offset = Mathf.Max(0, offset);

//unity-specific
public TextEditingValue moveSelection(int move) {
int offset = selection.baseOffset + move;
offset = Mathf.Max(0, offset);

//unity-specific
public TextEditingValue compose(string composeText) {
D.assert(!string.IsNullOrEmpty(composeText));
var composeStart = composing == TextRange.empty ? selection.start : composing.start;

);
}
//unity-specific
public TextEditingValue clearCompose() {
if (composing == TextRange.empty) {
return this;

);
}
public static readonly TextEditingValue empty = new TextEditingValue();
public bool Equals(TextEditingValue other) {
if (ReferenceEquals(null, other)) {
return false;

public override string ToString() {
return $"Text: {text}, Selection: {selection}, Composing: {composing}";
}
public static TextEditingValue fromJSON(JSONNode encoded) {
return new TextEditingValue(
text: encoded["text"] ,
selection: new TextSelection(
baseOffset: encoded.GetValueOrDefault("selectionBase", defaultIndexNode).AsInt,
extentOffset: encoded.GetValueOrDefault("selectionExtent", defaultIndexNode).AsInt,
affinity: TextInputUtils._toTextAffinity(encoded["selectionAffinity"] ) ?? TextAffinity.downstream,
isDirectional: encoded["selectionIsDirectional"] ?? false
),
composing: new TextRange(
start: encoded.GetValueOrDefault("composingBase", defaultIndexNode).AsInt,
end: encoded.GetValueOrDefault("composingExtent", defaultIndexNode).AsInt
)
);
}
}
public interface TextSelectionDelegate {

void performAction(TextInputAction action);
void updateFloatingCursor(RawFloatingCursorPoint point);
RawInputKeyResponse globalInputKeyHandler(RawKeyEvent evt);
}
public enum TextInputAction {
none,
unspecified,
done,
go,
search,
send,
next,
previous,
continueAction,
join,
route,
emergencyCall,
newline
}
public enum TextCapitalization {
words,
sentences,
characters,
none
}
public class TextInputConfiguration {
public TextInputConfiguration(
TextInputType inputType = null,
bool obscureText = false,
bool autocorrect = true,
//SmartDashesType smartDashesType,
//SmartQuotesType smartQuotesType,
bool enableSuggestions = true,
string actionLabel = null,
TextInputAction inputAction = TextInputAction.done,
ui.Brightness keyboardAppearance = ui.Brightness.light,
TextCapitalization textCapitalization = TextCapitalization.none,
bool unityTouchKeyboard = false
) {
D.assert(inputType != null);
D.assert(obscureText != null);
//smartDashesType = smartDashesType ?? (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
//smartQuotesType = smartQuotesType ?? (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
D.assert(autocorrect != null);
D.assert(enableSuggestions != null);
D.assert(keyboardAppearance != null);
D.assert(inputAction != null);
D.assert(textCapitalization != null);
this.inputType = inputType ?? TextInputType.text;
this.obscureText = obscureText;
this.autocorrect = autocorrect;
this.enableSuggestions = enableSuggestions;
this.actionLabel = actionLabel;
this.inputAction = inputAction;
this.textCapitalization = textCapitalization;
this.keyboardAppearance = keyboardAppearance;
this.unityTouchKeyboard = unityTouchKeyboard;
}
public readonly TextInputAction inputAction;
public readonly TextInputType inputType;
public readonly string actionLabel;
public readonly bool obscureText;
public readonly bool autocorrect;
//public readonly TextInputAction inputAction;
public readonly bool enableSuggestions;
public readonly TextCapitalization textCapitalization;
public readonly ui.Brightness keyboardAppearance;
public readonly bool unityTouchKeyboard;
public JSONNode toJson() {
var json = new JSONObject();
json["inputType"] = inputType.toJson();
json["obscureText"] = obscureText;
json["autocorrect"] = autocorrect;
//'smartDashesType': smartDashesType.index.toString(),
//'smartQuotesType': smartQuotesType.index.toString(),
json["enableSuggestions"] = enableSuggestions;
json["actionLabel"] = actionLabel;
json["inputAction"] = inputAction.ToString();
json["unityTouchKeyboard"] = unityTouchKeyboard;
json["textCapitalization"] = textCapitalization.ToString();
json["keyboardAppearance"] = keyboardAppearance.ToString();
return json;
}
//unity-specific
RawInputKeyResponse globalInputKeyHandler(RawKeyEvent evt);
}
public class TextInputConnection {

internal Size _cachedSize;
internal Matrix4 _cachedTransform;
D.assert(to != null);
//TextInput._instance._show();
Input.imeCompositionMode = IMECompositionMode.On;
TextInput.keyboardDelegate.show();

D.assert(attached);
TextInput.keyboardDelegate.setEditingState(value);
//TextInput._instance._setEditingState(value);
//var dictionary = new JSONObject();
//json["text"] = text;
Dictionary<string,object> dictionary = new Dictionary<string, object>();
dictionary["width"] = editableBoxSize.width;
dictionary["height"] = editableBoxSize.height;

);
}
}
string fontFamily = null,
float? fontSize = null,
FontWeight fontWeight = null,
TextDirection? textDirection = null,
TextAlign? textAlign = null
) { /// ????
string fontFamily,
float? fontSize,
FontWeight fontWeight,
TextDirection textDirection,
TextAlign textAlign
) {
dictionary["textAlignIndex"] = textAlign?.GetHashCode();
dictionary["textDirectionIndex"] = textDirection?.GetHashCode();
dictionary["textAlignIndex"] = (int)textAlign;
dictionary["textDirectionIndex"] = (int)textDirection;
//TextInput._instance._clearClient();
TextInput.keyboardDelegate.clearClient();
TextInput._currentConnection = null;
Input.imeCompositionMode = IMECompositionMode.Auto;

TextInput._currentConnection = null;
D.assert(!attached);
}
internal readonly Window _window;
TouchScreenKeyboard _keyboard;
}

public static TextInputConnection attach(TextInputClient client, TextInputConfiguration configuration) {
D.assert(client != null);
D.assert(configuration != null);
var connection = new TextInputConnection(client);
_currentConnection = connection;
if (keyboardDelegate != null) {

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


fileFormatVersion: 2
guid: ba4b5dab38db54970bf74725b5642400
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: 628dbae83defc65479f1ad3d8c9acbfb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/com.unity.uiwidgets/Runtime/service/text_editing.cs → /com.unity.uiwidgets/Runtime/services/text_editing.cs

/com.unity.uiwidgets/Runtime/service/clipboard.cs → /com.unity.uiwidgets/Runtime/services/clipboard.cs

/com.unity.uiwidgets/Runtime/service/keyboard.cs → /com.unity.uiwidgets/Runtime/services/keyboard.cs

/com.unity.uiwidgets/Runtime/service/text_formatter.cs → /com.unity.uiwidgets/Runtime/services/text_formatter.cs

/com.unity.uiwidgets/Runtime/service/text_input.cs → /com.unity.uiwidgets/Runtime/services/text_input.cs

/com.unity.uiwidgets/Runtime/service/platform_channel.cs → /com.unity.uiwidgets/Runtime/services/platform_channel.cs

/com.unity.uiwidgets/Runtime/service/system_channels.cs → /com.unity.uiwidgets/Runtime/services/system_channels.cs

/com.unity.uiwidgets/Runtime/service/raw_keyboard.cs → /com.unity.uiwidgets/Runtime/services/raw_keyboard.cs

/com.unity.uiwidgets/Runtime/service/system_chrome.cs → /com.unity.uiwidgets/Runtime/services/system_chrome.cs

正在加载...
取消
保存