예제 #1
0
    private static void GenerateJsTypeInfoConfig()
    {
        string filePath = JSPathSettings.JsTypeInfoConfig;

        File.WriteAllText(filePath, JsonMapper.ToJson(JsTypeNameSet.ToArray()));
        Debug.Log(string.Format("JsTypeInfoConfig:{0}\nOK. File: {1}", JsTypeNameSet.Count, filePath));
    }
예제 #2
0
    /// <summary>
    /// Wills the type be translated to javascript.
    /// </summary>
    /// <param name="type">The type.</param>
    /// <returns></returns>
    public static bool WillTypeBeTranslatedToJavaScript(Type type)
    {
        if (type.IsDefined(typeof(JsTypeAttribute), false))
        {
            return(true);
        }

        if (JsTypeNameSet.Contains(type.FullName))
        {
            return(true);
        }

        return(false);
    }