demo functionality

This commit is contained in:
2016-10-11 05:00:51 +07:00
parent 4fff634d9c
commit f04ffd6d76
2 changed files with 31 additions and 2 deletions

View File

@@ -22,8 +22,16 @@ namespace FTEditor.Postprocessors {
{
var swf_paths = imported_assets
.Where(p => Path.GetExtension(p).ToLower().Equals(".swf"));
foreach ( var swf_path in swf_paths ) {
SwfFileProcess(swf_path);
if ( swf_paths.Any() && SwfEditorUtils.IsDemoEnded ) {
var title = "Demo version";
var message =
"This demo is for evaluation purpose only. " +
"It means that you can't have more than 5 animation assets in the project.";
EditorUtility.DisplayDialog(title, message, "Ok");
} else {
foreach ( var swf_path in swf_paths ) {
SwfFileProcess(swf_path);
}
}
}

View File

@@ -200,6 +200,27 @@ namespace FTEditor {
}
}
// ---------------------------------------------------------------------
//
// Demo
//
// ---------------------------------------------------------------------
#if FT_VERSION_DEMO
public static bool IsDemoEnded {
get {
var guids = AssetDatabase.FindAssets("t:SwfAsset");
return guids.Length >= 5;
}
}
#else
public static bool IsDemoEnded {
get {
return false;
}
}
#endif
// ---------------------------------------------------------------------
//
// Menu