docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Message

    A message is a piece of text that can be broken down into multiple sub fragments. A fragment can be writable or read only. A read only fragment indicates that the sub string should be preserved and not modified by ant pseudo methods.

    Inheritance
    object
    Message
    Namespace: UnityEngine.Localization.Pseudo
    Assembly: Unity.Localization.dll
    Syntax
    public class Message

    Properties

    Name Description
    Fragments

    A message is comprised of writable and readonly fragments. Readonly fragments are those that should be preserved such as xml/rich text tags.

    Length

    Total length of the Message including all Fragments.

    Original

    The original text before it was broken into fragments.

    Methods

    Name Description
    CreateReadonlyTextFragment(string)

    Creates a ReadOnlyMessageFragment which represents string that should be preserved and not modified by any other pseudo methods. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment or allow the Message to handle returning the fragment if it is part of Fragments.

    CreateReadonlyTextFragment(string, int, int)

    Creates a ReadOnlyMessageFragment which represents a sub string of the original that should be preserved and not modified by any other pseudo methods. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment or allow the Message to handle returning the fragment if it is part of Fragments.

    CreateTextFragment(string)

    Creates a new WritableMessageFragment which represents a string. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment or allow the Message to handle returning the fragment if it is part of Fragments.

    CreateTextFragment(string, int, int)

    Creates a new WritableMessageFragment which represents a sub string of the original. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment.

    ReleaseFragment(MessageFragment)

    Returns a Fragment back to its ObjectPool so it can be used again.

    ReplaceFragment(MessageFragment, MessageFragment)

    Replaces the Fragments in Fragments and returns the previous fragment back to the ObjectPool so it can be reused.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)