Skip to content

Commit

Permalink
adding Modifier definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
sassembla committed Aug 20, 2016
1 parent 704215f commit 229d980
Show file tree
Hide file tree
Showing 25 changed files with 632 additions and 59 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,17 @@ obj/*
*.userprefs

Assets/EditorGUI Style Viewer*
Assets/EditorGUI Style Viewer/*
Assets/EditorGUI Style Viewer/*
Assets/SampleMat.mat

Assets/SampleMat.mat.meta

Assets/SampleRenderTex.renderTexture

Assets/SampleRenderTex.renderTexture.meta

Assets/sss.renderTexture

Assets/sss.renderTexture.meta

Assets/TestResourceAssets.meta
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class AssetBundleGraphSettings {
public const string BUNDLEBUILDER_CACHE_PLACE = APPLICATIONDATAPATH_CACHE_PATH + "BundleBuilt";

public const string IMPORTER_SETTINGS_PLACE = ASSETBUNDLEGRAPH_PATH + "SavedSettings/ImportSettings";
public const string MODIFIER_OPERATION_DATAS_PLACE = ASSETBUNDLEGRAPH_PATH + "SavedSettings/ModifierOperationDatas";
public const string MODIFIER_OPERATION_DATA_NANE = "modifierOperation.json";

public const string UNITY_METAFILE_EXTENSION = ".meta";
public const string UNITY_LOCAL_DATAPATH = "Assets";
Expand Down Expand Up @@ -77,6 +79,7 @@ node generation from GUI
{"Create " + MENU_LOADER_NAME + " Node", NodeKind.LOADER_GUI},
{"Create " + MENU_FILTER_NAME + " Node", NodeKind.FILTER_GUI},
{"Create " + MENU_IMPORTSETTING_NAME + " Node", NodeKind.IMPORTSETTING_GUI},
{"Create " + MENU_MODIFIER_NAME + " Node", NodeKind.MODIFIER_GUI},
{"Create " + MENU_GROUPING_NAME + " Node", NodeKind.GROUPING_GUI},
{"Create " + MENU_PREFABRICATOR_NAME + " Node", NodeKind.PREFABRICATOR_GUI},
{"Create " + MENU_BUNDLIZER_NAME + " Node", NodeKind.BUNDLIZER_GUI},
Expand All @@ -88,6 +91,7 @@ node generation from GUI
{NodeKind.LOADER_GUI, "Loader"},
{NodeKind.FILTER_GUI, "Filter"},
{NodeKind.IMPORTSETTING_GUI, "ImportSetting"},
{NodeKind.MODIFIER_GUI, "Modifier"},
{NodeKind.GROUPING_GUI, "Grouping"},
{NodeKind.PREFABRICATOR_GUI, "Prefabricator"},
{NodeKind.BUNDLIZER_GUI, "Bundlizer"},
Expand Down Expand Up @@ -120,6 +124,7 @@ node generation from GUI
public const string NODE_FILTER_CONTAINS_KEYWORDS = "filterContainsKeywords";
public const string NODE_FILTER_CONTAINS_KEYTYPES = "filterContainsKeytypes";
public const string NODE_IMPORTER_PACKAGES = "importerPackages";
public const string NODE_MODIFIER_PACKAGES = "modifierPackages";
public const string NODE_GROUPING_KEYWORD = "groupingKeyword";
public const string NODE_BUNDLIZER_BUNDLENAME_TEMPLATE = "bundleNameTemplate";
public const string NODE_BUNDLIZER_USE_OUTPUT = "bundleUseOutput";
Expand Down Expand Up @@ -162,6 +167,7 @@ public enum NodeKind : int {
LOADER_GUI,
FILTER_GUI,
IMPORTSETTING_GUI,
MODIFIER_GUI,

GROUPING_GUI,
PREFABRICATOR_GUI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace AssetBundleGraph {
public class FilterBase : INodeBase {
public void Setup (string nodeName, string nodeId, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Setup (string nodeName, string connectionIdToNextNode, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
foreach (var groupKey in groupedSources.Keys) {

var outputDict = new Dictionary<string, List<InternalAssetData>>();
Expand All @@ -25,7 +25,7 @@ public void Setup (string nodeName, string nodeId, string _, Dictionary<string,
}
outputDict[groupKey] = outputs;
Output(nodeId, label, outputDict, new List<string>());
Output(connectionIdToNextNode, label, outputDict, new List<string>());
};
try {
In(absoluteSourcePaths, _PreOutput);
Expand All @@ -35,7 +35,7 @@ public void Setup (string nodeName, string nodeId, string _, Dictionary<string,
}
}

public void Run (string nodeName, string nodeId, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Run (string nodeName, string connectionIdToNextNode, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
foreach (var groupKey in groupedSources.Keys) {
var outputDict = new Dictionary<string, List<InternalAssetData>>();

Expand All @@ -54,7 +54,7 @@ public void Run (string nodeName, string nodeId, string _, Dictionary<string, Li
}
outputDict[groupKey] = outputs;
Output(nodeId, label, outputDict, new List<string>());
Output(connectionIdToNextNode, label, outputDict, new List<string>());
};
try {
In(absoluteSourcePaths, _Output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ delete undetectable node.
case AssetBundleGraphSettings.NodeKind.LOADER_GUI:
case AssetBundleGraphSettings.NodeKind.FILTER_GUI:
case AssetBundleGraphSettings.NodeKind.IMPORTSETTING_GUI:
case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI:
case AssetBundleGraphSettings.NodeKind.GROUPING_GUI:
case AssetBundleGraphSettings.NodeKind.EXPORTER_GUI: {
// nothing to do.
Expand Down Expand Up @@ -560,6 +561,30 @@ public static EndpointNodeIdsAndNodeDatasAndConnectionDatas SerializeNodeRoute (
break;
}

case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
var modifierPackagesSource = nodeDict[AssetBundleGraphSettings.NODE_MODIFIER_PACKAGES] as Dictionary<string, object>;
var modifierPackages = new Dictionary<string, string>();

if (modifierPackagesSource == null) {

modifierPackagesSource = new Dictionary<string, object>();
}
foreach (var platform_package_key in modifierPackagesSource.Keys) {
modifierPackages[platform_package_key] = string.Empty;
}

nodeDatas.Add(
new NodeData(
nodeId:nodeId,
nodeKind:nodeKind,
nodeName:nodeName,
outputPointIds:outputPointIds,
modifierPackages:modifierPackages
)
);
break;
}

case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
var groupingKeywordSource = nodeDict[AssetBundleGraphSettings.NODE_GROUPING_KEYWORD] as Dictionary<string, object>;
var groupingKeyword = new Dictionary<string, string>();
Expand Down Expand Up @@ -935,6 +960,12 @@ also outputPoint which doesn't have connection should take assets by keyword and
executor.Run(nodeName, nodeId, firstConnectionIdFromThisNodeToChildNode, inputParentResults, alreadyCachedPaths, Output);
break;
}

case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
var executor = new IntegratedGUIModifier();
executor.Run(nodeName, nodeId, firstConnectionIdFromThisNodeToChildNode, inputParentResults, alreadyCachedPaths, Output);
break;
}

case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
var executor = new IntegratedGUIGrouping(GetCurrentPlatformPackageOrDefaultFromDict(nodeKind, currentNodeData.groupingKeyword));
Expand Down Expand Up @@ -1082,6 +1113,12 @@ also outputPoint which doesn't have connection should take assets by keyword and
executor.Setup(nodeName, nodeId, firstConnectionIdFromThisNodeToChildNode, inputParentResults, alreadyCachedPaths, Output);
break;
}

case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
var executor = new IntegratedGUIModifier();
executor.Setup(nodeName, nodeId, firstConnectionIdFromThisNodeToChildNode, inputParentResults, alreadyCachedPaths, Output);
break;
}

case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
var executor = new IntegratedGUIGrouping(GetCurrentPlatformPackageOrDefaultFromDict(nodeKind, currentNodeData.groupingKeyword));
Expand Down Expand Up @@ -1220,6 +1257,7 @@ private static void AssertNodeOrder (AssetBundleGraphSettings.NodeKind fromKind,
}
}
}


public static string WithProjectPath (string pathUnderProjectFolder) {
var assetPath = Application.dataPath;
Expand All @@ -1245,7 +1283,11 @@ public static List<string> GetCachedDataByNodeKind (AssetBundleGraphSettings.Nod

switch (nodeKind) {
case AssetBundleGraphSettings.NodeKind.IMPORTSETTING_GUI: {
// no cache exists without file itself.
// no cache file exists for importSetting.
return new List<string>();
}
case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
// no cache file exists for modifier.
return new List<string>();
}

Expand Down Expand Up @@ -1443,6 +1485,8 @@ public class NodeData {

// for Importer GUI data
public readonly Dictionary<string, string> importerPackages;

// for Modifier GUI data
public readonly Dictionary<string, string> modifierPackages;

// for Grouping GUI data
Expand Down Expand Up @@ -1504,8 +1548,6 @@ public NodeData (
}

case AssetBundleGraphSettings.NodeKind.FILTER_SCRIPT:
// case AssetGraphSettings.NodeKind.IMPORTER_SCRIPT:

case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_SCRIPT:
case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_GUI: {
this.scriptClassName = scriptClassName;
Expand All @@ -1522,6 +1564,11 @@ public NodeData (
this.importerPackages = importerPackages;
break;
}

case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: {
this.modifierPackages = modifierPackages;
break;
}

case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: {
this.groupingKeyword = groupingKeyword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public interface INodeBase {
/**
fire when setup.
*/
void Setup (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output);
void Setup (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output);

