Compare commits

...
465 Commits
Author SHA1 Message Date
Jiaqi Liu 4e25c7f593 Update ReleaseBuildPipeline.cs 2023-08-12 21:26:41 -07:00
Jiaqi Liu dbc4f3747d Update LiberationSans SDF - Fallback.asset 2023-08-12 21:06:15 -07:00
Jiaqi Liu 780a2087e6 v0.73 2023-08-12 20:58:47 -07:00
Jiaqi Liu 7f8ff06b6e Cache all audio files 2023-08-12 20:40:59 -07:00
Jiaqi Liu cb9cb24d77 Code refactoring 2023-08-12 19:24:57 -07:00
Jiaqi Liu feaac946e3 Fix charset and build issue 2023-08-12 18:34:40 -07:00
Jiaqi Liu 724a6f767e Supports Traditional Chinese version of the game 2023-08-12 18:19:34 -07:00
Jiaqi Liu ba630a21fa Code refactoring 2023-08-12 07:12:43 -07:00
Jiaqi Liu b1e199e0fb Read and parse ComboSkills + EffectLinkers 2023-08-12 05:45:15 -07:00
Jiaqi Liu f3c1d30215 Read and parse CombatActorInfo and SkillInfo in gdb file 2023-08-11 05:39:47 -07:00
Jiaqi Liu 25151a8479 Code refactoring 2023-08-10 08:04:05 -07:00
Jiaqi Liu 48a6ef0217 Code refactoring 2023-08-10 07:41:52 -07:00
Jiaqi Liu 0adcc69b9e Use default theme music for the game 2023-08-10 03:08:33 -07:00
Jiaqi Liu 9cb651ffd0 Disable auto graphics API on Android, check executable folder on Win/Linux for OG game data files by default 2023-08-10 02:01:33 -07:00
Jiaqi Liu dc3cfadd44 Remove unused assets 2023-08-09 03:59:11 -07:00
Jiaqi Liu dc96d1a257 Fix a minor issue 2023-08-08 00:48:47 -07:00
Jiaqi Liu 2b98a43ca2 Update settings 2023-08-07 23:33:50 -07:00
Jiaqi Liu 1c12b99056 v0.72 2023-08-07 23:22:03 -07:00
Jiaqi Liu 515f99d391 Supports Vulkan + SSAO on Android 2023-08-07 23:12:07 -07:00
Jiaqi Liu 5073f9ac49 Minor fix 2023-08-07 09:22:30 -07:00
Jiaqi Liu ee2128d5ca Add debug info on-off switch in settings menu 2023-08-07 08:35:02 -07:00
Jiaqi Liu d7c0a05165 Fix dialogue positioning issue when resizing the game window 2023-08-07 05:55:19 -07:00
Jiaqi Liu 0b27516bff Minor fixes 2023-08-07 04:27:02 -07:00
Jiaqi Liu b0eca97589 Tweaks and fixes 2023-08-06 09:44:45 -07:00
Jiaqi Liu 33f8f40399 v0.71 2023-08-06 07:57:36 -07:00
Jiaqi Liu ab24b6ab14 Tweak slide speed on SlidewayObject 2023-08-06 07:56:58 -07:00
Jiaqi Liu 55fc5504a5 v0.71 2023-08-06 07:47:28 -07:00
Jiaqi Liu a223a0ea1d Keep linear fog shader (used by PAL3A) 2023-08-06 07:12:44 -07:00
Jiaqi Liu d328f26c1f Implement mini map 2023-08-06 07:07:24 -07:00
Jiaqi Liu 0419a4bbd7 Update QualitySettings.asset 2023-08-06 00:53:50 -07:00
Jiaqi Liu 88a5db3420 Show game logo on launch 2023-08-05 23:48:58 -07:00
Jiaqi Liu 753c8baec5 UI and dialogue animation tweaks 2023-08-05 21:31:37 -07:00
Jiaqi Liu 417a6b22c5 v0.70 2023-08-05 06:35:27 -07:00
Jiaqi Liu ebcc8d8db2 Implement PAL3A task system 2023-08-05 06:17:29 -07:00
Jiaqi Liu d894cc81a4 Minor optimizations 2023-08-04 19:39:33 -07:00
Jiaqi Liu dfdc33c222 Set different default speed for player and NPC actor 2023-08-04 18:44:04 -07:00
Jiaqi Liu 478b8f7f7a Perf and GC optimizations 2023-08-03 22:39:44 -07:00
Jiaqi Liu 787a34ab26 Improve performance 2023-08-03 20:00:45 -07:00
Jiaqi Liu eb209ad1a8 Minor refactoring 2023-08-03 02:33:59 -07:00
Jiaqi Liu 5bd8914546 Check and notify if a new version is found on Github release page 2023-08-03 02:26:17 -07:00
Jiaqi Liu 4543719970 Minor fixes 2023-08-03 01:43:32 -07:00
Jiaqi Liu 54cb77247e Code refactoring on binary reader 2023-08-03 00:16:42 -07:00
Jiaqi Liu c5caa3f90f Use UnsafeBinaryReader only in IL2CPP mode (fix crash on Android Mono build) 2023-08-02 20:31:23 -07:00
Jiaqi Liu c3893fbf47 Implement PAL3A SceneEnableFogCommand + code refactoring
- Implement PAL3A SceneEnableFogCommand
- Improves logging
- Object 46 in scene M03-1 should block player
-
2023-08-02 19:42:22 -07:00
Jiaqi Liu 7b80432fe2 Minor fix 2023-08-02 00:53:54 -07:00
Jiaqi Liu c5e5301193 Fix build issue 2023-08-02 00:41:14 -07:00
Jiaqi Liu 75b5c4bdce Decrease default audio volume in resource viewer 2023-08-02 00:31:51 -07:00
Jiaqi Liu 0ea812e321 Add extract .cpk button to resource viewer with bug fixes 2023-08-02 00:24:37 -07:00
Jiaqi Liu c5dc4d7335 v0.67 2023-08-01 22:52:28 -07:00
Jiaqi Liu 34370ec2e8 Add more supported build targets 2023-08-01 22:28:53 -07:00
Jiaqi Liu bd892fb3fb Fix a regression on path separator handling for unix-like system 2023-08-01 21:52:38 -07:00
Jiaqi Liu 39c27b04d7 Implement flashing animation for time-sensitive dialogue 2023-08-01 20:59:35 -07:00
Jiaqi Liu b1afd47878 Add background image to dialogue selection buttons
Add background image to dialogue selection buttons.
Add mov preview in game resource viewer.
Add padding to dialogue selection button text
2023-08-01 16:15:36 -07:00
Jiaqi Liu 9286d3160a Code refactoring 2023-08-01 13:49:12 -07:00
Jiaqi Liu 54fb05093c Code refactoring 2023-08-01 09:00:29 -07:00
Jiaqi Liu f872dd7c3d Remove hack code 2023-07-31 00:59:36 -07:00
Jiaqi Liu 9ffebd2b71 Fix shader issue with Metal on MacOS 2023-07-31 00:48:07 -07:00
Jiaqi Liu 4c6c8752d9 Code refactoring 2023-07-30 22:01:05 -07:00
Jiaqi Liu db11847130 v0.66 2023-07-30 03:58:14 -07:00
Jiaqi Liu d88f737375 Code refactoring 2023-07-30 03:36:57 -07:00
Jiaqi Liu d1a7de0229 Fix a bug that might be caused by a delayed destroy 2023-07-30 02:55:42 -07:00
Jiaqi Liu 78e9692abc Upgrade dependencies 2023-07-29 14:55:58 -07:00
Jiaqi Liu 836463c795 Smoothen skeletal animation with interpolation 2023-07-29 02:07:26 -07:00
Jiaqi Liu 630166880f Fix: Use Slerp for quaternion Interpolation 2023-07-29 02:06:59 -07:00
Jiaqi Liu 421ee12a82 Properly implement logic to read mtl file and handle GB Material 2023-07-28 19:52:03 -07:00
Jiaqi Liu 4dd3992a32 v0.65 2023-07-27 22:12:51 -07:00
Jiaqi Liu 5fab0d867e Implement skeletal animation logic (#17)
Properly implements SkeletalModelRenderer + SkeletalAnimationActorActionController
2023-07-27 21:48:39 -07:00
Jiaqi Liu a1801f59f5 Upgrade Unity version 2023-07-20 20:41:22 -07:00
Jiaqi Liu 3f467944ce Fix a bug where actor might spawn at wrong Y position 2023-07-06 00:28:33 -07:00
Jiaqi Liu b1add2a940 Minor refactoring 2023-07-05 23:58:27 -07:00
Jiaqi Liu 3e8f350740 Upgrade packages 2023-07-01 23:34:41 -07:00
Jiaqi Liu 790f72d836 Merge branch 'main' of https://github.com/0x7c13/Pal3.Unity 2023-06-29 19:16:34 -07:00
Jiaqi Liu 4fcb2b74da Minor fixes 2023-06-29 19:16:32 -07:00
Jackie Liu e0d1cf0f80 Fix mono build issue 2023-06-29 12:58:54 -07:00
Jiaqi Liu bdb0476417 Fix build issue 2023-06-29 11:53:52 -07:00
Jackie Liu 4d23ec3c47 v0.64 2023-06-29 11:23:27 -07:00
Jackie Liu 4f6f411816 Code refactoring 2023-06-08 20:07:43 -07:00
Jackie Liu cf015037bf Upgrade project to Unity 2022.3 LTS 2023-06-01 19:26:48 -07:00
Jiaqi Liu 259768e954 Code refactoring 2023-04-24 13:15:19 +08:00
Jackie Liu 57a2189812 Update ProjectVersion.txt 2023-04-13 21:11:43 -07:00
Jackie Liu 00f7b223a0 Code refactoring 2023-04-12 22:36:49 -07:00
Jackie Liu e4791b460e Code refactoring 2023-04-10 03:27:14 -07:00
Jackie Liu 60458949df Code refactoring 2023-04-10 03:00:13 -07:00
Jackie Liu a8bfe5917b Upgrade NugetForUnity and nuget packages 2023-04-10 02:42:27 -07:00
Jackie Liu f90463466d Implement MshFile and MshFileReader 2023-04-10 02:29:08 -07:00
Jackie Liu e6a9cfb28a Fix spacing issue 2023-04-09 04:20:09 -07:00
Jackie Liu 7f22dfe51b Implement MovFile and MovFileReader 2023-04-09 04:15:19 -07:00
Jackie Liu ef8e891ab0 Code refactoring 2023-04-08 06:52:56 -07:00
Jackie Liu ee6b6ec2af Code refactoring 2023-04-07 19:40:50 -07:00
Jackie Liu 1406fc857e Deactivate main actor in init menu scene 2023-04-06 22:52:24 -07:00
Jackie Liu 09300bb28a Code refactoring 2023-04-06 22:39:53 -07:00
Jackie Liu c4ac634589 Code refactoring and bug fixes 2023-04-06 20:33:47 -07:00
Jackie Liu 3a101d6e0a Use TryAdd and TryGetValue for Dictionary ops 2023-04-06 08:36:30 -07:00
Jackie Liu 4a6d68ea59 Code refactoring 2023-04-06 08:02:02 -07:00
Jackie Liu a6eabdb8d8 Properly implement Hold behavior for actor 2023-04-05 00:52:51 -07:00
Jackie Liu 43133b2ebd Initial work on supporting bone animated actors 2023-04-04 23:24:21 -07:00
Jackie Liu 8d21346cd7 Code refactoring 2023-04-04 21:34:58 -07:00
Jackie Liu e0267dce3b Code refactoring 2023-04-04 18:27:04 -07:00
Jackie Liu 263d9fcd8c Code refactoring + bug fixes 2023-04-03 19:26:21 -07:00
Jackie Liu be5aebde3b Bug fixes 2023-04-03 02:32:37 -07:00
Jackie Liu 142593a9f2 v0.63 2023-04-03 01:41:11 -07:00
Jackie Liu 63e8bf3291 Implement auto-save and save/load menus 2023-04-03 01:09:40 -07:00
Jackie Liu 0268e131f1 Bug fixes 2023-04-02 21:53:17 -07:00
Jackie Liu a3277187cf Code refactoring 2023-04-02 20:37:09 -07:00
Jackie Liu de45ada269 Fixing sort order 2023-04-02 05:33:12 -07:00
Jackie Liu 5e42873ca2 v0.62 2023-04-02 05:07:57 -07:00
Jackie Liu 6a0648e3de BigMap UI rework + improve button navigation 2023-04-02 04:52:59 -07:00
Jackie Liu 9a114775dd Fix iOS build issue 2023-04-02 03:23:21 -07:00
Jackie Liu 45f5aefbaa Downgrade Unity version to 2022.2.12f1 to pass the CI 2023-04-02 03:00:46 -07:00
Jackie Liu f54efce2eb Rework on game init view 2023-04-02 02:55:12 -07:00
Jackie Liu 758e37cfab Code refactoring 2023-04-01 18:05:06 -07:00
Jiaqi Liu a9f9b5efdd v0.61 2023-04-01 04:51:05 -07:00
Jiaqi Liu f7a3a77130 Fix a bug where info notes might block user interaction on buttons 2023-04-01 04:49:27 -07:00
Jiaqi Liu 97bc1a9c80 Remove unused log code 2023-04-01 02:59:15 -07:00
Jiaqi Liu 45bbca6c78 Fix another bug related to resolution scale changing on iOS devices 2023-04-01 02:58:47 -07:00
Jiaqi Liu cfcf7fd493 Workaround on iOS to enable SSAO without affecting blur shader on startup 2023-04-01 02:35:54 -07:00
Jiaqi Liu 188056e260 Disable game icon compression 2023-04-01 01:47:28 -07:00
Jiaqi Liu b55eca02bc Bug fixes 2023-04-01 01:17:43 -07:00
Jackie Liu 4ff25872a0 Reset anchored position after returning to main menu 2023-03-31 23:10:14 -07:00
Jackie Liu 9c6a742db6 Save settings after initialization 2023-03-31 22:23:10 -07:00
Jackie Liu a9b1fab282 Minor fix 2023-03-31 22:13:39 -07:00
Jackie Liu fd3bf05aee Persist settings when exit main menu 2023-03-31 22:06:16 -07:00
Jackie Liu 11480c0fda Bump bundle version 2023-03-31 21:38:22 -07:00
Jackie Liu 1404ad41e6 v0.60 2023-03-31 21:37:44 -07:00
Jackie Liu 86b82feecc Add resolution setting for non-standalone devices 2023-03-31 20:42:23 -07:00
Jackie Liu 488797d118 Update virtual joystick icons 2023-03-31 20:08:03 -07:00
Jackie Liu 041f3ba2e9 Implement settings in main menu 2023-03-31 18:51:16 -07:00
Jackie Liu cb0982d69c Implement dialogue popup/hide animation 2023-03-31 15:05:39 -07:00
Jiaqi Liu 9024de3920 Implement rounded frosted glass shader + UI tweaks 2023-03-31 02:12:51 -07:00
Jiaqi Liu fbcba999aa Upgrade input system package 2023-03-31 00:35:37 -07:00
Jackie Liu 0247d19677 UI tweaks 2023-03-30 03:22:53 -07:00
Jackie Liu 31416dd1df UI Code refactoring Part 2 2023-03-30 02:52:19 -07:00
Jackie Liu f660dacfa6 UI Code refactoring Part 1 2023-03-29 02:21:23 -07:00
Jackie Liu a7648df691 Create .gitattributes 2023-03-28 20:21:12 -07:00
Jackie Liu 273fd398ff Update quality settings 2023-03-28 00:34:29 -07:00
Jackie Liu 5d7595970e Update READMEs to include dependencies 2023-03-27 02:38:55 -07:00
Jackie Liu 57d1da275f v0.52 2023-03-26 00:31:55 -07:00
Jackie Liu 07bf42ee04 Support and enable game folder picker for Android devices 2023-03-26 00:30:18 -07:00
Jackie Liu 2fe8e61032 Allow custom game data folder selection on standalone devices only 2023-03-25 20:01:29 -07:00
Jackie Liu 10d9cc9eca Translate few Strings into Chinese in SimpleFileBrowser 2023-03-25 19:23:09 -07:00
Jiaqi Liu 86a698d66d Search all possible game data file locations when possible (#13)
* Search all possible game data file locations when possible

* Add checks for gameDataFolderSearchLocations queue

* Update README
2023-03-26 09:06:07 +08:00
Jackie Liu efba3b899b Bug fixes 2023-03-24 23:02:55 -07:00
Jackie Liu c369b1cf14 Disable light and shadow toggle in open source build
Disable light and shadow toggle in open source build since toon materials will not be available anyway
2023-03-24 20:25:05 -07:00
Jackie Liu 8e7f6bdbe0 Add version info in README 2023-03-24 19:15:24 -07:00
Jiaqi Liu d37348e503 Delete activation.yml 2023-03-25 09:40:14 +08:00
Jackie Liu 79435a7edb [CI] Update CI files and README 2023-03-24 18:37:06 -07:00
Jackie Liu 68026452c5 [CI] Fixed a bug in main.yml 2023-03-24 14:08:53 -07:00
Jackie Liu bd3243213c [CI] Update action versions 2023-03-24 14:07:58 -07:00
Jiaqi Liu bae12e066d [CI] Revert versioning method to Semantic 2023-03-24 04:54:52 -07:00
Jiaqi Liu c57b4aaf78 [CI] Use Tag as versioning method 2023-03-24 04:41:46 -07:00
Jiaqi Liu e5449c0f06 [CI] Update main.yml 2023-03-24 04:14:53 -07:00
Jiaqi Liu 54344ead7f [CI] Fix syntax issue in main.yml 2023-03-24 03:41:26 -07:00
Jiaqi Liu f26636ca8c [CI] Bug fixes 2023-03-24 03:39:08 -07:00
Jiaqi Liu 7ea58826cf [CI] Fix issues in main.yml 2023-03-24 03:37:28 -07:00
Jiaqi Liu c957519b50 [CI] Correcting build artifact names 2023-03-24 03:09:20 -07:00
Jackie Liu 95208f5328 Update READMEs 2023-03-24 00:46:12 -07:00
Jackie Liu 74a1cd88e2 Update README.md and add README.en-US.md 2023-03-24 00:29:32 -07:00
Jackie Liu ddc1e7565b Add workflow build badge to README.md 2023-03-23 23:20:11 -07:00
Jackie Liu 255103b36a [CI] Set allowDirtyBuild for PAL3 build job 2023-03-23 22:59:50 -07:00
Jackie Liu 6155eca8ce [CI] Add build steps for PAL3A 2023-03-23 22:56:56 -07:00
Jackie Liu a0d6b9c725 Update ProjectSettings.asset 2023-03-23 22:33:35 -07:00
Jackie Liu 5276462b8e Update main.yml 2023-03-23 22:17:19 -07:00
Jackie Liu 5081dfd0d1 [CI] Add main.yml 2023-03-23 21:27:48 -07:00
Jackie Liu c2c69497d2 [CI] Add activation.yml 2023-03-23 21:03:32 -07:00
Jackie Liu d05637763b Implement editor option to zip release files 2023-03-23 20:28:03 -07:00
Jiaqi Liu 3e8c0b2979 Create XCode project for MacOS build in build pipelines script 2023-03-23 01:23:18 -07:00
Jiaqi Liu f1bd8a57db Improve SetDisplaySafeAreaCompatibilityModeProcessor logic to handle two types of builds for MacOS 2023-03-23 01:15:06 -07:00
Jiaqi Liu 94c8e824d2 Upgrade Unity version to 2022.2.12 + Finishing up BuildPipelines 2023-03-23 00:06:26 -07:00
Jackie Liu b49a24caf7 Implement in-editor build pipelines 2023-03-22 21:41:03 -07:00
Jackie Liu fba2ff7481 Code refactoring 2023-03-22 20:28:49 -07:00
Jackie Liu f621ab34b4 Implement helper command to decompile all dialogues to file 2023-03-22 06:06:25 -07:00
Jackie Liu ca4504f9f6 v0.51 2023-03-22 03:38:34 -07:00
Jackie Liu a8dfa06970 Fix a button highlighting issue + Increased SSAO intensity 2023-03-21 19:04:16 -07:00
Jackie Liu 6c7eecd150 Fix button highlighting issue when mouse and controller/keyboard are used at same time 2023-03-21 18:42:54 -07:00
Jiaqi Liu a34ad95c0c Fix a bug where player could move virtual joy stick and rotate camera at same time using one finger after scene switch 2023-03-21 18:16:50 -07:00
Jackie Liu 7574df5262 Code refactoring 2023-03-21 03:17:20 -07:00
Jiaqi Liu b778ac551f Fix water transparency and properly handle InvertColorBlend when lit materials are used 2023-03-20 20:29:33 -07:00
Jackie Liu 0458896a92 Allow changing resolution scale when game is in full screen mode 2023-03-20 05:17:08 -07:00
Jiaqi Liu d7302be6e3 Minor fix 2023-03-20 03:29:24 -07:00
Jackie Liu dce0ca95b8 Minor fix 2023-03-20 03:27:38 -07:00
Jackie Liu 80c6be9549 v0.50 2023-03-20 03:21:01 -07:00
Jackie Liu e50460cb43 Update GameResourceInitializer.cs 2023-03-20 03:07:32 -07:00
Jackie Liu f567e548ba Integrate SimpleFileBrowser for game data folder picking 2023-03-20 02:54:15 -07:00
Jackie Liu 547a60fe9d Code refactoring and bug fixes for unli/lit material factories 2023-03-19 23:57:40 -07:00
Jackie Liu 1a6409b0ce Update CollidableObject.cs 2023-03-19 21:46:55 -07:00
Jackie Liu 16c954739b Support changing real time lighting and shadow setting during runtime 2023-03-19 21:34:36 -07:00
Jackie Liu afdb08bf3f Code refactoring 2023-03-19 15:44:19 -07:00
Jackie Liu 7f6f35b63b Add music and sfx volume settings + bug fixes 2023-03-19 06:44:29 -07:00
Jackie Liu ad3a4a3f5c Code refactoring 2023-03-19 02:11:49 -07:00
Jackie Liu 91b8454c0b Code refactoring 2023-03-19 00:02:55 -07:00
Jiaqi Liu de4c4c53a5 Initial work on game settings 2023-03-18 20:41:39 -07:00
Jackie Liu 6b19c8bf23 Fix a bug where jump indicators might not be removed during scene switch 2023-03-18 00:58:20 -07:00
Jackie Liu 8cb3a6ca47 Code refactoring 2023-03-17 20:10:19 -07:00
Jackie Liu 3bfc11088e Fixed a rare bug where CollidableObject might block player after interaction 2023-03-17 02:00:59 -07:00
Jackie Liu ca041945b5 Fix a bug related to jump logic in PAL3 scene M15-B1 2023-03-17 01:54:00 -07:00
Jackie Liu fd1de1af0f Fix box interaction in PAL3 scene M24-3 2023-03-17 01:40:50 -07:00
Jackie Liu 6c6f11fb84 Upgrade Unity version to 2022.2.11 2023-03-15 23:41:37 -07:00
Jackie Liu 6d7f2e3cc8 v0.46 2023-03-15 23:27:31 -07:00
Jackie Liu 7abe277d79 Small tweak to the interaction logic of PushableObject 2023-03-15 23:22:06 -07:00
Jackie Liu 1420351153 Bug fixes 2023-03-15 23:12:49 -07:00
Jackie Liu dc200f4bb3 Persist camera rotation in save archive 2023-03-15 19:57:30 -07:00
Jackie Liu 12cfa042c6 Use cache in CRC hash compute 2023-03-15 18:21:50 -07:00
Jiaqi Liu 7b22af124b Tweak min jump distance for better tolerance 2023-03-15 05:36:24 -07:00
Jiaqi Liu 07e6952d17 Add missing line 2023-03-15 05:31:20 -07:00
Jiaqi Liu 91fe12caae Fix a bug in jump logic and make some improvements 2023-03-15 05:30:44 -07:00
Jiaqi Liu 0f8d3caae6 Code refactoring 2023-03-15 04:34:49 -07:00
Jiaqi Liu b065483cab Minor fixes 2023-03-14 22:08:18 -07:00
Jiaqi Liu ea5cede832 Update README.md 2023-03-15 11:18:22 +08:00
Jiaqi Liu 8f540025b0 Disable multi-threaded rendering for iOS and Android 2023-03-14 19:31:35 -07:00
Jackie Liu d52ef620a7 v0.45 2023-03-14 19:27:27 -07:00
Jackie Liu 07039886ae Minor tweaks 2023-03-14 18:51:18 -07:00
Jiaqi Liu 401185a2cc Implement Paperweight + PaperweightDesk with bug fixes
also properly implement DoorObject for PAL3A
2023-03-14 18:26:07 -07:00
Jackie Liu 9439c01107 Fix an edge case of LiftingPlatformObject 2023-03-14 02:53:21 -07:00
Jackie Liu bc7a68b979 Proper implementation of RoadElevatorOrBlocker for PAL3A 2023-03-14 02:44:36 -07:00
Jackie Liu 2d0af700a2 Implement PAL3A WaterSurface 2023-03-14 02:23:25 -07:00
Jackie Liu 373810692d Minor fixes 2023-03-14 01:36:02 -07:00
Jackie Liu ff13300bcd Properly implement TrapObject for PAL3A 2023-03-14 01:26:25 -07:00
Jackie Liu 6590e58f0a Implement SectorBridge + DivineTreePortal for PAL3A 2023-03-14 01:10:29 -07:00
Jackie Liu b2517803b2 Implement MushroomBridge 2023-03-13 23:03:13 -07:00
Jackie Liu 46efff5a02 Use predefined variable in SCN config to handle times check for toggle and wuling switch 2023-03-13 02:22:18 -07:00
Jackie Liu 941f1924ec Fix a potential bug in MovableCarrierObject impl 2023-03-12 23:16:44 -07:00
Jackie Liu 0310a412f1 Properly implement ThreePhaseSwitchObject + ThreePhaseBridgeObject 2023-03-12 23:07:22 -07:00
Jackie Liu 2ec6399303 Init PAL3A ThreePhaseBridge + ThreePhaseSwitch 2023-03-12 03:15:07 -07:00
Jackie Liu 1a1c177969 Fix a bug in PolyModelRenderer where white texture should be used when texture name is null or empty 2023-03-12 01:36:01 -08:00
Jackie Liu a2254ea709 Fix few of the edge cases 2023-03-11 22:37:50 -08:00
Jackie Liu c237ce7f0a Implement PAL3A RetractableBlocker object 2023-03-11 20:33:29 -08:00
Jackie Liu b9445499e2 Move left virtual stick a bit to the right 2023-03-11 17:45:53 -08:00
Jackie Liu 3350680b5c Implement RotatingWall object 2023-03-11 17:35:04 -08:00
Jackie Liu ee2d8bef6e Minor tweaks 2023-03-10 22:37:09 -08:00
Jackie Liu d7ea45b595 Implement Teapot + PAL3A CMD 188/189 + Code refactoring 2023-03-10 19:48:16 -08:00
Jackie Liu 22f24f499c Update README.md 2023-03-10 02:37:47 -08:00
Jackie Liu 23c1921c2c Upgrade Unity version to 2022.2.10 2023-03-10 02:36:38 -08:00
Jackie Liu 0ba0a01908 Minor tweaks 2023-03-09 00:22:29 -08:00
Jackie Liu 7acf5061e3 Implement PAL3A ToggleSwitch, ElevatorFloorOrBlocker and WuLingSwitch 2023-03-09 00:05:20 -08:00
Jiaqi Liu 03c41461c1 Fix video player for some of the Android devices
Change depth stencil format for render texture used by video player to support some Android devices
2023-03-08 03:27:55 -08:00
Jackie Liu 7a87c4114c Implement activation logic for chained objects in PAL3A 2023-03-08 02:48:48 -08:00
Jackie Liu eb8233457a Add additional logic to handle Switch interaction for PAL3A 2023-03-08 02:03:55 -08:00
Jackie Liu b08158fd5a Update ProjectSettings.asset 2023-03-08 00:50:33 -08:00
Jackie Liu bdc24381a7 Minor tweaks and fixes 2023-03-08 00:49:24 -08:00
Jackie Liu 60a8edf481 Minor tweaks for PushableObject 2023-03-07 18:34:50 -08:00
Jackie Liu 1e63b244ec Minor fixes 2023-03-07 18:16:50 -08:00
Jackie Liu 9e4fdbb5f1 Fix the color(texture) issue of impulsive mechanism in M11-2 which uses _r.pol as the main model 2023-03-06 23:41:59 -08:00
Jackie Liu fb94533109 Properly handle switch and chest object in PAL3 scene m17-3 2023-03-06 22:57:03 -08:00
Jackie Liu 6d20996ccd Add mesh collider to chest objects 2023-03-06 21:02:11 -08:00
Jackie Liu 112f4beb4a Fixed data overflow issue 2023-03-06 20:42:56 -08:00
Jiaqi Liu be733ccf8b Code refactoring 2023-03-06 02:08:34 -08:00
Jiaqi Liu 6a5ac4d8e6 Minor fixes for PAL3A scene objects 2023-03-06 01:40:55 -08:00
Jackie Liu 874a68d7c7 Fix a bug where LongKui's mode is not correctly persisted across scenes 2023-03-05 21:45:44 -08:00
Jackie Liu 34286a8101 Properly implement Switch interaction logic for PAL3A 2023-03-05 15:43:56 -08:00
Jackie Liu 3f5755e553 Implement a special case for Door object interaction in PAL3A 2023-03-05 15:27:48 -08:00
Jackie Liu 1e938ee8f5 Better implementation for RareChest interaction 2023-03-05 15:27:17 -08:00
Jackie Liu 384c13c5ac Fix a bug where actor might spwan at invalid position 2023-03-05 15:25:48 -08:00
Jiaqi Liu 6af384649a Update README.md 2023-03-05 05:49:52 +08:00
Jackie Liu f22e037bb5 Upgrade Linux toolchain version 2023-03-04 00:48:16 -08:00
Jackie Liu 6bed3676a3 Bump Unity version 2023-03-04 00:35:08 -08:00
Jackie Liu 93af80f8a1 v0.40 2023-03-04 00:21:46 -08:00
Jackie Liu bccc36949c Minor fixes 2023-03-03 19:16:28 -08:00
Jackie Liu 1a03ef926c Implement FallableObstacle 2023-03-03 18:49:01 -08:00
Jackie Liu 73d2514176 Code refactoring 2023-03-02 19:33:53 -08:00
Jackie Liu 3e6dff1ae8 Update charset + font atlas 2023-03-02 19:10:04 -08:00
Jackie Liu bad8a177b7 Implement interaction logic for SwordBridge 2023-03-01 20:37:09 -08:00
Jackie Liu 6451f9cfd7 Properly implement PushableObject to support all scenarios 2023-03-01 19:08:29 -08:00
Jackie Liu a2c2c71617 Code refactoring 2023-02-28 19:28:05 -08:00
Jackie Liu cbe8d90eec Some general objects in specific scenes should block player
Some general objects in specific scenes should block player
2023-02-27 19:13:07 -08:00
Jackie Liu 14c48b006f Implement SlideWay object 2023-02-27 18:31:42 -08:00
Jackie Liu b854dc76ab Implement interaction logic for bi-directional boxes
Implement interaction logic for bi-directional boxes
2023-02-26 16:36:47 -08:00
Jackie Liu 066712e887 Fixed a bug in jump logic + upgrade Unity version 2023-02-18 05:47:59 -08:00
Jiaqi Liu 906a651140 Update Rider plugin version 2023-01-21 02:19:48 -08:00
Jiaqi Liu 9dad13af49 Upgrading editor version to 2022.2.2f1 2023-01-17 22:37:02 -08:00
Jackie Liu f4fd18ae5e Update year in the header 2023-01-03 19:03:54 -08:00
Jackie Liu 94b0710933 Bug fix 2022-12-22 18:51:41 -08:00
Jackie Liu 8949ea9991 Code refactoring 2022-12-21 01:57:27 -08:00
Jiaqi Liu e34529e4b5 Code refactoring to avoid GC 2022-12-14 21:41:35 -08:00
Jiaqi Liu b4ac446eb5 Implement jump indicator 2022-12-14 21:31:07 -08:00
Jackie Liu 9b306b8fdf Code refactoring 2022-12-13 05:26:36 -08:00
Jackie Liu 7d2afad6cf Code refactoring 2022-12-12 18:15:40 -08:00
Jiaqi Liu 7ba42aefdf Use pushable object forward direction instead of world direction 2022-12-11 17:00:51 -08:00
Jackie Liu 80fbfb6448 Pushable object WIP 2022-12-11 15:39:56 -08:00
Jackie Liu c3feba43d2 Implement climbable object interaction indicators 2022-12-11 03:28:19 -08:00
Jackie Liu 367cd5004f Minor tweaks and fixes 2022-12-09 19:11:17 -08:00
Jiaqi Liu 1922aaac3f Code refactoring 2022-12-09 03:26:51 -08:00
Jiaqi Liu 839d1736a5 Code refactoring and tweaks 2022-12-09 03:16:26 -08:00
Jackie Liu c8af1231e0 Implement Pushable and EyeBall 2022-12-09 02:14:13 -08:00
Jiaqi Liu 5eedfcbbd5 Destroy combat npc on collision enter 2022-12-08 00:32:19 -08:00
Jackie Liu 872d0d69ef Implement right click to jump 2022-12-07 23:16:43 -08:00
Jackie Liu fce22f30fb Jump logic tweaks 2022-12-07 09:41:26 -08:00
Jackie Liu bc09d55d42 Implement jump logic + bug fixes 2022-12-07 08:27:09 -08:00
Jackie Liu e8b801fe1f Implement switch interaction indicator 2022-12-07 04:11:18 -08:00
Jackie Liu 6581d032ba Init impl of RotatingBridge 2022-12-05 19:27:26 -08:00
Jackie Liu 6cefef4e22 Bug fixes 2022-12-04 23:55:06 -08:00
Jackie Liu 7b62c6b4d9 Bug fixes 2022-12-04 18:55:02 -08:00
Jackie Liu 44e2e1c0aa Fix build issue 2022-12-04 06:25:39 -08:00
Jackie Liu 52b447ba7c Implement MovableCarrier 2022-12-04 06:21:44 -08:00
Jackie Liu 9cce012684 Properly Implement DivineTreePortal 2022-12-04 05:25:21 -08:00
Jackie Liu 41de45dce7 Only focus on scene object if not in camera view 2022-12-04 04:43:45 -08:00
Jackie Liu 00275411e4 Code refactoring and bug fixes 2022-12-04 04:00:00 -08:00
Jackie Liu e4bca08f27 Code refactoring 2022-12-03 00:25:32 -08:00
Jackie Liu b5dfab6875 Implement DivineTreeFlower and DivineTreePortal 2022-12-02 23:16:06 -08:00
Jackie Liu 84226daca7 Bug fixes 2022-12-01 20:12:38 -08:00
Jackie Liu e2aee25f58 Code refactoring 2022-12-01 20:03:08 -08:00
Jackie Liu ed18f220f0 Minor fixes 2022-12-01 04:56:14 -08:00
Jackie Liu d6278f135e Better logic to handle objects moved by the script 2022-11-30 22:24:20 -08:00
Jackie Liu d7f08163aa Remove empty spaces 2022-11-30 21:39:15 -08:00
Jackie Liu ae9b524cf3 Code refactoring 2022-11-30 21:13:17 -08:00
Jackie Liu 2cc59b540f Implement logic to support movement between multiple standing platforms 2022-11-30 03:43:07 -08:00
Jackie Liu e6e27b922c Implement ElevatorPedal 2022-11-30 00:36:22 -08:00
Jackie Liu 00f9911127 Implement Elevator, update PAL3A known commands 2022-11-29 19:31:13 -08:00
Jackie Liu f271460fd1 Bug fixes 2022-11-29 03:02:21 -08:00
Jackie Liu ced2dac458 Bug fixes 2022-11-29 02:13:03 -08:00
Jackie Liu 15acc159e8 Inherent nav layer index when switching player actor 2022-11-29 01:57:47 -08:00
Jackie Liu 7d75e8d3e1 Properly safe actor states in archive 2022-11-29 01:25:06 -08:00
Jackie Liu a2a1dc0ec7 Fixed a bug in save/load logic 2022-11-28 20:04:17 -08:00
Jackie Liu b354049b89 Fix PAL3A compile issue 2022-11-28 18:59:52 -08:00
Jackie Liu 178bcb42a7 Fix Mv3/Cvd/Pol bounds calculation 2022-11-28 18:52:38 -08:00
Jackie Liu e0cc85ca7f Better player interaction logic + code refactoring 2022-11-28 18:31:21 -08:00
Jackie Liu 8b232aeffd Minor refactoring 2022-11-28 03:06:12 -08:00
Jackie Liu a937052472 Minor fixes 2022-11-28 02:20:53 -08:00
Jackie Liu 8c58d13146 Implement ImpulsiveMechanism 2022-11-27 21:56:45 -08:00
Jackie Liu eb5c88da9a Code refactoring 2022-11-27 04:24:24 -08:00
Jackie Liu 6926cd02cb Implement SwordBridgeObject and fix a bug where actor might walking into air 2022-11-27 03:34:13 -08:00
Jackie Liu 2f257d3f95 Implement SceneObjectDoNotLoadFromSaveStateCommand 2022-11-27 02:56:54 -08:00
Jackie Liu 67df0f51ca Implement PedalSwitch and fixed scene object activation saving bug 2022-11-27 00:17:10 -08:00
Jackie Liu 1e648cc3a1 Implement ElevatorDoor and fix Mv3 bounds calculation 2022-11-26 22:41:43 -08:00
Jackie Liu ca8501fcdb And safety check for colliders in movement controller 2022-11-26 21:03:21 -08:00
Jackie Liu b68a154497 Properly implement PiranhaFlower behaviour 2022-11-26 20:36:38 -08:00
Jackie Liu e6792484af Code refactoring 2022-11-26 18:32:08 -08:00
Jackie Liu 2d9d1d859c Prevent player from walking thru collider + SpecialMechanism tweaks 2022-11-26 18:06:04 -08:00
Jackie Liu 99459f6cf5 Special handling for PAL3 M09 scene with WaterSurfaceMechanism 2022-11-26 02:46:37 -08:00
Jackie Liu ecc6d48830 Implement Trap 2022-11-26 01:50:53 -08:00
Jackie Liu 5f44ad2656 Implement LiftingMechanism 2022-11-26 00:59:37 -08:00
Jackie Liu 83418f3635 Implement SpecialMechanism 2022-11-25 22:59:02 -08:00
Jackie Liu 0b570221fc Persist switch state and times count 2022-11-25 19:47:09 -08:00
Jackie Liu 172fb32ac8 Code refactoring 2022-11-25 16:13:21 -08:00
Jackie Liu e8a00488b4 Code refactoring 2022-11-25 14:28:04 -08:00
Jackie Liu 1392c41ccd Reset actor facing after dialogue 2022-11-25 13:59:36 -08:00
Jackie Liu 373e9f7383 Remove lightMap from scene hash 2022-11-25 13:38:00 -08:00
Jackie Liu 85aa452117 Disable rigidbody for HuaYing & TaoZi 2022-11-25 13:30:29 -08:00
Jackie Liu 04af153741 Bug fixes 2022-11-25 01:01:17 -08:00
Jackie Liu febee04ea5 Better actor interaction logic and behavior 2022-11-25 00:09:16 -08:00
Jackie Liu 959631c340 Implement Switch & WaterSurfaceMechanism 2022-11-24 22:51:20 -08:00
Jackie Liu 292663f572 Handle standing platform ray hit for portal command 2022-11-24 22:00:12 -08:00
Jackie Liu 0604b8a341 Implement GravityTrigger & SuspensionBridge 2022-11-24 20:35:25 -08:00
Jackie Liu 6560b2882d Code refactoring 2022-11-23 20:36:44 -08:00
Jackie Liu 755a79642e Code refactoring 2022-11-23 17:38:14 -08:00
Jackie Liu 10d7ff65af Code refactoring 2022-11-22 14:02:06 -08:00
Jackie Liu 5ae0dbbf3d Minor tweaks and bug fixes 2022-11-20 14:36:24 -08:00
Jackie Liu 86f48207b3 Better scene object/actor interaction trigger logic 2022-11-20 14:10:34 -08:00
Jackie Liu 0bd0894547 Implement fundamental logic to support mechanisms 2022-11-19 13:10:00 -08:00
Jackie Liu e3540daa19 Implement player actor switching logic 2022-11-17 15:34:02 -08:00
Jackie Liu 03bd7a962d Bug fix 2022-11-16 19:37:26 -08:00
Jackie Liu bf6e8497d1 Code refactoring 2022-11-16 19:09:48 -08:00
Jackie Liu 1cb60e6be1 Bug fixes and code refactoring 2022-11-16 17:52:12 -08:00
Jackie Liu ee59f14953 Bug fixes and code refactoring 2022-11-16 03:00:30 -08:00
Jackie Liu e293426c27 Respect NumberOfWaypoints 2022-11-15 07:12:23 -08:00
Jiaqi Liu 7238ad7cbb Resolve unknown fields for ScnNpcInfo 2022-11-15 06:27:42 -08:00
Jackie Liu 8938597acf Remove current SceneObjectDoNotLoadFromSaveState impl since it should be set on SceneManager level 2022-11-15 05:28:31 -08:00
Jackie Liu b283516cd0 Disable door animation for script controlled ones 2022-11-15 03:33:57 -08:00
Jackie Liu 42ffc74421 Code refactoring 2022-11-15 03:26:49 -08:00
Jackie Liu 4e2b031f05 Impl door interaction animation + PiranhaFlower logic + code refactoring + bug fixes 2022-11-15 02:30:32 -08:00
Jiaqi Liu 3ce8c93dcb Fix build error 2022-11-14 05:07:23 -08:00
Jackie Liu 68c6a1b1a6 Implement Shakeable object 2022-11-14 04:33:28 -08:00
Jackie Liu 28b9b93146 Imple UIDisplayNextCaptionCommand 2022-11-14 03:43:36 -08:00
Jackie Liu ffd73d5e74 Implement CollidableObject 2022-11-14 03:27:19 -08:00
Jackie Liu a83e863f58 Code refactoring and bug fixes 2022-11-13 10:32:23 -08:00
Jackie Liu ef4d9a7fdd Use speed value from ScnNpcInfo 2022-11-13 08:50:26 -08:00
Jackie Liu 642ead2f5a Fix ChangeTexture bug 2022-11-13 08:39:26 -08:00
Jackie Liu 67e7184f5a Persist scene object activation state 2022-11-13 06:52:39 -08:00
Jackie Liu 84f0eccd5b Added AvailableInConsoleAttribute to control command enablement in console 2022-11-12 23:11:13 -08:00
Jackie Liu f90537b9a5 Minor fixes 2022-11-12 22:26:57 -08:00
Jackie Liu d175fcb401 Implement chest interaction 2022-11-12 04:37:01 -08:00
Jackie Liu 608276b484 Save inventory state 2022-11-12 02:32:01 -08:00
Jackie Liu 3eeadc77fc InventoryManager WIP 2022-11-11 05:54:09 -08:00
Jackie Liu 003694d930 GdbFile WIP 2022-11-10 06:01:31 -08:00
Jackie Liu 2cdb5b08a4 Gdb file reader WIP 2022-11-10 05:49:56 -08:00
Jackie Liu 6ac412fad3 Smarter Pal3 menu options 2022-11-09 21:38:22 -08:00
Jackie Liu 22323a65b5 Remove unused logging 2022-11-08 18:26:55 -08:00
Jackie Liu 14f5e6775d Perf improvements 2022-11-08 18:24:53 -08:00
Jackie Liu 78678024d5 Add editor function to enable/disable lighting feature flag 2022-11-08 00:26:07 -08:00
Jackie Liu 1f9e2b10f9 Upgrade to Unity 2022.2.x 2022-11-08 00:04:46 -08:00
Jiaqi Liu 5944c664f1 Update QualitySettings.asset 2022-11-07 02:45:53 -08:00
Jiaqi Liu 72f77ff1a7 v0.31 2022-11-07 02:37:22 -08:00
Jiaqi Liu 41efbdce8e Use CascadedShadowMaps for tier 3 mobile devices 2022-11-07 02:36:42 -08:00
Jackie Liu d751d5ea2a Hide collectable and chests 2022-11-07 02:34:03 -08:00
Jackie Liu 12ef307fe6 VFX WIP 2022-11-07 02:09:22 -08:00
Jackie Liu bc672d6179 Fix CVD normal issue 2022-11-06 05:58:00 -08:00
Jackie Liu fbadf6766e Add GamePad deadzone processor & code refactoring 2022-11-06 04:42:47 -08:00
Jiaqi Liu 41502ddefb Lighting tweaks 2022-11-03 06:58:44 -07:00
Jackie Liu 61ca35b1b8 Code refactoring 2022-11-01 19:05:05 -07:00
Jiaqi Liu cbb4d5e575 Bug fixes 2022-11-01 05:12:40 -07:00
Jiaqi Liu b37ac428d2 Minor fixes 2022-11-01 01:13:40 -07:00
Jiaqi Liu f9d17a9896 Disable automatic graphics API on Android 2022-11-01 01:00:29 -07:00
Jackie Liu 65d4fefd6f Update QualitySettings.asset 2022-10-31 21:16:12 -07:00
Jackie Liu 5e746c7922 v0.30 2022-10-31 21:06:31 -07:00
Jackie Liu 3c31cb1787 Lighting tweaks 2022-10-31 20:30:16 -07:00
Jackie Liu b0ea2f8638 Effect sprite rendering issue fixes
Also fixed portal base sprite rotation issue
2022-10-31 05:06:44 -07:00
Jackie Liu e38ffc9a40 Distortion code refactoring 2022-10-31 02:56:04 -07:00
Jiaqi Liu 96e2d151f9 Update QualitySettings.asset 2022-10-31 02:46:49 -07:00
yunyouandJackie Liu 23fa70496b 使用官方 PostProcessing ,扩展出来了一个 Distortion 的后处理 (#9)
* +extend PostProcessing , integrate Water wave Distortion into the game. Test it with "EffectSetScreenEffect 0"

Co-authored-by: Jackie Liu <jackil@microsoft.com>
2022-10-31 16:54:42 +08:00
Jackie Liu b3f67d3683 Lighting tweaks 2022-10-31 01:32:49 -07:00
Jackie Liu 84e44d7eec Lighting tweaks 2022-10-30 01:38:27 -07:00
Jackie Liu 661d2ce1c0 Nav mesh fixes 2022-10-30 00:58:46 -07:00
Jackie Liu be695cc353 Lighting tweaks 2022-10-29 19:56:27 -07:00
Jackie Liu 6aa8da32ea Code refactoring and bug fixes 2022-10-29 19:01:45 -07:00
Jackie Liu 2de4bce9e1 Tweak camera nearClipPlane value 2022-10-28 19:07:08 -07:00
Jackie Liu 56ec4d81ad Fix poly and cvd normal issues 2022-10-28 18:49:40 -07:00
Jackie Liu 261ad74a74 Fix mv3 normal issue by splitting the vertices & fix nav mesh facing issue 2022-10-28 17:45:04 -07:00
Jiaqi Liu 654ade106e Update screenshots 2022-10-28 06:01:59 -07:00
Jiaqi Liu 15970562d7 Bump Unity version 2022-10-27 22:31:47 -07:00
Jackie Liu c3fe8198d4 Fix build error 2022-10-27 11:09:10 -07:00
Jackie Liu 593e915dcd Calculate MV3 normals in Mv3FileReader 2022-10-27 01:58:02 -07:00
Jackie Liu 6d6f195aad Enable Ambient Occlusion on desktop devices 2022-10-26 19:03:46 -07:00
Jackie Liu 17814972f4 Tweak fire effect light source location 2022-10-26 18:39:47 -07:00
Jackie Liu a898c69b79 Fix mv3 normals with code refactoring 2022-10-26 18:24:58 -07:00
Jackie Liu 4d473bf69b Reduce shadowResolution 2022-10-26 01:08:23 -07:00
Jackie Liu 9eb091ead6 Temp workaround for mv3 normals 2022-10-26 00:07:52 -07:00
Jackie Liu 49f25b255e Add ToonMaterialFactory, temp fix for normals 2022-10-26 00:07:05 -07:00
Jackie Liu 820c3f1795 Code refactoring 2022-10-25 19:16:25 -07:00
Jackie Liu dac1505886 Move shaders to resource folder 2022-10-25 10:56:50 -07:00
Jackie Liu 2f12c317c4 Lighting tweaks 2022-10-25 00:58:25 -07:00
Jackie Liu 421aeb4c3f Minor tweaks 2022-10-25 00:41:18 -07:00
Jackie Liu 7dfdd4396f All about normals 2022-10-24 18:55:08 -07:00
Jackie Liu 4cf4890693 Light color tweaks 2022-10-24 04:35:13 -07:00
Jiaqi Liu dbeef96411 Update QualitySettings.asset 2022-10-24 04:14:44 -07:00
Jiaqi Liu c47f5b8edb Update SettingsManager.cs 2022-10-24 03:31:05 -07:00
Jackie Liu 173c95c70d Typo fix 2022-10-24 03:20:20 -07:00
Jiaqi Liu 993b5e7653 Experimental (#8)
* Experimental feature
2022-10-24 18:12:03 +08:00
Jiaqi Liu bbeca7a6c6 PostProcessManager code refactoring 2022-10-22 23:19:01 -07:00
Jackie Liu 845f7e8fd5 Fix fire sprite and implement CPK extractor feature in GameResourceViewer 2022-10-21 22:14:33 -07:00
Jackie Liu f2fe362d53 Add bloom effect for VFX with code refactoring 2022-10-21 20:44:19 -07:00
Jackie Liu 53efd23d0f Fix default weapon model for ZiXuan 2022-10-21 01:26:59 -07:00
Jackie Liu 8730c457c2 v0.29 2022-10-21 00:52:32 -07:00
Jackie Liu 1e2e080657 Implement portal ray effect 2022-10-21 00:50:51 -07:00
Jackie Liu a14be2670b VFX WIP: Adding bridge effect 2022-10-21 00:08:50 -07:00
Jackie Liu 766fe2c430 VFX WIP 2022-10-20 02:18:16 -07:00
Jiaqi Liu f7c0aa8e71 Delete 262.prefab.meta 2022-10-19 21:18:52 -07:00
Jackie Liu 18563a5063 Preload VFX prefab 2022-10-19 18:52:40 -07:00
Jackie Liu 5a12990ce1 VFX WIP 2022-10-19 00:27:21 -07:00
Jackie Liu 4c31d56b78 Code refactoring for VFX gameobject 2022-10-18 19:01:33 -07:00
Jackie Liu 9de0e3f9cb Update gitignore 2022-10-18 18:47:21 -07:00
Jackie Liu 8ff5685ed8 VFX init 2022-10-18 18:16:11 -07:00
Jiaqi Liu 4ac04f9e06 Added missing shaders in build bundle 2022-10-17 20:10:38 -07:00
Jiaqi Liu f7c993ef22 Minor tweaks and fixes 2022-10-17 10:15:23 -07:00
Jackie Liu ba68240d77 Minor tweaks 2022-10-17 03:06:59 -07:00
Jackie Liu 76f1b1f551 Fix quaternion calculation for the light source 2022-10-17 02:17:06 -07:00
Jackie Liu dc8b9f6423 Minor fix 2022-10-16 22:40:40 -07:00
Jackie Liu 94b26e15c3 Read Lgt file and create light source objects in editor 2022-10-16 22:27:22 -07:00
yunyouandJiaqi Liu 7ff9146b5e +water using indie material. apply water shadow texture on it (#7)
* +water using indie material. apply water shadow texture on it

* +modify Pal3Water.shader default blend parameter

* Uses first pixel's alpha as water surface opacity

Uses first pixel's alpha as water surface opacity and code refactoring

* Minor tweaks with exposure amount

* Remove empty line

Co-authored-by: Jiaqi Liu <jackil@microsoft.com>
2022-10-16 12:12:57 -07:00
Jackie Liu 2e5421146b EffectDefinition WIP 2022-10-15 17:38:18 -07:00
Jiaqi Liu 780041ec27 Merge pull request #6 from yunyou730/render_order
* Introduce MaterialFactory to manage the creation of materials.
* Fixed semi-transparent object and actor rendering order issue by implementing corresponding shaders with correct render pass.
* Proper implementation of PAL3 sprite shader.
2022-10-15 13:28:43 -07:00
Jackie Liu 8d13753246 Format refactorings 2022-10-15 13:25:38 -07:00
Jackie Liu 1a865a32c0 Code refactoring 2022-10-15 13:03:12 -07:00
Jackie Liu 59d7af002b Fixed a bug where PAL3A portal effect is not rendered correctly 2022-10-15 12:45:18 -07:00
Jackie Liu 9d62fc637a Code refactoring 2022-10-15 12:13:29 -07:00
yunyou da132bdf91 +clean material code 2022-10-15 23:57:00 +08:00
yunyou 0ca80340bc + sync comment with code 2022-10-15 23:43:14 +08:00
yunyou 93228511c3 +fix BlendFlag = 2, additive blend performance issue 2022-10-15 23:33:49 +08:00
miaoyunlong 63b5ca8393 +fix water not perform uv anim issue. 2022-10-15 16:08:29 +08:00
miaoyunlong 9003dbe3fc +3 shaders add _TintColor back (Pal3_Opaque, Pal3_Transparent, Pal3_TransparentOpaquePart) 2022-10-15 14:55:40 +08:00
Jackie Liu d8181e8dd8 Update Mv3ModelRenderer.cs 2022-10-14 20:53:31 -07:00
miaoyunlong 60519b39ef +调整渲染顺序为:Opaque -> SkyBox -> Transparent. 半透明物体会拆成 Opaque 和 Transparent 两部分绘制 2022-10-14 03:26:12 +08:00
miaoyunlong 23d3809cb7 +modify paremters 2022-10-13 22:47:07 +08:00
Jackie Liu 6622b3737c Should only record camera last transform when in gameplay state 2022-10-12 20:45:43 -07:00
miaoyunlong e00eb972a2 +fix transparent material alpha color bug 2022-10-13 01:51:25 +08:00
miaoyunlong e71a244ca6 +fix render order issue 2022-10-13 01:14:42 +08:00
Jiaqi Liu 3b6730b60a Fixed issue with Virtual Joystick UI not showing on some of the Android devices 2022-10-10 06:42:24 -07:00
923 changed files with 190359 additions and 13048 deletions

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
# * text=auto
# Unity files
*.anim text eol=lf
*.asmdef text eol=lf
*.asset text eol=lf
*.controller text eol=lf
*.mat text eol=lf
*.meta text eol=lf
*.overrideController text eol=lf
*.prefab text eol=lf
*.preset text eol=lf
*.spriteatlas text eol=lf
*.unity text eol=lf
*.mixer text eol=lf
*.renderTexture text eol=lf
*.json text eol=lf
*.xml text eol=lf
# Source files
*.sln text eol=crlf
*.csproj text eol=crlf
*.cs text eol=crlf
*.shader text eol=crlf
+9
View File
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: 'action-deps: '
@@ -0,0 +1,35 @@
name: Builds - PAL3 - Mono - Android
on: [push, pull_request]
jobs:
build_pal3_mono_android:
name: Build PAL3 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- Android # Build an Android .apk standalone app.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
+31
View File
@@ -0,0 +1,31 @@
name: Builds - PAL3 - Mono - iOS
on: [push, pull_request]
jobs:
build_pal3_mono_ios:
name: Build PAL3 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- iOS # Build an iOS player.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3
versioning: Semantic
# do not upload artifacts for iOS builds
@@ -0,0 +1,35 @@
name: Builds - PAL3 - Mono - Linux
on: [push, pull_request]
jobs:
build_pal3_mono_linux:
name: Build PAL3 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneLinux64 # Build a Linux 64-bit standalone.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,35 @@
name: Builds - PAL3 - Mono - MacOS
on: [push, pull_request]
jobs:
build_pal3_mono_macos:
name: Build PAL3 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,36 @@
name: Builds - PAL3 - Mono - Windows
on: [push, pull_request]
jobs:
build_pal3_mono_windows:
name: Build PAL3 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,48 @@
name: Builds - PAL3A - Mono - Android
on: [push, pull_request]
jobs:
build_pal3a_mono_android:
name: Build PAL3A for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- Android # Build an Android .apk standalone app.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- name: Switch define symbol from PAL3 to PAL3A
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "PAL3"
replace: "PAL3A"
include: "**ProjectSettings.asset"
- name: Replace PAL3 game icon with PAL3A one
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "6b32649dccc45df4ebe8e3f8eccee249"
replace: "d03d417e5660d5849939c8fe43732dbd"
include: "**ProjectSettings.asset"
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
allowDirtyBuild: true
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3A
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3A-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,44 @@
name: Builds - PAL3A - Mono - iOS
on: [push, pull_request]
jobs:
build_pal3a_mono_ios:
name: Build PAL3A for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- iOS # Build an iOS player.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- name: Switch define symbol from PAL3 to PAL3A
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "PAL3"
replace: "PAL3A"
include: "**ProjectSettings.asset"
- name: Replace PAL3 game icon with PAL3A one
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "6b32649dccc45df4ebe8e3f8eccee249"
replace: "d03d417e5660d5849939c8fe43732dbd"
include: "**ProjectSettings.asset"
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
allowDirtyBuild: true
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3A
versioning: Semantic
# do not upload artifacts for iOS builds
@@ -0,0 +1,48 @@
name: Builds - PAL3A - Mono - Linux
on: [push, pull_request]
jobs:
build_pal3a_mono_linux:
name: Build PAL3A for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneLinux64 # Build a Linux 64-bit standalone.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- name: Switch define symbol from PAL3 to PAL3A
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "PAL3"
replace: "PAL3A"
include: "**ProjectSettings.asset"
- name: Replace PAL3 game icon with PAL3A one
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "6b32649dccc45df4ebe8e3f8eccee249"
replace: "d03d417e5660d5849939c8fe43732dbd"
include: "**ProjectSettings.asset"
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
allowDirtyBuild: true
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3A
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3A-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,48 @@
name: Builds - PAL3A - Mono - MacOS
on: [push, pull_request]
jobs:
build_pal3a_mono_macos:
name: Build PAL3A for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- name: Switch define symbol from PAL3 to PAL3A
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "PAL3"
replace: "PAL3A"
include: "**ProjectSettings.asset"
- name: Replace PAL3 game icon with PAL3A one
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "6b32649dccc45df4ebe8e3f8eccee249"
replace: "d03d417e5660d5849939c8fe43732dbd"
include: "**ProjectSettings.asset"
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
allowDirtyBuild: true
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3A
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3A-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
@@ -0,0 +1,49 @@
name: Builds - PAL3A - Mono - Windows
on: [push, pull_request]
jobs:
build_pal3a_mono_windows:
name: Build PAL3A for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
steps:
- uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
lfs: true
- name: Switch define symbol from PAL3 to PAL3A
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "PAL3"
replace: "PAL3A"
include: "**ProjectSettings.asset"
- name: Replace PAL3 game icon with PAL3A one
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "6b32649dccc45df4ebe8e3f8eccee249"
replace: "d03d417e5660d5849939c8fe43732dbd"
include: "**ProjectSettings.asset"
- uses: actions/cache@v3.3.1
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
allowDirtyBuild: true
targetPlatform: ${{ matrix.targetPlatform }}
buildName: PAL3A
versioning: Semantic
- uses: actions/upload-artifact@v3.1.2
with:
name: PAL3A-Mono-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
retention-days: 14
+17
View File
@@ -70,3 +70,20 @@ crashlytics-build.properties
# Unity StreamingAssets folder
/Assets/StreamingAssets
# 3rd party plugin/assets
/Assets/Hovl Studio
/Assets/Hovl Studio.meta
/Assets/RealToon
/Assets/RealToon.meta
# VFX prefabs that are using 3rd party assets
/Assets/Resources/Prefabs/VFX/PAL3/*.prefab
/Assets/Resources/Prefabs/VFX/PAL3/*.meta
/Assets/Resources/Prefabs/VFX/PAL3A/*.prefab
/Assets/Resources/Prefabs/VFX/PAL3A/*.meta
# Materials that are using 3rd party assets
/Assets/Resources/Materials/
# VS Conde config file
.vsconfig
+2
View File
@@ -1,5 +1,7 @@
fileFormatVersion: 2
guid: 017f90526f3834e4ca575928f2369942
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
Binary file not shown.
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: bd9629b50a962774fa83514636685099
guid: d25342fa4b1c06a4fb5b9275bf3f6350
folderAsset: yes
DefaultImporter:
externalObjects: {}
Binary file not shown.
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c55e208d745dcdd4f869b845af4cfab3
guid: 2202405c70c652942ae8270006c01f9d
TextScriptImporter:
externalObjects: {}
userData:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 447a6384f74b843dc8c19f6397c505f7
guid: bed3e3b7fed51194da24fb7fb8c0a316
DefaultImporter:
externalObjects: {}
userData:
+71
View File
@@ -0,0 +1,71 @@
# ![Logo](https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/Doc/icons/logo.jpg) Json.NET
[![NuGet version (Newtonsoft.Json)](https://img.shields.io/nuget/v/Newtonsoft.Json.svg?style=flat-square)](https://www.nuget.org/packages/Newtonsoft.Json/)
[![Build status](https://dev.azure.com/jamesnk/Public/_apis/build/status/JamesNK.Newtonsoft.Json?branchName=master)](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
Json.NET is a popular high-performance JSON framework for .NET
## Serialize JSON
```csharp
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product);
// {
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
// }
```
## Deserialize JSON
```csharp
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
// Bad Boys
```
## LINQ to JSON
```csharp
JArray array = new JArray();
array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
string json = o.ToString();
// {
// "MyArray": [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
// }
```
## Links
- [Homepage](https://www.newtonsoft.com/json)
- [Documentation](https://www.newtonsoft.com/json/help)
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 6c6f55d45332bf34096a5ca9a5567681
PrefabImporter:
guid: 6069c71b8cbde2c46af37b4d5e9d6a4f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0569847255b194d4da45463253c1e4b1
guid: 520a919eca99b2345bd9cdcf39fe8e58
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9b982b4ebc3ab07418a1e9965b232813
guid: 45501e75b3795d04cbf421ad8a1021d3
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,5 +1,7 @@
fileFormatVersion: 2
guid: a4c52cca01a63c54ba72e8a873c28f55
guid: 0321b95b71cdcb84396730b66dc18f74
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
@@ -16,18 +18,6 @@ PluginImporter:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
@@ -865,6 +865,32 @@
Converts a <see cref="T:System.DateTime"/> to and from Unix epoch time
</summary>
</member>
<member name="P:Newtonsoft.Json.Converters.UnixDateTimeConverter.AllowPreEpoch">
<summary>
Gets or sets a value indicating whether the dates before Unix epoch
should converted to and from JSON.
</summary>
<value>
<c>true</c> to allow converting dates before Unix epoch to and from JSON;
<c>false</c> to throw an exception when a date being converted to or from JSON
occurred before Unix epoch. The default value is <c>false</c>.
</value>
</member>
<member name="M:Newtonsoft.Json.Converters.UnixDateTimeConverter.#ctor">
<summary>
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Converters.UnixDateTimeConverter"/> class.
</summary>
</member>
<member name="M:Newtonsoft.Json.Converters.UnixDateTimeConverter.#ctor(System.Boolean)">
<summary>
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Converters.UnixDateTimeConverter"/> class.
</summary>
<param name="allowPreEpoch">
<c>true</c> to allow converting dates before Unix epoch to and from JSON;
<c>false</c> to throw an exception when a date being converted to or from JSON
occurred before Unix epoch. The default value is <c>false</c>.
</param>
</member>
<member name="M:Newtonsoft.Json.Converters.UnixDateTimeConverter.WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer)">
<summary>
Writes the JSON representation of the object.
@@ -2554,7 +2580,7 @@
<summary>
Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="T:Newtonsoft.Json.JsonReaderException"/>.
A null value means there is no maximum.
The default value is <c>128</c>.
The default value is <c>64</c>.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonReader.TokenType">
@@ -3014,7 +3040,7 @@
<summary>
Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="T:Newtonsoft.Json.JsonReaderException"/>.
A null value means there is no maximum.
The default value is <c>128</c>.
The default value is <c>64</c>.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonSerializer.CheckAdditionalContent">
@@ -3330,7 +3356,7 @@
<summary>
Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="T:Newtonsoft.Json.JsonReaderException"/>.
A null value means there is no maximum.
The default value is <c>128</c>.
The default value is <c>64</c>.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Formatting">
@@ -3397,6 +3423,12 @@
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/> class.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonSerializerSettings.#ctor(Newtonsoft.Json.JsonSerializerSettings)">
<summary>
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/> class
using values copied from the passed in <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/>.
</summary>
</member>
<member name="T:Newtonsoft.Json.JsonTextReader">
<summary>
Represents a reader that provides fast, non-cached, forward-only access to JSON text data.
@@ -7031,6 +7063,25 @@
<param name="reader">The reader.</param>
<returns>An instance of <see cref="T:Newtonsoft.Json.Linq.JRaw"/> with the content of the reader's current token.</returns>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonCloneSettings">
<summary>
Specifies the settings used when cloning JSON.
</summary>
</member>
<member name="M:Newtonsoft.Json.Linq.JsonCloneSettings.#ctor">
<summary>
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JsonCloneSettings"/> class.
</summary>
</member>
<member name="P:Newtonsoft.Json.Linq.JsonCloneSettings.CopyAnnotations">
<summary>
Gets or sets a flag that indicates whether to copy annotations when cloning a <see cref="T:Newtonsoft.Json.Linq.JToken"/>.
The default value is <c>true</c>.
</summary>
<value>
A flag that indicates whether to copy annotations when cloning a <see cref="T:Newtonsoft.Json.Linq.JToken"/>.
</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonLoadSettings">
<summary>
Specifies the settings used when loading JSON.
@@ -8071,6 +8122,13 @@
</summary>
<returns>A new instance of the <see cref="T:Newtonsoft.Json.Linq.JToken"/>.</returns>
</member>
<member name="M:Newtonsoft.Json.Linq.JToken.DeepClone(Newtonsoft.Json.Linq.JsonCloneSettings)">
<summary>
Creates a new instance of the <see cref="T:Newtonsoft.Json.Linq.JToken"/>. All child tokens are recursively cloned.
</summary>
<param name="settings">A <see cref="T:Newtonsoft.Json.Linq.JsonCloneSettings"/> object to configure cloning settings.</param>
<returns>A new instance of the <see cref="T:Newtonsoft.Json.Linq.JToken"/>.</returns>
</member>
<member name="M:Newtonsoft.Json.Linq.JToken.AddAnnotation(System.Object)">
<summary>
Adds an object to the annotation list of this <see cref="T:Newtonsoft.Json.Linq.JToken"/>.
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7cdd1b6e2b1397547b722844a364a7c7
guid: 9b4b3cddff1ae1343a973b35c0738edd
TextScriptImporter:
externalObjects: {}
userData:
File renamed without changes.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: be12599e7ed6ddb44ac085726df1d0fd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,7 @@
fileFormatVersion: 2
guid: f691697ada4059c46a06801ddaf2ee3a
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
Binary file not shown.
@@ -1,33 +0,0 @@
fileFormatVersion: 2
guid: 8dc1be91775c4bb469f6b74cef450eaa
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
-21
View File
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 Patrick McCarthy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1d9014b99ad06af428514a5902d29ff3
timeCreated: 1573248500
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 83c5d2001771f15429a88d67e81366d6
timeCreated: 1517876157
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 217cb7caed5f7fb49b339428b1d80974
guid: 6440a5f3157375d469774ee0793ec07b
folderAsset: yes
timeCreated: 1510280316
licenseType: Free
timeCreated: 1479413187
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ff366e107d0770a41a2afe8ad87ef708
folderAsset: yes
timeCreated: 1509396159
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,31 @@
#if UNITY_EDITOR || UNITY_ANDROID
using UnityEngine;
namespace SimpleFileBrowser
{
public class FBCallbackHelper : MonoBehaviour
{
private System.Action mainThreadAction = null;
private void Awake()
{
DontDestroyOnLoad( gameObject );
}
private void Update()
{
if( mainThreadAction != null )
{
System.Action temp = mainThreadAction;
mainThreadAction = null;
temp();
}
}
public void CallOnMainThread( System.Action function )
{
mainThreadAction = function;
}
}
}
#endif
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 997bfc59716c24c41ad03bcbd7f8ef0a
timeCreated: 1570918076
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,36 @@
#if UNITY_EDITOR || UNITY_ANDROID
using UnityEngine;
namespace SimpleFileBrowser
{
public class FBDirectoryReceiveCallbackAndroid : AndroidJavaProxy
{
private readonly FileBrowser.AndroidSAFDirectoryPickCallback callback;
private readonly FBCallbackHelper callbackHelper;
public FBDirectoryReceiveCallbackAndroid( FileBrowser.AndroidSAFDirectoryPickCallback callback ) : base( "com.yasirkula.unity.FileBrowserDirectoryReceiver" )
{
this.callback = callback;
callbackHelper = new GameObject( "FBCallbackHelper" ).AddComponent<FBCallbackHelper>();
}
public void OnDirectoryPicked( string rawUri, string name )
{
callbackHelper.CallOnMainThread( () => DirectoryPickedCallback( rawUri, name ) );
}
private void DirectoryPickedCallback( string rawUri, string name )
{
try
{
if( callback != null )
callback( rawUri, name );
}
finally
{
Object.Destroy( callbackHelper.gameObject );
}
}
}
}
#endif
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8dec4dc5be16ca84e9c147627361671d
timeCreated: 1520199471
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,29 @@
#if UNITY_EDITOR || UNITY_ANDROID
using System.Threading;
using UnityEngine;
namespace SimpleFileBrowser
{
public class FBPermissionCallbackAndroid : AndroidJavaProxy
{
private object threadLock;
public int Result { get; private set; }
public FBPermissionCallbackAndroid( object threadLock ) : base( "com.yasirkula.unity.FileBrowserPermissionReceiver" )
{
Result = -1;
this.threadLock = threadLock;
}
public void OnPermissionResult( int result )
{
Result = result;
lock( threadLock )
{
Monitor.Pulse( threadLock );
}
}
}
}
#endif
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2cd91db0ba676ef47af67e3597037d1a
timeCreated: 1520199471
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: cae0a78f915b13748ba09fd56bafb4c8
timeCreated: 1606638456
licenseType: Store
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 53eaeb5abaee5aa4ca7f07beacb73c2e
folderAsset: yes
timeCreated: 1479489583
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,325 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1000011646011302}
m_IsPrefabParent: 1
--- !u!1 &1000010981689570
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000013702633820}
- component: {fileID: 222000010857273394}
- component: {fileID: 114000013995033306}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011646011302
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000013952242090}
- component: {fileID: 222000013410998874}
- component: {fileID: 114000012602770182}
- component: {fileID: 114000012265032802}
m_Layer: 5
m_Name: SimpleFileBrowserItem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000013967986654
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000012393993334}
- component: {fileID: 222000012809932278}
- component: {fileID: 114000013208375990}
m_Layer: 5
m_Name: MultiSelectionToggle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1268973638054374
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224447975432582502}
- component: {fileID: 222113778025760416}
- component: {fileID: 114807149938652920}
- component: {fileID: 114942441918357790}
m_Layer: 5
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114000012265032802
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b5f1b2825c50f7b4d9be146ab2137bff, type: 3}
m_Name:
m_EditorClassIdentifier:
background: {fileID: 114000012602770182}
icon: {fileID: 114807149938652920}
multiSelectionToggle: {fileID: 114000013208375990}
nameText: {fileID: 114000013995033306}
--- !u!114 &114000012602770182
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 6ff773ea42aedd04c8bb96a1fe9a73b8, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114000013208375990
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: d6beaeac8de2af749a48581db778df3e, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114000013995033306
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Filename
--- !u!114 &114807149938652920
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1268973638054374}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114942441918357790
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1268973638054374}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.1764706}
m_EffectDistance: {x: 0.75, y: -0.75}
m_UseGraphicAlpha: 1
--- !u!222 &222000010857273394
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
--- !u!222 &222000012809932278
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
--- !u!222 &222000013410998874
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
--- !u!222 &222113778025760416
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1268973638054374}
--- !u!224 &224000012393993334
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224000013952242090}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 18.99997, y: 0}
m_SizeDelta: {x: 30, y: -6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224000013702633820
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224000013952242090}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 19, y: 0}
m_SizeDelta: {x: -38, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224000013952242090
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224000012393993334}
- {fileID: 224447975432582502}
- {fileID: 224000013702633820}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!224 &224447975432582502
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1268973638054374}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224000013952242090}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 19, y: 0}
m_SizeDelta: {x: 30, y: -6}
m_Pivot: {x: 0.5, y: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c2db22c1e3cd2584fa0e9168745a4536
timeCreated: 1479415743
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,256 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1000011646011302}
m_IsPrefabParent: 1
--- !u!1 &1000010981689570
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000013702633820}
- component: {fileID: 222000010857273394}
- component: {fileID: 114000013995033306}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011646011302
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000013952242090}
- component: {fileID: 222000013410998874}
- component: {fileID: 114000012602770182}
- component: {fileID: 114000012163346592}
m_Layer: 5
m_Name: SimpleFileBrowserQuickLink
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000013967986654
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224000012393993334}
- component: {fileID: 222000012809932278}
- component: {fileID: 114000013208375990}
- component: {fileID: 114174331659558594}
m_Layer: 5
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114000012163346592
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1f277f5418eabf94cad94208055878af, type: 3}
m_Name:
m_EditorClassIdentifier:
background: {fileID: 114000012602770182}
icon: {fileID: 114000013208375990}
multiSelectionToggle: {fileID: 0}
nameText: {fileID: 114000013995033306}
--- !u!114 &114000012602770182
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 6ff773ea42aedd04c8bb96a1fe9a73b8, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114000013208375990
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114000013995033306
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Filename
--- !u!114 &114174331659558594
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.1764706}
m_EffectDistance: {x: 0.75, y: -0.75}
m_UseGraphicAlpha: 1
--- !u!222 &222000010857273394
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
--- !u!222 &222000012809932278
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
--- !u!222 &222000013410998874
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
--- !u!224 &224000012393993334
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013967986654}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224000013952242090}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 19, y: 0}
m_SizeDelta: {x: 30, y: -6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224000013702633820
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010981689570}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224000013952242090}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 19, y: 0}
m_SizeDelta: {x: -38, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224000013952242090
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011646011302}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224000012393993334}
- {fileID: 224000013702633820}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0, y: 1}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 419c1f8581236d6469bd13ae862bfb50
timeCreated: 1479415743
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
+121
View File
@@ -0,0 +1,121 @@
= Simple File Browser (v1.5.9) =
Online documentation & example code available at: https://github.com/yasirkula/UnitySimpleFileBrowser
E-mail: yasirkula@gmail.com
### ABOUT
This plugin helps you show save/load dialogs during gameplay with its uGUI based file browser.
### HOW TO
The file browser can be shown either as a save dialog or a load dialog. In load mode, the returned path(s) always lead to existing files or folders. In save mode, the returned path(s) can point to non-existing files, as well.
File browser comes bundled with two premade skins in the Skins directory: LightSkin and DarkSkin. New UISkins can be created via "Assets-Create-yasirkula-SimpleFileBrowser-UI Skin". A UISkin can be assigned to the file browser in two ways:
- By changing SimpleFileBrowserCanvas prefab's Skin field
- By changing the value of FileBrowser.Skin property from a C# script
### NEW INPUT SYSTEM SUPPORT
This plugin supports Unity's new Input System but it requires some manual modifications (if both the legacy and the new input systems are active at the same time, no changes are needed):
- the plugin mustn't be installed as a package, i.e. it must reside inside the Assets folder and not the Packages folder (it can reside inside a subfolder of Assets like Assets/Plugins)
- if Unity 2019.2.5 or earlier is used, add ENABLE_INPUT_SYSTEM compiler directive to "Player Settings/Scripting Define Symbols" (these symbols are platform specific, so if you change the active platform later, you'll have to add the compiler directive again)
- add "Unity.InputSystem" assembly to "SimpleFileBrowser.Runtime" Assembly Definition File's "Assembly Definition References" list
- open SimpleFileBrowserCanvas prefab, select EventSystem child object and replace StandaloneInputModule component with InputSystemUIInputModule component (or, if your scene(s) already have EventSystem objects, you can delete SimpleFileBrowserCanvas prefab's EventSystem child object)
### FAQ
- Android build fails, it says "error: attribute android:requestLegacyExternalStorage not found" in Console
"android:requestLegacyExternalStorage" attribute in AndroidManifest.xml grants full access to device's storage on Android 10 but requires you to update your Android SDK to at least SDK 29. If this isn't possible for you, you should open SimpleFileBrowser.aar with WinRAR or 7-Zip and then remove the "<application ... />" tag from AndroidManifest.xml.
- Can't show the file browser on Android, it says "java.lang.ClassNotFoundException: com.yasirkula.unity.FileBrowserPermissionReceiver" in Logcat
If you are sure that your plugin is up-to-date, then enable "Custom Proguard File" option from Player Settings and add the following line to that file: -keep class com.yasirkula.unity.* { *; }
- File browser doesn't show any files on Android 10+
File browser uses Storage Access Framework on these Android versions and users must first click the "Pick Folder" button in the quick links section
- File browser doesn't show any files on Unity 2021.3.x
Please see: https://github.com/yasirkula/UnitySimpleFileBrowser/issues/70
- RequestPermission returns Permission.Denied on Android
Declare the WRITE_EXTERNAL_STORAGE permission manually in your Plugins/Android/AndroidManifest.xml file as follows: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="replace"/>
You'll need to add the following attribute to the '<manifest ...>' element: xmlns:tools="http://schemas.android.com/tools"
### SCRIPTING API
Please see the online documentation for a more in-depth documentation of the Scripting API: https://github.com/yasirkula/UnitySimpleFileBrowser
NOTE: On Android Q (10) or later, it is impossible to work with File APIs. On these devices, SimpleFileBrowser uses Storage Access Framework (SAF) to browse the files. However, paths returned by SAF are not File API compatible. To simulate the behaviour of the File API on all devices (including SAF), you can check out the FileBrowserHelpers functions. For reference, here is an example SAF path: content://com.android.externalstorage.documents/tree/primary%3A/document/primary%3APictures
// Namespace
using SimpleFileBrowser;
public enum Permission { Denied = 0, Granted = 1, ShouldAsk = 2 };
public enum PickMode { Files = 0, Folders = 1, FilesAndFolders = 2 };
public delegate void OnSuccess( string[] paths );
public delegate void OnCancel();
// Changing the dialog's skin
public static UISkin Skin { get; set; }
// Showing dialog
bool ShowSaveDialog( OnSuccess onSuccess, OnCancel onCancel, PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Save", string saveButtonText = "Save" );
bool ShowLoadDialog( OnSuccess onSuccess, OnCancel onCancel, PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Load", string loadButtonText = "Select" );
IEnumerator WaitForSaveDialog( PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Save", string saveButtonText = "Save" );
IEnumerator WaitForLoadDialog( PickMode pickMode, bool allowMultiSelection = false, string initialPath = null, string initialFilename = null, string title = "Load", string loadButtonText = "Select" );
// Force closing an open dialog
void HideDialog( bool invokeCancelCallback = false );
// Customizing the dialog
bool AddQuickLink( string name, string path, Sprite icon = null );
void ClearQuickLinks();
void SetExcludedExtensions( params string[] excludedExtensions );
// Filters should include the period (e.g. ".jpg" instead of "jpg")
void SetFilters( bool showAllFilesFilter, IEnumerable<string> filters );
void SetFilters( bool showAllFilesFilter, params string[] filters );
void SetFilters( bool showAllFilesFilter, IEnumerable<FileBrowser.Filter> filters );
void SetFilters( bool showAllFilesFilter, params FileBrowser.Filter[] filters );
bool SetDefaultFilter( string defaultFilter );
// Filtering displayed files/folders programmatically
delegate bool FileSystemEntryFilter( FileSystemEntry entry );
event FileSystemEntryFilter DisplayedEntriesFilter;
// Android runtime permissions
FileBrowser.Permission CheckPermission();
FileBrowser.Permission RequestPermission();
// File manipulation functions that work on all platforms (including Storage Access Framework (SAF) on Android 10+)
// These functions should be called with the paths returned by the FileBrowser functions only
bool FileBrowserHelpers.FileExists( string path );
bool FileBrowserHelpers.DirectoryExists( string path );
bool FileBrowserHelpers.IsDirectory( string path );
bool FileBrowserHelpers.IsPathDescendantOfAnother( string path, string parentFolderPath );
string FileBrowserHelpers.GetDirectoryName( string path );
FileSystemEntry[] FileBrowserHelpers.GetEntriesInDirectory( string path, bool extractOnlyLastSuffixFromExtensions ); // Returns all files and folders in a directory. If you want "File.tar.gz"s extension to be extracted as ".tar.gz" instead of ".gz", set 'extractOnlyLastSuffixFromExtensions' to false
string FileBrowserHelpers.CreateFileInDirectory( string directoryPath, string filename ); // Returns the created file's path
string FileBrowserHelpers.CreateFolderInDirectory( string directoryPath, string folderName ); // Returns the created folder's path
void FileBrowserHelpers.WriteBytesToFile( string targetPath, byte[] bytes );
void FileBrowserHelpers.WriteTextToFile( string targetPath, string text );
void FileBrowserHelpers.AppendBytesToFile( string targetPath, byte[] bytes );
void FileBrowserHelpers.AppendTextToFile( string targetPath, string text );
byte[] FileBrowserHelpers.ReadBytesFromFile( string sourcePath );
string FileBrowserHelpers.ReadTextFromFile( string sourcePath );
void FileBrowserHelpers.CopyFile( string sourcePath, string destinationPath );
void FileBrowserHelpers.CopyDirectory( string sourcePath, string destinationPath );
void FileBrowserHelpers.MoveFile( string sourcePath, string destinationPath );
void FileBrowserHelpers.MoveDirectory( string sourcePath, string destinationPath );
string FileBrowserHelpers.RenameFile( string path, string newName ); // Returns the new path of the file
string FileBrowserHelpers.RenameDirectory( string path, string newName ); // Returns the new path of the directory
void FileBrowserHelpers.DeleteFile( string path );
void FileBrowserHelpers.DeleteDirectory( string path );
string FileBrowserHelpers.GetFilename( string path );
long FileBrowserHelpers.GetFilesize( string path );
DateTime FileBrowserHelpers.GetLastModifiedDate( string path );
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 02a0a0f34932297429c157aca8b9a977
timeCreated: 1563308858
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 1738075a39a390447b7a620ca6962142
guid: f4cd9780a618bad4b821ad3b1a68bacd
folderAsset: yes
timeCreated: 1510280362
licenseType: Free
timeCreated: 1479561120
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9ea2606f8fddead46aabb7adb3d8d434
timeCreated: 1479415546
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: be37f3e38d135f94e9d78c79ef89d303
folderAsset: yes
timeCreated: 1479413886
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,57 @@
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
namespace SimpleFileBrowser
{
// Avoid multiple EventSystems in the scene by activating the embedded EventSystem only if one doesn't already exist in the scene
[DefaultExecutionOrder( 1000 )]
public class EventSystemHandler : MonoBehaviour
{
#pragma warning disable 0649
[SerializeField]
private GameObject embeddedEventSystem;
#pragma warning restore 0649
private void OnEnable()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
SceneManager.sceneLoaded += OnSceneLoaded;
SceneManager.sceneUnloaded -= OnSceneUnloaded;
SceneManager.sceneUnloaded += OnSceneUnloaded;
ActivateEventSystemIfNeeded();
}
private void OnDisable()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
SceneManager.sceneUnloaded -= OnSceneUnloaded;
DeactivateEventSystem();
}
private void OnSceneLoaded( Scene scene, LoadSceneMode mode )
{
ActivateEventSystemIfNeeded();
}
private void OnSceneUnloaded( Scene current )
{
// Deactivate the embedded EventSystem before changing scenes because the new scene might have its own EventSystem
DeactivateEventSystem();
}
private void ActivateEventSystemIfNeeded()
{
if( embeddedEventSystem && !EventSystem.current )
embeddedEventSystem.SetActive( true );
}
private void DeactivateEventSystem()
{
if( embeddedEventSystem )
embeddedEventSystem.SetActive( false );
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0868341868a4a4641b4d272d2fc5f538
timeCreated: 1658741613
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f51dc09bf9e35804ba0f5e76c527025e
timeCreated: 1479416382
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,58 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.InputSystem;
#endif
namespace SimpleFileBrowser
{
public class FileBrowserAccessRestrictedPanel : MonoBehaviour
{
#pragma warning disable 0649
[SerializeField]
private Text messageLabel;
[SerializeField]
private Button okButton;
#pragma warning restore 0649
internal void Show()
{
gameObject.SetActive( true );
}
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
private void LateUpdate()
{
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Keyboard.current != null )
#endif
{
// Handle keyboard shortcuts
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Keyboard.current[Key.Enter].wasPressedThisFrame || Keyboard.current[Key.NumpadEnter].wasPressedThisFrame || Keyboard.current[Key.Escape].wasPressedThisFrame )
#else
if( Input.GetKeyDown( KeyCode.Return ) || Input.GetKeyDown( KeyCode.KeypadEnter ) || Input.GetKeyDown( KeyCode.Escape ) )
#endif
OKButtonClicked();
}
}
#endif
internal void RefreshSkin( UISkin skin )
{
Image background = GetComponentInChildren<Image>();
background.color = skin.PopupPanelsBackgroundColor;
background.sprite = skin.PopupPanelsBackground;
skin.ApplyTo( okButton );
skin.ApplyTo( messageLabel, skin.PopupPanelsTextColor );
}
public void OKButtonClicked()
{
gameObject.SetActive( false );
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 85ea21be7cacb484cb6db0d183d3b2a8
timeCreated: 1603800894
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,142 @@
using UnityEngine;
using UnityEngine.UI;
namespace SimpleFileBrowser
{
public class FileBrowserContextMenu : MonoBehaviour
{
#pragma warning disable 0649
[SerializeField]
private FileBrowser fileBrowser;
[SerializeField]
private RectTransform rectTransform;
[SerializeField]
private Button selectAllButton;
[SerializeField]
private Button deselectAllButton;
[SerializeField]
private Button createFolderButton;
[SerializeField]
private Button deleteButton;
[SerializeField]
private Button renameButton;
[SerializeField]
private GameObject selectAllButtonSeparator;
[SerializeField]
private Text[] allButtonTexts;
[SerializeField]
private Image[] allButtonSeparators;
[SerializeField]
private float minDistanceToEdges = 10f;
#pragma warning restore 0649
internal void Show( bool selectAllButtonVisible, bool deselectAllButtonVisible, bool deleteButtonVisible, bool renameButtonVisible, Vector2 position, bool isMoreOptionsMenu )
{
selectAllButton.gameObject.SetActive( selectAllButtonVisible );
deselectAllButton.gameObject.SetActive( deselectAllButtonVisible );
deleteButton.gameObject.SetActive( deleteButtonVisible );
renameButton.gameObject.SetActive( renameButtonVisible );
selectAllButtonSeparator.SetActive( !deselectAllButtonVisible );
rectTransform.anchoredPosition = position;
gameObject.SetActive( true );
if( isMoreOptionsMenu )
rectTransform.pivot = Vector2.one;
else
{
// Find the optimal pivot value
LayoutRebuilder.ForceRebuildLayoutImmediate( rectTransform );
Vector2 size = rectTransform.sizeDelta;
Vector2 canvasSize = fileBrowser.rectTransform.sizeDelta;
// Take canvas' Pivot into consideration
Vector2 positionOffset = canvasSize;
positionOffset.Scale( fileBrowser.rectTransform.pivot );
position += positionOffset;
// Try bottom-right corner first
Vector2 cornerPos = position + new Vector2( size.x + minDistanceToEdges, -size.y - minDistanceToEdges );
if( cornerPos.x <= canvasSize.x && cornerPos.y >= 0f )
rectTransform.pivot = new Vector2( 0f, 1f );
else
{
// Try bottom-left corner
cornerPos = position - new Vector2( size.x + minDistanceToEdges, size.y + minDistanceToEdges );
if( cornerPos.x >= 0f && cornerPos.y >= 0f )
rectTransform.pivot = Vector2.one;
else
{
// Try top-right corner
cornerPos = position + new Vector2( size.x + minDistanceToEdges, size.y + minDistanceToEdges );
if( cornerPos.x <= canvasSize.x && cornerPos.y <= canvasSize.y )
rectTransform.pivot = Vector2.zero;
else
{
// Use top-left corner
rectTransform.pivot = new Vector2( 1f, 0f );
}
}
}
}
}
internal void Hide()
{
gameObject.SetActive( false );
}
internal void RefreshSkin( UISkin skin )
{
rectTransform.GetComponent<Image>().color = skin.ContextMenuBackgroundColor;
deselectAllButton.image.color = skin.ContextMenuBackgroundColor;
selectAllButton.image.color = skin.ContextMenuBackgroundColor;
createFolderButton.image.color = skin.ContextMenuBackgroundColor;
deleteButton.image.color = skin.ContextMenuBackgroundColor;
renameButton.image.color = skin.ContextMenuBackgroundColor;
for( int i = 0; i < allButtonTexts.Length; i++ )
skin.ApplyTo( allButtonTexts[i], skin.ContextMenuTextColor );
for( int i = 0; i < allButtonSeparators.Length; i++ )
allButtonSeparators[i].color = skin.ContextMenuSeparatorColor;
}
public void OnSelectAllButtonClicked()
{
Hide();
fileBrowser.SelectAllFiles();
}
public void OnDeselectAllButtonClicked()
{
Hide();
fileBrowser.DeselectAllFiles();
}
public void OnCreateFolderButtonClicked()
{
Hide();
fileBrowser.CreateNewFolder();
}
public void OnDeleteButtonClicked()
{
Hide();
fileBrowser.DeleteSelectedFiles();
}
public void OnRenameButtonClicked()
{
Hide();
fileBrowser.RenameSelectedFile();
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0d5261bc2717e6143961d30ccb76fb66
timeCreated: 1603793977
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,61 @@
using UnityEngine;
using UnityEngine.EventSystems;
namespace SimpleFileBrowser
{
public class FileBrowserCursorHandler : MonoBehaviour
#if UNITY_EDITOR || ( !UNITY_ANDROID && !UNITY_IOS )
, IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IEndDragHandler
#endif
{
#if UNITY_EDITOR || ( !UNITY_ANDROID && !UNITY_IOS )
#pragma warning disable 0649
[SerializeField]
private Texture2D resizeCursor;
#pragma warning restore 0649
private bool isHovering;
private bool isResizing;
void IPointerEnterHandler.OnPointerEnter( PointerEventData eventData )
{
isHovering = true;
if( !eventData.dragging )
ShowResizeCursor();
}
void IPointerExitHandler.OnPointerExit( PointerEventData eventData )
{
isHovering = false;
if( !isResizing )
ShowDefaultCursor();
}
void IBeginDragHandler.OnBeginDrag( PointerEventData eventData )
{
isResizing = true;
ShowResizeCursor();
}
void IEndDragHandler.OnEndDrag( PointerEventData eventData )
{
isResizing = false;
if( !isHovering )
ShowDefaultCursor();
}
private void ShowDefaultCursor()
{
Cursor.SetCursor( null, Vector2.zero, CursorMode.Auto );
}
private void ShowResizeCursor()
{
Cursor.SetCursor( resizeCursor, new Vector2( resizeCursor.width * 0.5f, resizeCursor.height * 0.5f ), CursorMode.Auto );
}
#endif
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 759524cf7ef37f244bb00cd9724f0349
timeCreated: 1603745549
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,159 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.InputSystem;
#endif
namespace SimpleFileBrowser
{
public class FileBrowserFileOperationConfirmationPanel : MonoBehaviour
{
public enum OperationType { Delete = 0, Overwrite = 1 };
public delegate void OnOperationConfirmed();
#pragma warning disable 0649
[SerializeField]
private Text[] titleLabels;
[SerializeField]
private GameObject[] targetItems;
[SerializeField]
private Image[] targetItemIcons;
[SerializeField]
private Text[] targetItemNames;
[SerializeField]
private GameObject targetItemsRest;
[SerializeField]
private Text targetItemsRestLabel;
[SerializeField]
private RectTransform yesButtonTransform;
[SerializeField]
private RectTransform noButtonTransform;
[SerializeField]
private float narrowScreenWidth = 380f;
#pragma warning restore 0649
private OnOperationConfirmed onOperationConfirmed;
internal void Show( FileBrowser fileBrowser, List<FileSystemEntry> items, OperationType operationType, OnOperationConfirmed onOperationConfirmed )
{
Show( fileBrowser, items, null, operationType, onOperationConfirmed );
}
internal void Show( FileBrowser fileBrowser, List<FileSystemEntry> items, List<int> selectedItemIndices, OperationType operationType, OnOperationConfirmed onOperationConfirmed )
{
this.onOperationConfirmed = onOperationConfirmed;
int itemCount = ( selectedItemIndices != null ) ? selectedItemIndices.Count : items.Count;
for( int i = 0; i < titleLabels.Length; i++ )
titleLabels[i].gameObject.SetActive( (int) operationType == i );
for( int i = 0; i < targetItems.Length; i++ )
targetItems[i].SetActive( i < itemCount );
for( int i = 0; i < targetItems.Length && i < itemCount; i++ )
{
FileSystemEntry item = items[( selectedItemIndices != null ) ? selectedItemIndices[i] : i];
targetItemIcons[i].sprite = fileBrowser.GetIconForFileEntry( item );
targetItemNames[i].text = item.Name;
}
if( itemCount > targetItems.Length )
{
targetItemsRestLabel.text = string.Concat( "...and ", ( itemCount - targetItems.Length ).ToString(), " other" );
targetItemsRest.SetActive( true );
}
else
targetItemsRest.SetActive( false );
gameObject.SetActive( true );
}
// Handles responsive user interface
internal void OnCanvasDimensionsChanged( Vector2 size )
{
if( size.x >= narrowScreenWidth )
{
yesButtonTransform.anchorMin = new Vector2( 0.5f, 0f );
yesButtonTransform.anchorMax = new Vector2( 0.75f, 1f );
noButtonTransform.anchorMin = new Vector2( 0.75f, 0f );
}
else
{
yesButtonTransform.anchorMin = Vector2.zero;
yesButtonTransform.anchorMax = new Vector2( 0.5f, 1f );
noButtonTransform.anchorMin = new Vector2( 0.5f, 0f );
}
}
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
private void LateUpdate()
{
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Keyboard.current != null )
#endif
{
// Handle keyboard shortcuts
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Keyboard.current[Key.Enter].wasPressedThisFrame || Keyboard.current[Key.NumpadEnter].wasPressedThisFrame )
#else
if( Input.GetKeyDown( KeyCode.Return ) || Input.GetKeyDown( KeyCode.KeypadEnter ) )
#endif
YesButtonClicked();
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Keyboard.current[Key.Escape].wasPressedThisFrame )
#else
if( Input.GetKeyDown( KeyCode.Escape ) )
#endif
NoButtonClicked();
}
}
#endif
internal void RefreshSkin( UISkin skin )
{
Image background = GetComponentInChildren<Image>();
background.color = skin.PopupPanelsBackgroundColor;
background.sprite = skin.PopupPanelsBackground;
skin.ApplyTo( yesButtonTransform.GetComponent<Button>() );
skin.ApplyTo( noButtonTransform.GetComponent<Button>() );
for( int i = 0; i < titleLabels.Length; i++ )
skin.ApplyTo( titleLabels[i], skin.PopupPanelsTextColor );
skin.ApplyTo( targetItemsRestLabel, skin.PopupPanelsTextColor );
for( int i = 0; i < targetItemNames.Length; i++ )
skin.ApplyTo( targetItemNames[i], skin.PopupPanelsTextColor );
for( int i = 0; i < targetItems.Length; i++ )
targetItems[i].GetComponent<LayoutElement>().preferredHeight = skin.FileHeight;
}
public void YesButtonClicked()
{
gameObject.SetActive( false );
if( onOperationConfirmed != null )
onOperationConfirmed();
}
public void NoButtonClicked()
{
gameObject.SetActive( false );
onOperationConfirmed = null;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 524a683efed82084b9a9c4a3eff23b73
timeCreated: 1658958138
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,543 @@
using System.IO;
using UnityEngine;
namespace SimpleFileBrowser
{
public struct FileSystemEntry
{
public readonly string Path;
public readonly string Name;
public readonly string Extension;
public readonly FileAttributes Attributes;
public bool IsDirectory { get { return ( Attributes & FileAttributes.Directory ) == FileAttributes.Directory; } }
public FileSystemEntry( string path, string name, string extension, bool isDirectory )
{
Path = path;
Name = name;
Extension = extension;
Attributes = isDirectory ? FileAttributes.Directory : FileAttributes.Normal;
}
public FileSystemEntry( FileSystemInfo fileInfo, string extension )
{
Path = fileInfo.FullName;
Name = fileInfo.Name;
Extension = extension;
Attributes = fileInfo.Attributes;
}
}
public static class FileBrowserHelpers
{
#if !UNITY_EDITOR && UNITY_ANDROID
private static AndroidJavaClass m_ajc = null;
public static AndroidJavaClass AJC
{
get
{
if( m_ajc == null )
m_ajc = new AndroidJavaClass( "com.yasirkula.unity.FileBrowser" );
return m_ajc;
}
}
private static AndroidJavaObject m_context = null;
public static AndroidJavaObject Context
{
get
{
if( m_context == null )
{
using( AndroidJavaObject unityClass = new AndroidJavaClass( "com.unity3d.player.UnityPlayer" ) )
{
m_context = unityClass.GetStatic<AndroidJavaObject>( "currentActivity" );
}
}
return m_context;
}
}
private static string m_temporaryFilePath = null;
private static string TemporaryFilePath
{
get
{
if( m_temporaryFilePath == null )
{
m_temporaryFilePath = Path.Combine( Application.temporaryCachePath, "tmpFile" );
Directory.CreateDirectory( Application.temporaryCachePath );
}
return m_temporaryFilePath;
}
}
// On Android 10+, filesystem can be accessed via Storage Access Framework only
private static bool? m_shouldUseSAF = null;
public static bool ShouldUseSAF
{
get
{
if( m_shouldUseSAF == null )
m_shouldUseSAF = AJC.CallStatic<bool>( "CheckSAF" );
return m_shouldUseSAF.Value;
}
}
public static bool ShouldUseSAFForPath( string path ) // true: path should be managed with AJC (native helper class for Storage Access Framework), false: path should be managed with System.IO
{
return ShouldUseSAF && ( string.IsNullOrEmpty( path ) || path[0] != '/' );
}
#endif
public static bool FileExists( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<bool>( "SAFEntryExists", Context, path, false );
#endif
return File.Exists( path );
}
public static bool DirectoryExists( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<bool>( "SAFEntryExists", Context, path, true );
else if( ShouldUseSAF ) // Directory.Exists returns true even for inaccessible directories on Android 10+, we need to check if the directory is accessible
{
try
{
Directory.GetFiles( path, "testtesttest" );
return true;
}
catch
{
return false;
}
}
#endif
return Directory.Exists( path );
}
public static bool IsDirectory( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<bool>( "SAFEntryDirectory", Context, path );
#endif
if( Directory.Exists( path ) )
return true;
if( File.Exists( path ) )
return false;
string extension = Path.GetExtension( path );
return extension == null || extension.Length <= 1; // extension includes '.'
}
public static bool IsPathDescendantOfAnother( string path, string parentFolderPath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<bool>( "IsSAFEntryChildOfAnother", Context, path, parentFolderPath );
#endif
path = Path.GetFullPath( path ).Replace( '\\', '/' );
parentFolderPath = Path.GetFullPath( parentFolderPath ).Replace( '\\', '/' );
if( path == parentFolderPath )
return false;
if( parentFolderPath[parentFolderPath.Length - 1] != '/' )
parentFolderPath += "/";
return path != parentFolderPath && path.StartsWith( parentFolderPath, System.StringComparison.OrdinalIgnoreCase );
}
public static string GetDirectoryName( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<string>( "GetParentDirectory", Context, path );
#endif
return Path.GetDirectoryName( path );
}
public static FileSystemEntry[] GetEntriesInDirectory( string path, bool extractOnlyLastSuffixFromExtensions )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
{
string resultRaw = AJC.CallStatic<string>( "OpenSAFFolder", Context, path );
int separatorIndex = resultRaw.IndexOf( "<>" );
if( separatorIndex <= 0 )
{
Debug.LogError( "Entry count does not exist" );
return null;
}
int entryCount = 0;
for( int i = 0; i < separatorIndex; i++ )
{
char ch = resultRaw[i];
if( ch < '0' && ch > '9' )
{
Debug.LogError( "Couldn't parse entry count" );
return null;
}
entryCount = entryCount * 10 + ( ch - '0' );
}
if( entryCount <= 0 )
return null;
FileSystemEntry[] result = new FileSystemEntry[entryCount];
for( int i = 0; i < entryCount; i++ )
{
separatorIndex += 2;
if( separatorIndex >= resultRaw.Length )
{
Debug.LogError( "Couldn't fetch directory attribute" );
return null;
}
bool isDirectory = resultRaw[separatorIndex] == 'd';
separatorIndex++;
int nextSeparatorIndex = resultRaw.IndexOf( "<>", separatorIndex );
if( nextSeparatorIndex <= 0 )
{
Debug.LogError( "Entry name is empty" );
return null;
}
string entryName = resultRaw.Substring( separatorIndex, nextSeparatorIndex - separatorIndex );
separatorIndex = nextSeparatorIndex + 2;
nextSeparatorIndex = resultRaw.IndexOf( "<>", separatorIndex );
if( nextSeparatorIndex <= 0 )
{
Debug.LogError( "Entry rawUri is empty" );
return null;
}
string rawUri = resultRaw.Substring( separatorIndex, nextSeparatorIndex - separatorIndex );
separatorIndex = nextSeparatorIndex;
result[i] = new FileSystemEntry( rawUri, entryName, isDirectory ? null : FileBrowser.GetExtensionFromFilename( entryName, extractOnlyLastSuffixFromExtensions ), isDirectory );
}
return result;
}
#endif
try
{
FileSystemInfo[] items = new DirectoryInfo( path ).GetFileSystemInfos();
FileSystemEntry[] result = new FileSystemEntry[items.Length];
int index = 0;
for( int i = 0; i < items.Length; i++ )
{
try
{
result[index] = new FileSystemEntry( items[i], FileBrowser.GetExtensionFromFilename( items[i].Name, extractOnlyLastSuffixFromExtensions ) );
index++;
}
catch( System.Exception e )
{
Debug.LogException( e );
}
}
if( result.Length != index )
System.Array.Resize( ref result, index );
return result;
}
catch( System.UnauthorizedAccessException ) { }
catch( System.Exception e )
{
Debug.LogException( e );
}
return null;
}
public static string CreateFileInDirectory( string directoryPath, string filename )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( directoryPath ) )
return AJC.CallStatic<string>( "CreateSAFEntry", Context, directoryPath, false, filename );
#endif
string path = Path.Combine( directoryPath, filename );
using( File.Create( path ) ) { }
return path;
}
public static string CreateFolderInDirectory( string directoryPath, string folderName )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( directoryPath ) )
return AJC.CallStatic<string>( "CreateSAFEntry", Context, directoryPath, true, folderName );
#endif
string path = Path.Combine( directoryPath, folderName );
Directory.CreateDirectory( path );
return path;
}
public static void WriteBytesToFile( string targetPath, byte[] bytes )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( targetPath ) )
{
File.WriteAllBytes( TemporaryFilePath, bytes );
AJC.CallStatic( "WriteToSAFEntry", Context, targetPath, TemporaryFilePath, false );
File.Delete( TemporaryFilePath );
return;
}
#endif
File.WriteAllBytes( targetPath, bytes );
}
public static void WriteTextToFile( string targetPath, string text )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( targetPath ) )
{
File.WriteAllText( TemporaryFilePath, text );
AJC.CallStatic( "WriteToSAFEntry", Context, targetPath, TemporaryFilePath, false );
File.Delete( TemporaryFilePath );
return;
}
#endif
File.WriteAllText( targetPath, text );
}
public static void AppendBytesToFile( string targetPath, byte[] bytes )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( targetPath ) )
{
File.WriteAllBytes( TemporaryFilePath, bytes );
AJC.CallStatic( "WriteToSAFEntry", Context, targetPath, TemporaryFilePath, true );
File.Delete( TemporaryFilePath );
return;
}
#endif
using( var stream = new FileStream( targetPath, FileMode.Append, FileAccess.Write ) )
{
stream.Write( bytes, 0, bytes.Length );
}
}
public static void AppendTextToFile( string targetPath, string text )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( targetPath ) )
{
File.WriteAllText( TemporaryFilePath, text );
AJC.CallStatic( "WriteToSAFEntry", Context, targetPath, TemporaryFilePath, true );
File.Delete( TemporaryFilePath );
return;
}
#endif
File.AppendAllText( targetPath, text );
}
private static void AppendFileToFile( string targetPath, string sourceFileToAppend )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( targetPath ) )
{
AJC.CallStatic( "WriteToSAFEntry", Context, targetPath, sourceFileToAppend, true );
return;
}
#endif
using( Stream input = File.OpenRead( sourceFileToAppend ) )
using( Stream output = new FileStream( targetPath, FileMode.Append, FileAccess.Write ) )
{
byte[] buffer = new byte[4096];
int bytesRead;
while( ( bytesRead = input.Read( buffer, 0, buffer.Length ) ) > 0 )
output.Write( buffer, 0, bytesRead );
}
}
public static byte[] ReadBytesFromFile( string sourcePath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( sourcePath ) )
{
AJC.CallStatic( "ReadFromSAFEntry", Context, sourcePath, TemporaryFilePath );
byte[] result = File.ReadAllBytes( TemporaryFilePath );
File.Delete( TemporaryFilePath );
return result;
}
#endif
return File.ReadAllBytes( sourcePath );
}
public static string ReadTextFromFile( string sourcePath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( sourcePath ) )
{
AJC.CallStatic( "ReadFromSAFEntry", Context, sourcePath, TemporaryFilePath );
string result = File.ReadAllText( TemporaryFilePath );
File.Delete( TemporaryFilePath );
return result;
}
#endif
return File.ReadAllText( sourcePath );
}
public static void CopyFile( string sourcePath, string destinationPath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAF ) // No need to use ShouldUseSAFForPath because both SAF paths and raw file paths are handled on the native-side
{
AJC.CallStatic( "CopyFile", Context, sourcePath, destinationPath, false );
return;
}
#endif
File.Copy( sourcePath, destinationPath, true );
}
public static void CopyDirectory( string sourcePath, string destinationPath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAF ) // No need to use ShouldUseSAFForPath because both SAF paths and raw directory paths are handled on the native-side
{
AJC.CallStatic( "CopyDirectory", Context, sourcePath, destinationPath, false );
return;
}
#endif
CopyDirectoryRecursively( new DirectoryInfo( sourcePath ), destinationPath );
}
private static void CopyDirectoryRecursively( DirectoryInfo sourceDirectory, string destinationPath )
{
Directory.CreateDirectory( destinationPath );
FileInfo[] files = sourceDirectory.GetFiles();
for( int i = 0; i < files.Length; i++ )
files[i].CopyTo( Path.Combine( destinationPath, files[i].Name ), true );
DirectoryInfo[] subDirectories = sourceDirectory.GetDirectories();
for( int i = 0; i < subDirectories.Length; i++ )
CopyDirectoryRecursively( subDirectories[i], Path.Combine( destinationPath, subDirectories[i].Name ) );
}
public static void MoveFile( string sourcePath, string destinationPath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAF ) // No need to use ShouldUseSAFForPath because both SAF paths and raw file paths are handled on the native-side
{
AJC.CallStatic( "CopyFile", Context, sourcePath, destinationPath, true );
return;
}
#endif
File.Move( sourcePath, destinationPath );
}
public static void MoveDirectory( string sourcePath, string destinationPath )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAF ) // No need to use ShouldUseSAFForPath because both SAF paths and raw directory paths are handled on the native-side
{
AJC.CallStatic( "CopyDirectory", Context, sourcePath, destinationPath, true );
return;
}
#endif
Directory.Move( sourcePath, destinationPath );
}
public static string RenameFile( string path, string newName )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<string>( "RenameSAFEntry", Context, path, newName );
#endif
string newPath = Path.Combine( Path.GetDirectoryName( path ), newName );
File.Move( path, newPath );
return newPath;
}
public static string RenameDirectory( string path, string newName )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<string>( "RenameSAFEntry", Context, path, newName );
#endif
string newPath = Path.Combine( new DirectoryInfo( path ).Parent.FullName, newName );
Directory.Move( path, newPath );
return newPath;
}
public static void DeleteFile( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
{
AJC.CallStatic<bool>( "DeleteSAFEntry", Context, path );
return;
}
#endif
File.Delete( path );
}
public static void DeleteDirectory( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
{
AJC.CallStatic<bool>( "DeleteSAFEntry", Context, path );
return;
}
#endif
Directory.Delete( path, true );
}
public static string GetFilename( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<string>( "SAFEntryName", Context, path );
#endif
return Path.GetFileName( path );
}
public static long GetFilesize( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
if( ShouldUseSAFForPath( path ) )
return AJC.CallStatic<long>( "SAFEntrySize", Context, path );
#endif
return new FileInfo( path ).Length;
}
public static System.DateTime GetLastModifiedDate( string path )
{
#if !UNITY_EDITOR && UNITY_ANDROID
// Credit: https://stackoverflow.com/a/28504416/2373034
if( ShouldUseSAFForPath( path ) )
return new System.DateTime( 1970, 1, 1, 0, 0, 0 ).AddMilliseconds( AJC.CallStatic<long>( "SAFEntryLastModified", Context, path ) );
#endif
return new FileInfo( path ).LastWriteTime;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2370e7a82ec4087499ebf7efa149e9eb
timeCreated: 1570919647
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,238 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace SimpleFileBrowser
{
public class FileBrowserItem : ListItem, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler
#if UNITY_EDITOR || ( !UNITY_ANDROID && !UNITY_IOS )
, IPointerEnterHandler, IPointerExitHandler
#endif
{
#region Constants
private const float DOUBLE_CLICK_TIME = 0.5f;
private const float TOGGLE_MULTI_SELECTION_HOLD_TIME = 0.5f;
#endregion
#region Variables
protected FileBrowser fileBrowser;
#pragma warning disable 0649
[SerializeField]
private Image background;
[SerializeField]
private Image icon;
public Image Icon { get { return icon; } }
[SerializeField]
private Image multiSelectionToggle;
[SerializeField]
private Text nameText;
#pragma warning restore 0649
#pragma warning disable 0414
private bool isSelected, isHidden;
#pragma warning restore 0414
private UISkin skin;
private float pressTime = Mathf.Infinity;
private float prevClickTime;
#endregion
#region Properties
private RectTransform m_transform;
public RectTransform TransformComponent
{
get
{
if( m_transform == null )
m_transform = (RectTransform) transform;
return m_transform;
}
}
public string Name { get { return nameText.text; } }
public bool IsDirectory { get; private set; }
#endregion
#region Initialization Functions
public void SetFileBrowser( FileBrowser fileBrowser, UISkin skin )
{
this.fileBrowser = fileBrowser;
OnSkinRefreshed( skin, false );
}
public void SetFile( Sprite icon, string name, bool isDirectory )
{
this.icon.sprite = icon;
nameText.text = name;
IsDirectory = isDirectory;
}
#endregion
#region Messages
private void Update()
{
if( fileBrowser.AllowMultiSelection && Time.realtimeSinceStartup - pressTime >= TOGGLE_MULTI_SELECTION_HOLD_TIME )
{
// Item is held for a while
pressTime = Mathf.Infinity;
fileBrowser.OnItemHeld( this );
}
}
#endregion
#region Pointer Events
public void OnPointerClick( PointerEventData eventData )
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL || UNITY_WSA || UNITY_WSA_10_0
if( eventData.button == PointerEventData.InputButton.Middle )
return;
else if( eventData.button == PointerEventData.InputButton.Right )
{
// First, select the item
if( !isSelected )
{
prevClickTime = 0f;
fileBrowser.OnItemSelected( this, false );
}
// Then, show the context menu
fileBrowser.OnContextMenuTriggered( eventData.position );
return;
}
#endif
if( Time.realtimeSinceStartup - prevClickTime < DOUBLE_CLICK_TIME )
{
prevClickTime = 0f;
fileBrowser.OnItemSelected( this, true );
}
else
{
prevClickTime = Time.realtimeSinceStartup;
fileBrowser.OnItemSelected( this, false );
}
}
public void OnPointerDown( PointerEventData eventData )
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL || UNITY_WSA || UNITY_WSA_10_0
if( eventData.button != PointerEventData.InputButton.Left )
return;
#endif
pressTime = Time.realtimeSinceStartup;
}
public void OnPointerUp( PointerEventData eventData )
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL || UNITY_WSA || UNITY_WSA_10_0
if( eventData.button != PointerEventData.InputButton.Left )
return;
#endif
if( pressTime != Mathf.Infinity )
pressTime = Mathf.Infinity;
else if( fileBrowser.MultiSelectionToggleSelectionMode )
{
// We have activated MultiSelectionToggleSelectionMode with this press, processing the click would result in
// deselecting this item since its selected state would be toggled
eventData.eligibleForClick = false;
}
}
#if UNITY_EDITOR || ( !UNITY_ANDROID && !UNITY_IOS )
public void OnPointerEnter( PointerEventData eventData )
{
if( !isSelected )
background.color = skin.FileHoveredBackgroundColor;
}
#endif
#if UNITY_EDITOR || ( !UNITY_ANDROID && !UNITY_IOS )
public void OnPointerExit( PointerEventData eventData )
{
if( !isSelected )
background.color = ( Position % 2 ) == 0 ? skin.FileNormalBackgroundColor : skin.FileAlternatingBackgroundColor;
}
#endif
#endregion
#region Other Events
public void SetSelected( bool isSelected )
{
this.isSelected = isSelected;
background.color = isSelected ? skin.FileSelectedBackgroundColor : ( ( Position % 2 ) == 0 ? skin.FileNormalBackgroundColor : skin.FileAlternatingBackgroundColor );
nameText.color = isSelected ? skin.FileSelectedTextColor : skin.FileNormalTextColor;
if( isHidden )
{
Color c = nameText.color;
c.a = 0.55f;
nameText.color = c;
}
if( multiSelectionToggle ) // Quick links don't have multi-selection toggle
{
// Don't show multi-selection toggle for folders in file selection mode
if( fileBrowser.MultiSelectionToggleSelectionMode && ( !IsDirectory || fileBrowser.PickerMode != FileBrowser.PickMode.Files ) )
{
if( !multiSelectionToggle.gameObject.activeSelf )
{
multiSelectionToggle.gameObject.SetActive( true );
Vector2 shiftAmount = new Vector2( multiSelectionToggle.rectTransform.sizeDelta.x, 0f );
icon.rectTransform.anchoredPosition += shiftAmount;
nameText.rectTransform.anchoredPosition += shiftAmount;
}
multiSelectionToggle.sprite = isSelected ? skin.FileMultiSelectionToggleOnIcon : skin.FileMultiSelectionToggleOffIcon;
}
else if( multiSelectionToggle.gameObject.activeSelf )
{
multiSelectionToggle.gameObject.SetActive( false );
Vector2 shiftAmount = new Vector2( -multiSelectionToggle.rectTransform.sizeDelta.x, 0f );
icon.rectTransform.anchoredPosition += shiftAmount;
nameText.rectTransform.anchoredPosition += shiftAmount;
// Clicking a file shortly after disabling MultiSelectionToggleSelectionMode does nothing, this workaround fixes that issue
prevClickTime = 0f;
}
}
}
public void SetHidden( bool isHidden )
{
this.isHidden = isHidden;
Color c = icon.color;
c.a = isHidden ? 0.5f : 1f;
icon.color = c;
c = nameText.color;
c.a = isHidden ? 0.55f : ( isSelected ? skin.FileSelectedTextColor.a : skin.FileNormalTextColor.a );
nameText.color = c;
}
public void OnSkinRefreshed( UISkin skin, bool isInitialized = true )
{
this.skin = skin;
TransformComponent.sizeDelta = new Vector2( TransformComponent.sizeDelta.x, skin.FileHeight );
skin.ApplyTo( nameText, isSelected ? skin.FileSelectedTextColor : skin.FileNormalTextColor );
icon.rectTransform.sizeDelta = new Vector2( icon.rectTransform.sizeDelta.x, -skin.FileIconsPadding );
if( isInitialized )
SetSelected( isSelected );
}
#endregion
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b5f1b2825c50f7b4d9be146ab2137bff
timeCreated: 1479417850
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
using UnityEngine;
using UnityEngine.EventSystems;
namespace SimpleFileBrowser
{
public class FileBrowserMovement : MonoBehaviour
{
#region Variables
#pragma warning disable 0649
private FileBrowser fileBrowser;
private RectTransform canvasTR;
private Camera canvasCam;
[SerializeField]
private RectTransform window;
[SerializeField]
private RecycledListView listView;
#pragma warning restore 0649
private Vector2 initialTouchPos = Vector2.zero;
private Vector2 initialAnchoredPos, initialSizeDelta;
#endregion
#region Initialization Functions
public void Initialize( FileBrowser fileBrowser )
{
this.fileBrowser = fileBrowser;
canvasTR = fileBrowser.GetComponent<RectTransform>();
}
#endregion
#region Pointer Events
public void OnDragStarted( BaseEventData data )
{
PointerEventData pointer = (PointerEventData) data;
canvasCam = pointer.pressEventCamera;
RectTransformUtility.ScreenPointToLocalPointInRectangle( window, pointer.pressPosition, canvasCam, out initialTouchPos );
}
public void OnDrag( BaseEventData data )
{
PointerEventData pointer = (PointerEventData) data;
Vector2 touchPos;
RectTransformUtility.ScreenPointToLocalPointInRectangle( window, pointer.position, canvasCam, out touchPos );
window.anchoredPosition += touchPos - initialTouchPos;
}
public void OnEndDrag( BaseEventData data )
{
fileBrowser.EnsureWindowIsWithinBounds();
}
public void OnResizeStarted( BaseEventData data )
{
PointerEventData pointer = (PointerEventData) data;
canvasCam = pointer.pressEventCamera;
initialAnchoredPos = window.anchoredPosition;
initialSizeDelta = window.sizeDelta;
RectTransformUtility.ScreenPointToLocalPointInRectangle( canvasTR, pointer.pressPosition, canvasCam, out initialTouchPos );
}
public void OnResize( BaseEventData data )
{
PointerEventData pointer = (PointerEventData) data;
Vector2 touchPos;
RectTransformUtility.ScreenPointToLocalPointInRectangle( canvasTR, pointer.position, canvasCam, out touchPos );
Vector2 delta = touchPos - initialTouchPos;
Vector2 newSize = initialSizeDelta + new Vector2( delta.x, -delta.y );
Vector2 canvasSize = canvasTR.sizeDelta;
if( newSize.x < fileBrowser.minWidth ) newSize.x = fileBrowser.minWidth;
if( newSize.y < fileBrowser.minHeight ) newSize.y = fileBrowser.minHeight;
if( newSize.x > canvasSize.x ) newSize.x = canvasSize.x;
if( newSize.y > canvasSize.y ) newSize.y = canvasSize.y;
newSize.x = (int) newSize.x;
newSize.y = (int) newSize.y;
delta = newSize - initialSizeDelta;
window.anchoredPosition = initialAnchoredPos + new Vector2( delta.x * 0.5f, delta.y * -0.5f );
if( window.sizeDelta != newSize )
{
window.sizeDelta = newSize;
fileBrowser.OnWindowDimensionsChanged( newSize );
}
listView.OnViewportDimensionsChanged();
}
public void OnEndResize( BaseEventData data )
{
fileBrowser.EnsureWindowIsWithinBounds();
}
#endregion
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 46d41d79fe7c3d44ca846b4f3d81a476
timeCreated: 1479486534
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,21 @@
using UnityEngine;
namespace SimpleFileBrowser
{
public class FileBrowserQuickLink : FileBrowserItem
{
#region Properties
private string m_targetPath;
public string TargetPath { get { return m_targetPath; } }
#endregion
#region Initialization Functions
public void SetQuickLink( Sprite icon, string name, string targetPath )
{
SetFile( icon, name, true );
m_targetPath = targetPath;
}
#endregion
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1f277f5418eabf94cad94208055878af
timeCreated: 1479417850
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,79 @@
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.InputSystem;
#endif
namespace SimpleFileBrowser
{
public class FileBrowserRenamedItem : MonoBehaviour
{
public delegate void OnRenameCompleted( string filename );
#pragma warning disable 0649
[SerializeField]
private Image background;
[SerializeField]
private Image icon;
[SerializeField]
private InputField nameInputField;
public InputField InputField { get { return nameInputField; } }
#pragma warning restore 0649
private OnRenameCompleted onRenameCompleted;
private RectTransform m_transform;
public RectTransform TransformComponent
{
get
{
if( m_transform == null )
m_transform = (RectTransform) transform;
return m_transform;
}
}
public void Show( string initialFilename, Color backgroundColor, Sprite icon, OnRenameCompleted onRenameCompleted )
{
background.color = backgroundColor;
this.icon.sprite = icon;
this.onRenameCompleted = onRenameCompleted;
transform.SetAsLastSibling();
gameObject.SetActive( true );
nameInputField.text = initialFilename;
nameInputField.ActivateInputField();
}
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
private void LateUpdate()
{
// Don't allow scrolling with mouse wheel while renaming a file or creating a folder
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
if( Mouse.current != null && Mouse.current.scroll.ReadValue().y != 0f )
#else
if( Input.mouseScrollDelta.y != 0f )
#endif
nameInputField.DeactivateInputField();
}
#endif
public void OnInputFieldEndEdit( string filename )
{
gameObject.SetActive( false );
// If we don't deselect the InputField manually, FileBrowser's keyboard shortcuts
// no longer work until user clicks on a UI element and thus, deselects the InputField
if( EventSystem.current && !EventSystem.current.alreadySelecting && EventSystem.current.currentSelectedGameObject == nameInputField.gameObject )
EventSystem.current.SetSelectedGameObject( null );
if( onRenameCompleted != null )
onRenameCompleted( filename );
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c7397ff7ae1ba4c47b6dfd3c84936584
timeCreated: 1603812277
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
using UnityEngine;
using UnityEngine.UI;
namespace SimpleFileBrowser
{
// Credit: http://answers.unity.com/answers/1157876/view.html
[RequireComponent( typeof( CanvasRenderer ) )]
public class NonDrawingGraphic : Graphic
{
public override void SetMaterialDirty() { return; }
public override void SetVerticesDirty() { return; }
protected override void OnPopulateMesh( VertexHelper vh )
{
vh.Clear();
return;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b4fd8cdb8c068dd4bb48c415877496ba
timeCreated: 1603794018
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: dec11495f4b8cef49b7a3b4b06f094c3
folderAsset: yes
timeCreated: 1485706514
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,16 @@
namespace SimpleFileBrowser
{
public delegate void OnItemClickedHandler( ListItem item );
public interface IListViewAdapter
{
OnItemClickedHandler OnItemClicked { get; set; }
int Count { get; }
float ItemHeight { get; }
ListItem CreateItem();
void SetItemContent( ListItem item );
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 08e51b912648ace4784ebe20fc6cc961
timeCreated: 1485706575
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
using UnityEngine;
namespace SimpleFileBrowser
{
[RequireComponent( typeof( RectTransform ) )]
public class ListItem : MonoBehaviour
{
public object Tag { get; set; }
public int Position { get; set; }
private IListViewAdapter adapter;
internal void SetAdapter( IListViewAdapter listView )
{
this.adapter = listView;
}
public void OnClick()
{
if( adapter.OnItemClicked != null )
adapter.OnItemClicked( this );
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9c3e7249b2cb96446a7ccfbed51aab81
timeCreated: 1485706535
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,252 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace SimpleFileBrowser
{
[RequireComponent( typeof( ScrollRect ) )]
public class RecycledListView : MonoBehaviour
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
, IPointerClickHandler
#endif
{
#pragma warning disable 0649
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
[SerializeField]
private FileBrowser fileBrowser;
#endif
// Cached components
[SerializeField]
private RectTransform viewportTransform;
[SerializeField]
private RectTransform contentTransform;
#pragma warning restore 0649
private float itemHeight, _1OverItemHeight;
private float viewportHeight;
private readonly Dictionary<int, ListItem> items = new Dictionary<int, ListItem>();
private readonly Stack<ListItem> pooledItems = new Stack<ListItem>();
IListViewAdapter adapter = null;
// Current indices of items shown on screen
private int currentTopIndex = -1, currentBottomIndex = -1;
private void Start()
{
viewportHeight = viewportTransform.rect.height;
GetComponent<ScrollRect>().onValueChanged.AddListener( ( pos ) => UpdateItemsInTheList() );
}
public void SetAdapter( IListViewAdapter adapter )
{
this.adapter = adapter;
itemHeight = adapter.ItemHeight;
_1OverItemHeight = 1f / itemHeight;
}
public void OnSkinRefreshed()
{
if( currentTopIndex >= 0 )
{
DestroyItemsBetweenIndices( currentTopIndex, currentBottomIndex );
currentTopIndex = currentBottomIndex = -1;
}
itemHeight = adapter.ItemHeight;
_1OverItemHeight = 1f / itemHeight;
UpdateList();
}
// Update the list
public void UpdateList()
{
float newHeight = Mathf.Max( 1f, adapter.Count * itemHeight );
contentTransform.sizeDelta = new Vector2( 0f, newHeight );
viewportHeight = viewportTransform.rect.height;
UpdateItemsInTheList( true );
}
// Window is resized, update the list
public void OnViewportDimensionsChanged()
{
viewportHeight = viewportTransform.rect.height;
UpdateItemsInTheList();
}
// Calculate the indices of items to show
private void UpdateItemsInTheList( bool updateAllVisibleItems = false )
{
// If there is at least one item to show
if( adapter.Count > 0 )
{
float contentPos = contentTransform.anchoredPosition.y - 1f;
int newTopIndex = (int) ( contentPos * _1OverItemHeight );
int newBottomIndex = (int) ( ( contentPos + viewportHeight + 2f ) * _1OverItemHeight );
if( newTopIndex < 0 )
newTopIndex = 0;
if( newBottomIndex > adapter.Count - 1 )
newBottomIndex = adapter.Count - 1;
if( currentTopIndex == -1 )
{
// There are no active items
updateAllVisibleItems = true;
currentTopIndex = newTopIndex;
currentBottomIndex = newBottomIndex;
CreateItemsBetweenIndices( newTopIndex, newBottomIndex );
}
else
{
// There are some active items
if( newBottomIndex < currentTopIndex || newTopIndex > currentBottomIndex )
{
// If user scrolled a lot such that, none of the items are now within
// the bounds of the scroll view, pool all the previous items and create
// new items for the new list of visible entries
updateAllVisibleItems = true;
DestroyItemsBetweenIndices( currentTopIndex, currentBottomIndex );
CreateItemsBetweenIndices( newTopIndex, newBottomIndex );
}
else
{
// User did not scroll a lot such that, some items are are still within
// the bounds of the scroll view. Don't destroy them but update their content,
// if necessary
if( newTopIndex > currentTopIndex )
{
DestroyItemsBetweenIndices( currentTopIndex, newTopIndex - 1 );
}
if( newBottomIndex < currentBottomIndex )
{
DestroyItemsBetweenIndices( newBottomIndex + 1, currentBottomIndex );
}
if( newTopIndex < currentTopIndex )
{
CreateItemsBetweenIndices( newTopIndex, currentTopIndex - 1 );
// If it is not necessary to update all the items,
// then just update the newly created items. Otherwise,
// wait for the major update
if( !updateAllVisibleItems )
{
UpdateItemContentsBetweenIndices( newTopIndex, currentTopIndex - 1 );
}
}
if( newBottomIndex > currentBottomIndex )
{
CreateItemsBetweenIndices( currentBottomIndex + 1, newBottomIndex );
// If it is not necessary to update all the items,
// then just update the newly created items. Otherwise,
// wait for the major update
if( !updateAllVisibleItems )
{
UpdateItemContentsBetweenIndices( currentBottomIndex + 1, newBottomIndex );
}
}
}
currentTopIndex = newTopIndex;
currentBottomIndex = newBottomIndex;
}
if( updateAllVisibleItems )
{
// Update all the items
UpdateItemContentsBetweenIndices( currentTopIndex, currentBottomIndex );
}
}
else if( currentTopIndex != -1 )
{
// There is nothing to show but some items are still visible; pool them
DestroyItemsBetweenIndices( currentTopIndex, currentBottomIndex );
currentTopIndex = -1;
}
}
private void CreateItemsBetweenIndices( int topIndex, int bottomIndex )
{
for( int i = topIndex; i <= bottomIndex; i++ )
{
CreateItemAtIndex( i );
}
}
// Create (or unpool) an item
private void CreateItemAtIndex( int index )
{
ListItem item;
if( pooledItems.Count > 0 )
{
item = pooledItems.Pop();
item.gameObject.SetActive( true );
}
else
{
item = adapter.CreateItem();
item.transform.SetParent( contentTransform, false );
item.SetAdapter( adapter );
}
// Reposition the item
( (RectTransform) item.transform ).anchoredPosition = new Vector2( 1f, -index * itemHeight );
// To access this item easily in the future, add it to the dictionary
items[index] = item;
}
private void DestroyItemsBetweenIndices( int topIndex, int bottomIndex )
{
for( int i = topIndex; i <= bottomIndex; i++ )
{
ListItem item = items[i];
item.gameObject.SetActive( false );
pooledItems.Push( item );
}
}
private void UpdateItemContentsBetweenIndices( int topIndex, int bottomIndex )
{
for( int i = topIndex; i <= bottomIndex; i++ )
{
ListItem item = items[i];
item.Position = i;
adapter.SetItemContent( item );
}
}
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WSA || UNITY_WSA_10_0
// When free space inside ScrollRect is clicked:
// Left click: deselect selected file(s)
// Right click: show context menu
public void OnPointerClick( PointerEventData eventData )
{
if( eventData.button == PointerEventData.InputButton.Left )
fileBrowser.DeselectAllFiles();
else if( eventData.button == PointerEventData.InputButton.Right )
fileBrowser.OnContextMenuTriggered( eventData.position );
}
#endif
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 87ad67b4806678e40a492e337338760b
timeCreated: 1485620000
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,651 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace SimpleFileBrowser
{
[Serializable]
public struct FiletypeIcon
{
public string extension;
public Sprite icon;
}
[CreateAssetMenu( fileName = "UI Skin", menuName = "yasirkula/SimpleFileBrowser/UI Skin", order = 111 )]
public class UISkin : ScriptableObject
{
private int m_version = 0;
public int Version { get { return m_version; } }
[ContextMenu( "Refresh UI" )]
private void Invalidate()
{
m_version = UnityEngine.Random.Range( int.MinValue / 2, int.MaxValue / 2 );
initializedFiletypeIcons = false;
}
#if UNITY_EDITOR
protected virtual void OnValidate()
{
// Refresh all UIs that use this skin
Invalidate();
}
#endif
#pragma warning disable 0649
[Header( "General" )]
[SerializeField]
private Font m_font;
public Font Font
{
get { return m_font; }
set { if( m_font != value ) { m_font = value; m_version++; } }
}
[SerializeField]
private int m_fontSize = 14;
public int FontSize
{
get { return m_fontSize; }
set { if( m_fontSize != value ) { m_fontSize = value; m_version++; } }
}
[Header( "File Browser Window" )]
[SerializeField]
private Color m_windowColor = Color.grey;
public Color WindowColor
{
get { return m_windowColor; }
set { if( m_windowColor != value ) { m_windowColor = value; m_version++; } }
}
[SerializeField]
private Color m_filesListColor = Color.white;
public Color FilesListColor
{
get { return m_filesListColor; }
set { if( m_filesListColor != value ) { m_filesListColor = value; m_version++; } }
}
[SerializeField]
private Color m_filesVerticalSeparatorColor = Color.grey;
public Color FilesVerticalSeparatorColor
{
get { return m_filesVerticalSeparatorColor; }
set { if( m_filesVerticalSeparatorColor != value ) { m_filesVerticalSeparatorColor = value; m_version++; } }
}
[SerializeField]
private Color m_titleBackgroundColor = Color.black;
public Color TitleBackgroundColor
{
get { return m_titleBackgroundColor; }
set { if( m_titleBackgroundColor != value ) { m_titleBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_titleTextColor = Color.white;
public Color TitleTextColor
{
get { return m_titleTextColor; }
set { if( m_titleTextColor != value ) { m_titleTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_windowResizeGizmoColor = Color.black;
public Color WindowResizeGizmoColor
{
get { return m_windowResizeGizmoColor; }
set { if( m_windowResizeGizmoColor != value ) { m_windowResizeGizmoColor = value; m_version++; } }
}
[SerializeField]
private Color m_headerButtonsColor = Color.white;
public Color HeaderButtonsColor
{
get { return m_headerButtonsColor; }
set { if( m_headerButtonsColor != value ) { m_headerButtonsColor = value; m_version++; } }
}
[SerializeField]
private Sprite m_windowResizeGizmo;
public Sprite WindowResizeGizmo
{
get { return m_windowResizeGizmo; }
set { if( m_windowResizeGizmo != value ) { m_windowResizeGizmo = value; m_version++; } }
}
[SerializeField]
private Sprite m_headerBackButton;
public Sprite HeaderBackButton
{
get { return m_headerBackButton; }
set { if( m_headerBackButton != value ) { m_headerBackButton = value; m_version++; } }
}
[SerializeField]
private Sprite m_headerForwardButton;
public Sprite HeaderForwardButton
{
get { return m_headerForwardButton; }
set { if( m_headerForwardButton != value ) { m_headerForwardButton = value; m_version++; } }
}
[SerializeField]
private Sprite m_headerUpButton;
public Sprite HeaderUpButton
{
get { return m_headerUpButton; }
set { if( m_headerUpButton != value ) { m_headerUpButton = value; m_version++; } }
}
[SerializeField]
private Sprite m_headerContextMenuButton;
public Sprite HeaderContextMenuButton
{
get { return m_headerContextMenuButton; }
set { if( m_headerContextMenuButton != value ) { m_headerContextMenuButton = value; m_version++; } }
}
[Header( "Input Fields" )]
[SerializeField]
private Color m_inputFieldNormalBackgroundColor = Color.white;
public Color InputFieldNormalBackgroundColor
{
get { return m_inputFieldNormalBackgroundColor; }
set { if( m_inputFieldNormalBackgroundColor != value ) { m_inputFieldNormalBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_inputFieldInvalidBackgroundColor = Color.red;
public Color InputFieldInvalidBackgroundColor
{
get { return m_inputFieldInvalidBackgroundColor; }
set { if( m_inputFieldInvalidBackgroundColor != value ) { m_inputFieldInvalidBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_inputFieldTextColor = Color.black;
public Color InputFieldTextColor
{
get { return m_inputFieldTextColor; }
set { if( m_inputFieldTextColor != value ) { m_inputFieldTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_inputFieldPlaceholderTextColor = new Color( 0f, 0f, 0f, 0.5f );
public Color InputFieldPlaceholderTextColor
{
get { return m_inputFieldPlaceholderTextColor; }
set { if( m_inputFieldPlaceholderTextColor != value ) { m_inputFieldPlaceholderTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_inputFieldSelectedTextColor = Color.blue;
public Color InputFieldSelectedTextColor
{
get { return m_inputFieldSelectedTextColor; }
set { if( m_inputFieldSelectedTextColor != value ) { m_inputFieldSelectedTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_inputFieldCaretColor = Color.black;
public Color InputFieldCaretColor
{
get { return m_inputFieldCaretColor; }
set { if( m_inputFieldCaretColor != value ) { m_inputFieldCaretColor = value; m_version++; } }
}
[SerializeField]
private Sprite m_inputFieldBackground;
public Sprite InputFieldBackground
{
get { return m_inputFieldBackground; }
set { if( m_inputFieldBackground != value ) { m_inputFieldBackground = value; m_version++; } }
}
[Header( "Buttons" )]
[SerializeField]
private Color m_buttonColor = Color.white;
public Color ButtonColor
{
get { return m_buttonColor; }
set { if( m_buttonColor != value ) { m_buttonColor = value; m_version++; } }
}
[SerializeField]
private Color m_buttonTextColor = Color.black;
public Color ButtonTextColor
{
get { return m_buttonTextColor; }
set { if( m_buttonTextColor != value ) { m_buttonTextColor = value; m_version++; } }
}
[SerializeField]
private Sprite m_buttonBackground;
public Sprite ButtonBackground
{
get { return m_buttonBackground; }
set { if( m_buttonBackground != value ) { m_buttonBackground = value; m_version++; } }
}
[Header( "Dropdowns" )]
[SerializeField]
private Color m_dropdownColor = Color.white;
public Color DropdownColor
{
get { return m_dropdownColor; }
set { if( m_dropdownColor != value ) { m_dropdownColor = value; m_version++; } }
}
[SerializeField]
private Color m_dropdownTextColor = Color.black;
public Color DropdownTextColor
{
get { return m_dropdownTextColor; }
set { if( m_dropdownTextColor != value ) { m_dropdownTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_dropdownArrowColor = Color.black;
public Color DropdownArrowColor
{
get { return m_dropdownArrowColor; }
set { if( m_dropdownArrowColor != value ) { m_dropdownArrowColor = value; m_version++; } }
}
[SerializeField]
private Color m_dropdownCheckmarkColor = Color.black;
public Color DropdownCheckmarkColor
{
get { return m_dropdownCheckmarkColor; }
set { if( m_dropdownCheckmarkColor != value ) { m_dropdownCheckmarkColor = value; m_version++; } }
}
[SerializeField]
private Sprite m_dropdownBackground;
public Sprite DropdownBackground
{
get { return m_dropdownBackground; }
set { if( m_dropdownBackground != value ) { m_dropdownBackground = value; m_version++; } }
}
[SerializeField]
private Sprite m_dropdownArrow;
public Sprite DropdownArrow
{
get { return m_dropdownArrow; }
set { if( m_dropdownArrow != value ) { m_dropdownArrow = value; m_version++; } }
}
[SerializeField]
private Sprite m_dropdownCheckmark;
public Sprite DropdownCheckmark
{
get { return m_dropdownCheckmark; }
set { if( m_dropdownCheckmark != value ) { m_dropdownCheckmark = value; m_version++; } }
}
[Header( "Toggles" )]
[SerializeField]
private Color m_toggleColor = Color.white;
public Color ToggleColor
{
get { return m_toggleColor; }
set { if( m_toggleColor != value ) { m_toggleColor = value; m_version++; } }
}
[SerializeField]
private Color m_toggleTextColor = Color.black;
public Color ToggleTextColor
{
get { return m_toggleTextColor; }
set { if( m_toggleTextColor != value ) { m_toggleTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_toggleCheckmarkColor = Color.black;
public Color ToggleCheckmarkColor
{
get { return m_toggleCheckmarkColor; }
set { if( m_toggleCheckmarkColor != value ) { m_toggleCheckmarkColor = value; m_version++; } }
}
[SerializeField]
private Sprite m_toggleBackground;
public Sprite ToggleBackground
{
get { return m_toggleBackground; }
set { if( m_toggleBackground != value ) { m_toggleBackground = value; m_version++; } }
}
[SerializeField]
private Sprite m_toggleCheckmark;
public Sprite ToggleCheckmark
{
get { return m_toggleCheckmark; }
set { if( m_toggleCheckmark != value ) { m_toggleCheckmark = value; m_version++; } }
}
[Header( "Scrollbars" )]
[SerializeField]
private Color m_scrollbarBackgroundColor = Color.grey;
public Color ScrollbarBackgroundColor
{
get { return m_scrollbarBackgroundColor; }
set { if( m_scrollbarBackgroundColor != value ) { m_scrollbarBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_scrollbarColor = Color.black;
public Color ScrollbarColor
{
get { return m_scrollbarColor; }
set { if( m_scrollbarColor != value ) { m_scrollbarColor = value; m_version++; } }
}
[Header( "Files" )]
[SerializeField]
private float m_fileHeight = 30f;
public float FileHeight
{
get { return m_fileHeight; }
set { if( m_fileHeight != value ) { m_fileHeight = value; m_version++; } }
}
[SerializeField]
private float m_fileIconsPadding = 6f;
public float FileIconsPadding
{
get { return m_fileIconsPadding; }
set { if( m_fileIconsPadding != value ) { m_fileIconsPadding = value; m_version++; } }
}
[SerializeField]
private Color m_fileNormalBackgroundColor = Color.clear;
public Color FileNormalBackgroundColor
{
get { return m_fileNormalBackgroundColor; }
set { if( m_fileNormalBackgroundColor != value ) { m_fileNormalBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_fileAlternatingBackgroundColor = Color.clear;
public Color FileAlternatingBackgroundColor
{
get { return m_fileAlternatingBackgroundColor; }
set { if( m_fileAlternatingBackgroundColor != value ) { m_fileAlternatingBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_fileHoveredBackgroundColor = Color.cyan;
public Color FileHoveredBackgroundColor
{
get { return m_fileHoveredBackgroundColor; }
set { if( m_fileHoveredBackgroundColor != value ) { m_fileHoveredBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_fileSelectedBackgroundColor = Color.blue;
public Color FileSelectedBackgroundColor
{
get { return m_fileSelectedBackgroundColor; }
set { if( m_fileSelectedBackgroundColor != value ) { m_fileSelectedBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_fileNormalTextColor = Color.black;
public Color FileNormalTextColor
{
get { return m_fileNormalTextColor; }
set { if( m_fileNormalTextColor != value ) { m_fileNormalTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_fileSelectedTextColor = Color.black;
public Color FileSelectedTextColor
{
get { return m_fileSelectedTextColor; }
set { if( m_fileSelectedTextColor != value ) { m_fileSelectedTextColor = value; m_version++; } }
}
[Header( "File Icons" )]
[SerializeField]
private Sprite m_folderIcon;
public Sprite FolderIcon
{
get { return m_folderIcon; }
set { if( m_folderIcon != value ) { m_folderIcon = value; m_version++; } }
}
[SerializeField]
private Sprite m_driveIcon;
public Sprite DriveIcon
{
get { return m_driveIcon; }
set { if( m_driveIcon != value ) { m_driveIcon = value; m_version++; } }
}
[SerializeField]
private Sprite m_defaultFileIcon;
public Sprite DefaultFileIcon
{
get { return m_defaultFileIcon; }
set { if( m_defaultFileIcon != value ) { m_defaultFileIcon = value; m_version++; } }
}
[SerializeField]
private FiletypeIcon[] m_filetypeIcons;
public FiletypeIcon[] FiletypeIcons
{
get { return m_filetypeIcons; }
set
{
if( m_filetypeIcons != value )
{
m_filetypeIcons = value;
initializedFiletypeIcons = false;
m_version++;
}
}
}
[NonSerialized] // Never save this value during domain reload (it's sometimes saved even though it's private)
private bool initializedFiletypeIcons = false;
private Dictionary<string, Sprite> filetypeToIcon;
[NonSerialized]
private bool m_allIconExtensionsHaveSingleSuffix = true;
public bool AllIconExtensionsHaveSingleSuffix
{
get
{
if( !initializedFiletypeIcons )
InitializeFiletypeIcons();
return m_allIconExtensionsHaveSingleSuffix;
}
}
[SerializeField]
private Sprite m_fileMultiSelectionToggleOffIcon;
public Sprite FileMultiSelectionToggleOffIcon
{
get { return m_fileMultiSelectionToggleOffIcon; }
set { if( m_fileMultiSelectionToggleOffIcon != value ) { m_fileMultiSelectionToggleOffIcon = value; m_version++; } }
}
[SerializeField]
private Sprite m_fileMultiSelectionToggleOnIcon;
public Sprite FileMultiSelectionToggleOnIcon
{
get { return m_fileMultiSelectionToggleOnIcon; }
set { if( m_fileMultiSelectionToggleOnIcon != value ) { m_fileMultiSelectionToggleOnIcon = value; m_version++; } }
}
[Header( "Context Menu" )]
[SerializeField]
private Color m_contextMenuBackgroundColor = Color.grey;
public Color ContextMenuBackgroundColor
{
get { return m_contextMenuBackgroundColor; }
set { if( m_contextMenuBackgroundColor != value ) { m_contextMenuBackgroundColor = value; m_version++; } }
}
[SerializeField]
private Color m_contextMenuTextColor = Color.black;
public Color ContextMenuTextColor
{
get { return m_contextMenuTextColor; }
set { if( m_contextMenuTextColor != value ) { m_contextMenuTextColor = value; m_version++; } }
}
[SerializeField]
private Color m_contextMenuSeparatorColor = Color.black;
public Color ContextMenuSeparatorColor
{
get { return m_contextMenuSeparatorColor; }
set { if( m_contextMenuSeparatorColor != value ) { m_contextMenuSeparatorColor = value; m_version++; } }
}
[Header( "Popup Panels" )]
[SerializeField, UnityEngine.Serialization.FormerlySerializedAs( "m_deletePanelBackgroundColor" )]
private Color m_popupPanelsBackgroundColor = Color.grey;
public Color PopupPanelsBackgroundColor
{
get { return m_popupPanelsBackgroundColor; }
set { if( m_popupPanelsBackgroundColor != value ) { m_popupPanelsBackgroundColor = value; m_version++; } }
}
[SerializeField, UnityEngine.Serialization.FormerlySerializedAs( "m_deletePanelTextColor" )]
private Color m_popupPanelsTextColor = Color.black;
public Color PopupPanelsTextColor
{
get { return m_popupPanelsTextColor; }
set { if( m_popupPanelsTextColor != value ) { m_popupPanelsTextColor = value; m_version++; } }
}
[SerializeField, UnityEngine.Serialization.FormerlySerializedAs( "m_deletePanelBackground" )]
private Sprite m_popupPanelsBackground;
public Sprite PopupPanelsBackground
{
get { return m_popupPanelsBackground; }
set { if( m_popupPanelsBackground != value ) { m_popupPanelsBackground = value; m_version++; } }
}
#pragma warning restore 0649
public void ApplyTo( Text text, Color textColor )
{
text.color = textColor;
text.font = m_font;
text.fontSize = m_fontSize;
}
public void ApplyTo( InputField inputField )
{
inputField.image.color = m_inputFieldNormalBackgroundColor;
inputField.image.sprite = m_inputFieldBackground;
inputField.selectionColor = m_inputFieldSelectedTextColor;
inputField.caretColor = m_inputFieldCaretColor;
ApplyTo( inputField.textComponent, m_inputFieldTextColor );
if( inputField.placeholder as Text )
ApplyTo( (Text) inputField.placeholder, m_inputFieldPlaceholderTextColor );
}
public void ApplyTo( Button button )
{
button.image.color = m_buttonColor;
button.image.sprite = m_buttonBackground;
ApplyTo( button.GetComponentInChildren<Text>(), m_buttonTextColor );
}
public void ApplyTo( Dropdown dropdown )
{
dropdown.image.color = m_dropdownColor;
dropdown.image.sprite = m_dropdownBackground;
dropdown.template.GetComponent<Image>().color = m_dropdownColor;
Image dropdownArrow = dropdown.transform.Find( "Arrow" ).GetComponent<Image>();
dropdownArrow.color = m_dropdownArrowColor;
dropdownArrow.sprite = m_dropdownArrow;
ApplyTo( dropdown.captionText, m_dropdownTextColor );
ApplyTo( dropdown.itemText, m_dropdownTextColor );
Transform dropdownItem = dropdown.itemText.transform.parent;
dropdownItem.Find( "Item Background" ).GetComponent<Image>().color = m_dropdownColor;
Image dropdownCheckmark = dropdownItem.Find( "Item Checkmark" ).GetComponent<Image>();
dropdownCheckmark.color = m_dropdownCheckmarkColor;
dropdownCheckmark.sprite = m_dropdownCheckmark;
}
public void ApplyTo( Toggle toggle )
{
toggle.image.color = m_toggleColor;
toggle.image.sprite = m_toggleBackground;
toggle.graphic.color = m_toggleCheckmarkColor;
( (Image) toggle.graphic ).sprite = m_toggleCheckmark;
ApplyTo( toggle.GetComponentInChildren<Text>(), m_toggleTextColor );
}
public void ApplyTo( Scrollbar scrollbar )
{
scrollbar.GetComponent<Image>().color = m_scrollbarBackgroundColor;
scrollbar.image.color = m_scrollbarColor;
}
public Sprite GetIconForFileEntry( FileSystemEntry fileInfo, bool extensionMayHaveMultipleSuffixes )
{
if( !initializedFiletypeIcons )
InitializeFiletypeIcons();
Sprite icon;
if( fileInfo.IsDirectory )
return m_folderIcon;
else if( filetypeToIcon.TryGetValue( fileInfo.Extension, out icon ) )
return icon;
else if( extensionMayHaveMultipleSuffixes )
{
for( int i = 0; i < m_filetypeIcons.Length; i++ )
{
if( fileInfo.Extension.EndsWith( m_filetypeIcons[i].extension, StringComparison.Ordinal ) )
{
filetypeToIcon[fileInfo.Extension] = m_filetypeIcons[i].icon;
return m_filetypeIcons[i].icon;
}
}
}
filetypeToIcon[fileInfo.Extension] = m_defaultFileIcon;
return m_defaultFileIcon;
}
private void InitializeFiletypeIcons()
{
initializedFiletypeIcons = true;
if( filetypeToIcon == null )
filetypeToIcon = new Dictionary<string, Sprite>( 128 );
else
filetypeToIcon.Clear();
m_allIconExtensionsHaveSingleSuffix = true;
for( int i = 0; i < m_filetypeIcons.Length; i++ )
{
m_filetypeIcons[i].extension = m_filetypeIcons[i].extension.ToLowerInvariant();
if( m_filetypeIcons[i].extension[0] != '.' )
m_filetypeIcons[i].extension = "." + m_filetypeIcons[i].extension;
filetypeToIcon[m_filetypeIcons[i].extension] = m_filetypeIcons[i].icon;
m_allIconExtensionsHaveSingleSuffix &= ( m_filetypeIcons[i].extension.LastIndexOf( '.' ) == 0 );
}
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 66bc3ce4885990c40a88f80fe0ad0101
timeCreated: 1634711050
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,16 @@
{
"name": "SimpleFileBrowser.Runtime",
"rootNamespace": "",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c685d05731421f64287ad6d13be5af0e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7e6307005d898f2458a6b0a2ef136d0b
folderAsset: yes
timeCreated: 1634717866
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,150 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 66bc3ce4885990c40a88f80fe0ad0101, type: 3}
m_Name: DarkSkin
m_EditorClassIdentifier:
m_font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_fontSize: 14
m_windowColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_filesListColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 1}
m_filesVerticalSeparatorColor: {r: 0.334, g: 0.334, b: 0.334, a: 1}
m_titleBackgroundColor: {r: 0.07058824, g: 0.07058824, b: 0.07058824, a: 1}
m_titleTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_windowResizeGizmoColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_headerButtonsColor: {r: 1, g: 1, b: 1, a: 1}
m_windowResizeGizmo: {fileID: 21300000, guid: 285f1e681b119ce48ae469448241360b,
type: 3}
m_headerBackButton: {fileID: 21300000, guid: 130f660889a70c947bff4c8ba8a2c73e, type: 3}
m_headerForwardButton: {fileID: 21300000, guid: 130f660889a70c947bff4c8ba8a2c73e,
type: 3}
m_headerUpButton: {fileID: 21300000, guid: 130f660889a70c947bff4c8ba8a2c73e, type: 3}
m_headerContextMenuButton: {fileID: 21300000, guid: 3eb0ab0fddc930a498bef8ce7e149ea0,
type: 3}
m_inputFieldNormalBackgroundColor: {r: 0.18039216, g: 0.18039216, b: 0.18039216,
a: 1}
m_inputFieldInvalidBackgroundColor: {r: 0.4392157, g: 0.12156863, b: 0.12156863,
a: 1}
m_inputFieldTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_inputFieldPlaceholderTextColor: {r: 1, g: 1, b: 1, a: 0.6509804}
m_inputFieldSelectedTextColor: {r: 0.13725491, g: 0.46666667, b: 0.69411767, a: 0.5019608}
m_inputFieldCaretColor: {r: 1, g: 1, b: 1, a: 1}
m_inputFieldBackground: {fileID: 21300000, guid: f668f62689b67d242ad33ff665594344,
type: 3}
m_buttonColor: {r: 0.18039216, g: 0.18039216, b: 0.18039216, a: 1}
m_buttonTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_buttonBackground: {fileID: 21300000, guid: 2c46fa192de46b04e8281f225bee0230, type: 3}
m_dropdownColor: {r: 0.18039216, g: 0.18039216, b: 0.18039216, a: 1}
m_dropdownTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_dropdownArrowColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_dropdownCheckmarkColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_dropdownBackground: {fileID: 21300000, guid: 2c46fa192de46b04e8281f225bee0230,
type: 3}
m_dropdownArrow: {fileID: 21300000, guid: f73f38102c749484bbd884d4d8d87440, type: 3}
m_dropdownCheckmark: {fileID: 21300000, guid: 4924b77159e651e4aaa9a22286725d94,
type: 3}
m_toggleColor: {r: 0.18039216, g: 0.18039216, b: 0.18039216, a: 1}
m_toggleTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_toggleCheckmarkColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_toggleBackground: {fileID: 21300000, guid: f668f62689b67d242ad33ff665594344, type: 3}
m_toggleCheckmark: {fileID: 21300000, guid: 4924b77159e651e4aaa9a22286725d94, type: 3}
m_scrollbarBackgroundColor: {r: 0.07058824, g: 0.07058824, b: 0.07058824, a: 1}
m_scrollbarColor: {r: 0.26666668, g: 0.26666668, b: 0.26666668, a: 1}
m_fileHeight: 30
m_fileIconsPadding: 6
m_fileNormalBackgroundColor: {r: 1, g: 1, b: 1, a: 0}
m_fileAlternatingBackgroundColor: {r: 1, g: 1, b: 1, a: 0.043137256}
m_fileHoveredBackgroundColor: {r: 0.88235295, g: 0.88235295, b: 1, a: 0.2}
m_fileSelectedBackgroundColor: {r: 0, g: 0.34117648, b: 0.5803922, a: 1}
m_fileNormalTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_fileSelectedTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_folderIcon: {fileID: 21300000, guid: 27947666271b231439b4409a81cb5d59, type: 3}
m_driveIcon: {fileID: 21300000, guid: 81da6e5b6342f8f47a5a3a24221306c6, type: 3}
m_defaultFileIcon: {fileID: 21300000, guid: 89f87b95a0cf73b4484ab74fe3f9ea26, type: 3}
m_filetypeIcons:
- extension: .txt
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .doc
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .docx
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .xml
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .json
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .rtf
icon: {fileID: 21300000, guid: d06b8cf70dff2fe418249a6276f9ff70, type: 3}
- extension: .pdf
icon: {fileID: 21300000, guid: ac5741fcd06d2ce45b9ae2ce9df3c4a1, type: 3}
- extension: .jpg
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .jpeg
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .png
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .gif
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .bmp
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .psd
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .tif
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .tiff
icon: {fileID: 21300000, guid: 93482309cf79cef4a9ed8464c560334b, type: 3}
- extension: .mp4
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .mkv
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .mov
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .avi
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .flv
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .webm
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .wmv
icon: {fileID: 21300000, guid: 53a62df1d392a10498ec79719f8eef1f, type: 3}
- extension: .mp3
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .wav
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .aac
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .m4a
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .ogg
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .wma
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .flac
icon: {fileID: 21300000, guid: 293ea6a99c4ba134cae49556942ee0ff, type: 3}
- extension: .zip
icon: {fileID: 21300000, guid: 3b2a773e413d3e84f8c7c757734af584, type: 3}
- extension: .rar
icon: {fileID: 21300000, guid: 3b2a773e413d3e84f8c7c757734af584, type: 3}
- extension: .7z
icon: {fileID: 21300000, guid: 3b2a773e413d3e84f8c7c757734af584, type: 3}
- extension: .gz
icon: {fileID: 21300000, guid: 3b2a773e413d3e84f8c7c757734af584, type: 3}
- extension: .exe
icon: {fileID: 21300000, guid: c1e1f7ef76f59f54bbde5162f2709794, type: 3}
m_fileMultiSelectionToggleOffIcon: {fileID: 21300000, guid: d6beaeac8de2af749a48581db778df3e,
type: 3}
m_fileMultiSelectionToggleOnIcon: {fileID: 21300000, guid: 30a2566f94f937b4998542121050e68b,
type: 3}
m_contextMenuBackgroundColor: {r: 0.11372549, g: 0.11372549, b: 0.11372549, a: 1}
m_contextMenuTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_contextMenuSeparatorColor: {r: 0.6392157, g: 0.6392157, b: 0.6392157, a: 1}
m_popupPanelsBackgroundColor: {r: 0.18039216, g: 0.18039216, b: 0.18039216, a: 1}
m_popupPanelsTextColor: {r: 1, g: 1, b: 1, a: 0.87058824}
m_popupPanelsBackground: {fileID: 21300000, guid: b9c5fedc997f125448c4d8be2fc43bcd,
type: 3}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 07c1616acb3e05d4789781b38d6ab800
timeCreated: 1634717905
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
Loaded 100 of 923 files, more files were not shown because too many files have changed in this diff. Show more