private async System.Threading.Tasks.Task UpdateParentMaterial(string materialAbsFile, bool resetTechnique) { var materialInfoAbsFile = materialAbsFile + EditorCommon.Program.ResourceInfoExt; if (mResourceInfoProcessers == null) { return; } foreach (var processer in mResourceInfoProcessers) { try { if (processer.ResourceInfoTypeStr == EngineNS.Editor.Editor_RNameTypeAttribute.Material) { this.Dispatcher.Invoke(() => { mCurrentMaterialInfo = System.Activator.CreateInstance(processer.ResourceInfoType) as EditorCommon.Resources.ResourceInfo; }); } } catch (System.Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } } // 材质不存在则使用默认材质 if (string.IsNullOrEmpty(materialAbsFile) || !System.IO.File.Exists(materialInfoAbsFile)) { materialInfoAbsFile = EngineNS.CEngine.Instance.MaterialManager.DefaultMaterial.Name.Address; } await mCurrentMaterialInfo.AsyncLoad(materialInfoAbsFile); MaterialNameTextBlock.Text = mCurrentMaterialInfo.ResourceName.PureName(); }
public static void SetSelectedResourceInfo(string key, EditorCommon.Resources.ResourceInfo resInfo) { SelectedResourceInfoDic[key] = resInfo; }
public static EditorCommon.Resources.ResourceInfo GetSelectedResourceInfo(string key) { EditorCommon.Resources.ResourceInfo resInfo = null; SelectedResourceInfoDic.TryGetValue(key, out resInfo); return(resInfo); }