Disables text field when it is not active in settings.
This commit is contained in:
@@ -5,7 +5,9 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Cryville.Crtr.Config.UI {
|
||||
public abstract class PVPNumberBase : PropertyValuePanel, IInitializePotentialDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler {
|
||||
public abstract class PVPNumberBase : PropertyValuePanel {
|
||||
[SerializeField]
|
||||
GameObject m_slider;
|
||||
[SerializeField]
|
||||
RectTransform m_handleArea;
|
||||
[SerializeField]
|
||||
@@ -13,6 +15,8 @@ namespace Cryville.Crtr.Config.UI {
|
||||
[SerializeField]
|
||||
TMP_InputField m_text;
|
||||
protected void Start() {
|
||||
m_slider.AddComponent<SliderBehaviour>().parent = this;
|
||||
|
||||
m_text.interactable = SetMapped;
|
||||
m_text.onValueChanged.AddListener(OnTextEdited);
|
||||
m_text.onDeselect.AddListener(OnTextDeselected);
|
||||
@@ -29,6 +33,7 @@ namespace Cryville.Crtr.Config.UI {
|
||||
}
|
||||
void OnTextDeselected(string value) {
|
||||
OnValueUpdated();
|
||||
m_text.enabled = false;
|
||||
}
|
||||
|
||||
protected override void OnValueUpdated() {
|
||||
@@ -52,79 +57,92 @@ namespace Cryville.Crtr.Config.UI {
|
||||
|
||||
protected virtual void OnIdle() { }
|
||||
|
||||
protected virtual void Update() {
|
||||
if (use) {
|
||||
SetRatio(GetRatioFromPos(pp));
|
||||
SetValueFromPos(pp);
|
||||
}
|
||||
}
|
||||
class SliderBehaviour : UIBehaviour, IInitializePotentialDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler {
|
||||
public PVPNumberBase parent;
|
||||
|
||||
Camera cam;
|
||||
Vector2 pp;
|
||||
bool use, nouse;
|
||||
public void OnInitializePotentialDrag(PointerEventData eventData) {
|
||||
// eventData.useDragThreshold = false;
|
||||
pp = eventData.position;
|
||||
}
|
||||
Camera cam;
|
||||
Vector2 pp;
|
||||
bool use, nouse;
|
||||
|
||||
public void OnDrag(PointerEventData eventData) {
|
||||
if (nouse) return;
|
||||
cam = eventData.pressEventCamera;
|
||||
if (!use) {
|
||||
var delta = eventData.position - pp;
|
||||
float dx = Mathf.Abs(delta.x), dy = Mathf.Abs(delta.y);
|
||||
if (dx > dy) use = true;
|
||||
else if (dx < dy) nouse = true;
|
||||
void Update() {
|
||||
if (use) {
|
||||
parent.SetRatio(GetRatioFromPos(pp));
|
||||
SetValueFromPos(pp);
|
||||
}
|
||||
}
|
||||
if (use) {
|
||||
|
||||
public void OnInitializePotentialDrag(PointerEventData eventData) {
|
||||
// eventData.useDragThreshold = false;
|
||||
pp = eventData.position;
|
||||
eventData.Use();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData) {
|
||||
if (!nouse) {
|
||||
public void OnDrag(PointerEventData eventData) {
|
||||
if (nouse) return;
|
||||
cam = eventData.pressEventCamera;
|
||||
if (!use) {
|
||||
var delta = eventData.position - pp;
|
||||
float dx = Mathf.Abs(delta.x), dy = Mathf.Abs(delta.y);
|
||||
if (dx > dy) use = true;
|
||||
else if (dx < dy) nouse = true;
|
||||
}
|
||||
if (use) {
|
||||
pp = eventData.position;
|
||||
eventData.Use();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData) {
|
||||
if (!nouse) {
|
||||
SetValueFromPos(eventData.position);
|
||||
parent.OnIdle();
|
||||
eventData.Use();
|
||||
use = false;
|
||||
}
|
||||
nouse = false;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData) {
|
||||
SetValueFromPos(eventData.position);
|
||||
OnIdle();
|
||||
eventData.Use();
|
||||
use = false;
|
||||
}
|
||||
nouse = false;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData) {
|
||||
SetValueFromPos(eventData.position);
|
||||
eventData.Use();
|
||||
}
|
||||
|
||||
float GetRatioFromPos(Vector2 pos) {
|
||||
Vector2 lp;
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(m_handleArea, pos, cam, out lp)) {
|
||||
lp -= m_handleArea.rect.position;
|
||||
return Mathf.Clamp01(lp.x / m_handleArea.rect.width);
|
||||
float GetRatioFromPos(Vector2 pos) {
|
||||
Vector2 lp;
|
||||
RectTransform handleArea = parent.m_handleArea;
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(handleArea, pos, cam, out lp)) {
|
||||
lp -= handleArea.rect.position;
|
||||
return Mathf.Clamp01(lp.x / handleArea.rect.width);
|
||||
}
|
||||
return float.NegativeInfinity;
|
||||
}
|
||||
|
||||
void SetValueFromPos(Vector2 pos) {
|
||||
double min, max;
|
||||
parent.GetRange(out min, out max);
|
||||
double ratio = GetRatioFromPos(pos);
|
||||
double result = parent.GetValue(ratio, Time.deltaTime, min, max);
|
||||
if (result < min) result = min;
|
||||
else if (result > max) result = max;
|
||||
parent.RawValue = result;
|
||||
}
|
||||
return float.NegativeInfinity;
|
||||
}
|
||||
|
||||
void SetValueFromPos(Vector2 pos) {
|
||||
double min = double.NegativeInfinity, max = double.PositiveInfinity;
|
||||
void GetRange(out double min, out double max) {
|
||||
min = double.NegativeInfinity;
|
||||
max = double.PositiveInfinity;
|
||||
if (Range != null && Range.Length == 2) {
|
||||
min = (double)Range[0];
|
||||
max = (double)Range[1];
|
||||
}
|
||||
double ratio = GetRatioFromPos(pos);
|
||||
double result = GetValue(ratio, Time.deltaTime, min, max);
|
||||
if (result < min) result = min;
|
||||
else if (result > max) result = max;
|
||||
RawValue = result;
|
||||
}
|
||||
|
||||
protected void SetRatio(float ratio) {
|
||||
RectTransform handle = m_handle.rectTransform;
|
||||
handle.anchorMin = new Vector2(ratio, handle.anchorMin.y);
|
||||
handle.anchorMax = new Vector2(ratio, handle.anchorMax.y);
|
||||
handle.anchoredPosition = Vector2.zero;
|
||||
}
|
||||
|
||||
protected abstract double GetValue(double ratio, float deltaTime, double min, double max);
|
||||
|
||||
protected void SetRatio(float ratio) {
|
||||
m_handle.rectTransform.anchorMin = new Vector2(ratio, m_handle.rectTransform.anchorMin.y);
|
||||
m_handle.rectTransform.anchorMax = new Vector2(ratio, m_handle.rectTransform.anchorMax.y);
|
||||
m_handle.rectTransform.anchoredPosition = Vector2.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8577451538889190559}
|
||||
- {fileID: 2291627355068766130}
|
||||
- {fileID: 1877935619881050152}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -266,6 +266,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 94cb9dad5ac3eb04ca16d58a7bae0cb5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_slider: {fileID: 1071711914868990498}
|
||||
m_handleArea: {fileID: 224546415986473210}
|
||||
m_handle: {fileID: 114706336791114340}
|
||||
m_text: {fileID: 1622683950754073188}
|
||||
@@ -352,7 +353,6 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 2291627355068766130}
|
||||
- component: {fileID: 5861081162571998075}
|
||||
- component: {fileID: 7068599382446502617}
|
||||
- component: {fileID: 1622683950754073188}
|
||||
m_Layer: 5
|
||||
m_Name: InputText
|
||||
@@ -368,17 +368,17 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1516478028581408786}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
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:
|
||||
- {fileID: 8891570624646202547}
|
||||
m_Father: {fileID: 224653211064760656}
|
||||
m_Father: {fileID: 1877935619881050152}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.8, y: 0.2}
|
||||
m_AnchorMax: {x: 0.95, y: 0.8}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
@@ -390,36 +390,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1516478028581408786}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7068599382446502617
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1516478028581408786}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &1622683950754073188
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -427,7 +397,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1516478028581408786}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f332b1d4d7bb2d4a921f0787a93e5e3, type: 3}
|
||||
m_Name:
|
||||
@@ -439,7 +409,7 @@ MonoBehaviour:
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Transition: 0
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_HighlightedColor: {r: 1, g: 1, b: 1, a: 0.101960786}
|
||||
@@ -460,7 +430,7 @@ MonoBehaviour:
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 7068599382446502617}
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_TextViewport: {fileID: 2291627355068766130}
|
||||
m_TextComponent: {fileID: 8145219841909227652}
|
||||
m_Placeholder: {fileID: 0}
|
||||
@@ -739,6 +709,44 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_aspectRatio: 1.25
|
||||
m_isVertical: 0
|
||||
--- !u!1 &5130728753652414311
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1877935619881050152}
|
||||
m_Layer: 5
|
||||
m_Name: InputTextContainer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1877935619881050152
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5130728753652414311}
|
||||
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:
|
||||
- {fileID: 4951006577986707717}
|
||||
- {fileID: 2291627355068766130}
|
||||
m_Father: {fileID: 224653211064760656}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.8, y: 0.2}
|
||||
m_AnchorMax: {x: 0.95, y: 0.8}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &5558574064147534234
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1100,6 +1108,151 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_shader: {fileID: 0}
|
||||
--- !u!1 &7824964553950254161
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4951006577986707717}
|
||||
- component: {fileID: 1990259306577958325}
|
||||
- component: {fileID: 806632623498340722}
|
||||
- component: {fileID: 449712112310770823}
|
||||
m_Layer: 5
|
||||
m_Name: ActivateButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4951006577986707717
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824964553950254161}
|
||||
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: 1877935619881050152}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1990259306577958325
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824964553950254161}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &806632623498340722
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824964553950254161}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &449712112310770823
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824964553950254161}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_HighlightedColor: {r: 1, g: 1, b: 1, a: 0.101960786}
|
||||
m_PressedColor: {r: 1, g: 1, b: 1, a: 0.2}
|
||||
m_SelectedColor: {r: 1, g: 1, b: 1, a: 0.101960786}
|
||||
m_DisabledColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 806632623498340722}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 1622683950754073188}
|
||||
m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine
|
||||
m_MethodName: set_enabled
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1622683950754073188}
|
||||
m_TargetAssemblyTypeName: UnityEngine.UI.Selectable, UnityEngine.UI
|
||||
m_MethodName: Select
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
m_CallState: 2
|
||||
--- !u!1 &8402309688152667175
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1141,6 +1141,11 @@ namespace TMPro
|
||||
UpdateLabel();
|
||||
}
|
||||
|
||||
if (caretRectTrans)
|
||||
{
|
||||
caretRectTrans.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
// Subscribe to event fired when text object has been regenerated.
|
||||
TextEventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
|
||||
}
|
||||
@@ -1171,6 +1176,11 @@ namespace TMPro
|
||||
|
||||
m_Mesh = null;
|
||||
|
||||
if (caretRectTrans)
|
||||
{
|
||||
caretRectTrans.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
// Unsubscribe to event triggered when text object has been regenerated
|
||||
TextEventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user