IEnumerator _ColorLine() { var textInfo = fieldInput.textComponent.textInfo; fieldInput.textComponent.ForceMeshUpdate(); Color32[] newVertexColors; Color32 c0 = fieldInput.textComponent.color; fieldInput.textComponent.renderMode = TextRenderFlags.DontRender; yield return(new WaitForSeconds(0.1f)); while (true) { var characterCount = textInfo.characterCount; if (characterCount == 0) { yield return(new WaitForSeconds(0.25f)); continue; } for (var i = 0; i < characterCount; i++) { if (!textInfo.characterInfo[i].isVisible) { continue; } var materialIndex = textInfo.characterInfo[i].materialReferenceIndex; newVertexColors = textInfo.meshInfo[materialIndex].colors32; var vertexIndex = textInfo.characterInfo[i].vertexIndex; if (i >= size.x && i <= size.y) { c0 = new Color32(0, 205, 100, 255); } else { c0 = new Color32(255, 255, 255, 255); } newVertexColors[vertexIndex + 0] = c0; newVertexColors[vertexIndex + 1] = c0; newVertexColors[vertexIndex + 2] = c0; newVertexColors[vertexIndex + 3] = c0; } fieldInput.textComponent.UpdateVertexData(); if (LayerKernel.IsQuittingOrChangingScene()) { yield break; } yield return(new WaitForSeconds(UnityEngine.Time.deltaTime)); } }
void OnDisable() { if (LayerKernel.IsQuittingOrChangingScene()) { return; } fieldInput.text = string.Empty; fieldInput.onSubmit.RemoveListener(AddToConsole); fieldInput.onValueChanged.RemoveListener(ChangeText); if (EventSystem.current != null) { EventSystem.current.SetSelectedGameObject(null); } }
void OnDisable() { if (LayerKernel.IsQuittingOrChangingScene()) { return; } if (target != null) { foreach (var c in cacheFolds) { EditorPrefs.SetBool(string.Format($"{c.Value.atr.name}{c.Value.props[0].name}{target.name}"), c.Value.expanded); c.Value.Dispose(); } } }