public void GetConfig() { if (_config == null) { _config = AssetDatabase.LoadAssetAtPath(configPath, typeof(SpineXiimoonConfig)) as SpineXiimoonConfig; if (_config == null) { _config = SkeletonDataAsset.CreateInstance <SpineXiimoonConfig>(); AssetDatabase.CreateAsset(_config, configPath); AssetDatabase.SaveAssets(); } } }
public static void Split() { UnityEngine.Object _activeObject = Selection.activeObject; if (_activeObject.GetType() == typeof(SkeletonDataAsset)) { string _path = AssetDatabase.GetAssetPath(_activeObject); SpineXiimoonConfig _config = AssetDatabase.LoadAssetAtPath(configPath, typeof(SpineXiimoonConfig)) as SpineXiimoonConfig; if (_config == null) { return; } string exportPath = GetAnimationExportPath(_path, _config); if (string.IsNullOrEmpty(exportPath)) { return; } _config = null; SplitAnimationTool.DoSplit(_path, exportPath, 0); } }
static string GetAnimationExportPath(string assetPath, SpineXiimoonConfig config) { var resolver = "";//new Ngame.ABSystem.AssetBundlePathResolver();wumiao for (int i = 0; i < config.dopaths.Count; i++) { if (assetPath.Contains(config.dopaths[i])) { string _result = assetPath.Replace(config.dopaths[i], GetPathExportPath(config.dopaths[i])); _splitIndex = _result.LastIndexOf("/"); _result = _result.Substring(0, _splitIndex); // get the bundle path // add by adam //Debug.Assert(_result.StartsWith(resolver.ABResPlayGroundAssetPath)); wumiao //_result = _result.Substring(resolver.ABResPlayGroundAssetPath.Length + 1); wumiao return(_result); } } return(string.Empty); }