/**
fire when build.
*/
void Run (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output);
void Run (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ public IntegratedGUIBundleBuilder (List<string> bundleOptions, List<string> rela
// this.relatedNodeIds = relatedNodeIds;
}

public void Setup (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Setup (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
/*
forcely merge to group ["0"].
these are came from bundlizer.
merge multi group into ["0"] group.
*/
var outputDict = new Dictionary<string, List<InternalAssetData>>();
outputDict["0"] = new List<InternalAssetData>();
Expand All @@ -29,13 +28,12 @@ these are came from bundlizer.
outputDict["0"].AddRange(outputSources);
}

Output(nodeId, labelToNext, outputDict, new List<string>());
Output(connectionIdToNextNode, labelToNext, outputDict, new List<string>());
}

public void Run (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
// RemoveOtherPlatformAndPackageBundleSettings(relatedNodeIds, package);
public void Run (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {

var recommendedBundleOutputDirSource = FileController.PathCombine(AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE, nodeId);
var recommendedBundleOutputDirSource = FileController.PathCombine(AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE, connectionIdToNextNode);
var recommendedBundleOutputDir = FileController.PathCombine(recommendedBundleOutputDirSource, GraphStackController.GetCurrentPlatformPackageFolder());
if (!Directory.Exists(recommendedBundleOutputDir)) Directory.CreateDirectory(recommendedBundleOutputDir);

Expand Down Expand Up @@ -159,7 +157,7 @@ check assumed bundlized resources and actual generated assetbundles.
outputDict["0"] = outputSources;

var usedCache = new List<string>(alreadyCached);
Output(nodeId, labelToNext, outputDict, usedCache);
Output(connectionIdToNextNode, labelToNext, outputDict, usedCache);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public IntegratedGUIBundlizer (string bundleNameTemplate, string assetsConnectio
this.resourcesOutputConnectionId = resourcesConnectionId;
}

public void Setup (string nodeName, string nodeId, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Setup (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {

try {
ValidateBundleNameTemplate(
Expand Down Expand Up @@ -64,7 +64,7 @@ public void Setup (string nodeName, string nodeId, string _, Dictionary<string,
}
}

public void Run (string nodeName, string nodeId, string _, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Run (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
ValidateBundleNameTemplate(
bundleNameTemplate,
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public IntegratedGUIExporter (string exportFilePath) {
this.exportFilePath = exportFilePath;
}

public void Setup (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Setup (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {

try {
ValidateExportPath(
Expand All @@ -31,10 +31,10 @@ public void Setup (string nodeName, string nodeId, string labelToNext, Dictionar
return;
}

Export(nodeName, nodeId, labelToNext, groupedSources, Output, false);
Export(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output, false);
}

public void Run (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
ValidateExportPath(
exportFilePath,
exportFilePath,
Expand All @@ -46,7 +46,7 @@ public void Run (string nodeName, string nodeId, string labelToNext, Dictionary<
}
);

Export(nodeName, nodeId, labelToNext, groupedSources, Output, true);
Export(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output, true);
}

private void Export (string nodeName, string nodeId, string labelToNext, Dictionary<string, List<InternalAssetData>> groupedSources, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output, bool isRun) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public IntegratedGUIFilter (string[] connectionIdsFromThisNodeToChildNodes, List
this.containsKeytypes = containsKeytypes;
}

public void Setup (string nodeName, string nodeId, string noUseLabel, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Setup (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
// overlapping test.
try {
var overlappingCheckList = new List<string>();
Expand Down Expand Up @@ -60,7 +60,7 @@ public void Setup (string nodeName, string nodeId, string noUseLabel, Dictionary
}
}

public void Run (string nodeName, string nodeId, string noUseLabel, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
public void Run (string nodeName, string nodeId, string nused_connectionIdToNextNode, Dictionary<string, List<InternalAssetData>> groupedSources, List<string> alreadyCached, Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Output) {
// overlapping test.
{
var overlappingCheckList = new List<string>();
Expand Down
Loading

0 comments on commit 229d980

Please sign in to comment.