UnityEngine.TextGenerator.PopulateWithErrors C# (CSharp) Method

PopulateWithErrors() public method

Will generate the vertices and other data for the given string with the given settings.

public PopulateWithErrors ( string str, TextGenerationSettings settings, GameObject context ) : bool
str string String to generate.
settings TextGenerationSettings Generation settings.
context GameObject The object used as context of the error log message, if necessary.
return bool
        public bool PopulateWithErrors(string str, TextGenerationSettings settings, GameObject context)
        {
            TextGenerationError error = this.PopulateWithError(str, settings);
            if (error == TextGenerationError.None)
            {
                return true;
            }
            if ((error & TextGenerationError.CustomSizeOnNonDynamicFont) != TextGenerationError.None)
            {
                object[] args = new object[] { settings.font };
                Debug.LogErrorFormat(context, "Font '{0}' is not dynamic, which is required to override its size", args);
            }
            if ((error & TextGenerationError.CustomStyleOnNonDynamicFont) != TextGenerationError.None)
            {
                object[] objArray2 = new object[] { settings.font };
                Debug.LogErrorFormat(context, "Font '{0}' is not dynamic, which is required to override its style", objArray2);
            }
            return false;
        }

Usage Example

コード例 #1
0
 static int PopulateWithErrors(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         UnityEngine.TextGenerator obj = (UnityEngine.TextGenerator)ToLua.CheckObject(L, 1, typeof(UnityEngine.TextGenerator));
         string arg0 = ToLua.CheckString(L, 2);
         UnityEngine.TextGenerationSettings arg1 = (UnityEngine.TextGenerationSettings)ToLua.CheckObject(L, 3, typeof(UnityEngine.TextGenerationSettings));
         UnityEngine.GameObject             arg2 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 4, typeof(UnityEngine.GameObject));
         bool o = obj.PopulateWithErrors(arg0, arg1, arg2);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }