Class UnityHtmlContentFetcher
Fetches launcher news HTML and extracts the configured content fragment from it.
public class UnityHtmlContentFetcher : MonoBehaviour, IHtmlContentFetcher
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUnityHtmlContentFetcher
- Implements
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Fetching and formatting are separate concerns: this component produces a parsed node and the active ILauncherView renders it. Formatting used to live here, back when TextMeshPro rich text was the only output format.
Properties
HtmlPxToTmpSizeFactor
Approximate conversion factor from HTML pixels to TextMeshPro font size.
public float HtmlPxToTmpSizeFactor { get; }
Property Value
MaxRetries
Maximum number of retries for each web request.
public int MaxRetries { get; }
Property Value
RetryDelay
Delay in seconds between retries for web requests.
public float RetryDelay { get; }
Property Value
WebRequestService
Service for handling Unity web requests.
public UnityWebRequestService WebRequestService { get; }
Property Value
WebRequestTimeout
Timeout in seconds for each individual web request.
public int WebRequestTimeout { get; }
Property Value
Methods
FetchAndExtract(string, string, Action<HtmlNode>, Action<string>)
Fetches HTML from a URL and extracts the element identified by divClass.
public IEnumerator FetchAndExtract(string url, string divClass, Action<HtmlNode> onContentReady, Action<string> onError)
Parameters
urlstringThe URL to fetch HTML from.
divClassstringThe class name of the div to extract.
onContentReadyAction<HtmlNode>Callback for successful extraction.
onErrorAction<string>Callback for error handling.
Returns
- IEnumerator
Coroutine enumerator.