Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TMP 1.2.2 on Unity 2018.1f1 error

Discussion in 'UGUI & TextMesh Pro' started by PNordlund, May 2, 2018.

  1. PNordlund

    PNordlund

    Joined:
    Nov 20, 2013
    Posts:
    48
    I installed the package and got all my non-editor scripts to compile correctly, but my editor scripts are throwing an error:

    The type or namespace name `TextAlignmentOptions' does not exist in the namespace `TMPro'. Are you missing an assembly reference?

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEditor;
    5. using UnityEngine.UI;
    6. using TMPro;
    7.  
    8. [CustomEditor(typeof(PLRText))]
    9. public class PLRTextEditor : Editor
    10. {
    11.     PLRText.VisualTemplate previousTemplate;    
    12.     string previousLabel;
    13.     TMPro.TextAlignmentOptions previousAlignment;
    14.     TMPro.TextOverflowModes previousOverflow;
    I'm also getting the same error from TextOverflowModes. I have added the "Unity.TextMeshPro" to my editor scripts assembly definition file.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Adding the reference to "Unity.TextMeshPro" manually to your asmdef should have worked.

    I would suggest testing if you are able to reference these without using an asmdef on your end.
     
  3. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    "Adding the reference to "Unity.TextMeshPro" manually to your asmdef should have worked."

    How do you do this? I couldn't find Unity.TextMeshPro in the selection.

    Edit: Got it. Click Open to open the json file in text editor and add "Unity.TextMeshPro" manually.
     
    Last edited: May 6, 2018