public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { var referencesGUIDs = new List <string>(); var extension = Path.GetExtension(path); // processing Shader Graph dependencies if (extension.Equals(".shadergraph", StringComparison.InvariantCultureIgnoreCase)) { var dependencies = CSAssetTools.GetAssetImporterDependencies(path); if (dependencies != null) { referencesGUIDs.AddRange(CSAssetTools.GetAssetsGUIDs(dependencies)); } } else if (extension.Equals(".shadersubgraph", StringComparison.InvariantCultureIgnoreCase)) { var dependencies = CSAssetTools.GetAssetImporterDependencies(path); if (dependencies != null) { referencesGUIDs.AddRange(CSAssetTools.GetAssetsGUIDs(dependencies)); } } // processing usual Shader dependencies else { // below is an another workaround for dependenciesGUIDs not include #include-ed files, like *.cginc referencesGUIDs.AddRange(ScanFileForIncludes(path)); } return(referencesGUIDs); }
public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { if (kind != AssetKind.Regular) { return(null); } return(GetAssetsReferencedFromAssemblyDefinitionReference(path)); }
public void Update(AssetKind kind) { switch (kind) { case AssetKind.DataCenter: UpdateDataCenters(); break; } }
private static string AssetsPath(AssetKind k) { switch(k) { case AssetKind.Image: return Path.DirectorySeparatorChar + "img"; case AssetKind.Layout: return Path.DirectorySeparatorChar + "layout"; case AssetKind.Print: return Path.DirectorySeparatorChar + "print"; case AssetKind.JavaScript: return Path.DirectorySeparatorChar + "js"; case AssetKind.Any: default: return ""; } }
public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { if (path.EndsWith(".cginc")) { // below is an another workaround for dependenciesGUIDs not include #include-ed files, like *.cginc return(ShaderParser.ScanFileForIncludes(path)); } return(null); }
public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { // checking by name since addressables are in optional external package if (type == null || type.Name != "AddressableAssetGroup") { return(null); } var assetGroup = AssetDatabase.LoadMainAssetAtPath(path); return(assetGroup == null ? null : ExtractReferencedAssets(assetGroup)); }
private AssetQuery AssetQueryFor(string name, AssetKind assetKind) { switch (assetKind) { case AssetKind.User: return(new UserQuery(name, _authorizationStructure)); case AssetKind.OrganizationalUnit: return(new OrganizationalUnitQuery(name, _authorizationStructure)); case AssetKind.Hardware: return(new HardwareQuery(name, _authorizationStructure)); default: throw new ArgumentOutOfRangeException(); } }
public void OnSubmit(List <string> passedValue = null, string reference = null) { TableUtility tableUtility = new TableUtility(); switch (reference) { case "asset_kind": tableUtility.CreateTable(AssetKind.GetDefaultValue()); AssetKind newAssetKind = new AssetKind(passedValue[0]); tableUtility.InsertTableRow(newAssetKind); FormUtility.GetBindingSource(dataGridView).Add(newAssetKind); break; case "asset_kind_edit": selectedAssetKind.Description = passedValue[0]; tableUtility.MergeTableRow(selectedAssetKind); break; } }
public static string NicifyAssetPath(string path, AssetKind kind, bool trimExtension = false) { var nicePath = path; switch (kind) { case AssetKind.Regular: if (path.Length <= 7) { return(path); } nicePath = nicePath.Remove(0, 7); break; case AssetKind.Settings: break; case AssetKind.FromPackage: break; case AssetKind.Unsupported: break; default: throw new ArgumentOutOfRangeException("kind", kind, null); } if (trimExtension) { var lastSlash = nicePath.LastIndexOf('/'); var lastDot = nicePath.LastIndexOf('.'); // making sure we'll not trim path like Test/My.Test/linux_file if (lastDot > lastSlash) { nicePath = nicePath.Remove(lastDot, nicePath.Length - lastDot); } } return(nicePath); }
private void InitializeCustomComponents() { ruleName = FormUtility.CreateTextBox(20, 5); addNewAssetKind = FormUtility.CreateButton("Neue Titelart hinzufügen", 20, 65); addNewAssetKind.Click += (sender, e) => new OneAttributeForm(this, "Titelart", "asset_kind").Visible = true; dataGridView = FormUtility.CreateDataGridView(typeof(AssetKind), 20, 210, 400, 1050); ToolStripMenuItem contextMenuItemDelete = FormUtility.CreateContextMenuItem("Löschen", (sender, e) => { TableUtility tableUtility = new TableUtility(); tableUtility.DeleteTableRow(GetSelectedAssetKind()); dataGridView.Rows.Remove(dataGridView.SelectedRows[0]); }); ToolStripMenuItem contextMenuItemEdit = FormUtility.CreateContextMenuItem("Bearbeiten", (sender, e) => { selectedAssetKind = GetSelectedAssetKind(); _ = new OneAttributeForm(this, "Titelart", "asset_kind_edit", selectedAssetKind.Description) { Visible = true }; }); FormUtility.AddContextMenu(dataGridView, contextMenuItemEdit, contextMenuItemDelete); FormUtility.AddControlsToForm(this, dataGridView, addNewAssetKind, ruleName); }
public static List <AssetInfo> GetAssetInfosWithKind(List <AssetInfo> assets, AssetKind kind) { var result = new List <AssetInfo>(); foreach (var asset in assets) { if (asset.Kind == kind) { result.Add(asset); } } return(result); }
public AssetType(string name, string shortName, AssetKind kind) { Name = name; ShortName = shortName; Kind = kind; }
//file system support public static string GetDefaultAssetsPath(AssetKind kind, Type t = null) { return GetDefaultAssetsPath() + AssetsPath(kind) + (t != null ? (Path.DirectorySeparatorChar + t.Namespace) : ""); }
internal static string[] FindDependencies(AssetSettingsKind settingsKind, Type type, AssetKind kind, string path) { var dependenciesGUIDs = new HashSet <string>(); if (settingsKind == AssetSettingsKind.NotSettings) { /* pre-regular dependenciesGUIDs additions */ FillDependencies(InternalDependenciesParsers, ref dependenciesGUIDs, kind, type, path); /* regular dependenciesGUIDs additions */ var dependencies = AssetDatabase.GetDependencies(path, false); var guids = CSAssetTools.GetAssetsGUIDs(dependencies); if (guids != null && guids.Length > 0) { dependenciesGUIDs.UnionWith(guids); } } else { FillSettingsAssetDependencies(ref dependenciesGUIDs, path, settingsKind); } if (externalDependenciesParsers != null && externalDependenciesParsers.Count > 0) { FillDependencies(externalDependenciesParsers, ref dependenciesGUIDs, kind, type, path); } // kept for debugging purposes /*if (Path.Contains("1.unity")) * { * Debug.Log("1.unity non-recursive dependenciesGUIDs:"); * foreach (var reference in references) * { * Debug.Log(reference); * } * }*/ return(dependenciesGUIDs.ToArray()); }
private static void FillDependencies(List <IDependenciesParser> dependenciesParsers, ref HashSet <string> dependenciesGUIDs, AssetKind kind, Type type, string path) { foreach (var parser in dependenciesParsers) { if (parser.Type != null && parser.Type != type) { continue; } var foundDependencies = parser.GetDependenciesGUIDs(kind, type, path); if (foundDependencies == null || foundDependencies.Count == 0) { continue; } dependenciesGUIDs.UnionWith(foundDependencies); } }
public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { // below is an another workaround for dependenciesGUIDs not include #include-ed files, like *.cginc return(ScanFileForIncludes(path)); }
/// <summary> /// AAS 조회(by IsMonitoring) /// </summary> /// <param name="assetKind"></param> /// <returns></returns> public async Task <IResult <IElementContainer <IAssetAdministrationShell> > > GetAssetAdministrationShellsByMonitorAsync(AssetKind assetKind, bool isMonitoring) { var request = this.CreateRequest(GetUri(DISCOVERY, "GetAssetAdministrationShellsByMonitor", assetKind.ToString(), isMonitoring.ToString()), HttpMethod.Get); var response = await SendRequestAsync(request); return(await EvaluateResponseAsync <ElementContainer <IAssetAdministrationShell> >(response, response.Entity)); }
public List <string> GetDependenciesGUIDs(AssetKind kind, Type type, string path) { return(GetAssetsGUIDsInFoldersReferencedFromSpriteAtlas(path)); }