Пример #1
0
 public static void CreateScript(string filepath, string @namespace, string[] types, Predicate <Type> isReferenceType)
 {
     using (var writer = new StreamWriter(filepath))
     {
         writer.WriteLine(NamespaceBegin(@namespace));
         foreach (var type in _VALUE_TYPES.Value)
         {
             if (types.Contains(type.FullName))
             {
                 writer.CreateReaderVariants(type, isReferenceType);
                 writer.CreateWriterVariants(type, isReferenceType);
                 writer.CreateReaderAndWriterVariants(type, isReferenceType);
                 writer.CreateSerializedReaderAndWriterVariant(type);
             }
         }
         writer.WriteLine(NamespaceEnd());
     }
     AssetDatabase.Refresh();
 }