-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathAddContentLayoutLoadableObject.cs
More file actions
44 lines (38 loc) · 1.66 KB
/
Copy pathAddContentLayoutLoadableObject.cs
File metadata and controls
44 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Collections.Generic;
using Microsoft.Data.Sqlite;
namespace UnityDataTools.Analyzer.SQLite.Commands.ContentLayout
{
internal class AddContentLayoutLoadableObject : AbstractCommand
{
// Version 2 layouts (Unity 6.6) record the source asset path and source lfid of each
// loadable; newer versions do not. The table is created with those columns only when a
// v2 layout is imported, so v3 databases are not cluttered with always-NULL columns.
// Set before CreateCommand, which reads DDLSource and Fields.
public bool V2Columns { get; set; }
protected override string TableName => "content_layout_loadable_objects";
protected override string DDLSource => V2Columns
? Properties.Resources.ContentLayoutLoadableObjectsV2
: Properties.Resources.ContentLayoutLoadableObjects;
protected override Dictionary<string, SqliteType> Fields
{
get
{
var fields = new Dictionary<string, SqliteType>
{
{ "loadable_index", SqliteType.Integer },
{ "guid", SqliteType.Text },
{ "lfid", SqliteType.Integer },
{ "identifier_type", SqliteType.Integer },
{ "serialized_file_index", SqliteType.Integer },
{ "is_root_asset", SqliteType.Integer }
};
if (V2Columns)
{
fields.Add("asset_path", SqliteType.Text);
fields.Add("source_lfid", SqliteType.Integer);
}
return fields;
}
}
}
}