void LoadAsset() { string path = EditorUtility.OpenFilePanel("Overwrite with png", "Assets", extension); path = path.Replace(Application.dataPath, "Assets"); if (string.IsNullOrEmpty(path)) { return; } var result = AssetDatabase.LoadAssetAtPath <ViewElementOverrideAsset>(path); var data = new ViewElementOverride(); foreach (var item in result.viewElementOverride) { data.Add(item); } fieldInfo.SetValue(propertySource.serializedObject.targetObject, data); Refrersh(); }
void PickCurrent() { var overrideChecker = ScriptableObject.CreateInstance <ViewElementOverridesImporterWindow>(); var result = overrideChecker.SetData(viewElement.transform, original.transform, (import) => { var data = new ViewElementOverride(); foreach (var item in import) { data.Add(item); } fieldInfo.SetValue(propertySource.serializedObject.targetObject, data); Refrersh(); }, null); if (result) { overrideChecker.ShowUtility(); } }
public void ApplyOverrides(ViewElementOverride overrideDatas) { ApplyOverrides(overrideDatas.GetValues()); }