예제 #1
0
        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();
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
 public void ApplyOverrides(ViewElementOverride overrideDatas)
 {
     ApplyOverrides(overrideDatas.GetValues());
 }