Update
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
Starting from version 5.x, the examples are available at the following link:
|
||||
https://www.figma.com/design/QRYCs4gMgj7f6KCWegNs9B/Figma-Converter-for-Unity---Example-templates
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e8d630cfaa4a2349b0ec9ac0d4d8b56
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cca0baffbcd595b4aa5be04e99f2a8c8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abd0c88ce723f714eaa76f1a8e73c78d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c236302a021efc4995b64b893b1317a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,90 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ImageLinearMaterial
|
||||
m_Shader: {fileID: 4800000, guid: 3cb4c812684fb1b47846ef823ee026f3, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _ColorMask: 15
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41bc1ce8da9e87a4fa340d902394e0df
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48911abe3bd370642831b302f021d9c5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
{0}
|
||||
|
||||
namespace {1}
|
||||
{{
|
||||
public class {2} : {3}
|
||||
{{
|
||||
{4}
|
||||
}}
|
||||
}}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e32de32e14b50747995a6f5a08bb9ae
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,256 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 471efbc970a337c4c83b1330ba757435, type: 3}
|
||||
m_Name: FcuConfig
|
||||
m_EditorClassIdentifier:
|
||||
productVersion: 5.2.3
|
||||
localizator:
|
||||
locFile: {fileID: 4900000, guid: 76e267d64912f5c44a25b64a5d86254b, type: 3}
|
||||
tags:
|
||||
- label: None
|
||||
fcuTag: 0
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 0
|
||||
- label: Page
|
||||
fcuTag: 3
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 0
|
||||
- label: Frame
|
||||
fcuTag: 2
|
||||
figmaTag: frame
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 0
|
||||
- label: Container
|
||||
fcuTag: 1
|
||||
figmaTag: cont
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: Image
|
||||
fcuTag: 201
|
||||
figmaTag: img
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 1
|
||||
- label: Background
|
||||
fcuTag: 203
|
||||
figmaTag: bg
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 1
|
||||
- label: Vector
|
||||
fcuTag: 202
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: Text
|
||||
fcuTag: 200
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: Placeholder
|
||||
fcuTag: 302
|
||||
figmaTag: ph
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: AutoLayoutGroup
|
||||
fcuTag: 100
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: ContentSizeFitter
|
||||
fcuTag: 101
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: AspectRatioFitter
|
||||
fcuTag: 102
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 1
|
||||
- label: BtnDefault
|
||||
fcuTag: 400
|
||||
figmaTag: def
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: BtnHover
|
||||
fcuTag: 401
|
||||
figmaTag: hov
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: BtnPressed
|
||||
fcuTag: 402
|
||||
figmaTag: pres
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: BtnSelected
|
||||
fcuTag: 403
|
||||
figmaTag: sel
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: BtnDisabled
|
||||
fcuTag: 404
|
||||
figmaTag: dis
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: BtnLooped
|
||||
fcuTag: 405
|
||||
figmaTag: lp
|
||||
customButtonTag: 1
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 0
|
||||
- label: Button
|
||||
fcuTag: 300
|
||||
figmaTag: btn
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: InputField
|
||||
fcuTag: 301
|
||||
figmaTag: fld
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: PasswordField
|
||||
fcuTag: 304
|
||||
figmaTag: pwd
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: ScrollView
|
||||
fcuTag: 303
|
||||
figmaTag: scroll
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: Toggle
|
||||
fcuTag: 305
|
||||
figmaTag: tg
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: ToggleGroup
|
||||
fcuTag: 306
|
||||
figmaTag: tgr
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 0
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: Shadow
|
||||
fcuTag: 500
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: CanvasGroup
|
||||
fcuTag: 501
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 1
|
||||
- label: Mask
|
||||
fcuTag: 502
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 1
|
||||
hasComponent: 1
|
||||
- label: Blur
|
||||
fcuTag: 503
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 1
|
||||
- label: Ignore
|
||||
fcuTag: 600
|
||||
figmaTag: ignore
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 0
|
||||
- label: 9-slice
|
||||
fcuTag: 204
|
||||
figmaTag:
|
||||
customButtonTag: 0
|
||||
canBeDownloaded: 1
|
||||
canBeInsideSingleImage: 0
|
||||
hasComponent: 0
|
||||
webLogFileName: response.json
|
||||
dateTimeFormat1: HH-mm-ss-fff
|
||||
dateTimeFormat2: HH-mm-ss
|
||||
dateTimeFormat3: yyyy-MM-dd--HH-mm-ss
|
||||
canvasGameObjectName: Canvas {0}
|
||||
i2LocGameObjectName: Language Source
|
||||
recentProjectsLimit: 20
|
||||
figmaSessionsLimit: 10
|
||||
logFilesLimit: 50
|
||||
maxRenderSize: 4096
|
||||
renderUpscaleFactor: 2
|
||||
blurredObjectTag: UIBlur
|
||||
blurCameraTag: BackgroundBlur
|
||||
realTagSeparator: 45
|
||||
apiRequestsCountLimit: 500
|
||||
apiTimeoutSec: 60
|
||||
chunkSizeGetNodes: 10
|
||||
frameListDepth: 2
|
||||
gFontsApiKey:
|
||||
whiteSprite32px: {fileID: 21300000, guid: c863a1ee30e5f0a478b421c09b3bcfd9, type: 3}
|
||||
missingImageTexture128px: {fileID: 21300000, guid: 3e820c8fcbbdcfd4592a8ccbb7de0370, type: 3}
|
||||
baseClass: {fileID: 4900000, guid: 8e32de32e14b50747995a6f5a08bb9ae, type: 3}
|
||||
imageLinearMaterial: {fileID: 2100000, guid: 41bc1ce8da9e87a4fa340d902394e0df, type: 2}
|
||||
vectorMaterials:
|
||||
UnlitVector: {fileID: 2100000, guid: 73ddb2958e9cd451c82f37c26efa5eb0, type: 2}
|
||||
UnlitVectorGradient: {fileID: 2100000, guid: 137d858a4eae4d34298f3cdcd31f5e0b, type: 2}
|
||||
UnlitVectorGradientUI: {fileID: 2100000, guid: 0b012844cadfbe541b20626331cf90a2, type: 2}
|
||||
UnlitVectorUI: {fileID: 2100000, guid: 8d66e65c66e29504199ed664979682cd, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1dd01905e44636f45b813d9ac33a6073
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,685 @@
|
||||
key;en-US
|
||||
log_added_total;
|
||||
log_api_waiting;Figma API timeout. {0} seconds remaining...
|
||||
log_auth_complete;Auth complete!
|
||||
log_cant_auth;"Can't auth.
|
||||
Status: {0}
|
||||
Message: {1}
|
||||
Exception: {2}"
|
||||
log_cant_draw_object;Can't draw '{0}' object.
|
||||
log_cant_find_package;"The package '{0}' is not found, required for the asset to work. To install the package:
|
||||
1. Open the Unity Package Manager;
|
||||
2. Click on the PLUS button in the upper left corner of the window;
|
||||
3. Select 'Add package from git URL' menu item and enter the package name '{0}';
|
||||
4. Click on the Install button;
|
||||
5. The package is installed, now you can use the asset."
|
||||
log_cant_get_images;Unable to download some images. You may need to add links to Figma projects with your master components in the '{0}' tab.
|
||||
log_cant_get_part_of_frames;"Can't get part of frames.
|
||||
Error: {0}
|
||||
Status: {1}"
|
||||
log_cant_get_image_links;"Can't get sprite links.
|
||||
Error: {0}
|
||||
Status: {1}"
|
||||
log_cant_execute_because_no_backup;Unable to perform this action due to the inability to create a scene backup. Perhaps your scene was created for the first time and does not yet have a saved scene file?
|
||||
log_component_not_selected_in_hierarchy;{0}'s gameobject not selected in hierarchy.
|
||||
log_current_canvas_metas_destroy;FCU {0}: {1} '{2}.cs' scripts destroyed.
|
||||
log_dev_function_enabled;"You have enabled the '{0}' function.
|
||||
In current version of the asset this function is under development and may work with errors."
|
||||
log_downloading_fonts;Downloading fonts: {0} of {1}
|
||||
log_downloading_images;Downloading images: {0} of {1}
|
||||
log_drawn_count;Drawing '{0}' components: {1} of {2}
|
||||
log_enable_http_project_settings;"Unity doesn't allow establishing an HTTP connection.
|
||||
To proceed with the import, open Project Settings > Player > Configuration, and switch the 'Allow downloads over HTTP' option to 'Always allowed'."
|
||||
log_fcu_assigned;{0} {1}'s ({2}) assigned.
|
||||
log_generating_sprites;Generating sprites: {0} of {1}
|
||||
log_generating_tmp_fonts;Generating TMP fonts: {0} of {1}
|
||||
log_getting_frames;Getting frames: {0} of {1}
|
||||
log_getting_links;Getting links to download images: {0} of {1}
|
||||
log_import_complete;Import complete!
|
||||
log_import_task_canceled;
|
||||
log_incorrect_selection;
|
||||
log_instantiate_game_objects;Instantiating GameObjects...
|
||||
log_links_added;Image links received: {0} of {1}
|
||||
log_local_prefabs_found;{0} prefabs found.
|
||||
log_malformed_url;"For some of your components ({0}), download links for images were not found. Possible reasons:
|
||||
1. You are importing frames that have a large size in pixels. Try reducing the Image Scale in the Main Settings of the asset;
|
||||
2. You need to reauthorize in your Figma account within the asset;
|
||||
3. You have exceeded the request limit to the Figma API, and you need to wait some time before attempting another import;
|
||||
4. Your component is hidden, has zero, or negative size.
|
||||
|
||||
If the advice from points 1, 2, or 3 did not help, please contact the developer.
|
||||
Also, you can try using an asset for procedural image generation instead of the standard one, for example, the free Shapes2D asset. You can read more about this in the ""Manual for developers"" attached to the asset.
|
||||
|
||||
List of these components:
|
||||
{1}"
|
||||
log_mark_as_sprite;Assigning 'Sprite' type to the downloaded images: {0} of {1}
|
||||
log_need_auth;Import stopped. Reauthorization required.
|
||||
log_no_google_fonts_api_key;
|
||||
log_no_sync_helper;
|
||||
log_nothing_to_import;
|
||||
log_open_auth_page;Opening authorization page in the web browser…
|
||||
log_prefabs_created;{0} prefabs created.
|
||||
log_project_downloaded;The project has been downloaded. Select the page you want to get frames from.
|
||||
log_project_empty;Project is empty.
|
||||
log_project_not_found;Either this file doesn't exist or you don't have permission to view it. Ask the file owner to verify the link and/or update permissions. If you are using a team project, read the 'Teamwork' section in 'Manual for designers.pdf'.
|
||||
log_search_local_prefabs;Searching prefabs…
|
||||
log_set_anchors;Setting anchors: {0} of {1}
|
||||
log_ssl_error;"Turn off HTTPS in Main Settings.
|
||||
Error: {0}
|
||||
Status: {1}"
|
||||
log_start_adding_to_fonts_list;Start adding fonts to the list...
|
||||
log_start_creating_prefabs;Start creating prefabs...
|
||||
log_start_download_images;Start downloading images...
|
||||
log_start_setting_transform;Start setting transforms...
|
||||
log_tagging;Tagging in progress. Processed items: {0}
|
||||
log_tagging_by_parts;Tagging in progress. Part {0}...
|
||||
log_unknown_aligment;"Unable to recognize alignment.
|
||||
Aligment: {0}
|
||||
Component: {1}
|
||||
Please report this error to the developer."
|
||||
log_unknown_error;"Unknown error:
|
||||
Status: {1}
|
||||
Error: {0}
|
||||
Exception: {2}"
|
||||
log_not_authorized;
|
||||
log_feature_not_available_with;This function is not available when using {0}.
|
||||
log_incorrent_project_url;Incorrect project url.
|
||||
log_name_linking_not_recommended;"You switched the '{0}' to '{1}'.
|
||||
This mode is not recommended for use because objects with the same names can get confused during linking.
|
||||
Please refer to the manual included with the 'UITK Element Linker' asset to learn more about this in detail."
|
||||
log_svg_scale_1;
|
||||
loading_google_fonts;Loading '{0}' fonts data from Google repository...
|
||||
cant_download_fonts;Failed to download {0} fonts, you need to add them to the project manually: {1}
|
||||
cant_generate_fonts;Failed to generate {0} fonts, you need to generate them manually: {1}
|
||||
cant_load_sprites;"Sprites for some of your components ({0}) cannot be loaded.
|
||||
List of components:
|
||||
{1}"
|
||||
cant_download_sprite;"Can't download sprite for '{0}' object.
|
||||
Error: {1}
|
||||
Status: {2}"
|
||||
label_advanced_mode;Advanced Mode
|
||||
tooltip_advanced_mode;
|
||||
label_add_tmp_fonts_from_folder;Add from current folder
|
||||
tooltip_add_fonts_from_folder;
|
||||
label_add_ttf_fonts_from_folder;Add from current folder
|
||||
tooltip_add_ttf_fonts_from_folder;
|
||||
label_all;All
|
||||
tooltip_all;
|
||||
label_apply_and_continue;Apply and continue
|
||||
tooltip_apply_and_continue;Continue import with selected parameters.
|
||||
label_asset;HOME
|
||||
tooltip_asset;
|
||||
label_asset_creator_settings;FONT ASSET CREATOR SETTINGS
|
||||
tooltip_asset_creator_settings;TextMeshPro font generation settings, identical to the settings of the 'Font Asset Creator' utility.
|
||||
label_asset_dependencies;ASSET DEPENDENCIES
|
||||
tooltip_asset_dependencies;
|
||||
label_atlas_padding;Atlas Padding
|
||||
tooltip_atlas_padding;"Specify the space, in pixels, between characters in the font texture.
|
||||
|
||||
Padding provides the space required to render character separately, and to generate the SDF gradient (See the documentation on Font Assets for details).
|
||||
|
||||
The larger the padding, the smoother the transition, which allows for higher-quality rendering and larger effects, like thick outlines.
|
||||
|
||||
A padding of 5 is often fine for a 512x512 texture."
|
||||
label_atlas_population_mode;Atlas Population Mode
|
||||
tooltip_atlas_population_mode;
|
||||
label_atlas_resolution;Atlas Resolution
|
||||
tooltip_atlas_resolution;"Set the size width and height of the font texture, in pixels.
|
||||
|
||||
A resolution of 512 x 512 is fine for most fonts, as long as you are only including ASCII characters. Fonts with more characters may require larger resolutions, or multiple atlases.
|
||||
|
||||
When using an SDF font, a higher resolution produces finer gradients, and therefore higher quality text."
|
||||
label_auto_disable_compress_assets_on_import;Compress Assets On Import
|
||||
tooltip_auto_disable_compress_assets_on_import;
|
||||
label_auto_size;Auto Size
|
||||
tooltip_auto_size;Auto sizes the text to fit the available space.
|
||||
label_best_fit;Best Fit
|
||||
tooltip_best_fit;Should Unity ignore the size properties and simply try to fit the text to the control's rectangle?
|
||||
label_beta_version;"This is the beta version.
|
||||
If you encounter bugs, please
|
||||
contact the developer,
|
||||
and your problem will be solved
|
||||
as soon as possible."
|
||||
tooltip_beta_version;
|
||||
label_buggy_version;This version contains bugs that have been fixed in the next versions.
|
||||
tooltip_buggy_version;
|
||||
label_button_settings;UI.BUTTON SETTINGS
|
||||
tooltip_button_settings;
|
||||
label_button_type;Button Component
|
||||
tooltip_button_type;
|
||||
label_change;...
|
||||
tooltip_change;
|
||||
label_changed_in_figma;Changed In Figma
|
||||
tooltip_changed_in_figma;"Components whose hash, saved in the SyncHelper object at the time of the previous import, differs from the hash obtained before the new import as a result of analyzing the same component in Figma.
|
||||
The component hash is a hash of the aggregate values of all properties of that component in Figma."
|
||||
label_changed_in_unity;Changed In Unity
|
||||
tooltip_changed_in_unity;"Components whose properties have been changed in the Unity Inspector.
|
||||
Currently, tracking of two properties is supported: color and size."
|
||||
label_comparer_desc;"In order to see the difference between the two objects
|
||||
that you have selected, open thewebsite for comparing
|
||||
two texts using the '{0}' button
|
||||
and copy the properties of the two objects that you see below
|
||||
into the appropriate fields."
|
||||
tooltip_comparer_desc;
|
||||
label_components_settings;
|
||||
tooltip_import_components;The components that will be created on your Canvas when you import the project.
|
||||
label_compression_quality;Crunch Compression Quality
|
||||
tooltip_compression_quality;"When using Crunch Texture compression, use the slider to adjust the quality. A higher compression quality means larger Textures and longer compression times.
|
||||
|
||||
Note: For Android platforms, the Compressor Quality values provide slightly different options. For more information, see Texture formats for platform-specific overrides."
|
||||
label_copy_new_data;Copy new data
|
||||
tooltip_copy_new_data;
|
||||
label_copy_old_data;Copy old data
|
||||
tooltip_copy_old_data;
|
||||
label_copy_to_clipboard;Copy to clipboard
|
||||
tooltip_copy_to_clipboard;
|
||||
label_crunched_compression;Use Crunch Compression
|
||||
tooltip_crunched_compression;"Use crunch compression, if applicable. Crunch is a lossy compression format on top of DXT or ETC Texture compression.
|
||||
|
||||
Unity decompresses Textures to DXT or ETC on the CPU and then uploads them to the GPU at runtime. Crunch compression helps the Texture use the lowest possible amount of space on disk and for downloads.
|
||||
|
||||
Crunch Textures can take a long time to compress, but decompression at runtime is very fast."
|
||||
label_csv_separator;Separator
|
||||
tooltip_csv_separator;
|
||||
label_custom_pivot;Custom Pivot
|
||||
tooltip_custom_pivot;"The custom pivot, when alignement is ""Custom""."
|
||||
label_dabutton_settings;
|
||||
tooltip_dabutton_settings;
|
||||
label_debug_mode;Debug Mode
|
||||
tooltip_debug_mode;Feature for developers. Allows to save the received response from Figma in json format.
|
||||
label_debug_tools;DEBUG TOOLS
|
||||
label_debug;DEBUG
|
||||
tooltip_debug_tools;"Used for debugging the asset.
|
||||
Parameters are applied globally to all instances of the asset."
|
||||
label_dependencies;DEPENDENCIES
|
||||
tooltip_dependencies;
|
||||
label_disable_compress_assets_on_import;
|
||||
tooltip_disable_compress_assets_on_import;
|
||||
label_dont_remove_fcu_meta;Don't remove this script until you are done with the layout.
|
||||
tooltip_dont_remove_fcu_meta;
|
||||
label_download_fonts_from_project;Download '{0}' fonts from project
|
||||
tooltip_download_fonts_from_project;
|
||||
label_download_multiple_fills;Download If Multiple Fills
|
||||
tooltip_download_multiple_fills;
|
||||
label_download_unsupported_gradients;Download Unsupported Gradients
|
||||
tooltip_download_unsupported_gradients;
|
||||
label_figma_auth;FIGMA AUTH
|
||||
tooltip_figma_auth;
|
||||
label_figma_color;Figma
|
||||
tooltip_figma_color;
|
||||
label_figma_comp;FIGMA COMPONENTS
|
||||
tooltip_figma_comp;
|
||||
label_figma_comp_desc;"In this tab, you can set links to Figma projects that contain your master components.
|
||||
This is usually necessary if the asset cannot access sprites that are part of a
|
||||
component instance whose master component is not in the main project."
|
||||
tooltip_figma_comp_desc;
|
||||
label_figma_layout_culture;Layout Language
|
||||
tooltip_figma_layout_culture;The language of your Figma project's text
|
||||
label_find_added_objects;
|
||||
tooltip_find_added_objects;
|
||||
label_flip_x;Flip X
|
||||
tooltip_flip_x;
|
||||
label_flip_y;Flip Y
|
||||
tooltip_flip_y;
|
||||
label_font_settings;FONT SETTINGS
|
||||
tooltip_font_settings;
|
||||
label_font_subset;Font Subset
|
||||
tooltip_font_subset;"A Font Subset is a sequence (Unicode-Range) of Unicode hexadecimal values, or ranges of values, to specify which characters to include in your font file.
|
||||
|
||||
Google supports several subsets for different language groups that are passed to the 'Font Asset Creator' utility when creating a TMP font.
|
||||
|
||||
To change the range after font generation, open your TMP font asset in the Inspector and click on the 'Update Atlas Texture' button.
|
||||
|
||||
A hyphen is used to separate the first and last values in a range.
|
||||
Commas are used to separate values and ranges (for example, '20-7E,A0,2026', where '2026' code is ellipsis (...))."
|
||||
label_force_fix;Force Fix
|
||||
tooltip_force_fix;
|
||||
label_frames_to_import;FRAMES TO IMPORT ({0}/{1})
|
||||
tooltip_frames_to_import;
|
||||
label_generate_physics_shape;Generate Physics Shape
|
||||
tooltip_generate_physics_shape;Automaticallly generates a physics shape.
|
||||
label_gradient_resolution;Gradient Resolution
|
||||
tooltip_gradient_resolution;Size of each rasterized gradient in pixels. Higher values consume memory but result in more accurate gradients.
|
||||
label_horizontal_mapping;Horizontal Mapping
|
||||
tooltip_horizontal_mapping;Horizontal UV mapping when using a shader with a texture face option.
|
||||
label_horizontal_overflow;Horizontal Overflow
|
||||
tooltip_horizontal_overflow;The method used to handle the situation where the text is too wide to fit in the rectangle. The options are Wrap and Overflow.
|
||||
label_https_setting;HTTPS
|
||||
tooltip_https_setting;
|
||||
label_image_and_sprites;
|
||||
tooltip_image_and_sprites;
|
||||
label_image_component;Image Component
|
||||
tooltip_image_component;
|
||||
label_image_type;Type
|
||||
tooltip_image_type;
|
||||
label_import;
|
||||
tooltip_import;
|
||||
label_import_events;IMPORT EVENTS
|
||||
tooltip_import_events;
|
||||
log_import_stoped_because_error;Import stoped because error.
|
||||
label_import_stoped_manually;Import stopped.
|
||||
tooltip_stop_import;Stop import
|
||||
label_kerning;Kerning
|
||||
tooltip_kerning;Enables character specific spacing between pairs of characters.
|
||||
label_kilobytes;The number of downloaded kilobytes of the current download object.
|
||||
tooltip_kilobytes;
|
||||
label_layout_culture;
|
||||
tooltip_layout_culture;
|
||||
label_line_spacing;Line Spacing
|
||||
tooltip_line_spacing;The vertical separation between lines of text.
|
||||
label_loc_case_type;Key Case
|
||||
tooltip_loc_case_type;
|
||||
label_loc_component;Localization Component
|
||||
tooltip_loc_component;
|
||||
label_localization_settings;LOCALIZATION
|
||||
tooltip_localization_settings;
|
||||
label_localizator;Localizator
|
||||
tooltip_localizator;
|
||||
label_log_default;Default Log
|
||||
tooltip_log_default;
|
||||
label_log_downloadable;Downloadable Log
|
||||
tooltip_log_downloadable;
|
||||
label_log_go_drawer;Go Drawer Log
|
||||
tooltip_log_go_drawer;
|
||||
label_log_set_tag;Set Tag Log
|
||||
tooltip_log_set_tag;
|
||||
label_log_transform;Transform Log
|
||||
tooltip_log_transform;
|
||||
label_made_by;
|
||||
tooltip_made_by;
|
||||
label_main_settings;MAIN SETTINGS
|
||||
tooltip_main_settings;
|
||||
label_mask_interaction;Mask Interaction
|
||||
tooltip_mask_interaction;
|
||||
label_maskable;Maskable
|
||||
tooltip_maskable;
|
||||
label_max_cord_deviation_enabled;Max Cord Enabled
|
||||
tooltip_max_cord_deviation_enabled;Enables the 'max cord deviation' tessellation test.
|
||||
label_max_tangent_angle_enabled;Max Tangent Enabled
|
||||
tooltip_max_tangent_angle_enabled;Enables the 'max tangent angle' tessellation test.
|
||||
label_mipmap_enabled;Generate Mip Maps
|
||||
tooltip_mipmap_enabled;Check this box to enable mipmap generation.
|
||||
label_missings_in_frame;This property does not change when switching to the Single Channel Texture type.
|
||||
tooltip_missings_in_frame;
|
||||
label_namespace;Namespace
|
||||
tooltip_namespace;
|
||||
label_new;New
|
||||
tooltip_new;
|
||||
label_no_recent_projects;No recent projects found.
|
||||
tooltip_no_recent_projects;
|
||||
label_old_data;Old Data
|
||||
tooltip_old_data;
|
||||
label_override_line_spacing_px;Override TMP Line Spacing (px)
|
||||
tooltip_override_line_spacing_px;
|
||||
label_override_tags;Override Tags
|
||||
tooltip_override_tags;Whether the color settings override the <color> tag.
|
||||
label_parse_escape_characters;Parse Escape Characters
|
||||
tooltip_parse_escape_characters;"Whether to display strings such as \""\\n\"" as is or replace them by the character they represent."
|
||||
label_pixels_per_unit;Pixels Per Unit
|
||||
tooltip_pixels_per_unit;How many pixels in the sprite correspond to one unit in the world.
|
||||
label_positioning_mode;Positioning Mode
|
||||
tooltip_positioning_mode;
|
||||
label_prefab_creator;PREFAB CREATOR
|
||||
tooltip_prefab_creator;
|
||||
label_prefabs_path;Prefabs Path
|
||||
tooltip_prefabs_path;
|
||||
label_preserve_aspect;Preserve Aspect
|
||||
tooltip_preserve_aspect;
|
||||
label_preserve_numbers;Preserve Numbers
|
||||
tooltip_preserve_numbers;
|
||||
label_project_url;Project Url
|
||||
tooltip_project_url;Link to your project in Figma.
|
||||
label_pui_falloff_distance;Falloff Distance
|
||||
tooltip_pui_falloff_distance;
|
||||
label_rate;Rate
|
||||
tooltip_rate;
|
||||
label_rateme;Rate Me
|
||||
tooltip_rateme;
|
||||
label_rateme_desc;"Hello! :)
|
||||
|
||||
For {0} days, I continue to release
|
||||
the updates of asset and
|
||||
provide support to users.
|
||||
|
||||
If you like my asset, I will be grateful
|
||||
if you rate it in the Asset Store."
|
||||
tooltip_rateme_desc;
|
||||
label_raycast_padding;Raycast Padding
|
||||
tooltip_raycast_padding;
|
||||
label_raycast_target;Raycast Target
|
||||
tooltip_raycast_target;Whether the text blocks raycasts from the Graphic Raycaster.
|
||||
label_redownload_sprites;Redownload Sprites
|
||||
tooltip_redownload_sprites;If enabled, the downloadable images will replace those that were downloaded earlier when old downloading.
|
||||
label_remove;Remove
|
||||
tooltip_remove;
|
||||
label_remove_unused_sprites;"Remove sprites from the selected folder that are not used by
|
||||
Image components in the current open scene."
|
||||
tooltip_remove_unused_sprites;
|
||||
label_render_mode;Render Mode
|
||||
tooltip_render_mode;Specify the render mode to use when outputting the font atlas.
|
||||
label_rich_text;Rich Text
|
||||
tooltip_rich_text;Enables the use of rich text tags such as <color> and <font>.
|
||||
label_rtl_textmeshpro_settings;RTL TEXTMESHPRO SETTINGS
|
||||
tooltip_rtl_textmeshpro_settings;
|
||||
label_sampling_steps;Sampling Steps
|
||||
tooltip_sampling_steps;Number of samples evaluated on paths. Higher values give more accurate results (but takes longer).
|
||||
label_shadow_type;Shadow Type
|
||||
tooltip_shadow_type;The type of shadow that is used when transferring the shadow effect from Figma. Currently the 'TrueShadow' asset is supported, you can also turn off the shadow.
|
||||
label_shadows_tab;SHADOWS
|
||||
tooltip_shadows_tab;
|
||||
label_sort_point;Sort Point
|
||||
tooltip_sort_point;
|
||||
label_sorting_layer;Sorting Layer
|
||||
tooltip_sorting_layer;
|
||||
label_sprite_import_mode;Sprite Import Mode
|
||||
tooltip_sprite_import_mode;"Texture importer modes for Sprite import.
|
||||
|
||||
None - Graphic is not a Sprite.
|
||||
|
||||
Single - Sprite is a single image section extracted automatically from the texture.
|
||||
|
||||
Multiple - Sprites are multiple image sections extracted from the texture.
|
||||
|
||||
Polygon - Sprite has it own mesh outline defined."
|
||||
label_step_distance;Step Distance
|
||||
tooltip_step_distance;Distance at which vertices will be generated along the paths. Lower values will result in a more dense tessellation.
|
||||
label_svg_image_settings;SVG IMAGE SETTINGS
|
||||
tooltip_svg_image_settings;
|
||||
label_svg_importer_settings;SVG IMPORTER SETTINGS
|
||||
tooltip_svg_importer_settings;
|
||||
label_svg_type;Generated Asset Type
|
||||
tooltip_svg_type;How the SVG file will be imported.
|
||||
label_text_and_fonts;TEXT & FONTS
|
||||
tooltip_text_and_fonts;
|
||||
label_text_and_font_settings;
|
||||
tooltip_text_and_font_settings;
|
||||
label_text_component;Text Component
|
||||
tooltip_text_component;A text component to be used when wrapping text from Figma. Currently 'Unity.UI.Text' and 'TextMeshPro' are supported.
|
||||
label_textmeshpro_settings;TEXTMESHPRO SETTINGS
|
||||
tooltip_textmeshpro_settings;
|
||||
label_texture_compression;Texture Compression
|
||||
tooltip_texture_compression;"Select the kind of compression you want for your texture.
|
||||
|
||||
Uncompressed - Texture will not be compressed.
|
||||
|
||||
Compressed - Texture will be compressed using a standard format depending on the platform (DXT, ASTC, ...).
|
||||
|
||||
CompressedHQ - Texture will be compressed using a high quality format depending on the platform and availability (BC7, ASTC4x4, ...).
|
||||
|
||||
CompressedLQ - Texture will be compressed using a low quality but high performance, high compression format depending on the platform and availability (2bpp PVRTC, ASTC8x8, ...)."
|
||||
label_texture_importer_settings;TEXTURE IMPORTER SETTINGS
|
||||
tooltip_texture_importer_settings;
|
||||
label_texture_type;Texture Type
|
||||
tooltip_texture_type;"Use the Texture Type property to select the type of Texture you want to create from the source image file.
|
||||
|
||||
The other properties in the Texture Import settings window change depending on the value you set."
|
||||
label_ttf_path;TTF Fonts Path
|
||||
tooltip_ttf_path;
|
||||
label_ui_framework;UI Framework
|
||||
tooltip_ui_framework;
|
||||
label_ui_toolkit;
|
||||
tooltip_ui_toolkit;
|
||||
label_unity_comp;UNITY COMPONENTS
|
||||
tooltip_unity_comp;
|
||||
label_unity_image_settings;UNITY IMAGE SETTINGS
|
||||
tooltip_unity_image_settings;
|
||||
label_unity_text_settings;UNITY TEXT SETTINGS
|
||||
tooltip_unity_text_settings;
|
||||
label_uitk_linking_mode;UITK Linking Mode
|
||||
tooltip_uitk_linking_mode;
|
||||
label_uitk_output_path;UITK Output Path
|
||||
tooltip_uitk_output_path;
|
||||
label_use_i2localization;Use I2Localization
|
||||
tooltip_use_i2localization;Whether to add 'I2Localize' script to 'Unity.UI.Text' or 'TextMeshPro' component.
|
||||
label_visible_descender;Visible Descender
|
||||
tooltip_visible_descender;Compute descender values from visible characters only. Used to adjust layout behavior when hiding and revealing characters dynamically.
|
||||
label_viewport_options;Viewport Options
|
||||
tooltip_viewport_options;Viewport options to use while importing the SVG document.
|
||||
label_vertical_mapping;Vertical Mapping
|
||||
tooltip_vertical_mapping;Vertical UV mapping when using a shader with a texture face option.
|
||||
label_vertical_overflow;Vertical Overflow
|
||||
tooltip_vertical_overflow;The method used to handle the situation where wrapped text is too tall to fit in the rectangle. The options are Truncate and Overflow.
|
||||
label_without_changes;Without changes
|
||||
tooltip_label_without_changes;
|
||||
label_wrapping;Wrapping
|
||||
tooltip_wrapping;Wraps text to the next line when reaching the edge of the container.
|
||||
label_xml_parsing;
|
||||
tooltip_xml_parsing;
|
||||
label_procedural_ui_settings;SETTINGS FOR ANY PROCEDURAL IMAGE
|
||||
tooltip_procedural_ui_settings;
|
||||
label_pui_settings;PROCEDURAL UI IMAGE SETTINGS
|
||||
tooltip_pui_settings;
|
||||
label_mpuikit_settings;MPIMAGE SETTINGS
|
||||
tooltip_mpuikit_settings;
|
||||
label_sr_settings;SPRITE RENDERER SETTINGS
|
||||
tooltip_sr_settings;
|
||||
label_is_readable;Is Readable
|
||||
tooltip_is_readable;"Whether Unity stores an additional copy of this texture's pixel data in CPU-addressable memory.
|
||||
|
||||
This is required for methods that read, write, and manipulate the pixel data on the CPU, such as Texture2D.GetPixels or ImageConversion.
|
||||
|
||||
EncodeToPNG. It is not required for methods that perform all their work on the GPU, such as Graphics.CopyTexture or Graphics.Blit."
|
||||
label_next_order_step;Next Order Step
|
||||
tooltip_next_order_step;
|
||||
label_raw_import;Raw Import
|
||||
tooltip_raw_import;When enabled, importing the full structure of your layout, without smart-combine multiple sprites into one sprite.
|
||||
label_buttons_tab;BUTTONS
|
||||
tooltip_buttons_tab;
|
||||
label_ui_toolkit_tab;UI TOOLKIT
|
||||
tooltip_ui_toolkit_tab;
|
||||
label_nova_components;NOVA COMPONENTS
|
||||
tooltip_nova_components;
|
||||
label_fcu;Figma Converter for Unity
|
||||
tooltip_fcu;
|
||||
label_settings;Settings
|
||||
tooltip_settings;
|
||||
label_script_generator;SCRIPT GENERATOR
|
||||
tooltip_script_generator;
|
||||
label_enabled;Enabled
|
||||
tooltip_enabled;
|
||||
label_scripts_output_path;Scripts output path
|
||||
tooltip_scripts_output_path;
|
||||
label_select_folder;
|
||||
tooltip_select_folder;
|
||||
label_text_prefab_naming_mode;Text Prefab Naming Mode
|
||||
tooltip_text_prefab_naming_mode;
|
||||
label_humanized_color;Humanized Color String
|
||||
tooltip_humanized_color;
|
||||
label_hex_color;Humanized Color HEX
|
||||
tooltip_hex_color;
|
||||
label_log_component_drawer;
|
||||
tooltip_log_component_drawer;
|
||||
label_log_hash_generator_drawer;
|
||||
tooltip_log_hash_generator_drawer;
|
||||
label_override_tmp_letter_spacing;Override TMP Letter Spacing
|
||||
tooltip_override_tmp_letter_spacing;
|
||||
label_object_comparer;Object Comparer
|
||||
tooltip_object_comparer;
|
||||
label_fcu_is_null;"The script '{0}' is not attached to this object.
|
||||
If this object is a prefab, to ensure the '{1}' function
|
||||
works correctly after adding the object to the scene,
|
||||
you need to execute function '{2}' from the context menu.
|
||||
|
||||
More information about the Context Menu can be found in the Developer Manual."
|
||||
tooltip_fcu_is_null;
|
||||
label_more_about_layout_updating;You can learn more about this script in the dev manual, 'Layout updating' slide.
|
||||
tooltip_more_about_layout_updating;
|
||||
tooltip_open_fcu_window;
|
||||
tooltip_change_window_mode;_
|
||||
label_orthographic_mode;
|
||||
tooltip_orthographic_mode;
|
||||
label_extra_padding;Extra Padding
|
||||
tooltip_extra_padding;Adds some padding between the characters and the edge of the text mesh. Can reduce graphical errors when displaying small text.
|
||||
label_overflow;Overflow
|
||||
tooltip_overflow;How to display text which goes past the edge of the container.
|
||||
label_geometry_sorting;Geometry Sorting
|
||||
tooltip_geometry_sorting;The order in which text geometry is sorted. Used to adjust the way overlapping characters are displayed.
|
||||
label_shader;Shader
|
||||
tooltip_shader;
|
||||
label_farsi;Farsi
|
||||
tooltip_farsi;
|
||||
label_fix_tags;Fix Tags
|
||||
tooltip_fix_tags;
|
||||
label_user_name;The name of the user authorized in the current instance of the asset.
|
||||
tooltip_user_id;The ID of the user authorized in the current instance of the asset.
|
||||
label_asset_instance_id;
|
||||
tooltip_asset_instance_id;The ID of this asset instance.
|
||||
label_stable_version;This version of the asset is stable.
|
||||
tooltip_stable_version;
|
||||
label_open_diff_checker;Open difference checker website
|
||||
tooltip_open_diff_checker;
|
||||
label_go_name_length;GameObject Name Length
|
||||
tooltip_go_name_length;
|
||||
label_text_name_length;Text GameObject Name Length
|
||||
tooltip_text_name_length;
|
||||
label_go_layer;GameObject Layer
|
||||
tooltip_go_layer;"Sets the value of the ""Layout"" parameter, which you can see in the top-right corner of the Inspector, for all the GameObjects being instantiated."
|
||||
label_pivot_type;Pivot Type
|
||||
tooltip_pivot_type;
|
||||
label_components_to_import;COMPONENTS TO IMPORT
|
||||
tooltip_components_to_import;Components that will be added to the scene or updated if they already exist on the scene.
|
||||
label_components_with_count;COMPONENTS ({0}/{1})
|
||||
tooltip_components_with_count;
|
||||
tooltip_recent_projects;View recent projects.
|
||||
tooltip_download_project;"Download Figma project from URL.
|
||||
The current active import of the current canvas will be stopped."
|
||||
label_sampling_point_size;Sampling Point Size
|
||||
tooltip_sampling_point_size;The sampling point size.
|
||||
label_enable_multi_atlas_support;Enable Multi Atlas Support
|
||||
tooltip_enable_multi_atlas_support;
|
||||
label_images_format;Images Format
|
||||
tooltip_images_format;Format of images imported from Figma.
|
||||
label_images_scale;Images Scale
|
||||
tooltip_images_scale;The size of the images imported from Figma.
|
||||
label_preserve_ratio_mode;Preserve Ratio Mode
|
||||
tooltip_preserve_ratio_mode;If an object in Figma has the 'PreserveRatio' function enabled, the 'AspectRatioFitter' script will be added to it with your selected mode.
|
||||
label_sprites_path;Sprites Path
|
||||
tooltip_sprites_path;
|
||||
label_shapes2d_settings;SHAPES 2D SETTINGS
|
||||
tooltip_shapes2d_settings;
|
||||
label_google_fonts_settings;GOOGLE FONTS SETTINGS
|
||||
tooltip_google_fonts_settings;
|
||||
label_google_fonts_api_key;Google Fonts Api Key
|
||||
tooltip_google_fonts_api_key;In order for the asset to be able to automatically download missing fonts, you need to create your own '{0}', and enter it in '{0}' field.
|
||||
label_get_google_api_key;Get
|
||||
tooltip_get_google_api_key;
|
||||
label_remove_from_scene;REMOVE FROM SCENE
|
||||
tooltip_remove_from_scene;Components that will be removed from the scene.
|
||||
label_token;Token
|
||||
tooltip_token;The token is needed for the working of the asset, it is used to send api requests to Figma.
|
||||
tooltip_recent_tokens;
|
||||
tooltip_auth;Button for authorization in Figma.
|
||||
label_tmp_path;TMP Fonts Path
|
||||
tooltip_tmp_path;
|
||||
label_no_recent_sessions;No recent sessions found.
|
||||
tooltip_no_recent_sessions;
|
||||
label_different_component_data;Component data has differences.
|
||||
tooltip_different_component_data;
|
||||
label_has_differences;{0}: has differences. '{1}' in Unity. '{2}' in Figma.
|
||||
tooltip_has_differences;
|
||||
label_new_components;
|
||||
tooltip_new_components;Components that are missing on the scene but exist in Figma.
|
||||
label_import_frames;
|
||||
tooltip_import_frames;"Import selected frames from a downloaded or cached Figma project.
|
||||
The current active import of the current canvas will be stopped."
|
||||
label_open_settings_window;
|
||||
tooltip_open_settings_window;Open settings window
|
||||
label_select_fonts_folder;Choose a folder with your fonts
|
||||
tooltip_select_fonts_folder;
|
||||
label_select_prefabs_folder;
|
||||
tooltip_select_prefabs_folder;
|
||||
tooltip_product_version;The current version of the asset.
|
||||
label_auth;Auth
|
||||
label_component_detection_type;Component Detection Type
|
||||
log_cant_find_font;Can't find font file at path: '{0}'
|
||||
log_tm_font_already_exists;TextMeshPro font already exists for '{0}' font at path: {1}
|
||||
log_reopen_font_asset_creator;If you often see this error, close 'Font Asset Creator' before running the convert function. 'Font Asset Creator' should open by itself.
|
||||
log_converted_fonts;Converted {0} of {1} fonts.
|
||||
label_select_sprites_folder;Select the folder you want to remove unused sprites from
|
||||
label_inside_assets_folder;The object/folder you select must be inside the 'Assets' folder.
|
||||
log_added_total;"Added: {0}
|
||||
Total: {1}"
|
||||
label_update_avaliable;Update avalibale: {0}
|
||||
label_show_asset_in_inspector;Show asset in inspector
|
||||
label_show_asset_in_window;Show asset in window
|
||||
log_missing_fonts_list;Below is a list of fonts missing from the repository. You need to manually add them to the array of fonts in the '{0}' tab so that they will be available for the next import. Font list: {1}
|
||||
log_fonts_in_project;Fonts in project: {0}
|
||||
log_checking_fonts;Checking fonts...
|
||||
log_start_downloading_fonts;Start downloading fonts...
|
||||
log_instantiating_game_objects;Instantiating GameObjects: {0} of {1}
|
||||
label_verify;Verify
|
||||
fonts_settings;FONTS
|
||||
label_import_components;IMPORT COMPONENTS
|
||||
log_gameobject_not_selected_in_hierarchy;'{0}' not selected in hierarchy.
|
||||
log_asset_not_imported;Asset '{0}' was not imported. You can find it in the Asset Store or Package Manager.
|
||||
label_supported_from_unity_version;This feature is available in version Unity {0} and above.
|
||||
log_project_too_big;"Your project exceeds the allowable size. Import stopped.
|
||||
Project size: {0} MB.
|
||||
Allowable size: {1} MB.
|
||||
Please move the frames you want to import into a new project and try the import again."
|
||||
tooltip_all_components;All components - those that exist on the scene and those that exist in Figma (without duplicates).
|
||||
log_featutre_at_dev_stage;This feature ({0}) is not available and is under development.
|
||||
log_img_component_compatibility;The image component in the asset settings is switched to '{0}' because this is the only value compatible with the '{1}' image format.
|
||||
label_images_and_sprites_tab;IMAGES & SPRITES
|
||||
tooltip_images_and_sprites_tab;
|
||||
label_max_cord_deviation;Max Cord Deviation
|
||||
tooltip_max_cord_deviation;Distance on the cord to a straight line between two points after which more tessellation will be generated.
|
||||
label_max_tangent_angle;Max Tangent Angle
|
||||
tooltip_max_tangent_angle;Max tangent angle (in degrees) after which more tessellation will be generated.
|
||||
log_frames_finded;Finded {0} frames. Download them?
|
||||
"log_frames_not_found;No frames found. If you are using Sections, place them inside a frame using the ""Frame selection"" function in Figma, and try the import again.";
|
||||
log_current_canvas_childs_destroy;{0} childs destroyed.
|
||||
tooltip_component_detection_type;
|
||||
log_cant_get_profile_info;Can't get profile info: {0}
|
||||
log_sprites_removed;{0} sprites removed.
|
||||
log_cache_restored;{0} pages restored from cache.
|
||||
tooltip_show_asset_in_inspector;
|
||||
tooltip_show_asset_in_window;
|
||||
tooltip_global_config;
|
||||
log_loading_from_cache;Loading '{0}' project from cache…
|
||||
log_no_components_in_gameobject;No components in '{0}'.
|
||||
log_props_reset;{0} properties reset.
|
||||
log_object_reset;'{0}' has been reset to a prefab state.
|
||||
nan;
|
||||
log_closed_after_script_reload;{0} closed after scripts reload.
|
||||
log_corrent_project_url;Project URL is valid.
|
||||
log_package_installed;UPM Package Installed: {0}
|
||||
label_normal_color;Normal Color
|
||||
tooltip_normal_color;
|
||||
label_highlighted_color;Highlighted Color
|
||||
tooltip_highlighted_color;
|
||||
label_pressed_color;Pressed Color
|
||||
tooltip_pressed_color;
|
||||
label_selected_color;Selected Color
|
||||
tooltip_selected_color;
|
||||
label_disabled_color;Disabled Color
|
||||
tooltip_disabled_color;
|
||||
label_color_multiplier;Color Multiplier
|
||||
tooltip_color_multiplier;
|
||||
label_fade_duration;Fade Duration
|
||||
tooltip_fade_duration;
|
||||
label_go_name_max_length;GameObject Name Max Length
|
||||
tooltip_go_name_max_length;
|
||||
label_text_name_max_length;Text Name Max Length
|
||||
tooltip_text_name_max_length;
|
||||
log_import_failed_incompatible;Import failed because '{0}' is incompatible with '{1}'.\nPlease change the import settings.\n
|
||||
log_import_failed_enable_required;Import failed because you need to enable '{0}' to use '{1}'.\nPlease change the import settings.\n
|
||||
log_import_failed_unsupported;Import failed because you are attempting to use '{0}', which does not support '{1}'.\nPlease change the import settings.\n
|
||||
label_loc_key_max_lenght;Loc Key Max Length
|
||||
tooltip_loc_key_max_lenght;
|
||||
label_loc_folder_path;Localization Folder Path
|
||||
tooltip_loc_folder_path;
|
||||
label_loc_file_name;Localization File Name
|
||||
tooltip_loc_file_name;
|
||||
label_namespace;Namespace
|
||||
tooltip_namespace;
|
||||
label_field_name_max_length;Field Name Max Length
|
||||
tooltip_field_name_max_length;
|
||||
label_method_name_max_length;Method Name Max Length
|
||||
tooltip_method_name_max_length;
|
||||
label_class_name_max_length;Class Name Max Length
|
||||
tooltip_class_name_max_length;
|
||||
label_serialization_mode;Serialization Mode
|
||||
tooltip_serialization_mode;
|
||||
label_base_class;Base Class
|
||||
tooltip_base_class;
|
||||
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76e267d64912f5c44a25b64a5d86254b
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d1b55fcef2a30042b602bfe3340f7d9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b40e3faf7d1d5d246b54948d4954d6fd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,112 @@
|
||||
using DA_Assets.Constants;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.Logging;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ContextMenuItems
|
||||
{
|
||||
[MenuItem("Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.Create + " " + FcuConfig.ProductName, false, 0)]
|
||||
private static void CreateFcu_OnClick()
|
||||
{
|
||||
FcuEventHandlers.CreateFcu_OnClick();
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.SetFcuToSyncHelpers, false, 10)]
|
||||
private static void SetFcuToSyncHelpers_OnClick()
|
||||
{
|
||||
if (Selection.activeGameObject.TryGetComponentSafe(out FigmaConverterUnity fcu))
|
||||
{
|
||||
fcu.EventHandlers.SetFcuToSyncHelpers_OnClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_component_not_selected_in_hierarchy.Localize(nameof(FigmaConverterUnity)));
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.OptimizeSyncHelpers, false, 11)]
|
||||
private static void OptimizeSyncHelpers_OnClick()
|
||||
{
|
||||
if (Selection.activeGameObject.TryGetComponentSafe(out FigmaConverterUnity fcu))
|
||||
{
|
||||
fcu.EventHandlers.OptimizeSyncHelpers_OnClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_component_not_selected_in_hierarchy.Localize(nameof(FigmaConverterUnity)));
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.CompareTwoObjects, false, 12)]
|
||||
private static void Compare_OnClick()
|
||||
{
|
||||
if (Selection.gameObjects.Length != 2)
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_incorrect_selection.Localize());
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject go1 = Selection.gameObjects[0];
|
||||
GameObject go2 = Selection.gameObjects[1];
|
||||
|
||||
bool e1 = go1.TryGetComponentSafe(out SyncHelper sh1);
|
||||
bool e2 = go2.TryGetComponentSafe(out SyncHelper sh2);
|
||||
|
||||
if (e1 == false)
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_no_sync_helper.Localize(go1.name));
|
||||
return;
|
||||
}
|
||||
|
||||
if (e2 == false)
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_no_sync_helper.Localize(go2.name));
|
||||
return;
|
||||
}
|
||||
|
||||
ComparerWindow.Show(sh1, sh2);
|
||||
}
|
||||
|
||||
/*[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.DestroyLastImported, false, 13)]
|
||||
private static void DestroyLastImportedFrames_OnClick()
|
||||
{
|
||||
if (Selection.activeGameObject.TryGetComponentSafe(out FigmaConverterUnity fcu))
|
||||
{
|
||||
fcu.EventHandlers.DestroyLastImportedFrames_OnClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_component_not_selected_in_hierarchy.Localize(nameof(FigmaConverterUnity)));
|
||||
}
|
||||
}*/
|
||||
|
||||
[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.DestroySyncHelpers, false, 14)]
|
||||
private static void DestroySyncHelpers_OnClick()
|
||||
{
|
||||
if (Selection.activeGameObject.TryGetComponentSafe(out FigmaConverterUnity fcu))
|
||||
{
|
||||
fcu.EventHandlers.DestroySyncHelpers_OnClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_component_not_selected_in_hierarchy.Localize(nameof(FigmaConverterUnity)));
|
||||
}
|
||||
}
|
||||
|
||||
//[MenuItem("GameObject/Tools/" + DAConstants.Publisher + "/" + FcuConfig.ProductNameShort + ": " + FcuConfig.UpdatePrefabs, false, 5)]
|
||||
private static void UpdatePrefabs_OnClick()
|
||||
{
|
||||
if (Selection.activeGameObject.TryGetComponentSafe(out FigmaConverterUnity fcu))
|
||||
{
|
||||
fcu.EventHandlers.UpdatePrefabs_OnClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
DALogger.LogError(FcuLocKey.log_component_not_selected_in_hierarchy.Localize(nameof(FigmaConverterUnity)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53ce8ebb88d80ba45a3cbe13d1c50136
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,620 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Model;
|
||||
using DA_Assets.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class DifferenceCheckerWindow : LinkedEditorWindow<DifferenceCheckerWindow, FcuEditor, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private Dictionary<string, InfinityScrollRectWindow<SelectableObject<DiffInfo>, BlackInspector>> _importScrolls = new Dictionary<string, InfinityScrollRectWindow<SelectableObject<DiffInfo>, BlackInspector>>();
|
||||
private Dictionary<string, InfinityScrollRectWindow<SelectableObject<SyncData>, BlackInspector>> _removeScrolls = new Dictionary<string, InfinityScrollRectWindow<SelectableObject<SyncData>, BlackInspector>>();
|
||||
|
||||
private List<HamburgerItem> _selectableHambItems = new List<HamburgerItem>();
|
||||
|
||||
private UpdateBool _importNew = new UpdateBool(false, false);
|
||||
private UpdateBool _importFigmaChanged = new UpdateBool(false, false);
|
||||
private UpdateBool _importUnityChanged = new UpdateBool(false, false);
|
||||
private UpdateBool _importOther = new UpdateBool(false, false);
|
||||
|
||||
private Vector2Int _importNewCount = Vector2Int.zero;
|
||||
private Vector2Int _figmaSideChangedCount = Vector2Int.zero;
|
||||
private Vector2Int _unitySideChangedCount = Vector2Int.zero;
|
||||
private Vector2Int _importOtherCount = Vector2Int.zero;
|
||||
|
||||
private PreImportInput _diffStruct = new PreImportInput();
|
||||
private Action<PreImportOutput> _callback;
|
||||
|
||||
private bool inited = false;
|
||||
|
||||
internal void SetData(PreImportInput diffStruct, Action<PreImportOutput> callback)
|
||||
{
|
||||
_diffStruct = diffStruct;
|
||||
_callback = callback;
|
||||
|
||||
foreach (SelectableObject<DiffInfo> item in diffStruct.ToImport.Childs)
|
||||
{
|
||||
var isrw = new InfinityScrollRectWindow<SelectableObject<DiffInfo>, BlackInspector>(4, 100);
|
||||
isrw.SetData(item.Childs, DrawToImportItem);
|
||||
_importScrolls.Add($"toimport_{item.Object.Id}", isrw);
|
||||
}
|
||||
|
||||
foreach (SelectableObject<SyncData> item in diffStruct.ToRemove.Childs)
|
||||
{
|
||||
var isrw = new InfinityScrollRectWindow<SelectableObject<SyncData>, BlackInspector>(11, 40);
|
||||
isrw.SetData(item.Childs, DrawToRemoveItem);
|
||||
_removeScrolls.Add(item.Object.Id, isrw);
|
||||
}
|
||||
|
||||
UpdateFlags();
|
||||
inited = true;
|
||||
}
|
||||
|
||||
private void CheckForClose()
|
||||
{
|
||||
if (_diffStruct.IsDefault())
|
||||
{
|
||||
Debug.Log($"{this.name} was closed because the scripts were recompiled.");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawGUI()
|
||||
{
|
||||
if (!inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckForClose();
|
||||
}
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Scroll = true,
|
||||
Style = gui.ColoredStyle.DiffCheckerBackground,
|
||||
Body = () =>
|
||||
{
|
||||
gui.DrawSplitGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
SplitterWidth = 5,
|
||||
SplitterStartPos = 500
|
||||
},
|
||||
() =>
|
||||
{
|
||||
LeftPanel();
|
||||
},
|
||||
() =>
|
||||
{
|
||||
RightPanel();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void Footer()
|
||||
{
|
||||
if (gui.OutlineButton(FcuLocKey.label_apply_and_continue.Localize(), FcuLocKey.tooltip_apply_and_continue.Localize()))
|
||||
{
|
||||
Apply_OnClick();
|
||||
}
|
||||
|
||||
void Apply_OnClick()
|
||||
{
|
||||
IEnumerable<string> toImportSelected = _diffStruct.ToImport.Childs
|
||||
.SelectRecursive(x => x.Childs)
|
||||
.Where(x => x.Selected)
|
||||
.Select(x => x.Object.Id);
|
||||
|
||||
IEnumerable<SyncData> toRemoveSelected = _diffStruct.ToRemove.Childs
|
||||
.SelectRecursive(x => x.Childs)
|
||||
.Where(x => x.Selected)
|
||||
.Select(x => x.Object);
|
||||
|
||||
PreImportOutput result = new PreImportOutput
|
||||
{
|
||||
ToImport = toImportSelected,
|
||||
ToRemove = toRemoveSelected
|
||||
};
|
||||
|
||||
_callback.Invoke(result);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void LeftPanel()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.DiffCheckerToImportPanel,
|
||||
Body = () =>
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_components_to_import.Localize(), FcuLocKey.tooltip_components_to_import.Localize());
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
DrawToImport();
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.OutlineButton(FcuLocKey.label_open_diff_checker.Localize()))
|
||||
{
|
||||
Application.OpenURL("https://www.diffchecker.com/");
|
||||
}
|
||||
|
||||
gui.FlexibleSpace();
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space15();
|
||||
|
||||
DrawMenuWithChildren(_diffStruct.ToImport);
|
||||
|
||||
|
||||
void DrawMenuWithChildren(SelectableObject<DiffInfo> item)
|
||||
{
|
||||
bool isRoot = item.Object.Id == PreImportDataCreator.TO_IMPORT_MENU_ID;
|
||||
|
||||
int allCount = item.CountItems(x => x.Childs.IsEmpty());
|
||||
int selectedCount = item.CountItems(x => x.Childs.IsEmpty() && x.Selected);
|
||||
|
||||
bool isAllSelected = selectedCount == allCount;
|
||||
|
||||
GUIContent gc;
|
||||
string menuId = "toimport_";
|
||||
|
||||
if (isRoot)
|
||||
{
|
||||
menuId += PreImportDataCreator.TO_IMPORT_MENU_ID;
|
||||
gc = new GUIContent(FcuLocKey.label_components_with_count.Localize(selectedCount, allCount), "");
|
||||
|
||||
gui.DrawMenu(_selectableHambItems, new HamburgerItem
|
||||
{
|
||||
Id = menuId,
|
||||
GUIContent = gc,
|
||||
Body = () =>
|
||||
{
|
||||
foreach (SelectableObject<DiffInfo> child in item.Childs)
|
||||
{
|
||||
DrawMenuWithChildren(child);
|
||||
}
|
||||
},
|
||||
CheckBoxValueChanged = (id, value) =>
|
||||
{
|
||||
SetAllChildrenSelected(item, value, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
menuId += item.Object.Id;
|
||||
gc = new GUIContent($"{item.Object.Name} ({selectedCount}/{allCount})", "");
|
||||
|
||||
gui.DrawMenu(_selectableHambItems, new HamburgerItem
|
||||
{
|
||||
Id = menuId,
|
||||
GUIContent = gc,
|
||||
Body = () =>
|
||||
{
|
||||
_importScrolls[menuId].OnGUI();
|
||||
},
|
||||
CheckBoxValueChanged = (id, value) =>
|
||||
{
|
||||
SetAllChildrenSelected(item, value, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
SetCheckboxValue(menuId, isAllSelected);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
private void SetCheckboxValue(string id, bool value)
|
||||
{
|
||||
UpdateBool checkBoxValue = _selectableHambItems.FirstOrDefault(item => item.Id == id)?.CheckBoxValue;
|
||||
|
||||
if (checkBoxValue != null)
|
||||
{
|
||||
checkBoxValue.Value = value;
|
||||
checkBoxValue.Temp = value;
|
||||
}
|
||||
}
|
||||
private void RightPanel()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.DiffCheckerToRemovePanel,
|
||||
Body = () =>
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_remove_from_scene.Localize(), FcuLocKey.tooltip_remove_from_scene.Localize());
|
||||
|
||||
gui.Space15();
|
||||
|
||||
foreach (SelectableObject<SyncData> item in _diffStruct.ToRemove.Childs)
|
||||
{
|
||||
int selectedCount = item.Childs.Count(x => x.Selected);
|
||||
int allCount = item.Childs.Count;
|
||||
bool isAllSelected = selectedCount == allCount;
|
||||
|
||||
string menuId = "toremove_";
|
||||
menuId += item.Object.Id;
|
||||
|
||||
gui.DrawMenu(_selectableHambItems, new HamburgerItem
|
||||
{
|
||||
Id = menuId,
|
||||
GUIContent = new GUIContent($"{item.Object.Names.ObjectName} ({selectedCount}/{allCount})"),
|
||||
Body = () => _removeScrolls[item.Object.Id].OnGUI(),
|
||||
CheckBoxValueChanged = (id, value) =>
|
||||
{
|
||||
SetAllChildrenSelected(item, value, true);
|
||||
}
|
||||
});
|
||||
|
||||
SetCheckboxValue(menuId, isAllSelected);
|
||||
}
|
||||
|
||||
gui.FlexibleSpace();
|
||||
gui.Line();
|
||||
gui.Space15();
|
||||
|
||||
Footer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SetAllChildrenSelected<T>(SelectableObject<T> item, bool selected, bool remove) where T : IHaveId
|
||||
{
|
||||
SetAllChildrenSelectedRecursive(item, selected);
|
||||
|
||||
UpdateFlags();
|
||||
|
||||
void SetAllChildrenSelectedRecursive(SelectableObject<T> currentItem, bool value)
|
||||
{
|
||||
currentItem.Selected = value;
|
||||
|
||||
foreach (SelectableObject<T> child in currentItem.Childs)
|
||||
{
|
||||
SetAllChildrenSelectedRecursive(child, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawToRemoveItem(SelectableObject<SyncData> item)
|
||||
{
|
||||
bool oldState = item.Selected;
|
||||
item.Selected = gui.CheckBox(new GUIContent(GetHierarchyWithoutRootFrame(item.Object.NameHierarchy)), item.Selected, false);
|
||||
if (item.Selected != oldState)
|
||||
{
|
||||
UpdateFlags();
|
||||
}
|
||||
}
|
||||
|
||||
private string GetHierarchyWithoutRootFrame(string hierarchy)
|
||||
{
|
||||
int index = hierarchy.IndexOf(FcuConfig.HierarchyDelimiter);
|
||||
if (index != -1)
|
||||
{
|
||||
return ".." + hierarchy.Substring(index);
|
||||
}
|
||||
return hierarchy;
|
||||
}
|
||||
|
||||
private void DrawToImportItem(SelectableObject<DiffInfo> item)
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
gui.Space5();
|
||||
|
||||
string name = item.Object.OldData != null ? item.Object.OldData.NameHierarchy : item.Object.NewData.Data.NameHierarchy;
|
||||
name = GetHierarchyWithoutRootFrame(name);
|
||||
gui.Label12px(name, null, GUILayout.ExpandWidth(true));
|
||||
gui.Space5();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
bool oldState = item.Selected;
|
||||
item.Selected = GUILayout.Toggle(item.Selected, GUIContent.none);
|
||||
if (item.Selected != oldState)
|
||||
{
|
||||
UpdateFlags();
|
||||
}
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
if (gui.Button(new GUIContent(FcuLocKey.label_copy_old_data.Localize()), GUILayout.Width(120)))
|
||||
{
|
||||
GUIUtility.systemCopyBuffer = item.Object.OldData.HashData;
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.Button(new GUIContent(FcuLocKey.label_copy_new_data.Localize()), GUILayout.Width(120)))
|
||||
{
|
||||
GUIUtility.systemCopyBuffer = item.Object.NewData.Data.HashData;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space15();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
if (item.Object.HasFigmaDiff)
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_different_component_data.Localize(), null, GUILayout.ExpandWidth(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.Label12px("_");
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (item.Object.Color.Enabled)
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_has_differences.Localize(
|
||||
"Color",
|
||||
$"{item.Object.Color.Value1}",
|
||||
$"{item.Object.Color.Value2}"), null, GUILayout.ExpandWidth(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.Label12px("_");
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (item.Object.Size.Enabled)
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_has_differences.Localize(
|
||||
"Size",
|
||||
$"{item.Object.Size.Value1}",
|
||||
$"{item.Object.Size.Value2}"), null, GUILayout.ExpandWidth(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.Label12px("_");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gui.FlexibleSpace();
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space5();
|
||||
|
||||
gui.Line();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void UpdateData(Func<SelectableObject<DiffInfo>, bool> condition, bool value)
|
||||
{
|
||||
foreach (SelectableObject<DiffInfo> item in _diffStruct.ToImport.Childs)
|
||||
{
|
||||
UpdateDataRecursive(item, condition, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDataRecursive(SelectableObject<DiffInfo> item, Func<SelectableObject<DiffInfo>, bool> condition, bool value)
|
||||
{
|
||||
if (condition(item))
|
||||
item.Selected = value;
|
||||
|
||||
foreach (SelectableObject<DiffInfo> child in item.Childs)
|
||||
{
|
||||
UpdateDataRecursive(child, condition, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateFlags()
|
||||
{
|
||||
int importNewCount = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.IsNew);
|
||||
int importNewCountSelected = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.IsNew && x.Selected);
|
||||
_importNewCount = new Vector2Int(importNewCountSelected, importNewCount);
|
||||
_importNew.Value = importNewCount == importNewCountSelected && importNewCount != 0;
|
||||
_importNew.Temp = importNewCount == importNewCountSelected && importNewCount != 0;
|
||||
|
||||
int figmaChangedCount = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.HasFigmaDiff);
|
||||
int figmaChangedCountSelected = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.HasFigmaDiff && x.Selected);
|
||||
_figmaSideChangedCount = new Vector2Int(figmaChangedCountSelected, figmaChangedCount);
|
||||
_importFigmaChanged.Value = figmaChangedCount == figmaChangedCountSelected && figmaChangedCount != 0;
|
||||
_importFigmaChanged.Temp = figmaChangedCount == figmaChangedCountSelected && figmaChangedCount != 0;
|
||||
|
||||
int unityChangedCount = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.IsUnitySideChanged());
|
||||
int unityChangedCountSelected = _diffStruct.ToImport.CountItems(x => x.Childs.IsEmpty() && x.Object.IsUnitySideChanged() && x.Selected);
|
||||
_unitySideChangedCount = new Vector2Int(unityChangedCountSelected, unityChangedCount);
|
||||
_importUnityChanged.Value = unityChangedCount == unityChangedCountSelected && unityChangedCount != 0;
|
||||
_importUnityChanged.Temp = unityChangedCount == unityChangedCountSelected && unityChangedCount != 0;
|
||||
|
||||
int importSameCount = _diffStruct.ToImport.CountItems(x =>
|
||||
x.Object.IsNotChanged() &&
|
||||
!x.Object.IsUnitySideChanged());
|
||||
|
||||
int importSameCountSelected = _diffStruct.ToImport.CountItems(x =>
|
||||
x.Object.IsNotChanged() &&
|
||||
x.Selected);
|
||||
|
||||
_importOtherCount = new Vector2Int(importSameCountSelected, importSameCount);
|
||||
_importOther.Value = importSameCount == importSameCountSelected && importSameCount != 0;
|
||||
_importOther.Temp = importSameCount == importSameCountSelected && importSameCount != 0;
|
||||
}
|
||||
|
||||
private void ImportFigmaSide_OnChanged()
|
||||
{
|
||||
UpdateData(x => x.Object.HasFigmaDiff, _importFigmaChanged.Value);
|
||||
UpdateFlags();
|
||||
}
|
||||
|
||||
private void UnitySide_OnChanged()
|
||||
{
|
||||
UpdateData(x => x.Object.Color.Enabled || x.Object.Size.Enabled, _importUnityChanged.Value);
|
||||
UpdateFlags();
|
||||
}
|
||||
|
||||
private void ImportNew_OnChanged()
|
||||
{
|
||||
UpdateData(x => x.Object.IsNew, _importNew.Value);
|
||||
UpdateFlags();
|
||||
}
|
||||
|
||||
private void ImportOther_OnChanged()
|
||||
{
|
||||
UpdateData(x => !x.Object.IsNew &&
|
||||
!x.Object.HasFigmaDiff &&
|
||||
!x.Object.IsUnitySideChanged(), _importOther.Value);
|
||||
|
||||
UpdateFlags();
|
||||
}
|
||||
|
||||
private void DrawToImport()
|
||||
{
|
||||
gui.DrawTable(new Action[4, 3]
|
||||
{
|
||||
{
|
||||
() =>
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_new.Localize(), FcuLocKey.tooltip_new_components.Localize());
|
||||
},
|
||||
() =>
|
||||
{
|
||||
GUILayout.Label($"{_importNewCount.x}/{_importNewCount.y}", EditorStyles.boldLabel);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
_importNew.Value = GUILayout.Toggle(_importNew.Value, GUIContent.none);
|
||||
if (_importNew.Value != _importNew.Temp)
|
||||
{
|
||||
_importNew.Temp = _importNew.Value;
|
||||
ImportNew_OnChanged();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
() =>
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_changed_in_figma.Localize(), FcuLocKey.tooltip_changed_in_figma.Localize());
|
||||
},
|
||||
() =>
|
||||
{
|
||||
GUILayout.Label($"{_figmaSideChangedCount.x}/{_figmaSideChangedCount.y}", EditorStyles.boldLabel);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
_importFigmaChanged.Value = GUILayout.Toggle(_importFigmaChanged.Value, GUIContent.none);
|
||||
if (_importFigmaChanged.Value != _importFigmaChanged.Temp)
|
||||
{
|
||||
_importFigmaChanged.Temp = _importFigmaChanged.Value;
|
||||
ImportFigmaSide_OnChanged();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
() =>
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_changed_in_unity.Localize(), FcuLocKey.tooltip_changed_in_unity.Localize());
|
||||
},
|
||||
() =>
|
||||
{
|
||||
GUILayout.Label($"{_unitySideChangedCount.x}/{_unitySideChangedCount.y}", EditorStyles.boldLabel);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
_importUnityChanged.Value = GUILayout.Toggle(_importUnityChanged.Value, GUIContent.none);
|
||||
if (_importUnityChanged.Value != _importUnityChanged.Temp)
|
||||
{
|
||||
_importUnityChanged.Temp = _importUnityChanged.Value;
|
||||
UnitySide_OnChanged();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
() =>
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_without_changes.Localize(), FcuLocKey.tooltip_label_without_changes.Localize());
|
||||
},
|
||||
() =>
|
||||
{
|
||||
GUILayout.Label($"{_importOtherCount.x}/{_importOtherCount.y}", EditorStyles.boldLabel);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
_importOther.Value = GUILayout.Toggle(_importOther.Value, GUIContent.none);
|
||||
if (_importOther.Value != _importOther.Temp)
|
||||
{
|
||||
_importOther.Temp = _importOther.Value;
|
||||
ImportOther_OnChanged();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
internal static class DiffCheckerExtensions
|
||||
{
|
||||
internal static bool IsNotChanged(this DiffInfo diffInfo)
|
||||
{
|
||||
return !diffInfo.IsNew &&
|
||||
!diffInfo.HasFigmaDiff &&
|
||||
!diffInfo.IsUnitySideChanged();
|
||||
}
|
||||
|
||||
internal static bool IsUnitySideChanged(this DiffInfo diffInfo)
|
||||
{
|
||||
return diffInfo.Color.Enabled || diffInfo.Size.Enabled;
|
||||
}
|
||||
|
||||
internal static int CountItems<T>(this SelectableObject<T> obj, Func<SelectableObject<T>, bool> condition)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (condition(obj))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
foreach (SelectableObject<T> child in obj.Childs)
|
||||
{
|
||||
count += child.CountItems(condition);
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd2d49e3322433c439b7db651b3d0e0b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d072ad781ff31a44bf6c389f8dd65b5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,295 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.Logging;
|
||||
using DA_Assets.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable IDE0003
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[CustomEditor(typeof(FigmaConverterUnity)), CanEditMultipleObjects]
|
||||
internal class FcuEditor : DAEditor<FcuEditor, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public override void OnShow()
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
monoBeh.DelegateHolder.SetSpriteRects = SpriteEditorUtility.SetSpriteRects;
|
||||
monoBeh.DelegateHolder.ShowDifferenceChecker = ShowDifferenceChecker;
|
||||
monoBeh.DelegateHolder.UpdateScrollContent = this.FrameList.UpdateScrollContent;
|
||||
monoBeh.DelegateHolder.UpdateScrollContent();
|
||||
monoBeh.DelegateHolder.GetGameViewSize = GameViewUtils.GetGameViewSize;
|
||||
monoBeh.DelegateHolder.SetGameViewSize = GameViewUtils.SetGameViewSize;
|
||||
|
||||
try
|
||||
{
|
||||
_currentAssetVersion = UpdateChecker.GetCurrentVersionInfo(AssetType.fcu, FcuConfig.Instance.ProductVersion);
|
||||
_assetInfo = DAWebConfig.WebConfig.Assets.FirstOrDefault(x => x.Type == AssetType.fcu);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning(ex);
|
||||
}
|
||||
|
||||
_ = monoBeh.Authorizer.TryRestoreSession();
|
||||
}
|
||||
|
||||
private void ShowDifferenceChecker(PreImportInput data, Action<PreImportOutput> callback)
|
||||
{
|
||||
this.DifferenceCheckerWindow.SetData(data, callback);
|
||||
this.DifferenceCheckerWindow.Show();
|
||||
}
|
||||
|
||||
public void DrawBaseOnInspectorGUI()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () => base.OnInspectorGUI()
|
||||
});
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
DrawWindowedGUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawGUI(gui.ColoredStyle.Background);
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawWindowedGUI()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.Background,
|
||||
Body = () =>
|
||||
{
|
||||
gui.TopProgressBar(monoBeh.RequestSender.PbarProgress);
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
this.Header.DrawSmallHeader();
|
||||
|
||||
gui.Space15();
|
||||
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconOpen, FcuLocKey.tooltip_open_fcu_window.Localize())))
|
||||
{
|
||||
this.SettingsWindow.Show();
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconExpandWindow, FcuLocKey.tooltip_change_window_mode.Localize())))
|
||||
{
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
monoBeh.Settings.MainSettings.WindowMode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void DrawGUI(GUIStyle customStyle)
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = customStyle,
|
||||
Body = () =>
|
||||
{
|
||||
this.Header.Draw();
|
||||
|
||||
gui.Space15();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
monoBeh.Settings.MainSettings.ProjectUrl = gui.BigTextField(monoBeh.Settings.MainSettings.ProjectUrl, null);
|
||||
|
||||
gui.Space5();
|
||||
|
||||
Group gr = new Group();
|
||||
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
gr.Style = gui.ColoredStyle.Group5Buttons;
|
||||
}
|
||||
else
|
||||
{
|
||||
gr.Style = gui.ColoredStyle.Group6Buttons;
|
||||
}
|
||||
|
||||
gr.GroupType = GroupType.Horizontal;
|
||||
gr.Body = () =>
|
||||
{
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.ImgViewRecent, FcuLocKey.tooltip_recent_projects.Localize())))
|
||||
{
|
||||
ShowRecentProjectsPopup_OnClick();
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconDownload, FcuLocKey.tooltip_download_project.Localize())))
|
||||
{
|
||||
if (monoBeh.Authorizer.IsAuthed() == false)
|
||||
{
|
||||
DALogger.Log(FcuLocKey.log_not_authorized.Localize());
|
||||
}
|
||||
else if (monoBeh.Settings.MainSettings.ProjectUrl.IsEmpty())
|
||||
{
|
||||
DALogger.Log(FcuLocKey.log_incorrent_project_url.Localize());
|
||||
}
|
||||
else
|
||||
{
|
||||
monoBeh.EventHandlers.DownloadProject_OnClick();
|
||||
}
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconImport, FcuLocKey.tooltip_import_frames.Localize())))
|
||||
{
|
||||
monoBeh.EventHandlers.ImportSelectedFrames_OnClick();
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconStop, FcuLocKey.tooltip_stop_import.Localize())))
|
||||
{
|
||||
monoBeh.EventHandlers.StopImport_OnClick();
|
||||
}
|
||||
|
||||
if (monoBeh.Settings.MainSettings.WindowMode == false)
|
||||
{
|
||||
gui.Space5();
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconSettings, FcuLocKey.tooltip_open_settings_window.Localize())))
|
||||
{
|
||||
this.SettingsWindow.Show();
|
||||
}
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
if (gui.SquareButton30x30(new GUIContent(gui.Data.Resources.IconExpandWindow, FcuLocKey.tooltip_change_window_mode.Localize())))
|
||||
{
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
monoBeh.Settings.MainSettings.WindowMode = false;
|
||||
this.SettingsWindow.CreateTabs();
|
||||
}
|
||||
else
|
||||
{
|
||||
monoBeh.Settings.MainSettings.WindowMode = true;
|
||||
this.SettingsWindow.Show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
gui.DrawGroup(gr);
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (!monoBeh.InspectorDrawer.SelectableDocument.IsProjectEmpty())
|
||||
{
|
||||
this.FrameList.Draw();
|
||||
}
|
||||
|
||||
if (!_assetInfo.DeveloperMessage.Text.IsEmpty() || !_currentAssetVersion.DeveloperMessage.Text.IsEmpty())
|
||||
{
|
||||
gui.Space15();
|
||||
}
|
||||
|
||||
if (!_assetInfo.DeveloperMessage.Text.IsEmpty())
|
||||
{
|
||||
gui.HelpBox(_assetInfo.DeveloperMessage.Text, _assetInfo.DeveloperMessage.Type);
|
||||
gui.Space5();
|
||||
}
|
||||
|
||||
if (!_currentAssetVersion.DeveloperMessage.Text.IsEmpty())
|
||||
{
|
||||
gui.HelpBox(_currentAssetVersion.DeveloperMessage.Text, _currentAssetVersion.DeveloperMessage.Type);
|
||||
gui.Space5();
|
||||
}
|
||||
|
||||
Footer.DrawFooter();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void ShowRecentProjectsPopup_OnClick()
|
||||
{
|
||||
List<RecentProject> recentProjects = monoBeh.ProjectCacher.GetRecentProjects();
|
||||
|
||||
List<GUIContent> options = new List<GUIContent>();
|
||||
|
||||
if (recentProjects.IsEmpty())
|
||||
{
|
||||
options.Add(new GUIContent(FcuLocKey.label_no_recent_projects.Localize()));
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (RecentProject project in recentProjects)
|
||||
{
|
||||
options.Add(new GUIContent(project.Name));
|
||||
}
|
||||
}
|
||||
|
||||
EditorUtility.DisplayCustomMenu(new Rect(11, 150, 0, 0), options.ToArray(), -1, (userData, ops, selected) =>
|
||||
{
|
||||
RecentProject recentProject = recentProjects[selected];
|
||||
monoBeh.Settings.MainSettings.ProjectUrl = recentProject.Url;
|
||||
monoBeh.EventHandlers.DownloadProject_OnClick();
|
||||
}, null);
|
||||
}
|
||||
|
||||
internal DifferenceCheckerWindow DifferenceCheckerWindow =>
|
||||
DifferenceCheckerWindow.GetInstance(this, monoBeh, new Vector2(900, 600), false);
|
||||
|
||||
internal FcuSettingsWindow SettingsWindow =>
|
||||
FcuSettingsWindow.GetInstance(this, monoBeh, new Vector2(800, 600), false);
|
||||
|
||||
private HeaderSection _headerSection;
|
||||
internal HeaderSection Header => monoBeh.Link(ref _headerSection, this);
|
||||
|
||||
private FramesSection _frameListSection;
|
||||
internal FramesSection FrameList => monoBeh.Link(ref _frameListSection, this);
|
||||
|
||||
private AssetVersion _currentAssetVersion;
|
||||
private Asset _assetInfo;
|
||||
}
|
||||
|
||||
public enum HamburgerMenuId
|
||||
{
|
||||
MainSettingsKey,
|
||||
UnityTextSettingsKey,
|
||||
TextMeshSettingsKey,
|
||||
PuiSettingsKey,
|
||||
MPUIKitSettingsKey,
|
||||
FrameListKey,
|
||||
AssetsConfigKey,
|
||||
AssetToolsKey,
|
||||
DebugToolsKey,
|
||||
RemoveUnusedSpritesKey,
|
||||
ImportEventsKey,
|
||||
UnityImageSettingsKey,
|
||||
Shapes2DSettingsKey,
|
||||
TMFontsConverterKey
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc8f5f60c6791de4489a0cf2f325d658
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using DA_Assets.FCU.Model;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[CustomEditor(typeof(SyncHelper)), CanEditMultipleObjects]
|
||||
internal class SyncHelperEditor : UnityEditor.Editor
|
||||
{
|
||||
private DAInspector gui => BlackInspector.Instance.Inspector;
|
||||
private FigmaConverterUnity monoBeh;
|
||||
private SyncHelper syncObject;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
syncObject = (SyncHelper)target;
|
||||
monoBeh = syncObject.Data.FigmaConverterUnity as FigmaConverterUnity;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.Background,
|
||||
Body = () =>
|
||||
{
|
||||
|
||||
if (monoBeh == null)
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_dont_remove_fcu_meta.Localize(), null, GUILayout.ExpandWidth(true));
|
||||
gui.Label10px(FcuLocKey.label_more_about_layout_updating.Localize(), null, GUILayout.ExpandWidth(true));
|
||||
|
||||
gui.Space10();
|
||||
|
||||
gui.Label10px(FcuLocKey.label_fcu_is_null.Localize(nameof(FigmaConverterUnity), FcuConfig.CreatePrefabs, FcuConfig.SetFcuToSyncHelpers), null, GUILayout.ExpandWidth(true));
|
||||
return;
|
||||
}
|
||||
|
||||
gui.Colorize(() =>
|
||||
{
|
||||
if (monoBeh.IsUITK())
|
||||
{
|
||||
GUILayout.TextArea(syncObject.Data.NameHierarchy);
|
||||
}
|
||||
|
||||
if (monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
EditorGUILayout.Vector3Field("World Position", syncObject.transform.position);
|
||||
EditorGUILayout.Vector3Field("Local Position", syncObject.transform.localPosition);
|
||||
gui.Space10();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
});
|
||||
|
||||
if (monoBeh.IsUITK() || monoBeh.IsDebug())
|
||||
gui.Space10();
|
||||
|
||||
gui.Label12px(FcuLocKey.label_dont_remove_fcu_meta.Localize(), null, GUILayout.ExpandWidth(true));
|
||||
gui.Label10px(FcuLocKey.label_more_about_layout_updating.Localize(), null, GUILayout.ExpandWidth(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63aeeb6ed41d1e54ab010422bb5c1402
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53423b99078faac44a534a12f0a8fb79
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,129 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[Serializable]
|
||||
internal class FramesSection : MonoBehaviourLinkerEditor<FcuEditor, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
protected int _visibleItemCount = 10;
|
||||
protected float _itemHeight = 35;
|
||||
|
||||
private Dictionary<string, InfinityScrollRectWindow<SelectableFObject, BlackInspector>> _scrolls = new Dictionary<string, InfinityScrollRectWindow<SelectableFObject, BlackInspector>>();
|
||||
|
||||
public void UpdateScrollContent()
|
||||
{
|
||||
_scrolls.Clear();
|
||||
|
||||
foreach (SelectableFObject item in monoBeh.InspectorDrawer.SelectableDocument.Childs)
|
||||
{
|
||||
var isrw = new InfinityScrollRectWindow<SelectableFObject, BlackInspector>(10, 35);
|
||||
_scrolls.Add(item.Id, isrw);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawFrame(SelectableFObject item)
|
||||
{
|
||||
item.Selected = gui.CheckBox(new GUIContent(item.Name), item.Selected, rightSide: false, onValueChange: () =>
|
||||
{
|
||||
monoBeh.InspectorDrawer.FillSelectableFramesArray(monoBeh.CurrentProject.FigmaProject.Document);
|
||||
});
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
SelectableFObject doc = monoBeh.InspectorDrawer.SelectableDocument;
|
||||
|
||||
DrawMenuWithChildren(doc);
|
||||
|
||||
void DrawMenuWithChildren(SelectableFObject item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int selectedCount = item.Childs.Where(x => x != null).SelectRecursive(x => x.Childs).Count(x => x.Childs.IsEmpty() && x.Selected);
|
||||
int allCount = item.Childs.Where(x => x != null).SelectRecursive(x => x.Childs).Count(x => x.Childs.IsEmpty());
|
||||
bool isAllSelected = selectedCount == allCount;
|
||||
|
||||
SetCheckboxValue(item.Id, isAllSelected);
|
||||
|
||||
if (item.Type == Model.NodeType.CANVAS)
|
||||
{
|
||||
gui.DrawMenu(monoBeh.InspectorDrawer.SelectableHamburgerItems, new HamburgerItem
|
||||
{
|
||||
Id = item.Id,
|
||||
GUIContent = new GUIContent($"{item.Name} ({selectedCount}/{allCount})", ""),
|
||||
Body = () =>
|
||||
{
|
||||
foreach (SelectableFObject item1 in monoBeh.InspectorDrawer.SelectableDocument.Childs)
|
||||
{
|
||||
if (_scrolls.TryGetValue(item1.Id, out var scroll1))
|
||||
{
|
||||
scroll1.SetData(item1.Childs, DrawFrame);
|
||||
}
|
||||
}
|
||||
|
||||
if (_scrolls.TryGetValue(item.Id, out var scroll2))
|
||||
{
|
||||
scroll2.OnGUI();
|
||||
}
|
||||
},
|
||||
CheckBoxValueChanged = (id, value) => SetAllChildrenSelected(item, value)
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIContent gc;
|
||||
|
||||
if (item.Type == Model.NodeType.DOCUMENT)
|
||||
{
|
||||
gc = new GUIContent(FcuLocKey.label_frames_to_import.Localize(selectedCount, allCount), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
gc = new GUIContent($"{item.Name} ({selectedCount}/{allCount})", "");
|
||||
}
|
||||
|
||||
gui.DrawMenu(monoBeh.InspectorDrawer.SelectableHamburgerItems, new HamburgerItem
|
||||
{
|
||||
Id = item.Id,
|
||||
GUIContent = gc,
|
||||
Body = () =>
|
||||
{
|
||||
foreach (var child in item.Childs)
|
||||
{
|
||||
DrawMenuWithChildren(child);
|
||||
}
|
||||
},
|
||||
CheckBoxValueChanged = (id, value) => SetAllChildrenSelected(item, value)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void SetCheckboxValue(string id, bool value)
|
||||
{
|
||||
var checkBoxValue = monoBeh.InspectorDrawer.SelectableHamburgerItems.FirstOrDefault(item => item.Id == id)?.CheckBoxValue;
|
||||
if (checkBoxValue != null)
|
||||
{
|
||||
checkBoxValue.Value = value;
|
||||
checkBoxValue.Temp = value;
|
||||
}
|
||||
}
|
||||
|
||||
void SetAllChildrenSelected(SelectableFObject item, bool selected)
|
||||
{
|
||||
item.Selected = selected;
|
||||
foreach (var child in item.Childs)
|
||||
{
|
||||
SetAllChildrenSelected(child, selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d6c360a2d933754cb8cc9e8b277d6df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,205 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using DA_Assets.Tools;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[Serializable]
|
||||
internal class HeaderSection : MonoBehaviourLinkerEditor<FcuEditor, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private void DrawStar()
|
||||
{
|
||||
GUILayout.Box(gui.Data.Resources.ImgStar, gui.ColoredStyle.ImgStar);
|
||||
}
|
||||
|
||||
private void RateMeUI()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.FlexibleSpace();
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
DrawStar();
|
||||
|
||||
if (i != 5)
|
||||
{
|
||||
gui.Space5();
|
||||
}
|
||||
}
|
||||
|
||||
gui.FlexibleSpace();
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space15();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.BoxPanel,
|
||||
Body = () =>
|
||||
{
|
||||
int dc = GetFirstVersionDaysCount();
|
||||
gui.Label12px(new GUIContent(FcuLocKey.label_rateme_desc.Localize(dc)), GUILayout.ExpandWidth(true));
|
||||
|
||||
gui.Space5();
|
||||
if (gui.OutlineButton("Don't show", "null", true))
|
||||
{
|
||||
DontShowRateMe_OnClick();
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
if (gui.OutlineButton("Open Asset Store", "null", true))
|
||||
{
|
||||
int packageId;
|
||||
|
||||
if (monoBeh.IsUGUI())
|
||||
{
|
||||
packageId = 198134;
|
||||
}
|
||||
else
|
||||
{
|
||||
packageId = 272042;
|
||||
}
|
||||
|
||||
Application.OpenURL("https://assetstore.unity.com/packages/tools/utilities/" + packageId + "#reviews");
|
||||
|
||||
DontShowRateMe_OnClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DontShowRateMe_OnClick()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorPrefs.SetInt(FcuConfig.RATEME_PREFS_KEY, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
gui.TopProgressBar(monoBeh.RequestSender.PbarProgress);
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.Space(18);
|
||||
GUILayout.BeginVertical(gui.Data.Resources.FcuLogo, gui.ColoredStyle.Logo);
|
||||
gui.Space30();
|
||||
GUILayout.EndVertical();
|
||||
gui.Space(18);
|
||||
}
|
||||
});
|
||||
|
||||
if (monoBeh.AssetTools.NeedShowRateMe)
|
||||
{
|
||||
RateMeUI();
|
||||
gui.Space(25);
|
||||
}
|
||||
|
||||
UpdateChecker.DrawVersionLine(AssetType.fcu, FcuConfig.Instance.ProductVersion);
|
||||
#if FCU_EXISTS && FCU_UITK_EXT_EXISTS
|
||||
UpdateChecker.DrawVersionLine(AssetType.uitk, FuitkConfig.Instance.ProductVersion);
|
||||
#endif
|
||||
DrawImportInfoLine();
|
||||
DrawCurrentProjectName();
|
||||
}
|
||||
|
||||
private static int GetFirstVersionDaysCount()
|
||||
{
|
||||
try
|
||||
{
|
||||
Asset assetInfo = DAWebConfig.WebConfig.Assets.FirstOrDefault(x => x.Type == AssetType.fcu);
|
||||
AssetVersion firstVersion = assetInfo.Versions.First();
|
||||
|
||||
DateTime firstDt = DateTime.ParseExact(firstVersion.ReleaseDate, "MMM d, yyyy", new System.Globalization.CultureInfo("en-US"));
|
||||
|
||||
int dc = (int)Mathf.Abs((float)(DateTime.Now - firstDt).TotalDays);
|
||||
|
||||
return dc;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public void DrawSmallHeader()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
DrawImportInfoLine();
|
||||
DrawCurrentProjectName();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawImportInfoLine()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.FlexibleSpace();
|
||||
|
||||
gui.Label10px(new GUIContent($"{Mathf.Round(monoBeh.RequestSender.PbarBytes / 1024)} kB", FcuLocKey.label_kilobytes.Localize()));
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent("—"));
|
||||
|
||||
string userId = monoBeh.Authorizer.CurrentSession.User.Id.SubstringSafe(10);
|
||||
string userName = monoBeh.Authorizer.CurrentSession.User.Name;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(userName) == false)
|
||||
{
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent(userName, FcuLocKey.label_user_name.Localize()));
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent("—"));
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(userId) == false)
|
||||
{
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent(userId, FcuLocKey.tooltip_user_id.Localize()));
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent("—"));
|
||||
}
|
||||
|
||||
gui.Space5();
|
||||
gui.Label10px(new GUIContent(monoBeh.Guid, FcuLocKey.tooltip_asset_instance_id.Localize()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawCurrentProjectName()
|
||||
{
|
||||
string currentProjectName = monoBeh.CurrentProject.ProjectName;
|
||||
|
||||
if (currentProjectName != null)
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.FlexibleSpace();
|
||||
gui.Label10px(currentProjectName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abb9fafbbe0971843803ff2d85f5e8fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdffaed3ea1d1924fb13c316d98c2426
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,136 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class TextMeshSection : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private string[] shaderNames = new string[] { };
|
||||
|
||||
private int shaderSelectedIndex = -1;
|
||||
|
||||
public override void OnLink()
|
||||
{
|
||||
SetShaderNames();
|
||||
}
|
||||
|
||||
private void SetShaderNames()
|
||||
{
|
||||
shaderNames = ShaderUtil.GetAllShaderInfo().Select(info => info.name).ToArray();
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
#if TextMeshPro
|
||||
gui.SectionHeader(FcuLocKey.label_textmeshpro_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.AutoSize = gui.Toggle(new GUIContent(FcuLocKey.label_auto_size.Localize(), FcuLocKey.tooltip_auto_size.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.AutoSize);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.OverrideTags = gui.Toggle(new GUIContent(FcuLocKey.label_override_tags.Localize(), FcuLocKey.tooltip_override_tags.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.OverrideTags);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.Wrapping = gui.Toggle(new GUIContent(FcuLocKey.label_wrapping.Localize(), FcuLocKey.tooltip_wrapping.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.Wrapping);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (monoBeh.IsNova() || monoBeh.IsDebug())
|
||||
{
|
||||
monoBeh.Settings.TextMeshSettings.OrthographicMode = gui.Toggle(new GUIContent(FcuLocKey.label_orthographic_mode.Localize(), FcuLocKey.tooltip_orthographic_mode.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.OrthographicMode);
|
||||
|
||||
gui.Space10();
|
||||
}
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.RichText = gui.Toggle(new GUIContent(FcuLocKey.label_rich_text.Localize(), FcuLocKey.tooltip_rich_text.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.RichText);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.RaycastTarget = gui.Toggle(new GUIContent(FcuLocKey.label_raycast_target.Localize(), FcuLocKey.tooltip_raycast_target.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.RaycastTarget);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.ParseEscapeCharacters = gui.Toggle(new GUIContent(FcuLocKey.label_parse_escape_characters.Localize(), FcuLocKey.tooltip_parse_escape_characters.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.ParseEscapeCharacters);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.VisibleDescender = gui.Toggle(new GUIContent(FcuLocKey.label_visible_descender.Localize(), FcuLocKey.tooltip_visible_descender.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.VisibleDescender);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.Kerning = gui.Toggle(new GUIContent(FcuLocKey.label_kerning.Localize(), FcuLocKey.tooltip_kerning.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.Kerning);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.ExtraPadding = gui.Toggle(new GUIContent(FcuLocKey.label_extra_padding.Localize(), FcuLocKey.tooltip_extra_padding.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.ExtraPadding);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.Overflow = gui.EnumField(new GUIContent(FcuLocKey.label_overflow.Localize(), FcuLocKey.tooltip_overflow.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.Overflow);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.HorizontalMapping = gui.EnumField(new GUIContent(FcuLocKey.label_horizontal_mapping.Localize(), FcuLocKey.tooltip_horizontal_mapping.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.HorizontalMapping);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.VerticalMapping = gui.EnumField(new GUIContent(FcuLocKey.label_vertical_mapping.Localize(), FcuLocKey.tooltip_vertical_mapping.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.VerticalMapping);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.GeometrySorting = gui.EnumField(new GUIContent(FcuLocKey.label_geometry_sorting.Localize(), FcuLocKey.tooltip_geometry_sorting.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.GeometrySorting);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
shaderSelectedIndex = gui.ShaderDropdown(new GUIContent(FcuLocKey.label_shader.Localize()), shaderSelectedIndex, shaderNames, (option) =>
|
||||
{
|
||||
monoBeh.Settings.TextMeshSettings.Shader = Shader.Find(shaderNames[option]);
|
||||
});
|
||||
|
||||
#if RTLTMP_EXISTS
|
||||
if (monoBeh.UsingRTLTextMeshPro() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.Farsi = gui.Toggle(new GUIContent(FcuLocKey.label_farsi.Localize(), FcuLocKey.tooltip_farsi.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.Farsi);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.ForceFix = gui.Toggle(new GUIContent(FcuLocKey.label_force_fix.Localize(), FcuLocKey.tooltip_force_fix.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.ForceFix);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.PreserveNumbers = gui.Toggle(new GUIContent(FcuLocKey.label_preserve_numbers.Localize(), FcuLocKey.tooltip_preserve_numbers.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.PreserveNumbers);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextMeshSettings.FixTags = gui.Toggle(new GUIContent(FcuLocKey.label_fix_tags.Localize(), FcuLocKey.tooltip_fix_tags.Localize()),
|
||||
monoBeh.Settings.TextMeshSettings.FixTags);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 175db6af22d7e3a4a9abff4ad74dbf62
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class UnityImageSection : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_unity_image_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
if (monoBeh.UsingRawImage() == false)
|
||||
{
|
||||
monoBeh.Settings.UnityImageSettings.Type = gui.EnumField(new GUIContent(FcuLocKey.label_image_type.Localize(), ""),
|
||||
monoBeh.Settings.UnityImageSettings.Type);
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.UnityImageSettings.RaycastTarget = gui.Toggle(new GUIContent(FcuLocKey.label_raycast_target.Localize(), ""),
|
||||
monoBeh.Settings.UnityImageSettings.RaycastTarget);
|
||||
|
||||
if (monoBeh.UsingRawImage() == false)
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.UnityImageSettings.PreserveAspect = gui.Toggle(new GUIContent(FcuLocKey.label_preserve_aspect.Localize(), ""),
|
||||
monoBeh.Settings.UnityImageSettings.PreserveAspect);
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.UnityImageSettings.RaycastPadding = gui.Vector4Field(new GUIContent(FcuLocKey.label_raycast_padding.Localize(), ""),
|
||||
monoBeh.Settings.UnityImageSettings.RaycastPadding);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.UnityImageSettings.Maskable = gui.Toggle(new GUIContent(FcuLocKey.label_maskable.Localize(), ""),
|
||||
monoBeh.Settings.UnityImageSettings.Maskable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 821b2e52453bb0d438e04625e8871e82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc3c64974e8a14d4aa6af4cd761fea37
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Model;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class AuthTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public override void OnLink()
|
||||
{
|
||||
base.OnLink();
|
||||
monoBeh.Authorizer.Init();
|
||||
}
|
||||
|
||||
internal void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_figma_auth.Localize(), FcuLocKey.label_figma_auth.Localize());
|
||||
gui.Space15();
|
||||
|
||||
if (monoBeh.Authorizer.Options.IsEmpty())
|
||||
{
|
||||
DrawButtons();
|
||||
return;
|
||||
}
|
||||
|
||||
monoBeh.Authorizer.SelectedTableIndex = gui.BigDropdown(monoBeh.Authorizer.SelectedTableIndex, monoBeh.Authorizer.Options, (selected) =>
|
||||
{
|
||||
monoBeh.Authorizer.CurrentSession = monoBeh.Authorizer.RecentSessions[selected];
|
||||
}, expand: false);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
DrawButtons();
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton(new GUIContent("Delete all sessions")))
|
||||
{
|
||||
EditorPrefs.DeleteKey(FcuConfig.FIGMA_SESSIONS_PREFS_KEY);
|
||||
monoBeh.Authorizer.Init();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtons()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
if (gui.OutlineButton(new GUIContent("Sign In With Web Browser")))
|
||||
{
|
||||
monoBeh.EventHandlers.Auth_OnClick();
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Sign In With Access Token"))
|
||||
{
|
||||
_ = monoBeh.Authorizer.AddNew(new Model.AuthResult
|
||||
{
|
||||
AccessToken = monoBeh.Authorizer.Token
|
||||
}, AuthType.Manual);
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
FigmaSessionItem session = monoBeh.Authorizer.CurrentSession;
|
||||
|
||||
string token = gui.BigTextField(
|
||||
monoBeh.Authorizer.Token,
|
||||
null);
|
||||
|
||||
AuthResult authResult = session.AuthResult;
|
||||
authResult.AccessToken = token;
|
||||
session.AuthResult = authResult;
|
||||
monoBeh.Authorizer.CurrentSession = session;
|
||||
|
||||
gui.FlexibleSpace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49662f870a48b2d47b38164f3a69e5c3
|
||||
@@ -0,0 +1,16 @@
|
||||
using DA_Assets.DAI;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ButtonsTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
internal void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_buttons_tab.Localize(), FcuLocKey.tooltip_buttons_tab.Localize());
|
||||
gui.Space15();
|
||||
|
||||
gui.DrawObjectFields(monoBeh.Settings.ButtonSettings);
|
||||
gui.DrawObjectFields(monoBeh.Settings.ButtonSettings.UnityButtonSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3380dcddcc9e33240a38d9853d882437
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using DA_Assets.Tools;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class DebugTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private UnityEditor.Editor fcuConfigEditor;
|
||||
|
||||
public override void OnLink()
|
||||
{
|
||||
fcuConfigEditor = UnityEditor.Editor.CreateEditor(FcuConfig.Instance);
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_debug_tools.Localize());
|
||||
gui.Space15();
|
||||
|
||||
FcuDebugSettingsFlags settings = FcuDebugSettings.Settings;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
FcuDebugSettingsFlags newFlags = (FcuDebugSettingsFlags)EditorGUILayout.EnumFlagsField("Debug Settings", settings);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
FcuDebugSettings.Settings = newFlags;
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
if (gui.OutlineButton("Open logs folder"))
|
||||
{
|
||||
FcuConfig.LogPath.OpenFolderInOS();
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Open cache folder"))
|
||||
{
|
||||
FcuConfig.CachePath.OpenFolderInOS();
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Open backup folder"))
|
||||
{
|
||||
SceneBackuper.GetBackupsPath().OpenFolderInOS();
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Test Button"))
|
||||
{
|
||||
TestButton_OnClick();
|
||||
}
|
||||
|
||||
gui.FlexibleSpace();
|
||||
}
|
||||
});
|
||||
|
||||
if (monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space30();
|
||||
|
||||
gui.Colorize(() =>
|
||||
{
|
||||
fcuConfigEditor.OnInspectorGUI();
|
||||
});
|
||||
|
||||
if (scriptableObject.Inspector != null)
|
||||
{
|
||||
gui.Space30();
|
||||
scriptableObject.Inspector.DrawBaseOnInspectorGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TestButton_OnClick()
|
||||
{
|
||||
//Debug.Log(Color.white);
|
||||
//UnityWebRequest request = UnityWebRequest.Get("http://google.com/generate_204");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8756f6906897ede419956a9b3e9419a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,159 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[Serializable]
|
||||
internal class ImageSpritesTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_images_and_sprites_tab.Localize(), FcuLocKey.tooltip_images_and_sprites_tab.Localize());
|
||||
gui.Space15();
|
||||
|
||||
if (monoBeh.IsUGUI())
|
||||
{
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageComponent = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_image_component.Localize(), FcuLocKey.tooltip_image_component.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageComponent, false);
|
||||
|
||||
if (monoBeh.UsingAnyProceduralImage() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Settings.ImageSpritesSettings.ProceduralCondition);
|
||||
}
|
||||
|
||||
if (monoBeh.UsingSvgImage() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Settings.ImageSpritesSettings.SvgCondition);
|
||||
}
|
||||
|
||||
|
||||
if (monoBeh.UsingUnityImage() || monoBeh.UsingRawImage() || monoBeh.IsDebug())
|
||||
{
|
||||
if (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Linear || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
monoBeh.Settings.ImageSpritesSettings.UseImageLinearMaterial = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_use_image_linear_material.Localize(), FcuLocKey.tooltip_use_image_linear_material.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.UseImageLinearMaterial);
|
||||
}
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
}
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageFormat = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_images_format.Localize(), FcuLocKey.tooltip_images_format.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageFormat);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageScale = gui.SliderField(
|
||||
new GUIContent(FcuLocKey.label_images_scale.Localize(), FcuLocKey.tooltip_images_scale.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.ImageScale, 0.25f, 4.0f).RoundToNearest025();
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.MaxSpriteSize = gui.Vector2IntField(
|
||||
new GUIContent(FcuLocKey.label_max_sprite_size.Localize(), FcuLocKey.tooltip_max_sprite_size.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.MaxSpriteSize);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.PixelsPerUnit = gui.FloatField(
|
||||
new GUIContent(FcuLocKey.label_pixels_per_unit.Localize(), FcuLocKey.tooltip_pixels_per_unit.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.PixelsPerUnit);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.RedownloadSprites = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_redownload_sprites.Localize(), FcuLocKey.tooltip_redownload_sprites.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.RedownloadSprites);
|
||||
|
||||
bool procedural = monoBeh.UsingAnyProceduralImage() || monoBeh.IsUITK() || monoBeh.IsNova();
|
||||
|
||||
if (procedural || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.DownloadMultipleFills = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_download_multiple_fills.Localize(), FcuLocKey.tooltip_download_multiple_fills.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.DownloadMultipleFills);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.DownloadUnsupportedGradients = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_download_unsupported_gradients.Localize(), FcuLocKey.tooltip_download_unsupported_gradients.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.DownloadUnsupportedGradients);
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.PreserveRatioMode = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_preserve_ratio_mode.Localize(), FcuLocKey.tooltip_preserve_ratio_mode.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.PreserveRatioMode, uppercase: false);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ImageSpritesSettings.SpritesPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_sprites_path.Localize(), FcuLocKey.tooltip_sprites_path.Localize()),
|
||||
monoBeh.Settings.ImageSpritesSettings.SpritesPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_folder.Localize());
|
||||
|
||||
if (monoBeh.IsUGUI())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
switch (monoBeh.Settings.ImageSpritesSettings.ImageComponent)
|
||||
{
|
||||
case ImageComponent.UnityImage:
|
||||
case ImageComponent.RawImage:
|
||||
this.UnityImageSettingsSection.Draw();
|
||||
break;
|
||||
case ImageComponent.SubcShape:
|
||||
gui.SectionHeader(FcuLocKey.label_shapes2d_settings.Localize());
|
||||
gui.Space15();
|
||||
gui.DrawObjectFields(monoBeh.Settings.Shapes2DSettings);
|
||||
break;
|
||||
case ImageComponent.ProceduralImage:
|
||||
gui.DrawObjectFields(monoBeh.Settings.JoshPuiSettings);
|
||||
break;
|
||||
case ImageComponent.RoundedImage:
|
||||
gui.DrawObjectFields(monoBeh.Settings.DttPuiSettings);
|
||||
break;
|
||||
case ImageComponent.MPImage:
|
||||
gui.DrawObjectFields(monoBeh.Settings.MPUIKitSettings);
|
||||
break;
|
||||
case ImageComponent.SpriteRenderer:
|
||||
gui.DrawObjectFields(monoBeh.Settings.SpriteRendererSettings);
|
||||
break;
|
||||
case ImageComponent.SvgImage:
|
||||
gui.DrawObjectFields(monoBeh.Settings.SvgImageSettings);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
gui.DrawObjectFields(monoBeh.Settings.TextureImporterSettings);
|
||||
|
||||
if (monoBeh.IsUGUI())
|
||||
{
|
||||
if (monoBeh.UsingSvgImage() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
gui.DrawObjectFields(monoBeh.Settings.SVGImporterSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private UnityImageSection unityImageSettingsSection;
|
||||
internal UnityImageSection UnityImageSettingsSection => monoBeh.Link(ref unityImageSettingsSection, scriptableObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c71431a8765be9b49b63b897feee765f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
using DA_Assets.DAI;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ImportEventsTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
internal void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_import_events.Localize());
|
||||
gui.Space15();
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER == false
|
||||
gui.Label12px(FcuLocKey.label_supported_from_unity_version.Localize("2020.1.0"));
|
||||
return;
|
||||
#endif
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Events.OnObjectInstantiate);
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Events.OnAddComponent);
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Events.OnImportStart);
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Events.OnImportComplete);
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Events.OnImportFail);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cec4a2211705fe04bbce17d18bdde95e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,102 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
#if DALOC_EXISTS
|
||||
using DA_Assets.DAL;
|
||||
#endif
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class LocalizationTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private GenericMenu _selectLangMenu;
|
||||
|
||||
public override void OnLink()
|
||||
{
|
||||
base.OnLink();
|
||||
|
||||
#if DALOC_EXISTS
|
||||
_selectLangMenu = LanguageCollector.CreateLanguageMenu((cultureCode) =>
|
||||
{
|
||||
monoBeh.Settings.LocalizationSettings.CurrentFigmaLayoutCulture = cultureCode;
|
||||
Debug.Log(cultureCode);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_localization_settings.Localize(), FcuLocKey.tooltip_localization_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.LocalizationComponent = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_loc_component.Localize(), FcuLocKey.tooltip_loc_component.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.LocalizationComponent, false, null);
|
||||
|
||||
if (monoBeh.Settings.LocalizationSettings.LocalizationComponent == LocalizationComponent.None)
|
||||
return;
|
||||
|
||||
if (monoBeh.Settings.LocalizationSettings.LocalizationComponent == LocalizationComponent.DALocalizator || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
#if DALOC_EXISTS
|
||||
monoBeh.Settings.LocalizationSettings.Localizator = (ScriptableObject)gui.ObjectField(
|
||||
new GUIContent(FcuLocKey.label_localizator.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.Localizator,
|
||||
typeof(LocalizatorBase<>),
|
||||
false);
|
||||
#endif
|
||||
if (monoBeh.Settings.LocalizationSettings.Localizator == null)
|
||||
{
|
||||
gui.Space10();
|
||||
string message = $"Before starting the import, you need to serialize your localizer into the '{nameof(monoBeh.Settings.LocalizationSettings.Localizator)}' field.";
|
||||
gui.HelpBox(message, MessageType.Warning);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.LocKeyMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_loc_key_max_lenght.Localize(), FcuLocKey.tooltip_loc_key_max_lenght.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.LocKeyMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.LocKeyCaseType = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_loc_case_type.Localize(), FcuLocKey.tooltip_loc_case_type.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.LocKeyCaseType, false, null);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
|
||||
gui.GenericMenu(_selectLangMenu, new GUIContent(FcuLocKey.label_figma_layout_culture.Localize()), monoBeh.Settings.LocalizationSettings.CurrentFigmaLayoutCulture);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.CsvSeparator = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_csv_separator.Localize(), FcuLocKey.tooltip_csv_separator.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.CsvSeparator, false, null);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.LocFolderPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_loc_folder_path.Localize(), FcuLocKey.tooltip_loc_folder_path.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.LocFolderPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_folder.Localize());
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.LocalizationSettings.LocFileName = gui.TextField(
|
||||
new GUIContent(FcuLocKey.label_loc_file_name.Localize(), FcuLocKey.tooltip_loc_file_name.Localize()),
|
||||
monoBeh.Settings.LocalizationSettings.LocFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c393fed78a4b574b8cbdc56c6878ff1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class MainSettingsTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_main_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
gui.EnumField(new GUIContent(FcuLocKey.label_ui_framework.Localize(), FcuLocKey.tooltip_ui_framework.Localize()),
|
||||
monoBeh.Settings.MainSettings.UIFramework, onChange: (newValue) =>
|
||||
{
|
||||
monoBeh.Settings.MainSettings.UIFramework = newValue;
|
||||
scriptableObject.CreateTabs();
|
||||
});
|
||||
|
||||
if (monoBeh.IsUGUI() || monoBeh.IsNova() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.GameObjectLayer = gui.LayerField(
|
||||
new GUIContent(FcuLocKey.label_go_layer.Localize(), FcuLocKey.tooltip_go_layer.Localize()),
|
||||
monoBeh.Settings.MainSettings.GameObjectLayer);
|
||||
}
|
||||
|
||||
if (monoBeh.IsUGUI() || monoBeh.IsDebug())
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.PositioningMode = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_positioning_mode.Localize(), FcuLocKey.tooltip_positioning_mode.Localize()),
|
||||
monoBeh.Settings.MainSettings.PositioningMode);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.PivotType = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_pivot_type.Localize(), FcuLocKey.tooltip_pivot_type.Localize()),
|
||||
monoBeh.Settings.MainSettings.PivotType, uppercase: false);
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.GameObjectNameMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_go_name_max_length.Localize(), FcuLocKey.tooltip_go_name_max_length.Localize()),
|
||||
monoBeh.Settings.MainSettings.GameObjectNameMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.TextObjectNameMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_text_name_max_length.Localize(), FcuLocKey.tooltip_text_name_max_length.Localize()),
|
||||
monoBeh.Settings.MainSettings.TextObjectNameMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.RawImport = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_raw_import.Localize(), FcuLocKey.tooltip_raw_import.Localize()),
|
||||
monoBeh.Settings.MainSettings.RawImport);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.MainSettings.Https = gui.Toggle(
|
||||
new GUIContent(FcuLocKey.label_https_setting.Localize(), FcuLocKey.tooltip_https_setting.Localize()),
|
||||
monoBeh.Settings.MainSettings.Https);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.Settings.MainSettings.AllowedNameChars);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ffd4dd692a651b41ba4091cc11843ef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using DA_Assets.DAI;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class MainTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
if (scriptableObject.Inspector.Header.MonoBeh == null)
|
||||
{
|
||||
scriptableObject.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
scriptableObject.Inspector.DrawGUI(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c6e102231dc1ca4d91278f3df36b835
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
using DA_Assets.DAI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class PrefabCreatorTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_prefab_creator.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.PrefabSettings.PrefabsPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_prefabs_path.Localize(), FcuLocKey.tooltip_prefabs_path.Localize()),
|
||||
monoBeh.Settings.PrefabSettings.PrefabsPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_prefabs_folder.Localize());
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.PrefabSettings.TextPrefabNameType = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_text_prefab_naming_mode.Localize(), ""),
|
||||
monoBeh.Settings.PrefabSettings.TextPrefabNameType,
|
||||
false,
|
||||
new string[]
|
||||
{
|
||||
FcuLocKey.label_humanized_color.Localize(),
|
||||
FcuLocKey.label_hex_color.Localize(),
|
||||
FcuLocKey.label_figma_color.Localize()
|
||||
});
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Create", expand: true))
|
||||
{
|
||||
monoBeh.EventHandlers.CreatePrefabs_OnClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7be24b6c94abcd64bbee96b29486add5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using DA_Assets.DAI;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ScriptGeneratorTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_script_generator.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.SerializationMode = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_serialization_mode.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.SerializationMode, uppercase: false);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.Namespace = gui.TextField(
|
||||
new GUIContent(FcuLocKey.label_namespace.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.Namespace);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.BaseClass = gui.TextField(
|
||||
new GUIContent(FcuLocKey.label_base_class.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.BaseClass);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.OutputPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_scripts_output_path.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.OutputPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_folder.Localize());
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.FieldNameMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_field_name_max_length.Localize(), FcuLocKey.tooltip_field_name_max_length.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.FieldNameMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.MethodNameMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_method_name_max_length.Localize(), FcuLocKey.tooltip_method_name_max_length.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.MethodNameMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.ScriptGeneratorSettings.ClassNameMaxLenght = gui.IntField(
|
||||
new GUIContent(FcuLocKey.label_class_name_max_length.Localize(), FcuLocKey.tooltip_class_name_max_length.Localize()),
|
||||
monoBeh.Settings.ScriptGeneratorSettings.ClassNameMaxLenght);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Generate scripts", expand: true))
|
||||
{
|
||||
monoBeh.EventHandlers.GenerateScripts_OnClick();
|
||||
}
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.OutlineButton("Serialize objects", expand: true))
|
||||
{
|
||||
monoBeh.EventHandlers.SerializeObjects_OnClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2f27bf5bbe2ecf4cab69da3888f42e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using DA_Assets.DAI;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ShadowsTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_shadows_tab.Localize(), FcuLocKey.tooltip_shadows_tab.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.ShadowSettings.ShadowComponent = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_shadow_type.Localize(), FcuLocKey.tooltip_shadow_type.Localize()),
|
||||
monoBeh.Settings.ShadowSettings.ShadowComponent, false);
|
||||
|
||||
gui.Space30();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47b9dee7b703f67449fac7748187f819
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,195 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Model;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[Serializable]
|
||||
internal class TextFontsTab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_text_and_fonts.Localize(), FcuLocKey.tooltip_text_and_fonts.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.Settings.TextFontsSettings.TextComponent = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_text_component.Localize(), FcuLocKey.tooltip_text_component.Localize()),
|
||||
monoBeh.Settings.TextFontsSettings.TextComponent, false);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextFontsSettings.OverrideLetterSpacing = gui.Toggle(new GUIContent(FcuLocKey.label_override_tmp_letter_spacing.Localize(), FcuLocKey.tooltip_override_tmp_letter_spacing.Localize()),
|
||||
monoBeh.Settings.TextFontsSettings.OverrideLetterSpacing);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.TextFontsSettings.OverrideLineSpacingPx = gui.Toggle(new GUIContent(FcuLocKey.label_override_line_spacing_px.Localize(), FcuLocKey.tooltip_override_line_spacing_px.Localize()),
|
||||
monoBeh.Settings.TextFontsSettings.OverrideLineSpacingPx);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
switch (monoBeh.Settings.TextFontsSettings.TextComponent)
|
||||
{
|
||||
case TextComponent.UnityText:
|
||||
DrawDefaultTextSettings();
|
||||
break;
|
||||
case TextComponent.TextMeshPro:
|
||||
case TextComponent.RTLTextMeshPro:
|
||||
this.TextMeshSettingsSection.Draw();
|
||||
break;
|
||||
}
|
||||
|
||||
gui.Space15();
|
||||
gui.SectionHeader(FcuLocKey.label_font_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
DrawPathSettings();
|
||||
|
||||
gui.Space15();
|
||||
|
||||
DrawGoogleFontsSettings();
|
||||
|
||||
#if TextMeshPro
|
||||
gui.Space15();
|
||||
DrawFontGenerationSettings();
|
||||
#endif
|
||||
|
||||
gui.Space30();
|
||||
}
|
||||
|
||||
public void DrawDefaultTextSettings()
|
||||
{
|
||||
gui.DrawObjectFields(monoBeh.Settings.UnityTextSettings);
|
||||
|
||||
if (monoBeh.Settings.UnityTextSettings.VerticalWrapMode == VerticalWrapMode.Overflow)
|
||||
{
|
||||
monoBeh.Settings.UnityTextSettings.BestFit = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawFontGenerationSettings()
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_asset_creator_settings.Localize(), FcuLocKey.tooltip_asset_creator_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
monoBeh.FontDownloader.TmpDownloader.SamplingPointSize = gui.IntField(new GUIContent(FcuLocKey.label_sampling_point_size.Localize(), FcuLocKey.tooltip_sampling_point_size.Localize()),
|
||||
monoBeh.FontDownloader.TmpDownloader.SamplingPointSize);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasPadding = gui.IntField(new GUIContent(FcuLocKey.label_atlas_padding.Localize(), FcuLocKey.tooltip_atlas_padding.Localize()),
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasPadding);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.FontDownloader.TmpDownloader.RenderMode = gui.EnumField(new GUIContent(FcuLocKey.label_render_mode.Localize(), FcuLocKey.tooltip_render_mode.Localize()),
|
||||
monoBeh.FontDownloader.TmpDownloader.RenderMode);
|
||||
|
||||
gui.Space10();
|
||||
|
||||
Vector2Int atlasResolution = new Vector2Int(monoBeh.FontDownloader.TmpDownloader.AtlasWidth, monoBeh.FontDownloader.TmpDownloader.AtlasHeight);
|
||||
atlasResolution = gui.Vector2IntField(new GUIContent(FcuLocKey.label_atlas_resolution.Localize(), FcuLocKey.tooltip_atlas_resolution.Localize()), atlasResolution);
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasWidth = atlasResolution.x;
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasHeight = atlasResolution.y;
|
||||
|
||||
gui.Space10();
|
||||
|
||||
#if TextMeshPro
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasPopulationMode = gui.EnumField(new GUIContent(FcuLocKey.label_atlas_population_mode.Localize(), FcuLocKey.tooltip_atlas_population_mode.Localize()),
|
||||
monoBeh.FontDownloader.TmpDownloader.AtlasPopulationMode);
|
||||
#endif
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.FontDownloader.TmpDownloader.EnableMultiAtlasSupport = gui.Toggle(new GUIContent(FcuLocKey.label_enable_multi_atlas_support.Localize(), FcuLocKey.tooltip_enable_multi_atlas_support.Localize()),
|
||||
monoBeh.FontDownloader.TmpDownloader.EnableMultiAtlasSupport);
|
||||
|
||||
gui.Space15();
|
||||
|
||||
if (gui.OutlineButton(FcuLocKey.label_download_fonts_from_project.Localize(monoBeh.Settings.TextFontsSettings.TextComponent)))
|
||||
{
|
||||
_ = monoBeh.FontDownloader.DownloadAllProjectFonts();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawGoogleFontsSettings()
|
||||
{
|
||||
gui.SectionHeader(FcuLocKey.label_google_fonts_settings.Localize());
|
||||
gui.Space15();
|
||||
|
||||
FcuConfig.Instance.GoogleFontsApiKey = gui.TextField(
|
||||
new GUIContent(FcuLocKey.label_google_fonts_api_key.Localize(), FcuLocKey.tooltip_google_fonts_api_key.Localize(FcuLocKey.label_google_fonts_api_key.Localize())),
|
||||
FcuConfig.Instance.GoogleFontsApiKey,
|
||||
new GUIContent(FcuLocKey.label_get_google_api_key.Localize()), () =>
|
||||
{
|
||||
Application.OpenURL("https://developers.google.com/fonts/docs/developer_api#identifying_your_application_to_google");
|
||||
});
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.FontDownloader.GFontsApi.FontSubsets |= FontSubset.Latin;
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(
|
||||
scriptableObject.SerializedObject, x => x.FontDownloader.GFontsApi.FontSubsets);
|
||||
}
|
||||
|
||||
private void DrawPathSettings()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
monoBeh.FontLoader.TtfFontsPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_ttf_path.Localize(), ""),
|
||||
monoBeh.FontLoader.TtfFontsPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_fonts_folder.Localize());
|
||||
|
||||
gui.Space10();
|
||||
|
||||
if (gui.SubButtonText(FcuLocKey.label_add_ttf_fonts_from_folder.Localize(), FcuLocKey.tooltip_add_fonts_from_folder.Localize()))
|
||||
{
|
||||
_ = monoBeh.FontLoader.AddToTtfFontsList();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
gui.Space5();
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.FontLoader.TtfFonts);
|
||||
|
||||
#if TextMeshPro
|
||||
gui.Space15();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
monoBeh.FontLoader.TmpFontsPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_tmp_path.Localize(), ""),
|
||||
monoBeh.FontLoader.TmpFontsPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_fonts_folder.Localize());
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.SubButtonText(FcuLocKey.label_add_tmp_fonts_from_folder.Localize(), FcuLocKey.tooltip_add_fonts_from_folder.Localize()))
|
||||
{
|
||||
_ = monoBeh.FontLoader.AddToTmpMeshFontsList();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space5();
|
||||
|
||||
gui.SerializedPropertyField<FigmaConverterUnity>(scriptableObject.SerializedObject, x => x.FontLoader.TmpFonts);
|
||||
#endif
|
||||
}
|
||||
|
||||
private TextMeshSection textMeshSettingsSection;
|
||||
internal TextMeshSection TextMeshSettingsSection => monoBeh.Link(ref textMeshSettingsSection, scriptableObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc10d3e2df124c14e8bd38c05576df10
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using DA_Assets.DAI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class UITK_Tab : MonoBehaviourLinkerEditor<FcuSettingsWindow, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
gui.TabHeader(FcuLocKey.label_ui_toolkit_tab.Localize(), FcuLocKey.tooltip_ui_toolkit_tab.Localize());
|
||||
gui.Space15();
|
||||
|
||||
#if UITK_LINKER_EXISTS
|
||||
monoBeh.Settings.UITK_Settings.UitkLinkingMode = gui.EnumField(
|
||||
new GUIContent(FcuLocKey.label_uitk_linking_mode.Localize(), FcuLocKey.tooltip_uitk_linking_mode.Localize()),
|
||||
monoBeh.Settings.UITK_Settings.UitkLinkingMode);
|
||||
#endif
|
||||
|
||||
gui.Space10();
|
||||
|
||||
monoBeh.Settings.UITK_Settings.UitkOutputPath = gui.FolderField(
|
||||
new GUIContent(FcuLocKey.label_uitk_output_path.Localize(), FcuLocKey.tooltip_uitk_output_path.Localize()),
|
||||
monoBeh.Settings.UITK_Settings.UitkOutputPath,
|
||||
new GUIContent(FcuLocKey.label_change.Localize()),
|
||||
FcuLocKey.label_select_folder.Localize());
|
||||
|
||||
gui.Space10();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb361c999f81c4e4b99de284aa558d38
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d24035235f43962478f3bd5a675503d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,96 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Model;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class ComparerWindow : EditorWindow
|
||||
{
|
||||
private static Vector2 windowSize = new Vector2(410, 290);
|
||||
private SyncHelper sh1, sh2;
|
||||
private DAInspector gui => BlackInspector.Instance.Inspector;
|
||||
|
||||
public static void Show(SyncHelper sh1, SyncHelper sh2)
|
||||
{
|
||||
ComparerWindow win = GetWindow<ComparerWindow>(FcuLocKey.label_object_comparer.Localize());
|
||||
win.SetModel(sh1, sh2);
|
||||
|
||||
win.position = new Rect(
|
||||
(Screen.currentResolution.width - windowSize.x * 2) / 2,
|
||||
(Screen.currentResolution.height - windowSize.y * 2) / 2,
|
||||
windowSize.x,
|
||||
windowSize.y);
|
||||
}
|
||||
|
||||
public void SetModel(SyncHelper sh1, SyncHelper sh2)
|
||||
{
|
||||
this.sh1 = sh1;
|
||||
this.sh2 = sh2;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.TabBg2,
|
||||
Scroll = true,
|
||||
Body = () =>
|
||||
{
|
||||
gui.Label12px(FcuLocKey.label_comparer_desc.Localize(FcuLocKey.label_open_diff_checker.Localize()));
|
||||
|
||||
gui.Space5();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
GUILayout.TextArea(sh1.Data.HashDataTree, GUILayout.Height(100));
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.OutlineButton(FcuLocKey.label_copy_to_clipboard.Localize(), null, true))
|
||||
{
|
||||
GUIUtility.systemCopyBuffer = sh1.Data.HashDataTree;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space5();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Body = () =>
|
||||
{
|
||||
GUILayout.TextArea(sh2.Data.HashDataTree, GUILayout.Height(100));
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.OutlineButton(FcuLocKey.label_copy_to_clipboard.Localize(), null, true))
|
||||
{
|
||||
GUIUtility.systemCopyBuffer = sh2.Data.HashDataTree;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space5();
|
||||
|
||||
if (gui.OutlineButton(FcuLocKey.label_open_diff_checker.Localize(), null, true))
|
||||
{
|
||||
Application.OpenURL($"https://www.diffchecker.com/");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 050d9c123abe21749a4c690ea0ac76dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,230 @@
|
||||
using DA_Assets.DAI;
|
||||
using DA_Assets.FCU.Extensions;
|
||||
using DA_Assets.Tools;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable IDE0003
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
internal class FcuSettingsWindow : LinkedEditorWindow<FcuSettingsWindow, FcuEditor, FigmaConverterUnity, BlackInspector>
|
||||
{
|
||||
private List<UITab> _tabs = new List<UITab>();
|
||||
private int _selectedTab = 0;
|
||||
private AssetVersion _currentVersion;
|
||||
|
||||
public override void OnShow()
|
||||
{
|
||||
CreateTabs();
|
||||
_currentVersion = UpdateChecker.GetCurrentVersionInfo(AssetType.fcu, FcuConfig.Instance.ProductVersion);
|
||||
}
|
||||
|
||||
public void CreateTabs()
|
||||
{
|
||||
_tabs.Clear();
|
||||
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
UITab assetTab = new UITab(FcuLocKey.label_asset.Localize(), null, this.MainTab.Draw);
|
||||
_tabs.Add(assetTab);
|
||||
}
|
||||
|
||||
UITab mainSettingTab = new UITab(FcuLocKey.label_main_settings.Localize(), null, this.MainSettingsTab.Draw);
|
||||
_tabs.Add(mainSettingTab);
|
||||
|
||||
UITab authTab = new UITab(FcuLocKey.label_figma_auth.Localize(), FcuLocKey.tooltip_figma_auth.Localize(), this.AuthorizerTab.Draw);
|
||||
_tabs.Add(authTab);
|
||||
|
||||
UITab imageSpritesTab = new UITab(FcuLocKey.label_images_and_sprites_tab.Localize(), FcuLocKey.tooltip_images_and_sprites_tab.Localize(), this.ImageSpritesTab.Draw);
|
||||
_tabs.Add(imageSpritesTab);
|
||||
|
||||
UITab textFontTab = new UITab(FcuLocKey.label_text_and_fonts.Localize(), FcuLocKey.tooltip_text_and_fonts.Localize(), this.TextFontsTab.Draw);
|
||||
_tabs.Add(textFontTab);
|
||||
|
||||
if (monoBeh.IsUGUI() || monoBeh.IsNova() || monoBeh.IsDebug())
|
||||
{
|
||||
UITab buttonsTab = new UITab(FcuLocKey.label_buttons_tab.Localize(), FcuLocKey.tooltip_buttons_tab.Localize(), this.ButtonsTab.Draw);
|
||||
_tabs.Add(buttonsTab);
|
||||
}
|
||||
|
||||
UITab uitkTab = new UITab(FcuLocKey.label_ui_toolkit_tab.Localize(), FcuLocKey.tooltip_ui_toolkit_tab.Localize(), this.UITK_Tab.Draw);
|
||||
_tabs.Add(uitkTab);
|
||||
|
||||
UITab locTab = new UITab(FcuLocKey.label_localization_settings.Localize(), null, this.LocalizationTab.Draw);
|
||||
_tabs.Add(locTab);
|
||||
|
||||
if (monoBeh.IsUGUI() || monoBeh.IsDebug())
|
||||
{
|
||||
UITab shadowsTab = new UITab(FcuLocKey.label_shadows_tab.Localize(), FcuLocKey.tooltip_shadows_tab.Localize(), this.ShadowsTab.Draw);
|
||||
_tabs.Add(shadowsTab);
|
||||
}
|
||||
|
||||
if (monoBeh.IsUGUI() || monoBeh.IsNova() || monoBeh.IsDebug())
|
||||
{
|
||||
UITab prefabsTab = new UITab(FcuLocKey.label_prefab_creator.Localize(), null, this.PrefabCreatorTab.Draw);
|
||||
_tabs.Add(prefabsTab);
|
||||
}
|
||||
|
||||
UITab scriptGeneratorTab = new UITab(FcuLocKey.label_script_generator.Localize(), FcuLocKey.tooltip_script_generator.Localize(), this.ScriptGeneratorTab.Draw);
|
||||
_tabs.Add(scriptGeneratorTab);
|
||||
|
||||
UITab importEventsTab = new UITab(FcuLocKey.label_import_events.Localize(), null, this.ImportEventsTab.Draw);
|
||||
_tabs.Add(importEventsTab);
|
||||
|
||||
UITab debugTools = new UITab(FcuLocKey.label_debug.Localize(), FcuLocKey.tooltip_debug_tools.Localize(), this.DebugTab.Draw);
|
||||
_tabs.Add(debugTools);
|
||||
|
||||
_tabs[_selectedTab].Selected = true;
|
||||
}
|
||||
|
||||
public override void DrawGUI()
|
||||
{
|
||||
if (_tabs.Count < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (monoBeh.Settings.MainSettings.WindowMode)
|
||||
{
|
||||
titleContent = new GUIContent(FcuLocKey.label_fcu.Localize());
|
||||
}
|
||||
else
|
||||
{
|
||||
titleContent = new GUIContent(FcuLocKey.label_settings.Localize());
|
||||
}
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
DrawMenu();
|
||||
gui.VerticalSeparator();
|
||||
DrawTabContent();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawMenu()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.HamburgerTabsBg,
|
||||
Options = new[] { GUILayout.Width(200) },
|
||||
Scroll = true,
|
||||
InstanceId = monoBeh.GetInstanceID(),
|
||||
Body = () =>
|
||||
{
|
||||
for (int i = 0; i < _tabs.Count; i++)
|
||||
{
|
||||
if (gui.TabButton(_tabs[i]))
|
||||
{
|
||||
_selectedTab = i;
|
||||
_tabs[i].Selected = true;
|
||||
|
||||
for (int j = 0; j < _tabs.Count; j++)
|
||||
{
|
||||
if (i != j)
|
||||
{
|
||||
_tabs[j].Selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gui.FlexibleSpace();
|
||||
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Horizontal,
|
||||
Body = () =>
|
||||
{
|
||||
gui.Space10();
|
||||
|
||||
switch (_currentVersion.VersionType)
|
||||
{
|
||||
case VersionType.stable:
|
||||
gui.Label10px(FcuLocKey.label_stable_version.Localize(), null);
|
||||
break;
|
||||
case VersionType.beta:
|
||||
gui.Label10px(FcuLocKey.label_beta_version.Localize(), null);
|
||||
break;
|
||||
case VersionType.buggy:
|
||||
gui.RedLinkLabel10px(new GUIContent(FcuLocKey.label_buggy_version.Localize()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gui.Space(7);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawTabContent()
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.TabBg1,
|
||||
Scroll = true,
|
||||
InstanceId = monoBeh.GetInstanceID(),
|
||||
Body = () =>
|
||||
{
|
||||
gui.DrawGroup(new Group
|
||||
{
|
||||
GroupType = GroupType.Vertical,
|
||||
Style = gui.ColoredStyle.TabBg2,
|
||||
Body = () =>
|
||||
{
|
||||
_tabs[_selectedTab].Content.Invoke();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private MainTab mainTab;
|
||||
internal MainTab MainTab => monoBeh.Link(ref mainTab, this);
|
||||
|
||||
private LocalizationTab localizationTab;
|
||||
internal LocalizationTab LocalizationTab => monoBeh.Link(ref localizationTab, this);
|
||||
|
||||
private ButtonsTab buttonsTab;
|
||||
internal ButtonsTab ButtonsTab => monoBeh.Link(ref buttonsTab, this);
|
||||
|
||||
private MainSettingsTab mainSettingsTab;
|
||||
internal MainSettingsTab MainSettingsTab => monoBeh.Link(ref mainSettingsTab, this);
|
||||
|
||||
private ScriptGeneratorTab scriptGeneratorTab;
|
||||
internal ScriptGeneratorTab ScriptGeneratorTab => monoBeh.Link(ref scriptGeneratorTab, this);
|
||||
|
||||
private AuthTab authorizerTab;
|
||||
internal AuthTab AuthorizerTab => monoBeh.Link(ref authorizerTab, this);
|
||||
|
||||
private TextFontsTab textFontsTab;
|
||||
internal TextFontsTab TextFontsTab => monoBeh.Link(ref textFontsTab, this);
|
||||
|
||||
private UITK_Tab uitkTab;
|
||||
internal UITK_Tab UITK_Tab => monoBeh.Link(ref uitkTab, this);
|
||||
|
||||
private ImageSpritesTab imageSpritesTab;
|
||||
internal ImageSpritesTab ImageSpritesTab => monoBeh.Link(ref imageSpritesTab, this);
|
||||
|
||||
private ShadowsTab shadowsTab;
|
||||
internal ShadowsTab ShadowsTab => monoBeh.Link(ref shadowsTab, this);
|
||||
|
||||
private ImportEventsTab importEventsTab;
|
||||
internal ImportEventsTab ImportEventsTab => monoBeh.Link(ref importEventsTab, this);
|
||||
|
||||
private DebugTab debugTab;
|
||||
internal DebugTab DebugTab => monoBeh.Link(ref debugTab, this);
|
||||
|
||||
private PrefabCreatorTab prefabCreatorTab;
|
||||
internal PrefabCreatorTab PrefabCreatorTab => monoBeh.Link(ref prefabCreatorTab, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f33d6c165f60e2a40b16636d85ef8189
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c4710d8a48c84746bbf512826a589d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 049369e8fc56b424096f0b61f0382cc6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 712e0d67c6de2c84eb01f7eb27910519
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
#if JSONNET_EXISTS
|
||||
using Newtonsoft.Json;
|
||||
#endif
|
||||
|
||||
namespace DA_Assets.FCU.Model
|
||||
{
|
||||
public struct AuthResult
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("access_token")]
|
||||
#endif
|
||||
public string AccessToken { get; set; }
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("expires_in")]
|
||||
#endif
|
||||
public string ExpiresIn { get; set; }
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("refresh_token")]
|
||||
#endif
|
||||
public string RefreshToken { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 354bdafd6ab9b134faecff943a0ff340
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3731067170012443ab12dd8ea9fca47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
#if JSONNET_EXISTS
|
||||
using Newtonsoft.Json;
|
||||
#endif
|
||||
|
||||
namespace DA_Assets.FCU.Model
|
||||
{
|
||||
[Serializable]
|
||||
public struct FigmaUser
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("id")]
|
||||
#endif
|
||||
public string Id { get; set; }
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("handle")]
|
||||
#endif
|
||||
public string Name { get; set; }
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("email")]
|
||||
#endif
|
||||
public string Email { get; set; }
|
||||
#if JSONNET_EXISTS
|
||||
[JsonProperty("img_url")]
|
||||
#endif
|
||||
public string ImgUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4900b6b9596bc5d4092a7c186a9d682d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35d4bf06fd4d60148a0a52f6345aa8ff
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace DA_Assets.FCU.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field, AllowMultiple = false)]
|
||||
public class FObjectAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The object's name in Figma.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
public FObjectAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af80620cfa3a6394b8b14198dc5f84d4
|
||||
@@ -0,0 +1,41 @@
|
||||
using DA_Assets.DAI;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
||||
public class FcuInspectorProperty : CustomInspectorProperty
|
||||
{
|
||||
public FcuInspectorProperty(
|
||||
ComponentType type,
|
||||
FcuLocKey label,
|
||||
FcuLocKey tooltip,
|
||||
float minValue = 0,
|
||||
float maxValue = 1) : base(type, new GUIContent(GetLabelFromEnum(label), GetLabelFromEnum(tooltip)), minValue, maxValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static string GetLabelFromEnum(FcuLocKey value)
|
||||
{
|
||||
return value.Localize();
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)]
|
||||
public class FcuPropertyHeader : PropertyHeader
|
||||
{
|
||||
public FcuPropertyHeader(
|
||||
FcuLocKey label,
|
||||
FcuLocKey tooltip) : base(new GUIContent(GetLabelFromEnum(label), GetLabelFromEnum(tooltip)))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static string GetLabelFromEnum(FcuLocKey value)
|
||||
{
|
||||
return value.Localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c43b919dc8a35843b4a83a298c874a1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace DA_Assets.FCU.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class PaintPriorityAttribute : Attribute
|
||||
{
|
||||
public int Priority { get; }
|
||||
|
||||
public PaintPriorityAttribute(int priority)
|
||||
{
|
||||
Priority = priority;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa800b8053a516044b19668e55e95eff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e74f51a5e6e3c24da8a04e17eb043cf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,162 @@
|
||||
using DA_Assets.Constants;
|
||||
using DA_Assets.Extensions;
|
||||
using DA_Assets.FCU.Model;
|
||||
using DA_Assets.Singleton;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
[CreateAssetMenu(menuName = DAConstants.Publisher + "/FCU Config")]
|
||||
public class FcuConfig : AssetConfig<FcuConfig>
|
||||
{
|
||||
[SerializeField] List<TagConfig> tags;
|
||||
public List<TagConfig> TagConfigs => tags;
|
||||
|
||||
[Header("File names")]
|
||||
[SerializeField] string webLogFileName;
|
||||
public string WebLogFileName => webLogFileName;
|
||||
|
||||
[Header("Formats")]
|
||||
[SerializeField] string dateTimeFormat1;
|
||||
public string DateTimeFormat1 => dateTimeFormat1;
|
||||
|
||||
[SerializeField] string dateTimeFormat2;
|
||||
public string DateTimeFormat2 => dateTimeFormat2;
|
||||
|
||||
[SerializeField] string dateTimeFormat3;
|
||||
public string DateTimeFormat3 => dateTimeFormat3;
|
||||
|
||||
[Header("GameObject names")]
|
||||
[SerializeField] string canvasGameObjectName;
|
||||
public string CanvasGameObjectName => canvasGameObjectName;
|
||||
[SerializeField] string i2LocGameObjectName;
|
||||
public string I2LocGameObjectName => i2LocGameObjectName;
|
||||
|
||||
[Header("Values")]
|
||||
[SerializeField] int recentProjectsLimit = 20;
|
||||
public int RecentProjectsLimit => recentProjectsLimit;
|
||||
|
||||
[SerializeField] int figmaSessionsLimit = 10;
|
||||
public int FigmaSessionsLimit => figmaSessionsLimit;
|
||||
|
||||
[SerializeField] int logFilesLimit = 50;
|
||||
public int LogFilesLimit => logFilesLimit;
|
||||
|
||||
[SerializeField] int maxRenderSize = 4096;
|
||||
public int MaxRenderSize => maxRenderSize;
|
||||
|
||||
[SerializeField] int renderUpscaleFactor = 2;
|
||||
public int RenderUpscaleFactor => renderUpscaleFactor;
|
||||
|
||||
[SerializeField] string blurredObjectTag = "UIBlur";
|
||||
public string BlurredObjectTag => blurredObjectTag;
|
||||
|
||||
[SerializeField] string blurCameraTag = "BackgroundBlur";
|
||||
public string BlurCameraTag => blurCameraTag;
|
||||
|
||||
[SerializeField] char realTagSeparator = '-';
|
||||
public char RealTagSeparator => realTagSeparator;
|
||||
|
||||
[Header("Api")]
|
||||
[SerializeField] int apiRequestsCountLimit = 2;
|
||||
public int ApiRequestsCountLimit => apiRequestsCountLimit;
|
||||
|
||||
[SerializeField] int apiTimeoutSec = 5;
|
||||
public int ApiTimeoutSec => apiTimeoutSec;
|
||||
|
||||
[SerializeField] int chunkSizeGetNodes;
|
||||
public int ChunkSizeGetNodes => chunkSizeGetNodes;
|
||||
|
||||
[SerializeField] int frameListDepth = 2;
|
||||
public int FrameListDepth => frameListDepth;
|
||||
|
||||
[SerializeField] string gFontsApiKey;
|
||||
public string GoogleFontsApiKey { get => gFontsApiKey; set => gFontsApiKey = value; }
|
||||
|
||||
[Header("Other")]
|
||||
[SerializeField] Sprite whiteSprite32px;
|
||||
public Sprite WhiteSprite32px => whiteSprite32px;
|
||||
|
||||
[SerializeField] Sprite missingImageTexture128px;
|
||||
public Sprite MissingImageTexture128px => missingImageTexture128px;
|
||||
|
||||
[SerializeField] TextAsset baseClass;
|
||||
public TextAsset BaseClass => baseClass;
|
||||
|
||||
[SerializeField] Material imageLinearMaterial;
|
||||
public Material ImageLinearMaterial => imageLinearMaterial;
|
||||
|
||||
[SerializeField] VectorMaterials vectorMaterials;
|
||||
public VectorMaterials VectorMaterials => vectorMaterials;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//CONSTANTS//////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public const string ProductName = "Figma Converter for Unity";
|
||||
public const string ProductNameShort = "FCU";
|
||||
public const string DestroyChilds = "Destroy childs";
|
||||
public const string SetFcuToSyncHelpers = "Set current FCU to SyncHelpers";
|
||||
public const string CompareTwoObjects = "Compare two selected objects";
|
||||
public const string DestroyLastImported = "Destroy last imported frames";
|
||||
public const string DestroySyncHelpers = "Destroy SyncHelpers";
|
||||
public const string CreatePrefabs = "Create Prefabs";
|
||||
public const string UpdatePrefabs = "Update Prefabs";
|
||||
public const string Create = "Create";
|
||||
public const string OptimizeSyncHelpers = "Optimize SyncHelpers";
|
||||
public const string GenerateScripts = "Generate scripts";
|
||||
|
||||
public const float IMAGE_SCALE_MIN = 0.25f;
|
||||
public const float IMAGE_SCALE_MAX = 4f;
|
||||
|
||||
public static char HierarchyDelimiter { get; } = '/';
|
||||
public static string PARENT_ID { get; } = "603951929:602259738";
|
||||
public static char AsterisksChar { get; } = '•';
|
||||
public static string DefaultLocalizationCulture { get; } = "en-US";
|
||||
|
||||
public static string RATEME_PREFS_KEY { get; } = "DONT_SHOW_RATEME";
|
||||
public static string RECENT_PROJECTS_PREFS_KEY { get; } = "recentProjectsPrefsKey";
|
||||
public static string FIGMA_SESSIONS_PREFS_KEY { get; } = "FigmaSessions";
|
||||
|
||||
public static string ClientId => "LaB1ONuPoY7QCdfshDbQbT";
|
||||
public static string ClientSecret => "E9PblceydtAyE7Onhg5FHLmnvingDp";
|
||||
public static string RedirectUri => "http://localhost:1923/";
|
||||
public static string AuthUrl => "https://www.figma.com/api/oauth/token?client_id={0}&client_secret={1}&redirect_uri={2}&code={3}&grant_type=authorization_code";
|
||||
public static string OAuthUrl => "https://www.figma.com/oauth?client_id={0}&redirect_uri={1}&scope=file_read&state={2}&response_type=code";
|
||||
|
||||
private static string logPath;
|
||||
public static string LogPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (logPath.IsEmpty())
|
||||
logPath = Path.Combine(Directory.GetParent(Application.dataPath).FullName, "Logs");
|
||||
|
||||
logPath.CreateFolderIfNotExists();
|
||||
|
||||
return logPath;
|
||||
}
|
||||
}
|
||||
|
||||
private static string cachePath;
|
||||
public static string CachePath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (cachePath.IsEmpty())
|
||||
{
|
||||
string tempFolder = Path.GetTempPath();
|
||||
cachePath = Path.Combine(tempFolder, "FcuCache");
|
||||
}
|
||||
|
||||
cachePath.CreateFolderIfNotExists();
|
||||
|
||||
return cachePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 471efbc970a337c4c83b1330ba757435
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
using DA_Assets.Tools;
|
||||
using System.Linq;
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
public class FcuDebugSettings
|
||||
{
|
||||
private const string FCU_DEBUG_PREFS_KEY = "FCU_DEBUG_FLAGS";
|
||||
private static FcuDebugSettingsFlags flags;
|
||||
|
||||
static FcuDebugSettings()
|
||||
{
|
||||
FcuDebugSettingsFlags[] debugFlags = new FcuDebugSettingsFlags[]
|
||||
{
|
||||
FcuDebugSettingsFlags.LogDefault,
|
||||
FcuDebugSettingsFlags.LogSetTag,
|
||||
FcuDebugSettingsFlags.LogIsDownloadable,
|
||||
FcuDebugSettingsFlags.LogTransform,
|
||||
FcuDebugSettingsFlags.LogGameObjectDrawer,
|
||||
FcuDebugSettingsFlags.LogComponentDrawer,
|
||||
FcuDebugSettingsFlags.LogHashGenerator
|
||||
};
|
||||
|
||||
flags = (FcuDebugSettingsFlags)LocalPrefs.GetInt(FCU_DEBUG_PREFS_KEY, (int)debugFlags.Aggregate((acc, flag) => acc | flag));
|
||||
}
|
||||
|
||||
public static FcuDebugSettingsFlags Settings
|
||||
{
|
||||
get
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (flags != value)
|
||||
{
|
||||
flags = value;
|
||||
LocalPrefs.SetInt(FCU_DEBUG_PREFS_KEY, (int)flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16c8888a480355f41ada786e50e2d3e9
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace DA_Assets.FCU.Model
|
||||
{
|
||||
[Serializable]
|
||||
public struct TagConfig
|
||||
{
|
||||
[SerializeField] string label;
|
||||
[SerializeField] FcuTag fcuTag;
|
||||
[SerializeField] string figmaTag;
|
||||
[SerializeField] bool customButtonTag;
|
||||
[SerializeField] bool canBeDownloaded;
|
||||
[SerializeField] bool canBeInsideSingleImage;
|
||||
[SerializeField] bool hasComponent;
|
||||
|
||||
public FcuTag FcuTag => fcuTag;
|
||||
public string FigmaTag => figmaTag;
|
||||
public bool CustomButtonTag => customButtonTag;
|
||||
public bool CanBeDownloaded => canBeDownloaded;
|
||||
/// <summary>
|
||||
/// If the parent component includes at least one component with 1 == fall, it cannot be a downloadable image.
|
||||
/// </summary>
|
||||
public bool CanBeInsideSingleImage => canBeInsideSingleImage;
|
||||
/// <summary>
|
||||
/// Needed to count instantiated scripts/components.
|
||||
/// </summary>
|
||||
public bool HasComponent => hasComponent;
|
||||
|
||||
public void SetDefaultData(FcuTag fcuTag)
|
||||
{
|
||||
this.label = fcuTag.ToString();
|
||||
this.fcuTag = fcuTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aaaa5a9158c5bf043866042fa968b2e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 918d6ace255af2845bc2032d17356d04
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,154 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using DA_Assets.Extensions;
|
||||
|
||||
|
||||
#if JSONNET_EXISTS
|
||||
using Newtonsoft.Json;
|
||||
#endif
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
public class DAFormatter
|
||||
{
|
||||
static List<string> GetJsonPropertyNames<T>()
|
||||
{
|
||||
List<string> propertyNames = new List<string>();
|
||||
|
||||
FieldInfo[] fields = typeof(T).GetFields(BindingFlags.Public | BindingFlags.Instance);
|
||||
PropertyInfo[] properties = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
foreach (var field in fields)
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
JsonPropertyAttribute attribute = field.GetCustomAttribute<JsonPropertyAttribute>();
|
||||
if (attribute != null)
|
||||
{
|
||||
propertyNames.Add(attribute.PropertyName ?? field.Name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
JsonPropertyAttribute attribute = property.GetCustomAttribute<JsonPropertyAttribute>();
|
||||
if (attribute != null)
|
||||
{
|
||||
propertyNames.Add(attribute.PropertyName ?? property.Name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return propertyNames;
|
||||
}
|
||||
|
||||
private const int indentLength = 4;
|
||||
|
||||
private static string Repeat(int n) => new string(' ', n * indentLength);
|
||||
|
||||
public static JFResult Format<T>(string str)
|
||||
{
|
||||
JFResult jsonFormatResult = new JFResult();
|
||||
|
||||
if (str.IsEmpty())
|
||||
{
|
||||
return new JFResult
|
||||
{
|
||||
Json = string.Empty,
|
||||
IsValid = false,
|
||||
MatchTargetType = false
|
||||
};
|
||||
}
|
||||
|
||||
List<string> typeNames = GetJsonPropertyNames<T>();
|
||||
|
||||
foreach (string typeName in typeNames)
|
||||
{
|
||||
if (str.Contains($"\"{typeName}\""))
|
||||
{
|
||||
jsonFormatResult.MatchTargetType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool hasOpenBrace = false;
|
||||
bool hasCloseBrace = false;
|
||||
|
||||
int indent = 0;
|
||||
bool quoted = false;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for (var i = 0; i < str.Length; i++)
|
||||
{
|
||||
var ch = str[i];
|
||||
switch (ch)
|
||||
{
|
||||
case '{':
|
||||
case '[':
|
||||
if (ch == '{')
|
||||
hasOpenBrace = true;
|
||||
|
||||
sb.Append(ch);
|
||||
if (quoted == false)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.Append(Repeat(++indent));
|
||||
}
|
||||
break;
|
||||
case '}':
|
||||
case ']':
|
||||
if (ch == '}')
|
||||
hasCloseBrace = true;
|
||||
|
||||
if (quoted == false)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.Append(Repeat(--indent));
|
||||
}
|
||||
sb.Append(ch);
|
||||
break;
|
||||
case '"':
|
||||
sb.Append(ch);
|
||||
bool escaped = false;
|
||||
var index = i;
|
||||
while (index > 0 && str[--index] == '\\')
|
||||
escaped = !escaped;
|
||||
if (escaped == false)
|
||||
quoted = !quoted;
|
||||
break;
|
||||
case ',':
|
||||
sb.Append(ch);
|
||||
if (quoted == false)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.Append(Repeat(indent));
|
||||
}
|
||||
break;
|
||||
case ':':
|
||||
sb.Append(ch);
|
||||
if (quoted == false)
|
||||
sb.Append(" ");
|
||||
break;
|
||||
default:
|
||||
sb.Append(ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
jsonFormatResult.Json = sb.ToString();
|
||||
jsonFormatResult.IsValid = hasOpenBrace && hasCloseBrace;
|
||||
|
||||
return jsonFormatResult;
|
||||
}
|
||||
}
|
||||
|
||||
public struct JFResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string Json { get; set; }
|
||||
public bool MatchTargetType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06a73c612ca81644c9da29771f70be48
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
#if JSONNET_EXISTS
|
||||
using Newtonsoft.Json;
|
||||
#endif
|
||||
|
||||
namespace DA_Assets.FCU
|
||||
{
|
||||
public class DAJson
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
private static JsonSerializerSettings settings = new JsonSerializerSettings()
|
||||
{
|
||||
Error = (sender, error) => error.ErrorContext.Handled = true,
|
||||
Formatting = Formatting.Indented
|
||||
};
|
||||
#endif
|
||||
public static string ToJson(object obj)
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
return JsonConvert.SerializeObject(obj, settings);
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
public static T FromJson<T>(string json)
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
return JsonConvert.DeserializeObject<T>(json, settings);
|
||||
#else
|
||||
return default(T);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static async Task<DAResult<T>> FromJsonAsync<T>(string json)
|
||||
{
|
||||
DAResult<T> @return = new DAResult<T>();
|
||||
|
||||
try
|
||||
{
|
||||
#if JSONNET_EXISTS == false
|
||||
throw new MissingComponentException("Json.NET packaghe is not installed.");
|
||||
#endif
|
||||
JFResult jfr = default;
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
jfr = DAFormatter.Format<T>(json);
|
||||
});
|
||||
|
||||
if (jfr.IsValid == false)
|
||||
{
|
||||
throw new Exception("Not valid json.");
|
||||
}
|
||||
|
||||
if (jfr.MatchTargetType == false)
|
||||
{
|
||||
throw new InvalidCastException("The input json does not match the target type.");
|
||||
}
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
#if JSONNET_EXISTS
|
||||
@return.Object = JsonConvert.DeserializeObject<T>(json, settings);
|
||||
#endif
|
||||
});
|
||||
|
||||
@return.Success = true;
|
||||
}
|
||||
catch (InvalidCastException ex)
|
||||
{
|
||||
@return.Success = false;
|
||||
@return.Error = new WebError(29, ex.Message, ex);
|
||||
}
|
||||
catch (MissingComponentException ex)
|
||||
{
|
||||
@return.Success = false;
|
||||
@return.Error = new WebError(455, ex.Message, ex);
|
||||
}
|
||||
catch (ThreadAbortException ex)
|
||||
{
|
||||
@return.Success = false;
|
||||
@return.Error = new WebError(-1, ex.Message, ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@return.Success = false;
|
||||
@return.Error = new WebError(422, ex.Message, ex);
|
||||
}
|
||||
|
||||
return @return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13a6488720117b440923d3f85416ede7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "DA_Assets.FCU",
|
||||
"rootNamespace": "DA_Assets.FCU",
|
||||
"references": [
|
||||
"GUID:1b74e700d4693d342a6732b0ca624858",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:68550284b645f4b9894995579f34290a",
|
||||
"GUID:552447fb6cdb3d34b969d73c1b33b7d8"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"Newtonsoft.Json.dll"
|
||||
],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd2d248e310f8234eb351b83126b632e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8fbd541e7e9a1e4e91ea5b1970b580a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user