forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputField.cs
More file actions
2694 lines (2513 loc) · 65.3 KB
/
InputField.cs
File metadata and controls
2694 lines (2513 loc) · 65.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
namespace UnityEngine.UI
{
[AddComponentMenu("UI/Input Field", 31)]
public class InputField : Selectable, IUpdateSelectedHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler, ISubmitHandler, ICanvasElement, ILayoutElement, IEventSystemHandler
{
public enum ContentType
{
Standard,
Autocorrected,
IntegerNumber,
DecimalNumber,
Alphanumeric,
Name,
EmailAddress,
Password,
Pin,
Custom
}
public enum InputType
{
Standard,
AutoCorrect,
Password
}
public enum CharacterValidation
{
None,
Integer,
Decimal,
Alphanumeric,
Name,
EmailAddress
}
public enum LineType
{
SingleLine,
MultiLineSubmit,
MultiLineNewline
}
public delegate char OnValidateInput(string text, int charIndex, char addedChar);
[Serializable]
public class SubmitEvent : UnityEvent<string>
{
}
[Serializable]
public class OnChangeEvent : UnityEvent<string>
{
}
protected enum EditState
{
Continue,
Finish
}
protected TouchScreenKeyboard m_Keyboard;
private static readonly char[] kSeparators = new char[]
{
' ',
'.',
',',
'\t',
'\r',
'\n'
};
[FormerlySerializedAs("text"), SerializeField]
protected Text m_TextComponent;
[SerializeField]
protected Graphic m_Placeholder;
[SerializeField]
private InputField.ContentType m_ContentType = InputField.ContentType.Standard;
[FormerlySerializedAs("inputType"), SerializeField]
private InputField.InputType m_InputType = InputField.InputType.Standard;
[FormerlySerializedAs("asteriskChar"), SerializeField]
private char m_AsteriskChar = '*';
[FormerlySerializedAs("keyboardType"), SerializeField]
private TouchScreenKeyboardType m_KeyboardType = TouchScreenKeyboardType.Default;
[SerializeField]
private InputField.LineType m_LineType = InputField.LineType.SingleLine;
[FormerlySerializedAs("hideMobileInput"), SerializeField]
private bool m_HideMobileInput = false;
[FormerlySerializedAs("validation"), SerializeField]
private InputField.CharacterValidation m_CharacterValidation = InputField.CharacterValidation.None;
[FormerlySerializedAs("characterLimit"), SerializeField]
private int m_CharacterLimit = 0;
[FormerlySerializedAs("onSubmit"), FormerlySerializedAs("m_OnSubmit"), FormerlySerializedAs("m_EndEdit"), SerializeField]
private InputField.SubmitEvent m_OnEndEdit = new InputField.SubmitEvent();
[FormerlySerializedAs("onValueChange"), FormerlySerializedAs("m_OnValueChange"), SerializeField]
private InputField.OnChangeEvent m_OnValueChanged = new InputField.OnChangeEvent();
[FormerlySerializedAs("onValidateInput"), SerializeField]
private InputField.OnValidateInput m_OnValidateInput;
[SerializeField]
private Color m_CaretColor = new Color(0.196078435f, 0.196078435f, 0.196078435f, 1f);
[SerializeField]
private bool m_CustomCaretColor = false;
[FormerlySerializedAs("selectionColor"), SerializeField]
private Color m_SelectionColor = new Color(0.65882355f, 0.807843149f, 1f, 0.7529412f);
[FormerlySerializedAs("mValue"), SerializeField]
protected string m_Text = string.Empty;
[Range(0f, 4f), SerializeField]
private float m_CaretBlinkRate = 0.85f;
[Range(1f, 5f), SerializeField]
private int m_CaretWidth = 1;
[SerializeField]
private bool m_ReadOnly = false;
protected int m_CaretPosition = 0;
protected int m_CaretSelectPosition = 0;
private RectTransform caretRectTrans = null;
protected UIVertex[] m_CursorVerts = null;
private TextGenerator m_InputTextCache;
private CanvasRenderer m_CachedInputRenderer;
private bool m_PreventFontCallback = false;
[NonSerialized]
protected Mesh m_Mesh;
private bool m_AllowInput = false;
private bool m_ShouldActivateNextUpdate = false;
private bool m_UpdateDrag = false;
private bool m_DragPositionOutOfBounds = false;
private const float kHScrollSpeed = 0.05f;
private const float kVScrollSpeed = 0.1f;
protected bool m_CaretVisible;
private Coroutine m_BlinkCoroutine = null;
private float m_BlinkStartTime = 0f;
protected int m_DrawStart = 0;
protected int m_DrawEnd = 0;
private Coroutine m_DragCoroutine = null;
private string m_OriginalText = "";
private bool m_WasCanceled = false;
private bool m_HasDoneFocusTransition = false;
private const string kEmailSpecialCharacters = "!#$%&'*+-/=?^_`{|}~";
private Event m_ProcessingEvent = new Event();
private BaseInput input
{
get
{
BaseInput result;
if (EventSystem.current && EventSystem.current.currentInputModule)
{
result = EventSystem.current.currentInputModule.input;
}
else
{
result = null;
}
return result;
}
}
private string compositionString
{
get
{
return (!(this.input != null)) ? Input.compositionString : this.input.compositionString;
}
}
protected Mesh mesh
{
get
{
if (this.m_Mesh == null)
{
this.m_Mesh = new Mesh();
}
return this.m_Mesh;
}
}
protected TextGenerator cachedInputTextGenerator
{
get
{
if (this.m_InputTextCache == null)
{
this.m_InputTextCache = new TextGenerator();
}
return this.m_InputTextCache;
}
}
public bool shouldHideMobileInput
{
get
{
RuntimePlatform platform = Application.platform;
bool result;
switch (platform)
{
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.Android:
goto IL_34;
case RuntimePlatform.PS3:
case RuntimePlatform.XBOX360:
IL_1F:
if (platform != RuntimePlatform.TizenPlayer && platform != RuntimePlatform.tvOS)
{
result = true;
return result;
}
goto IL_34;
}
goto IL_1F;
IL_34:
result = this.m_HideMobileInput;
return result;
}
set
{
SetPropertyUtility.SetStruct<bool>(ref this.m_HideMobileInput, value);
}
}
private bool shouldActivateOnSelect
{
get
{
return Application.platform != RuntimePlatform.tvOS;
}
}
public string text
{
get
{
return this.m_Text;
}
set
{
if (!(this.text == value))
{
if (value == null)
{
value = "";
}
value = value.Replace("\0", string.Empty);
if (this.m_LineType == InputField.LineType.SingleLine)
{
value = value.Replace("\n", "").Replace("\t", "");
}
if (this.onValidateInput != null || this.characterValidation != InputField.CharacterValidation.None)
{
this.m_Text = "";
InputField.OnValidateInput onValidateInput = this.onValidateInput ?? new InputField.OnValidateInput(this.Validate);
this.m_CaretPosition = (this.m_CaretSelectPosition = value.Length);
int num = (this.characterLimit <= 0) ? value.Length : Math.Min(this.characterLimit, value.Length);
for (int i = 0; i < num; i++)
{
char c = onValidateInput(this.m_Text, this.m_Text.Length, value[i]);
if (c != '\0')
{
this.m_Text += c;
}
}
}
else
{
this.m_Text = ((this.characterLimit <= 0 || value.Length <= this.characterLimit) ? value : value.Substring(0, this.characterLimit));
}
if (!Application.isPlaying)
{
this.SendOnValueChangedAndUpdateLabel();
}
else
{
if (this.m_Keyboard != null)
{
this.m_Keyboard.text = this.m_Text;
}
if (this.m_CaretPosition > this.m_Text.Length)
{
this.m_CaretPosition = (this.m_CaretSelectPosition = this.m_Text.Length);
}
else if (this.m_CaretSelectPosition > this.m_Text.Length)
{
this.m_CaretSelectPosition = this.m_Text.Length;
}
this.SendOnValueChangedAndUpdateLabel();
}
}
}
}
public bool isFocused
{
get
{
return this.m_AllowInput;
}
}
public float caretBlinkRate
{
get
{
return this.m_CaretBlinkRate;
}
set
{
if (SetPropertyUtility.SetStruct<float>(ref this.m_CaretBlinkRate, value))
{
if (this.m_AllowInput)
{
this.SetCaretActive();
}
}
}
}
public int caretWidth
{
get
{
return this.m_CaretWidth;
}
set
{
if (SetPropertyUtility.SetStruct<int>(ref this.m_CaretWidth, value))
{
this.MarkGeometryAsDirty();
}
}
}
public Text textComponent
{
get
{
return this.m_TextComponent;
}
set
{
if (SetPropertyUtility.SetClass<Text>(ref this.m_TextComponent, value))
{
this.EnforceTextHOverflow();
}
}
}
public Graphic placeholder
{
get
{
return this.m_Placeholder;
}
set
{
SetPropertyUtility.SetClass<Graphic>(ref this.m_Placeholder, value);
}
}
public Color caretColor
{
get
{
return (!this.customCaretColor) ? this.textComponent.color : this.m_CaretColor;
}
set
{
if (SetPropertyUtility.SetColor(ref this.m_CaretColor, value))
{
this.MarkGeometryAsDirty();
}
}
}
public bool customCaretColor
{
get
{
return this.m_CustomCaretColor;
}
set
{
if (this.m_CustomCaretColor != value)
{
this.m_CustomCaretColor = value;
this.MarkGeometryAsDirty();
}
}
}
public Color selectionColor
{
get
{
return this.m_SelectionColor;
}
set
{
if (SetPropertyUtility.SetColor(ref this.m_SelectionColor, value))
{
this.MarkGeometryAsDirty();
}
}
}
public InputField.SubmitEvent onEndEdit
{
get
{
return this.m_OnEndEdit;
}
set
{
SetPropertyUtility.SetClass<InputField.SubmitEvent>(ref this.m_OnEndEdit, value);
}
}
[Obsolete("onValueChange has been renamed to onValueChanged")]
public InputField.OnChangeEvent onValueChange
{
get
{
return this.onValueChanged;
}
set
{
this.onValueChanged = value;
}
}
public InputField.OnChangeEvent onValueChanged
{
get
{
return this.m_OnValueChanged;
}
set
{
SetPropertyUtility.SetClass<InputField.OnChangeEvent>(ref this.m_OnValueChanged, value);
}
}
public InputField.OnValidateInput onValidateInput
{
get
{
return this.m_OnValidateInput;
}
set
{
SetPropertyUtility.SetClass<InputField.OnValidateInput>(ref this.m_OnValidateInput, value);
}
}
public int characterLimit
{
get
{
return this.m_CharacterLimit;
}
set
{
if (SetPropertyUtility.SetStruct<int>(ref this.m_CharacterLimit, Math.Max(0, value)))
{
this.UpdateLabel();
}
}
}
public InputField.ContentType contentType
{
get
{
return this.m_ContentType;
}
set
{
if (SetPropertyUtility.SetStruct<InputField.ContentType>(ref this.m_ContentType, value))
{
this.EnforceContentType();
}
}
}
public InputField.LineType lineType
{
get
{
return this.m_LineType;
}
set
{
if (SetPropertyUtility.SetStruct<InputField.LineType>(ref this.m_LineType, value))
{
this.SetToCustomIfContentTypeIsNot(new InputField.ContentType[]
{
InputField.ContentType.Standard,
InputField.ContentType.Autocorrected
});
this.EnforceTextHOverflow();
}
}
}
public InputField.InputType inputType
{
get
{
return this.m_InputType;
}
set
{
if (SetPropertyUtility.SetStruct<InputField.InputType>(ref this.m_InputType, value))
{
this.SetToCustom();
}
}
}
public TouchScreenKeyboardType keyboardType
{
get
{
return this.m_KeyboardType;
}
set
{
if (SetPropertyUtility.SetStruct<TouchScreenKeyboardType>(ref this.m_KeyboardType, value))
{
this.SetToCustom();
}
}
}
public InputField.CharacterValidation characterValidation
{
get
{
return this.m_CharacterValidation;
}
set
{
if (SetPropertyUtility.SetStruct<InputField.CharacterValidation>(ref this.m_CharacterValidation, value))
{
this.SetToCustom();
}
}
}
public bool readOnly
{
get
{
return this.m_ReadOnly;
}
set
{
this.m_ReadOnly = value;
}
}
public bool multiLine
{
get
{
return this.m_LineType == InputField.LineType.MultiLineNewline || this.lineType == InputField.LineType.MultiLineSubmit;
}
}
public char asteriskChar
{
get
{
return this.m_AsteriskChar;
}
set
{
if (SetPropertyUtility.SetStruct<char>(ref this.m_AsteriskChar, value))
{
this.UpdateLabel();
}
}
}
public bool wasCanceled
{
get
{
return this.m_WasCanceled;
}
}
protected int caretPositionInternal
{
get
{
return this.m_CaretPosition + this.compositionString.Length;
}
set
{
this.m_CaretPosition = value;
this.ClampPos(ref this.m_CaretPosition);
}
}
protected int caretSelectPositionInternal
{
get
{
return this.m_CaretSelectPosition + this.compositionString.Length;
}
set
{
this.m_CaretSelectPosition = value;
this.ClampPos(ref this.m_CaretSelectPosition);
}
}
private bool hasSelection
{
get
{
return this.caretPositionInternal != this.caretSelectPositionInternal;
}
}
[Obsolete("caretSelectPosition has been deprecated. Use selectionFocusPosition instead (UnityUpgradable) -> selectionFocusPosition", true)]
public int caretSelectPosition
{
get
{
return this.selectionFocusPosition;
}
protected set
{
this.selectionFocusPosition = value;
}
}
public int caretPosition
{
get
{
return this.m_CaretSelectPosition + this.compositionString.Length;
}
set
{
this.selectionAnchorPosition = value;
this.selectionFocusPosition = value;
}
}
public int selectionAnchorPosition
{
get
{
return this.m_CaretPosition + this.compositionString.Length;
}
set
{
if (this.compositionString.Length == 0)
{
this.m_CaretPosition = value;
this.ClampPos(ref this.m_CaretPosition);
}
}
}
public int selectionFocusPosition
{
get
{
return this.m_CaretSelectPosition + this.compositionString.Length;
}
set
{
if (this.compositionString.Length == 0)
{
this.m_CaretSelectPosition = value;
this.ClampPos(ref this.m_CaretSelectPosition);
}
}
}
private static string clipboard
{
get
{
return GUIUtility.systemCopyBuffer;
}
set
{
GUIUtility.systemCopyBuffer = value;
}
}
public virtual float minWidth
{
get
{
return 0f;
}
}
public virtual float preferredWidth
{
get
{
float result;
if (this.textComponent == null)
{
result = 0f;
}
else
{
TextGenerationSettings generationSettings = this.textComponent.GetGenerationSettings(Vector2.zero);
result = this.textComponent.cachedTextGeneratorForLayout.GetPreferredWidth(this.m_Text, generationSettings) / this.textComponent.pixelsPerUnit;
}
return result;
}
}
public virtual float flexibleWidth
{
get
{
return -1f;
}
}
public virtual float minHeight
{
get
{
return 0f;
}
}
public virtual float preferredHeight
{
get
{
float result;
if (this.textComponent == null)
{
result = 0f;
}
else
{
TextGenerationSettings generationSettings = this.textComponent.GetGenerationSettings(new Vector2(this.textComponent.rectTransform.rect.size.x, 0f));
result = this.textComponent.cachedTextGeneratorForLayout.GetPreferredHeight(this.m_Text, generationSettings) / this.textComponent.pixelsPerUnit;
}
return result;
}
}
public virtual float flexibleHeight
{
get
{
return -1f;
}
}
public virtual int layoutPriority
{
get
{
return 1;
}
}
protected InputField()
{
this.EnforceTextHOverflow();
}
protected void ClampPos(ref int pos)
{
if (pos < 0)
{
pos = 0;
}
else if (pos > this.text.Length)
{
pos = this.text.Length;
}
}
protected override void OnValidate()
{
base.OnValidate();
this.EnforceContentType();
this.EnforceTextHOverflow();
this.m_CharacterLimit = Math.Max(0, this.m_CharacterLimit);
if (this.IsActive())
{
this.UpdateLabel();
if (this.m_AllowInput)
{
this.SetCaretActive();
}
}
}
protected override void OnEnable()
{
base.OnEnable();
if (this.m_Text == null)
{
this.m_Text = string.Empty;
}
this.m_DrawStart = 0;
this.m_DrawEnd = this.m_Text.Length;
if (this.m_CachedInputRenderer != null)
{
this.m_CachedInputRenderer.SetMaterial(this.m_TextComponent.GetModifiedMaterial(Graphic.defaultGraphicMaterial), Texture2D.whiteTexture);
}
if (this.m_TextComponent != null)
{
this.m_TextComponent.RegisterDirtyVerticesCallback(new UnityAction(this.MarkGeometryAsDirty));
this.m_TextComponent.RegisterDirtyVerticesCallback(new UnityAction(this.UpdateLabel));
this.m_TextComponent.RegisterDirtyMaterialCallback(new UnityAction(this.UpdateCaretMaterial));
this.UpdateLabel();
}
}
protected override void OnDisable()
{
this.m_BlinkCoroutine = null;
this.DeactivateInputField();
if (this.m_TextComponent != null)
{
this.m_TextComponent.UnregisterDirtyVerticesCallback(new UnityAction(this.MarkGeometryAsDirty));
this.m_TextComponent.UnregisterDirtyVerticesCallback(new UnityAction(this.UpdateLabel));
this.m_TextComponent.UnregisterDirtyMaterialCallback(new UnityAction(this.UpdateCaretMaterial));
}
CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild(this);
if (this.m_CachedInputRenderer != null)
{
this.m_CachedInputRenderer.Clear();
}
if (this.m_Mesh != null)
{
UnityEngine.Object.DestroyImmediate(this.m_Mesh);
}
this.m_Mesh = null;
base.OnDisable();
}
[DebuggerHidden]
private IEnumerator CaretBlink()
{
InputField.<CaretBlink>c__Iterator0 <CaretBlink>c__Iterator = new InputField.<CaretBlink>c__Iterator0();
<CaretBlink>c__Iterator.$this = this;
return <CaretBlink>c__Iterator;
}
private void SetCaretVisible()
{
if (this.m_AllowInput)
{
this.m_CaretVisible = true;
this.m_BlinkStartTime = Time.unscaledTime;
this.SetCaretActive();
}
}
private void SetCaretActive()
{
if (this.m_AllowInput)
{
if (this.m_CaretBlinkRate > 0f)
{
if (this.m_BlinkCoroutine == null)
{
this.m_BlinkCoroutine = base.StartCoroutine(this.CaretBlink());
}
}
else
{
this.m_CaretVisible = true;
}
}
}
private void UpdateCaretMaterial()
{
if (this.m_TextComponent != null && this.m_CachedInputRenderer != null)
{
this.m_CachedInputRenderer.SetMaterial(this.m_TextComponent.GetModifiedMaterial(Graphic.defaultGraphicMaterial), Texture2D.whiteTexture);
}
}
protected void OnFocus()
{
this.SelectAll();
}
protected void SelectAll()
{
this.caretPositionInternal = this.text.Length;
this.caretSelectPositionInternal = 0;
}
public void MoveTextEnd(bool shift)
{
int length = this.text.Length;
if (shift)
{
this.caretSelectPositionInternal = length;
}
else
{
this.caretPositionInternal = length;
this.caretSelectPositionInternal = this.caretPositionInternal;
}
this.UpdateLabel();
}
public void MoveTextStart(bool shift)
{
int num = 0;
if (shift)
{
this.caretSelectPositionInternal = num;
}
else
{
this.caretPositionInternal = num;
this.caretSelectPositionInternal = this.caretPositionInternal;
}
this.UpdateLabel();
}
private bool InPlaceEditing()
{
return !TouchScreenKeyboard.isSupported;
}
private void UpdateCaretFromKeyboard()
{
RangeInt selection = this.m_Keyboard.selection;
int start = selection.start;
int end = selection.end;
bool flag = false;
if (this.caretPositionInternal != start)