Exemplo n.º 1
0
    public void Deserialize(NetworkManager networkManager, ElementDataBase elementData, UIBehaviour element)
    {
        TextMeshProData textData    = elementData as TextMeshProData;
        TextMeshProUGUI textElement = element as TextMeshProUGUI;

        if (textElement)
        {
            textElement.text      = textData.text;
            textElement.fontSize  = textData.fontSize;
            textElement.color     = textData.colorData.Deserialize();
            textElement.alignment = textData.alignment;
        }
    }
Exemplo n.º 2
0
    public ElementDataBase Serialize(UIBehaviour element)
    {
        TextMeshProData textData    = new TextMeshProData();
        TextMeshProUGUI textElement = element as TextMeshProUGUI;

        if (textElement)
        {
            textData.text      = textElement.text;
            textData.fontSize  = textElement.fontSize;
            textData.fontName  = textElement.font.name;
            textData.colorData = textElement.color.Serialize();
            textData.alignment = textElement.alignment;
        }
        return(textData);
    }