diff --git a/Assets/FR2_Cache.asset b/Assets/FR2_Cache.asset new file mode 100644 index 0000000..ef286cc --- /dev/null +++ b/Assets/FR2_Cache.asset @@ -0,0 +1,5214 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 933e0cc22e789714c87e348a699023d7, type: 3} + m_Name: FR2_Cache + m_EditorClassIdentifier: Assembly-CSharp-Editor::vietlabs.fr2.FR2_Cache + _autoRefresh: 0 + _curCacheVersion: 2.0 + _disabled: 0 + AssetList: + - guid: 00000000000000002000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000003000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000004000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000006000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000007000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000008000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000009000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000b000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000c000000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000004100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000005100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000006100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000007100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000a100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000b100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000c100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000d100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0000000000000000f100000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00000000000000000200000000000000 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00a44223f18a08f4593fb1796507276a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 00d52c17a2477654782bcda964b2c6a9 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0037a598aef33354889fbc5bd7620dd2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 00d99e4cf26b52f478eb6bf369455882 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 006baea4fd256d548aab072abfa194a8 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 00cdad8a54711544780c1feec7c5f4ad + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1021c24743fed7747b3444f8f15650a7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 10b3ad06f6fe84541945c46c29a1dbee + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1056b8bf593938a4399e74aa632e2a21 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 10ec51f3898722a4abfce04c9016b0da + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 10fc4df2da32a41aaa32d77bc913491c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 10ad83cca480ec64e825b99ac41ea41a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 104f21fa1f3844cd6820af820cd935cd + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 2035a9074de204f98a480d57e75e1ade + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 20171ebb5bb9e274e89385cee3e136bb + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 20395ab206b6eac4e970fe17567096d3 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 205d5ce9ef202fa41b4af3ddfdf828d8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3052ada84e39ffd4fb3cc3cbb885d867 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3065f0c265f7b574bbd13d9e07eefdb8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 30f5ed3e90f884c0ba8ae40f4545e4df + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 30a8c60365bb5a142ab1b2876f97277f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 30aa77e4537138c459541d179d9ca766 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 30cdb0de42be57b4aa6baeaf82e6d3a0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 309ee16fcfb514bb1aebfef0a8f8b7e2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 407bc68d299748449bbf7f48ee690f8d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 5042f4aab18174440be899c940c9c9aa + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6028a54f04beaeb4e848a9fb3d7872a5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 606b83f535f265c4599359df0b67ed9a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 60cc713d3ee17fd4fb17db2c2dde4d03 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 70b4a039b046c4e5785435c2b6a969e8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 709cfa1f273eab941897cc0f79d8f2c1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 709f11a7f3c4041caa4ef136ea32d874 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8080490af5235b043abfca704be7ff8d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 80858774e6f67c244a23535e8899a1be + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 808645e3ae431f64db2047340b764882 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 80f683e75cf2f2a41bb32d8e9de0a2f0 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 90862c045c716604295a1bf9e5428c0b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 90e846e179b03b84fb4f06f9a361c820 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 902bf77c947a4004c946c6ca3ccdf56e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 903e27eafe5bb764db202389e0fefbfa + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 90df501d86681394b834f647f6f4e939 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a06580b201713f049859865adcff3e21 + loadInfoTS: 0 + stamp: 0 + type: 6 + UseGUIDsList: [] + - guid: a02a7d8c237544f1962732b55a9aebf1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a04b90f0fbbf542ed92f0a9922294f2b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a06b6c01fda9ccb4dabd3a723df36e15 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b0e389ae1c0816542871ca77e897f26e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b0b55d83cf564dd42ab5e93b45b316d0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b0adc74f6eceb2d41b4891e6ce63d694 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c001d18ade3f180488179878fbaa3eef + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c0367155479c84189ad956f35f707b7c + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c017d286f7d324b8f83796be458d4bce + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c027a1302afba694a87436cdd0589908 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: c0cf40bb322ec734eb7442a0743e237f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d0603b6d5186471b96c778c3949c7ce2 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d0635b02a5454ec408df3a69b04f85a7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: d0a695a0813be834ea836fe574a97dc3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d07c01c40cc7be54da0ff3ae52484cd2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d09de72a6314d2d40bd136e616623b80 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d0ae482fe608b194187d16b960e3d14a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d0fe7a5c3e7eda64d97b8680f4d80f52 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e0e3f7ebcaee74582bbefed2ff209097 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e07c1f0451ca7c74f8be26581d4b697f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e0bdac6e268b2924cb27f6fb3a74d9eb + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e09e831aac4da4503b18ff5d7851c9a8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e0eebac9e6cbe431ca16d9cb27500785 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: e0af732b109e74208a73555b55c7a5cd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f0a07498b928b49c7a9af78293bef6a6 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: f00b7d5f3d5f69e4fbc9b571bb01100a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f0ce72466d7eeec4e8802ef83c9f3d62 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0170c5febdd43f14b9d2f2dda8dbb8df + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0132abec8436675439df17221165fabe + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 01e3f7a951bd04a35b3bf096b97166a7 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 0135956964cc9e744a08c28c7a636239 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0178fcb869bafef4690d177d31d17db8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 11727b51a902d4f44827a5be2a05018a + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 1115645f02362fc40a598fcdf0a09ba0 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 115996c1c8a06ff4181619f8231da9c7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 110c1108b625eea4883b2fb9f93e6c13 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 21905de6b99cf1349aadefc7fba12d56 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 211225e2aa121964aaea2b5fadb73408 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 21921bfe47bb8c74b8c5c5b0590bcc56 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 21d2df4841e81ee4b9c67a20351652d1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 21666f0998fcc6740858ec61771e6efd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 214964881737f46bc913946539880453 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 31337251af01540219224bc9b1f8a6b5 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 31e461f780a844c2384fa533b76c4190 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 31754f1cf32233b4689b9d3428d7bb23 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 315b1946fb534604485ba8d18e16b69c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 41b0d8a9ad245ce4dbd3a5fed7fc002e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4159108d362c9b34b94d7eb7b8259097 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 418a3b6f2d26694488bc7ca1f4c5893d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 419cb938471e1af409bca7414004c594 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 41ce3cb072b57b44eaafe927a4190025 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 417f823efc5eb074289c96bd1123d6f2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 519095f0598dfdf4ebe457561f77771c + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 512740f94d2b04507ba10965e1feb1b9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 512a49d95c0c4332bdd98131869c23c9 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 510e2f788c530724f9cc1f9ce7710566 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 51de16538507b4873b3491bbfdc8dd24 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 516f7331663e8a2438b3e532c1542f3b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 610c161d4376445ff8cabe0a0e8044ce + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 7133ca74527ebf543916eb424bcf7fde + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 71f465a50f1457b468b72d20f0ec7673 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 71185e9d206d7d145a1b54fe88a770c8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 716a391c8e627654dab900c7386c898a + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 815619cb4f624c04fa812302f02578b6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 81a936ee72b5dab45b6c0f63237602cc + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 910072f1f484a194eaf2ca5fd6ef7ceb + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9122c077ab24f4e4cb06fcf78c12b62a + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 91c2bc81e0c238349a8c86bd3351a3d0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 91d4800e505e7de4dae44d7a3a9cbd1d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 91e698db3a2a1324ba95a43dc4aaf9c4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 910a44a115a79bd45887e82eefe2d0f9 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 918eef923c01a6e4f98db1b9b7af1b73 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 91fe146af6315ed42a4d26a9b0aeea14 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a145d4213e4af9f4e9bf71051f19e627 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a169ac87a67d54cb29f0d1d1fc003c40 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a1bad058ff3819a4493013760f4b8ee8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a1abf267ac05dc14f98139ce5f0acb69 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a1dbe887ce6bb462fab6b88a53a471ed + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b1d96d3effbec42f98567b0529829092 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: b13b7b6e39ea0774996f0d40477f4aec + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: b17fc08c5823c468aa10fea63d45d11f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c1d46e9160a470746b81ec551f8d140e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c13f6124c2e32ef4987d72c0c9dbecd8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d1de526d00e4052458506ce20689b585 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e1c192340952e0c4aaf4d1f4bb4d4636 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e162302d23740dd498d18cc76def3680 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f160a5f4bf877fe48b1233cfe8c39308 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: f1b1a094f669d6b458370f63773462ed + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: f173d54a0be94a54bb3c9f8d72d2c3e7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f1ba9f523935b5c4ea182d144dea4bf0 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: f18ee2d82251a1e44b8b982e1c5d5397 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 022a9e7bed4970749a04b7f171d21780 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 02ea5ad83069b41149b254a7a04c4dd2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 02eb0d1bc582e4aadad8fae6327a51f0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 023c98a32f6cc00478e50479839530c5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 02ac814ebc281d54d812d7d9f0e14521 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 026fd8cec188743acb7e03ee6101aab9 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 02ff2bbb97cd1ea408923b9b3815571a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 124c112a6e8f1a54e8b0870e881b56d8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 128e987d567d4e2c824d754223b3f3b0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 22e12daced5232d4795b1a2181319eee + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 22a5243e756c4974cbd86e180f48fa4a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2237f7b28ca15624cb7804712f2802af + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 22ef63684cccf564ab931c177f255b19 + loadInfoTS: 0 + stamp: 0 + type: 6 + UseGUIDsList: [] + - guid: 32e59262626cc4f098f0b4844723dd5c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 324ce9a23e6a5144096a195460dd567f + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 42902e565f42b4b128ff9bf4a4a652de + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 4253ae3e62f3c4cf6a85b17df28b5b44 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4239609d08dd21e46be5dbc0e0e49605 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 427f9e7bc57fb6e49a9233fc60022383 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: 52a1fdeaf96581840bc09373ff2c7ad0 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 529f6b71dbeea8944a4febe6f7a2aa81 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 62a7d5dd45994494182ff5c1d8da0d3c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 62d93e6697138744980b64e320f9c356 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 628c581c4b87b1e46a508ac5bb44d32f + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 729791b8cf5dd874f94b1d07407161bf + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 8243bd7a07b5d0a4fa6ee10d95e5a578 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8216044785376fa43acab56ba15cd4be + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 92d93ac017c85ac44aa3951e571d5355 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 923c228195158b2428c032ff509fcb2c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a2e036e1b8e434698b24341c863bfa30 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a221ef0b363824540993c714c0fc7385 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: a251d1edd0885df41a12500d4941aec6 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a2b555b97c776d34185fc8762271d1e6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a29e0047c8943324eaf7731d746a8f49 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b204b6ab60d41421c99fcb26ba2a277d + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: b276ef85014b14cf1a6e39ae4d5a4ab8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b2e600f943c41f34a89a2843ea98a353 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b239d8d91d70d4604b08b74bc8289fcb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c2044ff1352a6bb4586d6d04b59012b7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c2f4d0884ba29d849afcaf6121027023 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c20867d5dd78f1c4d8646cb850f0e8b9 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: c24e49ee8237bac42930ef868a325c48 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c28f8b49b5fa1f84ba53d8a75703ecd0 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d2605d6c2f548fe409d2ffef4e689f04 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d2328d7a4fc5e464ea82a67370f1ad5c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d2e8cdc39adf0564ba35410ad8ac1761 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d2c9c39420ce08345b0bbc34ede2a3d9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d2ca050f69144e34b94336affffbef2a + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: d20ce1d35d1d34f4f8dd85ab513affd5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d21cabab2fd97b645a32b939854d2d0c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e2d2e8cbdd16a4742bd8c7fcff811151 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e2138c7ed54ba4f958c90fd344ccb868 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e2266355fe2904c49924b05343e664df + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e2472ed6bb5f9e04d84fc5d065674b8b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e2a9ad652c0a71440833531b5c1c759d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e2d97822d8b0e8f4b970ae7085917064 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e2de21ee084a2104086d72887cd5050c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f2c2e64d6679f4dbf9850d467b5b1d00 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f288ae1f4751b564a96ac7587541f7a2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 03551c0b797ca734097802d09c654c02 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 036760d73beac3b4a896d099fcf0bbbc + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 1371fdbec5844a14facbd435992a902c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 13d52fb2a77e25f4ba76c99ac5abb56e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 13a884ba82b714c27b6e58a512eef8aa + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 130fbae3929f3274a87fa23acc5b45f5 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 23072316c352de64c87f4f024deb1d80 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 23ce20d4b7f826b4fb30eae1fcb8797b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 335235f9108c8f845aba86a10297b736 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3374465d76b6040a4b130a69985f0c32 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 33f766e7dd541ee4182fbf362af67870 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 33f81f4f4926bfd44b2efa579622159c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4394cef785f95cf4eafc40098921380c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 43a45b2bb2bb2b8499debf83ef5a7371 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 43b8f1dc43642294f99fab0aaabf6197 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 436f07753de7a4c22b93b5f96fcc9660 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 53850649afe9a454aaf9564a2eb0d374 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 531641a9d49e5d042b06c7ce3c963d57 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 5367ec0c0f0ab498ca772ad1c02eb02b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 63b1f9a2947319e4ab91bb6235881ee2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6302c9b39a34a46cea4828af8ae53a36 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 63c7f212f60aadc47945b935dc40e7c0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6358783c937c11049ab66f324a24dc9c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 730466b26610d95498d22ab748d855a7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 73fc8d9d784364ed79497405f0b056ba + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 731f1baa9d144a9897cb1d341c2092b8 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 83121ed3212613f46bb4ef23a1cfcdbe + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 83359cfa09ec3a8409e5abf8de7fa62d + loadInfoTS: 0 + stamp: 0 + type: 6 + UseGUIDsList: [] + - guid: 837f6fee37538fa4d99670cff5366ba6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 93877641aa2b11d4ca44dca1a283d4b7 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 933a7fdefa4f6974b9ed61bd940da6ed + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 930b7a19d446f4b4c9c810e37e84e625 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 93eb78e61f0eb4fce8c0558cdb2f1517 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 932c993cb0b2b0649a7aea85cbaedc43 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 93dccfb8e34c04f9784a53c529653d6e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 933e0cc22e789714c87e348a699023d7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: a3248b7f77411ae458e6f2c845df7f55 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a326767bf949111429490e01d3a59d11 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a3d800b099a06e0478fb790c5e79057a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a3f92821cb529234994ca8cdebe0f32d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b3a1e0eb07937fa418c99504f882bee2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b3425777f1700b249a15eea0ea8f0bbc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b38226f7ff89304488651878bbf65734 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b3c215a811d0c844a98c16e4d383c1f5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b3490e0888a3247018fd98cd22db1f61 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: b3db7f737eb30334c8bcfd1bd71a83ad + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b3ddaa7f43eb8574a8d6541276fc1a67 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c35057df628234d1c88911f39e7aa11b + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: c334973cef89a9840b0b0c507e0377ab + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c3c4673abc7f1ac4e981951aabacc969 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c3199ed8a622e464b8357f9974d55417 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: c34d766647ee8994d83c19705febc269 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: c34ec4ea33f41784dada5802e39a8165 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c30f56f99c2725a4e861c19a5e83e0aa + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: d3e16afc13cd6a8459c393c2e1f17947 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d3d6402a12f22aa41a3d741b76e3a5bf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d3a7a37b96db74b19b57a350fc36b27c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d3ba0d9bfe79ff94ca52a3bd6b6870d4 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: e352a1349734b4dbd9437cd0803d35eb + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e362fe89183ef0c458ec2a3a64894ba0 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: e3265ab4bf004d28a9537516768c1c75 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e3e6fee2893b9d848b8b1ccca743c14f + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: e3bced12a72ad4348b849357056d7a70 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f3dd1a2d423bb5a46931b0e689fa779a + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: f31ee666b2527344e91520ba278c9869 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 048402e808bbcea429b741232b396c1f + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0476662ec41ab7e48acf131d0a49acee + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 04d63afcff91b445cb64ce94fc722f6d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 04bc55e2853356e4f999b995d0066b33 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 042d6c5b677b9451eab559b96f0a8810 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 049d6e00eece0994da98a140d99277d8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 14b2c6b45481420478d15060c3b476b4 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 14b82ffde5db5c547b5f454ac2791815 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 14eb328de4b8eb245bb7cea29e4ac00b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 24246dae3c57e3445a387b9c9697444f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 243e06394e614e5d99fab26083b707fa + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 34004f67cf2494b4385740d47250c634 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 3485c0e1a62b5de4caf5ce5e4a74c627 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 34e71885282880941b27deba6fee9e72 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 34092e00efa6748609b2d75d99d1592f + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 4400c462f14de4a09ad61a06230ed017 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 44b03eaa872f141408d84aad99e0175f + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 4486c8fafd690224c916681461010067 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 448d62fcada76fd4ab5702190add98fd + loadInfoTS: 0 + stamp: 0 + type: 4 + UseGUIDsList: [] + - guid: 54b64157c74c66c4ba75b65f7ed0dd2c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 543e447c3883a46458408c8d998b429d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 64babb133b483be49972dd184b31d84b + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 641bcdca48dc944e5a2aef201af4ea85 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 649ecccdabb7ef9438addcec6663b037 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 74112b16490588944bcb0bb101875a97 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 74d264d1aecb7410589f3c9516337729 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 74f42c695c784cd43a543aad32fc5741 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 742841b2f7233644898dc4d7a256c8f9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 745cc84ac413acc41ae9e8fd475cc2f0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 743d5a6fb6547c944bb6d20852cd5ab1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 741ea71ad8a1001469a879e03bca0296 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8484dc58e4e6dec4d8bbec756fa758bb + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8485375dbd3ec064bb102d6bea39b142 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 84c5d6dec27ee1e44abe88c6c1c59dfb + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 846de4aca6426f74c8cacda9de44511f + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 94fa5afaa6b1c2b479cba1acbc33c010 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 942b6a2cb94f6ea489d5c1b7861824d1 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 949cf3c297246c54593be19eac457770 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 94eee3d7761e17546bbfe6b1009b2de1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a4815d31a23d2b14fb3fd22d9e13630d + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: a493e305412e9414b8b9909c5034159d + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a4d4588e12cac6f48a17583c08a100d2 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: a4f5f3a8c02e38645b3460d430c73f7b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a4bb788560e5d4617b970cd301097f38 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b400aa51b5e6c3941a47ce7dbda137f9 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: b4f19be01db592c46a121bde5b9f4431 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b4742daca2cfe4d1598a7710d04792d7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b4b88b2d2f749a94fbcdc7c0447cd73c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b43fb578fa159d04aab7c95ee238a486 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c41005c129ba4d66911b75229fd70b45 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c4518f215ae949c4e9341e0353fc63b2 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c4a1fc9a5c921ca4f8a40e45ffb669b8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c4124d58192987b4eaf4fd60dd6f7789 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c4d3add090c4d9a4b9166270167cc035 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c41863cde78e90a4998ba2cdbbcadbdd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c4fa87eab65624843945653eccd6c93b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c47db3298e426c44aa2b69e6ba0be480 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c48f2679392c88f4685f8a151703a2e5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d4a6858007f12b14f8392b7b63ad68e8 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d4185f678f89bb246b64c6a199147cb8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d4eb550196a90ec46ac7a93e03d130b6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d42ec7ef2da4da54e8c3ec154f674a91 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d4df822e263091e43a32185a71130cd7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e4d1f326010d24d48974289d4d9c0eee + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e41d1a41a8089eb4b9ef84050f479d71 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f49fe2bead1c6d14580312213b2b489c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 05414fb21ee75eb4eab74af83c4cb868 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 0525b7ad910d145f9a39a0da3b697815 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0525bbd150d4d42f1aaf34f8112f4d70 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 059854c655f028c4ba5f9b4b0bccdbb6 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 057a586806ec86c45ab649f56c2da67a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 059c5ec4f72db6c428805baa9da543f0 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 053d6d729c0720645bccfdc4859c5c7f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 052faaac586de48259a63d0c4782560b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1530caefe50f68042978f4b8cd52a92b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 15715f31b8568404b888daf416351f7d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1545cfba9b5e06d41ae72c7ec766baaf + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 15b89ddb77a3f1f44b3678353a68b158 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 156c6035e42726546a6ec0245e9b0d30 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 250145e9ac4074b7bacc130ec1d651df + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 25d11d14cedb91e429ed168d92c81b80 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 25780adbe09da488ba079bc33c4bbf0f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 25fc17412156d8445953abccae0301cc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 35792a13abb764651b16631ccc27de9f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 353bd1e8150b74846ab1679a4a808645 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 358eb3b10abdc7b499d77c14ff892f1f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 45e2b720680172c48b5f3b5293706563 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 5545e4a9de9a44a378d21ae6af230fe0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 55074be14ca189546894da68b8899b30 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 55d9f997de358a34a85e48ef6b49e8f7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 552b1791c699a8144a0670db8e541363 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6530d89581085964cb783dcaa6b94725 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 658977c5b6e84344581803c8025947d3 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 652b7496d137e084a84a2e400f3769ff + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 65bc7dbf4170f435aa868c779acfb082 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 652dd05072570e542bf76031b0d45954 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 75a0638f761ec2243b71e963ff1b4161 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 75d7b9b96d1c9497ea12c1a3c94329eb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 75fb55249d53844d6a590e5e6b4869f0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 750e60971112d93469b60b1134ce96b3 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 751f193c0434849f995d247e088796cb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 85832f488e52e49df948f060d91469b8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8584f72f2fa12c1489898d805b793315 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 85187c2149c549c5b33f0cdb02836b17 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 852a9661951ea814d85d380d34784174 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a5716c11abba60e4289ed28e36d38769 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a5ab032500bb60a43826c8050069d4ea + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a5ab89115777da74c8c24290450eed85 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b543c2ce7dc56c2418505cbb6cb7852d + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: b514aec5044c41141ac3b62eca518b25 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b544755ebe420ba46b691b7834d6be04 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b5a458c9fe5e541c98ac84c292e82c28 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b5b43a6b54627474caeb9bf8c6eb3a19 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b5a659d4ca689c742b9a2c35f3054206 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b50ae01fce1bebf4192855975cf9f873 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b59f7f4df8ff049a6a4dc16548af3f48 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: c5a1205b169c81541ae07e8f32fd3673 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c53212551a89648a9baea70161fa5cc8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c514f1116e18b6c42907a5cb19aa228d + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c5f459ab5f410494386bbf564083b068 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c5cf9d420554e5e4e96d3bee1903967a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d51121717acd0e24abd00086f8148b39 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d5c2f1d0a3c6acc4a9cf0d8f013f14d3 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: d58630063939a6e41b11f8cbc686b95a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d547d478520e3e24b81720af16bdf5cd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d558d896a14050845823b525cd1f213f + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d5f8ed789f3fa6d4c81f229541dc8522 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d57a3d80d6b9c334692747b789c7d8d7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d5da7b0f929a74e82bc4568e2f2a40b4 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: d56c3230b6db1c6499606e09fe9f60d4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e5c8902ebac942748b019dd69cf124bc + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f5c64096647de5b429d162f38176f0a7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f54d1bd14bd3ca042bd867b519fee8cc + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: f55d3ec1ae6a17d4088817a2943fac46 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: f59e9a4d72a34e04a9556d79f2abc879 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 06204d9d896c516488661082347af268 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 068a0ee1aef344e5c907c530982b74bb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 063fd114d94810343b328b2a17eb9313 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 16d6c128130214680bf2391faf6584c7 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 16baec1334bbd3b4b934e7f7324de210 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 161b7cf82dd54e74d92b5ca72d3be3af + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 26105206120a119419bee8bb5f810902 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 26e038c29641b594f832c817337d6b19 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 266d8074719d56445b072bf011dab9ce + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 264f78e4c642a4347ad9a83b77720be5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 265f3a1321681e24db75052f3ca37099 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 36b02f9ded11447479d70224404a762b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3641c008424b8504095ec5d174376c50 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 36b31ea0a793f45f38b08fe292e0a611 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 36a7d26406f037b44a0eb7a79d109f60 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 36a8c0b00d3da6f4483be05ad9d1c207 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 36290e41ab1030a428eacb62cdc8ad94 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 36aabe72e2b2a3e4abf8f2e8906e9e5f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 4653ac173599ec54999cf2c8c15abbed + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4624034de411865438bf80512e193040 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 46245baa94911f54faa00445711ed536 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 46a54f2f3e4ec1f449e91a96c7dbb6b8 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 46ea5f6c3d8e3134c854428259abd4c6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 463b6be548abf464287096e1e92fcd01 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 466b1506a6c29c64e984b26012ad2082 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 460c2fe161ff3a6449648312c4e14eff + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 56d13d8d8e47a444289d2b75153e599a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 56eb762d74e4dba4db3f16160a6e082c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 66c3871a9524a43e392f64b1d9fe8faf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 663e42f73ce2d4c4da1a7bd245ba91a2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 66df99b9e1013b74986826c119a9afa1 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 76b79d5d16d19bc4c875c3e467a70640 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8688d56883697284fb92ef62bf363355 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 860fec1a0e7064032b9a58b2ca9fa31b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 96f58a2a22beb494aad989dc627e4c73 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 964ae5cd392ba08499b88de012ff8213 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 961bcd94025b26a41baf477580078f6a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 962bb7ef5bd1e41ccb65d492795530b8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 966d917eab0693640a1da0f164ec7ee1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 962ec832aeccb4ea58684eab97f35822 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 969ece6a3f459604aa8970d35bb4651d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 96de908384869cd409c75efa351d5edf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 963f2dea141da8d439f1433399db6d4e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a6f54caceb604a14084e7ff2ee0af531 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a699a8777229b294ebaef00b6768f1a3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a61cc0054eb1e0b47b62aa8ee533c6cc + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a66ea27b250d14c70a85d14654482936 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: a63f7e0dd8bb34e5bbdd7ad7f6f3e432 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c651e96b15e679740a526502ded8cdc2 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: c677c28c3b0a9674ab9be09764ceafa4 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: c66e0232103e3470b99b56569caed602 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d6f1c54ec55190448b9feaebea2ee3e7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: d68a2d348cadcc247844a85834d1aaa6 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e6f3abd49be7b414ab5442dd1d1f9ad4 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: e6956b728226c43ae9ee514d09ca61d1 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: e60be5c45dd18224db4da367d3f30317 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f640ec43e69e2c54c8151dbb101ec994 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f6a7193e067b59441a3ad2e6540e4ce8 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: f6ea022d65be5c94eaffb10f9f2fcc58 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f6ac2ba690e714ae0ab1778947a30c84 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: f63d574838ccfb44f84acc05fed0af48 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0761ee783e4248848b3e02e3c4689728 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0727ba69b779d42a0978a362226fad3e + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 07698b24c9a94f44d8b5edcfbb4a5f52 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 075f70222bbcc47cb8cbd8a385699eb8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 078fcdad7e7f84844aed00eb8082ee12 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 17b3ac4617b857d43bcf4dcfefca4bb1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 17e9b2b96ec87d543a6349823e045d3e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 176e6e187555baf469e9aec3a8c72a6e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 27354a1e0b8f50e44accdb49109dfa77 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 27c5969a30cbda148b7f175161f637fc + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 27e7e012d216e0143b94df13179d62dc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 37203cd677fbf4f4e976519219bb7f5f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 37e0082e688bc484e856bd553ecb50fc + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 379a3c5069b04a3468ed6837029bc961 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 370e93876c8724bc1877b021fef179da + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 47e00a5b983b8914fb75b565e8e00481 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4745e97d36dedb0418b26c4faead0723 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 47b57a7fe51fd154e975311ad293878a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 57a42e3770c47a34980340452cc89292 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 57263a63e2f03a648a91a20aba5220df + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 57f65195529b5b64480538f989880efa + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 572b3611e1e30514aaade959229a10ef + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 670637d0be7e1304198b2d411407150e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 67574182bd361634d85f65f690ba7498 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 77a22c0f5c59afe4784ebee863426198 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 77238c28791df534d8bac05b8d74cc9c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7798514526f7b7346a0052e7e6014618 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 773c9f4bc15194376974ee8e010b4f10 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 872d329bdd85298469aecb4acce3d6f2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 97017ed3bb40aff4e885440d9a7336ee + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 972193867b8114afdae8308123cfa3bb + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 97b9a359fe1623142abd4b99cc9ba953 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 97faeee1e2be76d4aa7f0be9857086d5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 970ccb6fbe463b846a6b2acb16828453 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a72a7de4f98ef4e9d8f2b533172221c1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a74c1adf01118d14e88997638d35fc54 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a77ec3850692bc34e98e9697bf7f28b4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b7f0c6b4626a24707961eb0600fca643 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b7a51de04e2bb41c8aa874afeb687417 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b70746b2eab96104080bb0dcb307cc64 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b7595d854267e4647b870b897feaa766 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: b75e0c5608bbdae4caf72802bf74413f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b7af398e69786499d9d719c28fea32a5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c7421826db2284b6b947d184f6a2335b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c7d67030b8dcdec489471b88c35dd78b + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: d77e75efa9e84c947bb541b97dbc2f36 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e73a58f6e2794ae7b1b7e50b7fb811b0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e75aba5a05607e744bb1951b833b8a1b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e7ae479e051350144a4869fdc7e689ab + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f71b9fecb98fc6040a489c8800fa4c81 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f7ada0af4f174f0694ca6a487b8f543d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0831855f145cc86428cc0fdc38232b92 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0842e15e17f2eb147942050a774d00be + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0882ff510b3c00241bee77e6b8ab5ab8 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: 087375fc77302da498bb8db542df99b2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 08a641124f86b3a4e8b038feeb33d723 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 08cde3bf3fe70434884174d8934406c2 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 18925b0fe0029224aa6d9f4d9ca9ab72 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 18f286dc2d0d6924f84efc494a76b964 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 1804bd0b6fc2f4096b1a59fae718d074 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 18dc0cd2c080841dea60987a38ce93fa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 18cd9d984aa577746b2cfc642d83d835 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 188e2771915f24b26b8e2976587ecad7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 284503034dcf8814993ee6199cff7d4e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2889c7803d8baf94f805b3ca889db1fe + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 284ac320f0449154dae9b92d90f5550b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 284ef6682822dfc42afa19e965f500fa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 280f953ad81164d1d86059ac86f36a57 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 387abc652c7ac1c449701bdfcf9d0f8b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 381dcb09d5029d14897e55f98031fca5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 48874f7fa809410459fad9f55010f4bb + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4897906e075169b4aabd6cf73198e1de + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 484a85041d9c04e31baf45155cfb0c43 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 48bb5f55d8670e349b6e614913f9d910 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 58d0d270b2e1f48c7b1e30b0afeb24ae + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 5812774afb198ea4496348d8b58d2ce5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 58062e37d08f0544c9654bb0770ee35c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 586f14ae3538f11478b8dd5d23f10776 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 68d02178f2edd4e4281ec70083f60126 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6815f328a3dc14a4cbc94ae4f77216b3 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 6846686d43c925744b07a57900ab5ae6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 68e6db2ebdc24f95958faec2be5558d6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 68dad9db2dc9d2249aa0a58c5d2adc36 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7857de3ab680ad346b0516baa444ae7c + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 780aeef26fc6de04684d65f3045fbe17 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 78fb4dab46be64a24beb41070eb5cf1a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8823e0bdbbd960d4193f7e4f4f96fdf6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 887c0daf592b6b0459640b32cd1cec2b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9860c7c883b289444b7ef7fa147ca787 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9806c8981db3d4a5d9825b879a8af6e2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 986a2786b21323c47a46d731b9274480 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a8a2e12cedc78674ab9a677d75197493 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: a8a49917659863546be2d2605f906424 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a8f43c3e39dea304cb6e7e3ed5c095e5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: a8785ec64de93ef4b8242cfa6e841d7a + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a88ba6a3bcd97154d834ecf03b20acb9 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a8cba3361c8f7724e8899289f1efa8cc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b8b3706795792c34d8893e31e15aa527 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b8bc1310bbf53544a889924a5126d8d7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c8d12adcee749c344b8117cf7c7eb912 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c8166fcc08c9d7d4ab74fe10abea2599 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c8f7a2fd7b09a9143a96f5d0886b7221 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c82a003de87344f429e62b0511fd0931 + loadInfoTS: 0 + stamp: 0 + type: 4 + UseGUIDsList: [] + - guid: c8fb3048cc2a34ac9b990026789f27e6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c83c9fe8d48510b4f88e0745b337051d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c8ec863ce1cbee646b02710933ea9cbc + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: c87d8c18eb42446b39c2fea75882d2cd + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: c8dfd43558a474050a547c096dedf9e9 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: d8060acbf19818d4a97059614b9a4ceb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d8ebd34c38d3d0a40b5422c0fd136471 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: d82c1b31c7e74239bff1220585707d2b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d84f4ef5844eaa34480a30b678d2fc20 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d88fdb15c650fc84bbb7c831ea365819 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e8b85335d3a5f40ab9a2cbfe28d08025 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: e87dbf0d24afd42c2b5507268209fcb0 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: f854a286f4836e64e92108de3f2d451c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f886b66207f14424b83af0a3216c274c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f8382067718a54f7eafbb5d640d91edc + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: f8de430ad75135743b87456111e7abac + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0952c1e419a634a07bd66500a3072a66 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 0919b50f8b1a1ea41b149170fc8ded0a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 093c8e9e69a2c6841a192847fbb527fa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 198053ade929735478b1cd74276a060a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 19843dacec4e4174e932026f548d4e37 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 19b7e0552df01a54282aced29a68d756 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 29636f40562819649b730c52f1babbcb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 29350d5dafe58194793aeaffb2c99ea8 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 2938054f9f41a0b4788f0dea2ae84e19 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 291e1d3fbd702a8409101efa1989bcd7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 29de0f102e946ee40bf4b695b8a03062 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 29dffe27204f9d5459147d239a58a521 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 3996648ad0f65c2449706f8bd29356cf + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 39078be2274d38948bfa1c883e4df90a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3997e2241185407d80309a82f9148466 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 394becac6cd00464aa334434422d4485 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 4900b2b933f056247806df532f93e2b9 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 49b365dc3e2ea9541a8ec7a8f7c5ece7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 59dce8e5623d64e219c0981f61e83dbf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 599d1b7ba45790545aaa9a505dfae579 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 59de5c9b86a054d2bba67e3b35d00a6d + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 69321f47ed26cf544a344ef198e16735 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 69837e49fa96641b8ab28a33d493b812 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 696fa446a02382a42933326be751d3d2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 79d373fa2010f23468f436efbbdacb46 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 79c4b1d4bcc7ab0449473b9ff81cf70d + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 79459efec17a4d00a321bdcc27bbc385 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 793a1f9b587f94d4494747bc8e72ff36 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 791c30b04e8fc1e4fbf198c410a652e2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 89330de1d6e137a4f96d0de0a66f04fc + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 892d68685873b2f41a633d96d9d72ad6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 893d846b602c7b840bed30d87d6e0444 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 99f05e9ed34776446a898a6e2eafde39 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9977e3f116d56d546ac6d24e57d3684a + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 99c751b9c9008e247a30b435258d7d72 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 99c9720ab356a0642a771bea13969a05 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: 997b92e505f9db5499084a934c145e06 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 99de4b5a7b2eedb4bb35f2b0b821b383 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 991fe8d2d97844146b65a782ac70ce28 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: a94161927775d4468af0ccbfab87225e + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: a9165df71e5beae4e97304ea99234a94 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: b943136bd10858b42b2790061dc1213e + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: b9436ee5096c3d44c8287db1b193a6e7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b955049addebd4a65be8e7ec64929e1b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: b96eb9eeb3f1d413ea73aed406ac657b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: c9e30e1e40e5f6a47aa6053500404e37 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: c9fb3bdeca11e9048b71da5061a0711d + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: d930090c0cd643c7b55f19a38538c162 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: d99b255318d484d3ea62d5f605eba1cf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e954dd9ea9ad155498ca94221f88ffe0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e9f693669af91aa45ad615fc681ed29f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: e93782e253185f0469a05b76e0aae5d1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: e96daeb60bacf3d48b0e9e4ccbbe167c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: f952c082cb03451daed3ee968ac6c63e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f974fbce47853134ab2bf4aa62ffacbd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f9d69f623d79bc34499b2939a9637ccc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: f9b9c04ea6b703343b8aff08a26cf9aa + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: f99d8e9d39ccb5541a921c15ff9f0eb7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0a4122de4379b46d39b85530143dd383 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 0a59a347a3128354ebd4f84afc97a0c5 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 1a609280f2dc3418d929be4ebf9e88c1 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 1a69dbe623b694948b1033886c8520e9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2a00840c96f30124da27ebccb089217b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2a401d753bae14b078d869d807c7304a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2a35dda49401e4045ba2165e15116a5f + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 2a4683f7dd934a647a0b9b397d2712e2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2a27f178cf089504482582b99442eea3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2a28f6e5be983c44296bafa54786e679 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2a0a5db363a8813489cfb4a715b69ef8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3a5136e13fd179f49ad55a85daa0a6fa + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 3ae68a63934423642a5564336855ec40 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3aaaa718a90f2447195b5e94a1d6cb56 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3a9df2c30188f10438112114dc22bae1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3aefb85fd241856408808aa5401c9d64 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 4a071cc6d8a54314daac9d4fe0964517 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4a0a30ba4ab95a049b8fe52447030bd5 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 4aecb92fff08436c8303b10eab8da368 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 6af46263eda284040a619ceb24120486 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6ab70aee4d56447429c680537fbf93ed + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 6aacb349af157442ebc4e122e8d6b9bd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7a8b02b78b9ba2b46bf67cddab7b9947 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7aec4c17e103c524f876c0f7079b92a1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7add44c86ec794566b285124e013616c + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 7a8e87f45847dd1489d695c690a94dc0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8a509b24b10440b48950942e384c0441 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8a34533662e950a408f311e64215ed7e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8a7650c879bb21049ab6fe052fcddeca + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8afa10cf0d9218142b2b82ac6176982b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8a7b60ba7421eeb4e9d4e0809ac8ccbd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: aa32d6dfbb0a546e0915c113d985ef59 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: aa838920db26ae7428d5610e97bdb140 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: aaa8fb1803056b94c86eedaf8e08dc2f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: aada8efe0bee60049acbe742066a75b7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: aaeba1ebfe403534e99ade157332a8d0 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: aa8f027e7f20b41ebb921f8d8003a776 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: baf30be0238bb4fe2b61f1d8b8c22d54 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ba34c2c74fd09a24b873eba1d614755e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: bac8ea813b5bd654590e6733af511c58 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: ba3c89e981c85b84f9f8ee5bb7de4b50 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: cab1dd28dda88bf41b753c010135b1f5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ca2ed216f98028c4dae6c5224a952b3c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ca3f5941f8a234a1dbfd695d7436cdfd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: da8139953a9a90442a58dddcf79e1511 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: da33a1bfeaaabaa4597896ca7003b785 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: da17151fe2da8bc4a89aebf8f35a9bbe + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: da4841125750fc944a1b4388e0892e0a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: da5f137e90c3a47d19ada21eba2e5cfc + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ea15edbbe9d58214ba53c62803c5c797 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ea064462ce028fc4ea92a414ff4da291 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ea79f05554dc6884a91cd53eece364b8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eaced99e50210cd40ac0719cae139991 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ea6fb698b63701548a3f85997f7334c7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fa7a25e0152444565adfbabda1fd925c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: faeb64ccea29ab2439073b7737a14b3d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fa9dc2ea9e2c9ac4f815f666014804c8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fade42e8bc714b018fac513c043d323b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0b7306b5c0c771147ab18037e40a820d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0bdebcc44a31c0944b2dad9aead91bea + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1b19d2b8183c838468a176d186dc1eb8 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1bf925625eff7be47a3c0251cadf9373 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1b4cd6ae99262c14dad642012772685e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2b233594ea2709d4198098553f664c5c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2bf5b105cf202f6449f6950210660c58 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2bb81c9776fa20842861616d9d3de799 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3b528a8c228f8c942b986767297f715c + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 3b5401099ed7f1049a6f1339094e387e + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 3b644a9de50e41f4ba244696c153c9c5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3bf4509625441ed47ac5119dc8f9246a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3bc5b774ad58c8740b5705e96c54ade6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3b765a80f6db150458ee2d041f1adf2b + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3b59c882f27d0d04a82d2db251af1728 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3b8a156591a014b42bc4461d8f54d2de + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3b7f31c835c0e6a4bbd20225c6c7e6ef + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4b83569d67af61e458304325a23e5dfd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 5b607cbaf7556b3489d0ccfbd4f926dc + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 5b51913d07f805546855136f7b5feb44 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 5b72d61cb7da95340912a6a9f1d4ffef + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 5b9cd4d988dedf245b5e514a22a35c71 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6bb1e412df9cd4efd8941377ebabb1be + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 6b6271afee3c0744088680ed08f4fe4a + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6b62a2942a0a19948b601dc0be99a527 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 6bb8247713a511d43be1201ddbd6d6ae + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6bd91348e91eb814a9f6d790eba21678 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6bdae0be3fbb27f4fadd65a2100bc95c + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6b0b58e8352625343951db00beb8cb0a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6b1f9a2b1600b4744a254f5c16d2970f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7bb4c2b089bb2f841bb905642a28daad + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7b3dd5720b6152047b45788060d64904 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8bb13d32d833dc9428b3d5471491263c + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 8b03e816b0b474c548d1bba1622f7908 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 8b7a426874fa70b49b88ae7bead6be25 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8baaa10e1e77f0944b3aa0b4312fc5a1 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 9b984b2461793e942acc4fba426b68d4 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9b2db4189b1cbc04e99b67f39d5bf3e2 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ab65069c5517193419a4dae722828284 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ab09877e2e707104187f6f83e2f62510 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ab99da1b8f76c44549a399bcdd9c8caa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ab8ade4a80d104d82813b493596d9b01 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ab8b1dbdbffad491480719258a9a4218 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: bbc24cf68e2d52b42a210e4039b9ba61 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: bb94ec2123d9e174e96d7f022224b182 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bbd60e6ff74c646b38b5d5c5675d0b9b + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: cbb134a7bf23946e8b1586288a520060 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cbe2b3b1d4eb9eb489c40b1ee7f31ac3 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: cbe3de6a9f2cea544993dbddc6dedaa8 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: cbba02fcc162eaf47b7f6dcf2bcf4aaf + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cbdc0125a9e84441784bd35a70b6d01d + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: dbd0bb55ecedee049a756ce04ec4ddfc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: dbc3790cccc4958458bb38d883b69afb + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: dbc44f6b99a984be3b652ea5127614d9 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: eb50796824fb2ac4abf000358eba64a8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eb725fd5e0490ea4fb78ba8bad024bdd + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: eb75ca52956091d43bf6e0e0c6a61954 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eb7a193d93fe988498909c44bc53286a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eb4c7e468d9d8e74a86bf01a6de88abf + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: eb2d7a3652e09444a958a1a37462559d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fb15369c53f574ae6a3087b81112159d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fbc663fe8f0aeb0438b6c8e42bda37c2 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fbaae1d077d294940b6ecbec3e9c88eb + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: fb4dac16a6c76a44f9da4a8fe00f144c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1c39accf3fc812b46a89b53030f37397 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 1cdb0d0dac6c1574ab787631b8133a8c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1caec8734d3325f4cae10f6867508561 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2c740b67c364942ea9f6e47119c6414b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2c78523a85cd32b41ae6d16d1783007e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 2c3fdd728b1207e4fbdfe3f3a0e9a4fb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3c60cbc3b9c055a44aa9b48a1d8a7587 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3c021314ae3b34ac99cac9b37cf63eb5 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 3c2d6ca5112dbbe4094dd6646dbf05e3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3c7d4e8f248a3e945882ef5600a1072c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3cbf64f765b7db741a1364e3b52bd6d6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4c71e9cf172a7494bb1d1feeaaa936a9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4c3393fc300cf524e9faaf5f36a73440 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4cc86724ea3edae42b38f8a90c69a019 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4c3a46956c5cf5446ab2698d8da6b2d8 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 4c8e90fed087c3a4599b387d34f2635b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 5c21b074e7442f54dbbcaf33913664fa + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 5ca7cff7542b53b498f0a9834786b9e0 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 5c8b2dd61ee48184abd441078a7792d5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6c8689dad9c3ed341b7088135cb83be6 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 6c2a36853a01e0740838d2b6caa327dc + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6c0bbd1c3b6ec4539b0bede6032c67f6 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 7ca6202b6c5aa084bba0cffffca6f323 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: 7cff48d6e981c442ba0f0dc4ae78edc3 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 8cc08453a7bdb8546bda10ce38776cf3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8cd04ae807995f94b93afb88bb040f39 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8c52bb7282c319e4f8c1f956d17cbdca + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 8c340112949a7394bb89c52fcdc9a1bd + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8cba91b5b5ca5fd42b9620147dd3edf6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8cfb0a1bbbefaa0469b9616f406ac2d7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8cbffc26c1c42498790291f6d831bbc5 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 9c78d16e4711178429930c47d8e89427 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9c490d5393576d54cbbc078d985b2f89 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9c4c8b274e878b84993520f5498360b7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9c4ceec8c6a8eb54e95749a658e27c14 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: aca1128e6f57f02458b60a9f48f23c0e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ac92cfb4db971489da14157130119008 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ac1cc01cb5dbf5d4f869c403b38f8a21 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bc070e9f178c14842a77e750ed455f02 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: bccbff0e6a6dcb54bbe58022842213f4 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bc6c93617312a3b4d8b868e993b73ff6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bc1ede39bf3643ee8e493720e4259791 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cca2815f9cac91741b705f09b49954ce + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ccc205272b051834eb39593f647c7bf1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ccf926d75e84c284a9e1be4a00ca1d2f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: dc74fee00e83c42e58c47841e2c9644e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: dcf58f7461465c941b4ade99fc81aa8a + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: dc2bd4e285ce924419b643e3806f6145 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ec029025145905e469fbb86354406c8e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ec46a2757e575457bbb6776691c0acda + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fcb4a5e1255d29f47ba16e73b60ab527 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fce6d601a5d475943bc43d2abd75570d + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: fc277da9561534211826eb7b4218282f + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: fcd7ea59a703cb64dada04e84ec8a7e4 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fc6da376d2cfebe47beeb9b6012e76dd + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 0d30dbda1301a774b8aebe3f8cf5166b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 0d51f5e57ffbddc4dab2f2d0f5d8e693 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 0d435b29fdbd9d94596872e9a687c72f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0d16334b89c473140a16455f5e844d76 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 0dbf10465a29e4b4787bbba0c96cc49e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 1d54d617e69b06a4085e3437d19a8ec1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1d05957aea0599443aa2c58bbc8803fa + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1d556788c65961d42b1fd31b737f68d9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1d7c75f795e08e142ad02e49dcd278b3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1dbd23638c056cc4db7ce7c0ffffe53c + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 2d04120cd47500b42b576d8fc50efa24 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2d0407bf5407f744c8f011cba4cb86b9 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2dabee7358c284eec92b562cb3b53b1d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3da5cc8cd354c574ca745941ba4ad9cf + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3d685a1204170a94b8f0f36cf54af36d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 3d1c04c698b4f32438a69661b90ff58b + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: 4d689ec6eaca849e1ad9d0c95ebead75 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4df8a650b6a7fda42aeb0bdb5fa10f3b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4dda16911fca9d242b5a90fdbeeb6e70 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4d3b5b9aaef01c74895a6dc18e480b1f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 5d5191c4a9c294e16b6ab73b1ee5903b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 5dd11660d05b5284b8015c842079c2ac + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 5dc578039be8b9e48a2260d640ffcfc1 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 5ddfe3f68a823864e82ca5cdb1743773 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6d006ec4b7aedd84dbbb3c61c092f8a5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6db35459fed979449864b7408ce3c087 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6de3b18bb00cc1b4a8edb47f4eb9f643 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6db5b6c2e2bbb4f2093a7cd892ececca + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 6d5becbf770f24fa3ab1ceaba45fcefa + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 7d62736a417e747e481e3aa85951cd18 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 7d43a14c4a37b4bb6b05d4e19cc83113 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7d2966db771d5db42a2d1ce112d24fc6 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 7dcb4ddbbd1968048b5428e0767e99a7 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7d4d0e0112ea64faca8552764847178a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7d3e0f522f190c6428f5708fe9c2b54f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7dae0b4b8edfdb24583856f1f5ffedc4 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 7d0f877b344e04ac8811ce60899454af + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8df157b82479d4737b02e6c7d874e6ac + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8d826f81581c9314fb1c2cd886cd78c1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8df67cc9bb9ed5446be0842ca5c4593b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8dbb7875e3b67cc4691de1c7244f52b5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8d2d15c452f229044961b046a03acc5e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 9d915c00589d8b544a529437f76867fd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9d7335962dd88b844bdaac92a7cb8d85 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 9dc5c955cde7ee4419719729bfc5e63d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9da705c8378866146a1d4be7b2469378 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9d4be41a1bffd4c23a37e05fa34360ab + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bd40bfa012c28324fba8872c4f4d20c3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bde78f1bf0c6944a4bdc532a4b44a83e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bddde641d938bd647991358542895971 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cdd61e8bd7930487a862f4830fde1595 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cde8f26b56c58c14aa9ecbe1c4c1fc64 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cddec4710686f41f7beaf4c5498d7775 + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: cd1f8f3a161c61f409ecc79b7e8e9214 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cd5f7622140ff49eb852b473c2023e36 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: dd132683a85e3fd4a845e604b6926be3 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ddd3fe86b03da644faf6d52ae79646b6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: dda4cd5af4ab9d044b1b528d70e03461 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: dde47c6dc3068974989b83b6a1aad5bb + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: dd08e354312b3b14d8f2573ae830c513 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: dd89cf5b9246416f84610a006f916af7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ed42ef09e3f9dfb43b35a64941bf8153 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ed1b7893d94924e47b5453250efebf19 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fda5f0fbb824fb847a8635f96d681d0a + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: fdb58052921ef1f4189410f86979a6a7 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: fd195ad04b6fa184796119ad5988b133 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: fdd92da255d585542b130c7b54a29267 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fd0bdc9452bca4ca19611fd2e4d124b5 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: fddf43598c3cd694299b53f8835f4543 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0ed142f8c193d8544995bb04fd255893 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0e15be54a2ff1094d87b4d09fec1efb7 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 0e664c14e21228443a2dabd67f5bac9a + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 0e2c632532b3a794f8a2dd6ac26a5fd7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 1ed08fcfe991a4e61b48c60a770f4c66 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1ed24cbf5d2860441957a07bcfe4a792 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1ef73579605b35e42b04fbd37bb61d49 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1e081977eea5041a2904f91ad13efe0d + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 1e3b057af24249748ff873be7fafee47 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1edb915788e7843648eee8dd8ca4ef75 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 1efe8e716ef494b9cbd65a146ec41442 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 2e66618c2739718459e4ecd2253c4ba7 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 2e5859277eaf7cb4d89743840a2d3d44 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2e498d1c8094910479dc3e1b768306a4 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 2efbcc1bdf0f24034ba8c05a6c27a4dd + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3ee2ee0b593a44884b15c70b3e8c6d4e + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3e0697a5cab8e244d9739aef01dd26b9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3e5c71be91d55394f9078eb682cc716a + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 4e70120f73adeb848bdb0667aab892cf + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4e8296651f102d441aee2e6912d11d18 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 4e63d952a02aeb047b5e5ac1d380a189 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 4e34b833ea5898745829ede65be71e5b + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 4e2a065fa28e72148b0fa49a1061dba9 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 5e82ea3f59c643648a33cf33b32dba58 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 5e6cbd92db86f4b18aec3ed561671858 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 5e3da1e62a0059645b805a8466f34e71 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 5edd015314bfe9a4fbce969052b9445d + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 5efd8891fb64e3f48891ef664340f098 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6e001668808a3d64680522e4c8d582b0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6e59c59b81ab47f9b6ec5781fa725d2c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 6eec5a7503802354f86cca1239a27a89 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7e95903860ee1446caa72c7af2cbae48 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7e473d16764048e40986f54d84b14754 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7e0b0adf7ef381644b302ff611ad5bd6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 7efd550bed900704eaf6ac57a71e5217 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8e37fbabcde96134d9483275f9bfadb8 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8e38c6bb53e2b46608f8e75c6199e52e + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 8e19627191eff7c4aab77503bcb4edf9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8e0ad5d232dc745449a3552e51de13a1 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9e22756989fb446e9b83305bcdb917be + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9ec32d583d2203244b854643c78360d4 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 9e2899aaa5c6c4d32ab1242b4ef00e78 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ae083d3813dfa4696a8520124331b445 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ae885d1eef947854ebcd3e9504def7d6 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: ae2c33704b88a1049b1dde5b7eeedf31 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: aedfc62aaa42cdd4486201736cd94a4f + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: be326f78a1100464994d2e0c795843e0 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: be2d3aa1094c59b428c56f957927f0d6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ced260b15c0643b46af865dc5a990bc0 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: ce4952ef3b9a251478bb2582398dc3c5 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ce6cfc015fea75b40b0ffd1ef6cef222 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: de829d6924c7e9d45aefab65c1e3ac4f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: dec6792ffb8f42849bf01efe7cc42b8f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: deab7e342bb598049b9972454a8399e5 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: deffa0b2443a8e541a3cc51184373923 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eef3c133a95d3a943948b782ca07a7d9 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ee96c65aecd3358488867f1b879f82c8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ee87708a178fd1843843e762102d3864 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ee48f88c40d1b4b68a784312431358fa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: fec42e10ecaca094ba9237b4c4b68039 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: fe393ace9b354375a9cb14cdbbc28be4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fe3bca7069883484faaf819d36087910 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fe6b12bf7fa04104ba5db5fe93d58c70 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fecb0a1b8f0eaba4dafea99365118022 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 1f989a13f8ea5bf47a53d25432ab273d + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2ff2de85daeb5eb4d89018b2d9ae3b31 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 2f389ffee6d895c4387f665d01ae4145 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3fe9179f5a6af7349909c74b7b867309 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 3f5b5dff67a942289a9defa416b206f3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 3f4e276f17e6f3f48b1812c25c33bb2e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 4fb3415c5348e5c49955e222fd43a55c + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 4fc3fefa8bfcb6a4abe9fdd8e395e6cf + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 4f6f554bcbc4309489c3a11930042443 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 5fc799adb27d5ea45990b5522b75ddda + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 6f95ff39b42c3414d9a7ced2eea58274 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6fe57e3a83987472dac578463c2f9f0b + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 6f39e3308448bc24a96b87b8c481127e + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7f51dcfcc7da47046924768b8ec5770f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7f563126d330ac545af16af7a40108ef + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 7f1ed5d1134de134a9e052ef368e3a84 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: 8f8041211171e7645b190437280891a1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8f05276190cf498a8153f6cbe761d4e6 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 8f586378b4e144a9851e7b34d9b748ee + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8f8e8b461fdf4c140a82a526fc737dfb + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 8fbf575abd6dde145ac13a28b92a87a0 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9fd0999bcdb5b874882e73d08ff0d45d + loadInfoTS: 0 + stamp: 0 + type: 6 + UseGUIDsList: [] + - guid: 9ff0ab7be26787c49a4748d4bfa19e47 + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: 9f74e45208f5cc745ba4fa3fb8a90f0f + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: 9fa5eaff9bedba54cbd1317e167a48d6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: 9f867ffdff3ae264b96353b0719df9c5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: 9f0cf3d8d0aa0004a8e74c06041b4da9 + loadInfoTS: 0 + stamp: 0 + type: 4 + UseGUIDsList: [] + - guid: af50e16ff6b530b4b808183a3ae0722b + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: af117ed1f1e492146ab8ae6abba53761 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: afa31e083c38f8b42aa842d0ff23a5d3 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: afc3283198e155d48ae0c6b362f1e364 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: afc5afb485e7fdb4e94dec910509cc97 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: af971f07767ddb04ea65efe40387b2d0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: af78bfed03156364d94dfcc720a2bda9 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: af997721cb0304f89a2cb8bfdc122874 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: af5a8af43302ffa4b9b01c7802a80f9d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: af0de5139b50b1f4a88714afc3d53389 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: affec65379c5c4d4e934ab8463f489e4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: bf4039bad99e6e64aae35786e6a87ba6 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: bf82169728589cb40ab39408bc144c8f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: bf57a637da3548349a506614a871e4ed + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bfb743aebdc7ddb4298041d5051d44aa + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bfc7db270185c4d98be2d4a447c6a8f6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: bfdcaf3c3d98ddc44a145e1af5249af6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cf81c85f95fe47e1a27f6ae460cf182c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cfd3128966397944e873a233f4f264a0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cf057e6b953681f4eab6dbc42af88361 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cf153a3aea3d5da4f9d4cdbff0be8180 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cff5163b8f27b84408f7970c4c52d148 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cf365ff3b9f2fb14ca9de54f9c6a9223 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cf68c757fe7c1448cbf1af55c6461335 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cf98bb5ef3761114880c616d168265e8 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cfbc1140f1b12a7499429eadf5eab7b0 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: cfddd57e539341a4981d0e2b50cdf614 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cfaf3e1a463c5504db745aa7a49e13d5 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: cfff45d9ec693b247909d39c182922ff + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: df129be8fadab79498bd429a59bb98e4 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: df158d4fec0503e4ebf0b3d8164a07be + loadInfoTS: 0 + stamp: 0 + type: 3 + UseGUIDsList: [] + - guid: dfecfe02d5c2c6840957bc94374fda43 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: dffef66376be4fa480fb02b19edbe903 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: eff27321950d49942819a402f9f25bad + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ef537df234c885c4981598e6b2288e27 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: eff39985ab2cec643a0e68294913cee1 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: eff4a63e5fb72db4094c7dce6e6ae0ef + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ef77a268fd864a84082b16c573317d83 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: ef8bf8c0c2458534bafa1d0df270613d + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ef0cc6a746af63e4ea423a4527703c0f + loadInfoTS: 0 + stamp: 0 + type: 7 + UseGUIDsList: [] + - guid: ef4c220979ff26645b7376a8b92585f6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: efaca1b28f706e54b882129c59ae25b6 + loadInfoTS: 0 + stamp: 0 + type: 5 + UseGUIDsList: [] + - guid: ff0396b48e0de1744aa0230580b44a5c + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ff53b187d425daf4c8af886bf3931e02 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ffd3c4e17a9e1d54ba9f7ca169a4b98f + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: fff421b68a8bbe34cb5d340b2e2ba185 + loadInfoTS: 0 + stamp: 0 + type: 1 + UseGUIDsList: [] + - guid: fffa73b7de367464b897a3e1cc339ed4 + loadInfoTS: 0 + stamp: 0 + type: 9 + UseGUIDsList: [] + - guid: ff9c722ff799831408a3475fe7fd57a6 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + - guid: ff7e4aa09ded2724e9f12b92cd6c6f95 + loadInfoTS: 0 + stamp: 0 + type: 2 + UseGUIDsList: [] + priority: 3 + setting: + alternateColor: 1 + excludeTypes: 0 + groupMode: 0 + listIgnore: [] + pingRow: 1 + referenceCount: 1 + rowColor: + serializedVersion: 2 + rgba: 201326592 + ScanColor: + serializedVersion: 2 + rgba: 4284926976 + SelectedColor: {r: 0, g: 0, b: 1, a: 0.25} + showFileSize: 0 + showSelection: 0 + showUsedByClassed: 1 + sortMode: 0 + treeIndent: 10 + timeStamp: 0 diff --git a/Assets/FR2_Cache.asset.meta b/Assets/FR2_Cache.asset.meta new file mode 100644 index 0000000..9463686 --- /dev/null +++ b/Assets/FR2_Cache.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a01905a4456bdae4ab3f6c123fd56003 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2.meta b/Assets/Scripts/Editor/FR2.meta new file mode 100644 index 0000000..52dd7f1 --- /dev/null +++ b/Assets/Scripts/Editor/FR2.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7595d854267e4647b870b897feaa766 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Asset.cs b/Assets/Scripts/Editor/FR2/FR2_Asset.cs new file mode 100644 index 0000000..0b3f6b6 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Asset.cs @@ -0,0 +1,2226 @@ +//#define FR2_DEBUG_BRACE_LEVEL +//#define FR2_DEBUG_SYMBOL +// #define FR2_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace vietlabs.fr2 +{ + public enum FR2_AssetType + { + UNKNOWN, + FOLDER, + SCRIPT, + SCENE, + DLL, + REFERENCABLE, + BINARY_ASSET, + MODEL, + TERRAIN, + NON_READABLE + } + + public enum FR2_AssetState + { + NEW, + CACHE, + MISSING + } + + [Serializable] + public class FR2_Asset + { + // ------------------------------ CONSTANTS --------------------------- + + private static readonly HashSet SCRIPT_EXTENSIONS = new HashSet + { + ".cs", ".js", ".boo", ".h" + }; + + private static readonly HashSet REFERENCABLE_EXTENSIONS = new HashSet + { + ".anim", ".controller", ".mat", ".unity", ".guiskin", ".prefab", + ".overridecontroller", ".mask", ".rendertexture", ".cubemap", ".flare", + ".mat", ".prefab", ".physicsmaterial", ".fontsettings", ".asset", ".prefs", ".spriteatlas" + }; + + private static readonly HashSet IGNORE_GUIDS = new HashSet(); + + internal static readonly HashSet IGNORE_UNUSED_GUIDS = new HashSet + { + "00000000000000001000000000000000", // Assets + "00000000000000002000000000000000", // ProjectSettings/InputManager.asset + "00000000000000003000000000000000", // ProjectSettings/TagManager.asset + "00000000000000004000000000000000", // ProjectSettings/ProjectSettings.asset + "00000000000000005000000000000000", // Library/BuildPlayer.prefs + "00000000000000006000000000000000", // ProjectSettings/AudioManager.asset + "00000000000000007000000000000000", // ProjectSettings/TimeManager.asset + "00000000000000008000000000000000", // ProjectSettings/DynamicsManager.asset + "00000000000000009000000000000000", // ProjectSettings/QualitySettings.asset + + // Reserved + "00000000000000000000000000000000", + "0000000000000000a000000000000000", + "0000000000000000b000000000000000", // ProjectSettings/EditorBuildSettings.asset + "0000000000000000c000000000000000", // ProjectSettings/EditorSettings.asset + "0000000000000000d000000000000000", // Library/unity editor resources + "0000000000000000e000000000000000", // Library/unity default resources + "0000000000000000f000000000000000", // Resources/unity_builtin_extra, + "00000000000000005100000000000000", //Physics2DSettings.asset + "00000000000000006100000000000000", //GraphicsSettings.asset + "00000000000000007100000000000000", //ClusterInputManager.asset + "0000000000000000a100000000000000", //UnityConnectSettings.asset + "0000000000000000b100000000000000", //PresetManager.asset + "0000000000000000c100000000000000", //VFXManager.asset + + "00000000000000004100000000000000" //NavMeshAreas.asset + }; + + private static readonly HashSet SCRIPT_KEYWORDS = new HashSet + { + "abstract", "as", "base", "break", "case", "catch", "checked", "class", "const", "continue", + "default", "delegate", "do", "else", "enum", "event", "explicit", "extern", "finally", + "fixed", "for", "foreach", "goto", "if", "implicit", "in", "interface", "internal", "is", + "lock", "namespace", "new", "operator", "out", "override", "params", "private", + "protected", "public", "readonly", "ref", "return", "sealed", "sizeof", "stackalloc", "static", + "struct", "switch", "this", "throw", "try", "typeof", "unchecked", "unsafe", "using", "virtual", + "volatile", "while", + "define", "elif", "else", "endif", "endregion", "error", "if", "line", "pragma", "region", "undef", + "warning", + "bool", "byte", "char", "decimal", "double", "float", "int", "long", "object", "sbyte", "short", + "string", "uint", "ulong", "ushort", "void", + "var", "true", "false", "Rect", "RectOffset", "CustomEditor", "null", "UNITY_4_3", + "UNITY_5", "UNITY_4", "Type", "BindingFlags", "get", "set", "NonSerialized", "Serialized", "Package", + "GUIContent", "AppDomain" + }; + + private static readonly Dictionary HashClassesNormal = new Dictionary + { + {1, "UnityEngine.GameObject"}, + {2, "UnityEngine.Component"}, + {4, "UnityEngine.Transform"}, + {8, "UnityEngine.Behaviour"}, + {12, "UnityEngine.ParticleAnimator"}, + {15, "UnityEngine.EllipsoidParticleEmitter"}, + {20, "UnityEngine.Camera"}, + {21, "UnityEngine.Material"}, + {23, "UnityEngine.MeshRenderer"}, + {25, "UnityEngine.Renderer"}, + {26, "UnityEngine.ParticleRenderer"}, + {27, "UnityEngine.Texture"}, + {28, "UnityEngine.Texture2D"}, + {33, "UnityEngine.MeshFilter"}, + {41, "UnityEngine.OcclusionPortal"}, + {43, "UnityEngine.Mesh"}, + {45, "UnityEngine.Skybox"}, + {47, "UnityEngine.QualitySettings"}, + {48, "UnityEngine.Shader"}, + {49, "UnityEngine.TextAsset"}, + {50, "UnityEngine.Rigidbody2D"}, + {53, "UnityEngine.Collider2D"}, + {54, "UnityEngine.Rigidbody"}, + {56, "UnityEngine.Collider"}, + {57, "UnityEngine.Joint"}, + {58, "UnityEngine.CircleCollider2D"}, + {59, "UnityEngine.HingeJoint"}, + {60, "UnityEngine.PolygonCollider2D"}, + {61, "UnityEngine.BoxCollider2D"}, + {62, "UnityEngine.PhysicsMaterial2D"}, + {64, "UnityEngine.MeshCollider"}, + {65, "UnityEngine.BoxCollider"}, + {68, "UnityEngine.EdgeCollider2D"}, + {72, "UnityEngine.ComputeShader"}, + {74, "UnityEngine.AnimationClip"}, + {75, "UnityEngine.ConstantForce"}, + {81, "UnityEngine.AudioListener"}, + {82, "UnityEngine.AudioSource"}, + {83, "UnityEngine.AudioClip"}, + {84, "UnityEngine.RenderTexture"}, + {87, "UnityEngine.MeshParticleEmitter"}, + {88, "UnityEngine.ParticleEmitter"}, + {89, "UnityEngine.Cubemap"}, + {90, "Avatar"}, + {92, "UnityEngine.GUILayer"}, + {93, "UnityEngine.RuntimeAnimatorController"}, + {95, "UnityEngine.Animator"}, + {96, "UnityEngine.TrailRenderer"}, + {102, "UnityEngine.TextMesh"}, + {104, "UnityEngine.RenderSettings"}, + {108, "UnityEngine.Light"}, + {111, "UnityEngine.Animation"}, + {114, "UnityEngine.MonoBehaviour"}, + {115, "UnityEditor.MonoScript"}, + {117, "UnityEngine.Texture3D"}, + {119, "UnityEngine.Projector"}, + {120, "UnityEngine.LineRenderer"}, + {121, "UnityEngine.Flare"}, + {123, "UnityEngine.LensFlare"}, + {124, "UnityEngine.FlareLayer"}, + {128, "UnityEngine.Font"}, + {129, "UnityEditor.PlayerSettings"}, + {131, "UnityEngine.GUITexture"}, + {132, "UnityEngine.GUIText"}, + {133, "UnityEngine.GUIElement"}, + {134, "UnityEngine.PhysicMaterial"}, + {135, "UnityEngine.SphereCollider"}, + {136, "UnityEngine.CapsuleCollider"}, + {137, "UnityEngine.SkinnedMeshRenderer"}, + {138, "UnityEngine.FixedJoint"}, + {142, "UnityEngine.AssetBundle"}, + {143, "UnityEngine.CharacterController"}, + {144, "UnityEngine.CharacterJoint"}, + {145, "UnityEngine.SpringJoint"}, + {146, "UnityEngine.WheelCollider"}, + {152, "UnityEngine.MovieTexture"}, + {153, "UnityEngine.ConfigurableJoint"}, + {154, "UnityEngine.TerrainCollider"}, + {156, "UnityEngine.TerrainData"}, + {157, "UnityEngine.LightmapSettings"}, + {158, "UnityEngine.WebCamTexture"}, + {159, "UnityEditor.EditorSettings"}, + {162, "UnityEditor.EditorUserSettings"}, + {164, "UnityEngine.AudioReverbFilter"}, + {165, "UnityEngine.AudioHighPassFilter"}, + {166, "UnityEngine.AudioChorusFilter"}, + {167, "UnityEngine.AudioReverbZone"}, + {168, "UnityEngine.AudioEchoFilter"}, + {169, "UnityEngine.AudioLowPassFilter"}, + {170, "UnityEngine.AudioDistortionFilter"}, + {171, "UnityEngine.SparseTexture"}, + {180, "UnityEngine.AudioBehaviour"}, + {182, "UnityEngine.WindZone"}, + {183, "UnityEngine.Cloth"}, + {192, "UnityEngine.OcclusionArea"}, + {193, "UnityEngine.Tree"}, + {198, "UnityEngine.ParticleSystem"}, + {199, "UnityEngine.ParticleSystemRenderer"}, + {200, "UnityEngine.ShaderVariantCollection"}, + {205, "UnityEngine.LODGroup"}, + {207, "UnityEngine.Motion"}, + {212, "UnityEngine.SpriteRenderer"}, + {213, "UnityEngine.Sprite"}, + {215, "UnityEngine.ReflectionProbe"}, + {218, "UnityEngine.Terrain"}, + {220, "UnityEngine.LightProbeGroup"}, + {221, "UnityEngine.AnimatorOverrideController"}, + {222, "UnityEngine.CanvasRenderer"}, + {223, "UnityEngine.Canvas"}, + {224, "UnityEngine.RectTransform"}, + {225, "UnityEngine.CanvasGroup"}, + {226, "UnityEngine.BillboardAsset"}, + {227, "UnityEngine.BillboardRenderer"}, + {229, "UnityEngine.AnchoredJoint2D"}, + {230, "UnityEngine.Joint2D"}, + {231, "UnityEngine.SpringJoint2D"}, + {232, "UnityEngine.DistanceJoint2D"}, + {233, "UnityEngine.HingeJoint2D"}, + {234, "UnityEngine.SliderJoint2D"}, + {235, "UnityEngine.WheelJoint2D"}, + {246, "UnityEngine.PhysicsUpdateBehaviour2D"}, + {247, "UnityEngine.ConstantForce2D"}, + {248, "UnityEngine.Effector2D"}, + {249, "UnityEngine.AreaEffector2D"}, + {250, "UnityEngine.PointEffector2D"}, + {251, "UnityEngine.PlatformEffector2D"}, + {252, "UnityEngine.SurfaceEffector2D"}, + {258, "UnityEngine.LightProbes"}, + {290, "UnityEngine.AssetBundleManifest"}, + {1003, "UnityEditor.AssetImporter"}, + {1004, "UnityEditor.AssetDatabase"}, + {1006, "UnityEditor.TextureImporter"}, + {1007, "UnityEditor.ShaderImporter"}, + {1011, "UnityEngine.AvatarMask"}, + {1020, "UnityEditor.AudioImporter"}, + {1029, "UnityEditor.DefaultAsset"}, + {1032, "UnityEditor.SceneAsset"}, + {1035, "UnityEditor.MonoImporter"}, + {1040, "UnityEditor.ModelImporter"}, + {1042, "UnityEditor.TrueTypeFontImporter"}, + {1044, "UnityEditor.MovieImporter"}, + {1045, "UnityEditor.EditorBuildSettings"}, + {1050, "UnityEditor.PluginImporter"}, + {1051, "UnityEditor.EditorUserBuildSettings"}, + {1105, "UnityEditor.HumanTemplate"}, + {1110, "UnityEditor.SpeedTreeImporter"}, + {1113, "UnityEditor.LightmapParameters"} + }; + // private static Dictionary _HashClasses; + // private static Dictionary HashClasses + // { + // get{ + // if(_HashClasses == null) + // { + // _HashClasses = new Dictionary(); + // string s =""; + // foreach(var item in HashClassesNormal) + // { + // s+= "{"+ item.Key + ", \t" + "\""+item.Value.FullName+"\"},\n"; + // // Debug.Log(item.Value + " => " +f); + // _HashClasses.Add(item.Key, item.Value.ToString()); + // } + // Debug.Log(s); + + // } + // return _HashClasses; + // } + // } + private static readonly Dictionary HashClasses = new Dictionary(); + + private static readonly HashSet SCRIPT_SYMBOL = new HashSet + { + "class", "interface", "enum", "struct", "delegate" + }; + + public static float ignoreTS; + + + public static float lastRefreshTS = 0f; + + internal static Dictionary cacheImage = new Dictionary(); + private static GUIStyle fileSizeTextStyle; + + //public + private readonly List ScriptSymbols = null; // class, enum, delegate, interface definitions + + //public + private readonly List ScriptTokens = null; // possibly used symbols + + + private bool _isExcluded; + private Dictionary> _UseGUIDs; + + private float excludeTS; + + // ----------------------------- DRAW --------------------------------------- + + [NonSerialized] private GUIContent fileSizeText; + // [SerializeField] public string assetPath; + // [SerializeField] public string assetFolder; + // [SerializeField] public string assetName; + + // [SerializeField] public int cacheStamp; + // [SerializeField] public string extension; + // [SerializeField] public string fileInfoHash; + + // [SerializeField] public long fileSize; + + // public string guid; + + // [SerializeField] public bool inEditor; + // [SerializeField] public bool inPlugins; + // [SerializeField] public bool inResources; + // [SerializeField] public bool inStreamingAsset; + public string guid; + + //[NonSerialized] internal List UsedBy = new List(); + internal HashSet HashUsedByClassesIds = new HashSet(); + + + internal bool loaded; + [SerializeField] internal float loadInfoTS; + internal string m_assetFolder; + internal string m_assetName; + + + //mmmm + internal string m_assetPath; + + internal int m_cacheStamp; + internal string m_extension; + internal string m_fileInfoHash; + + internal long m_fileSize; + internal bool m_inEditor; + internal bool m_inPlugins; + internal bool m_inResources; + internal bool m_inStreamingAsset; + + internal bool m_isAssetFile; + + [NonSerialized] internal List ScriptUsage = new List(); + + public int stamp; + + //internal FR2_AssetType __type; + + //{ + // get { return __type; } + // set { __type = value; + // if (assetPath.EndsWith("paintjob.asset")) + // { + // Debug.Log(assetPath + ":" + value); + // } + // } + //} + + internal FR2_AssetState state; + public FR2_AssetType type; + internal Dictionary UsedByMap = new Dictionary(); + [SerializeField] private List UseGUIDsList = new List(); + + public FR2_Asset(string guid) + { + this.guid = guid; + + type = FR2_AssetType.UNKNOWN; + // UseGUIDs = new Dictionary>(); + //ScriptSymbols = new List(); + //ScriptTokens = new List(); + } + + internal string assetPath + { + get + { + checkLoadContent(); + return m_assetPath; + } + } + + internal string assetFolder + { + get + { + checkLoadContent(); + return m_assetFolder; + } + } + + internal string assetName + { + get + { + checkLoadContent(); + return m_assetName; + } + set { m_assetName = value; } + } + + internal int cacheStamp + { + get + { + checkLoadContent(); + return m_cacheStamp; + } + } + + internal string extension + { + get + { + checkLoadContent(); + return m_extension; + } + } + + internal string fileInfoHash + { + get + { + checkLoadContent(); + return m_fileInfoHash; + } + } + + internal long fileSize + { + get + { + checkLoadContent(); + return m_fileSize; + } + } + + + internal bool inEditor + { + get + { + checkLoadContent(); + return m_inEditor; + } + } + + internal bool inPlugins + { + get + { + checkLoadContent(); + return m_inPlugins; + } + } + + internal bool inResources + { + get + { + checkLoadContent(); + return m_inResources; + } + } + + internal bool inStreamingAsset + { + get + { + checkLoadContent(); + return m_inStreamingAsset; + } + } + + public Dictionary> UseGUIDs + { + get + { + if (_UseGUIDs != null) + { + return _UseGUIDs; + } + + _UseGUIDs = new Dictionary>(UseGUIDsList.Count); + for (var i = 0; i < UseGUIDsList.Count; i++) + { + string guid = UseGUIDsList[i].guid; + if (_UseGUIDs.ContainsKey(guid)) + { + for (var j = 0; j < UseGUIDsList[i].ids.Count; j++) + { + int val = UseGUIDsList[i].ids[j]; + if (_UseGUIDs[guid].Contains(val)) + { + continue; + } + + _UseGUIDs[guid].Add(UseGUIDsList[i].ids[j]); + } + } + else + { + _UseGUIDs.Add(guid, new HashSet(UseGUIDsList[i].ids)); + } + } + + return _UseGUIDs; + } + } + + // ------------------------------- GETTERS ----------------------------- + + internal string parentFolderPath + { + get { return assetPath.Substring(0, assetPath.LastIndexOf('/')); } + } + + internal bool IsFolder + { + get { return type == FR2_AssetType.FOLDER; } + } + + internal bool IsScript + { + get { return type == FR2_AssetType.SCRIPT; } + } + + internal bool IsExcluded + { + get + { + if (excludeTS >= ignoreTS) + { + return _isExcluded; + } + + excludeTS = ignoreTS; + + _isExcluded = false; + + HashSet h = FR2_Setting.IgnoreAsset; + foreach (string item in FR2_Setting.IgnoreAsset) + { + if (assetPath.StartsWith(item)) + { + _isExcluded = true; + break; + } + } + + return _isExcluded; + } + } + + internal bool IsReferencable + { + get { return type == FR2_AssetType.REFERENCABLE || type == FR2_AssetType.SCENE; } + } + + internal bool IsBinaryAsset + { + get + { + return type == FR2_AssetType.BINARY_ASSET || + type == FR2_AssetType.MODEL || + type == FR2_AssetType.TERRAIN; + } + } + + internal bool IsMissing + { + get { return state == FR2_AssetState.MISSING; } + } + + private void checkLoadContent() + { + LoadAssetInfo(); + } + + public void AddUsedBy(string guid, FR2_Asset asset) + { + if (UsedByMap.ContainsKey(guid)) + { + return; + } + + UsedByMap.Add(guid, asset); + HashSet output; + if (HashUsedByClassesIds == null) + { + HashUsedByClassesIds = new HashSet(); + } + + if (asset.UseGUIDs.TryGetValue(this.guid, out output)) + { + foreach (int item in output) + { + HashUsedByClassesIds.Add(item); + } + } + + // int classId = HashUseByClassesIds + } + + public int UsageCount() + { + return UsedByMap.Count; + } + + public override string ToString() + { + return string.Format("FR2_Asset[{0}]", assetName); + } + + //--------------------------------- STATIC ---------------------------- + + internal static bool IsValidGUID(string guid) + { + if (IGNORE_GUIDS.Contains(guid)) + { + return false; + } + + string p = AssetDatabase.GUIDToAssetPath(guid); + if (p != null && !FR2_Cache.ASSET_ROOT_ALLOW.Any(x => p.StartsWith(x, StringComparison.Ordinal))) + { + return false; // Asset can be missing but can not be at invalid path + } + + return p != FR2_Cache.CachePath; + } + + internal void MarkAsDirty() + { + //Debug.Log("Mark Dirty : " + assetName + ":" + type); + m_fileInfoHash = null; + m_cacheStamp = 0; + stamp = 0; + loaded = false; + } + + // --------------------------------- APIs ------------------------------ + + internal void GuessAssetType() + { + if (SCRIPT_EXTENSIONS.Contains(m_extension)) + { + type = FR2_AssetType.SCRIPT; + } + else if (REFERENCABLE_EXTENSIONS.Contains(m_extension)) + { + bool isUnity = m_extension == ".unity"; + type = isUnity ? FR2_AssetType.SCENE : FR2_AssetType.REFERENCABLE; + + if (m_extension == ".asset" || isUnity || m_extension == ".spriteatlas") + { + var buffer = new byte[5]; + + try + { + FileStream stream = File.OpenRead(m_assetPath); + stream.Read(buffer, 0, 5); + stream.Close(); + } +#if FR2_DEBUG + catch (Exception e) + { + Debug.LogWarning("Guess Asset Type error :: " + e + "\n" + m_assetPath); +#else + catch + { +#endif + state = FR2_AssetState.MISSING; + return; + } + + string str = string.Empty; + foreach (byte t in buffer) + { + str += (char) t; + } + + if (str != "%YAML") + { + type = FR2_AssetType.BINARY_ASSET; + } + } + } + else if (m_extension == ".fbx") + { + type = FR2_AssetType.MODEL; + } + else if (m_extension == ".dll") + { + type = FR2_AssetType.DLL; + } + else + { + type = FR2_AssetType.NON_READABLE; + } + } + + internal void LoadAssetInfo() + { + if (string.IsNullOrEmpty(m_assetPath)) + { + loadInfoTS = lastRefreshTS - 1; + } + + if (loadInfoTS >= lastRefreshTS) + { + return; + } + +#if FR2_DEBUG + Debug.LogWarning("Refreshing ... " + loadInfoTS + ":" + AssetDatabase.GUIDToAssetPath(guid)); +#endif + + loadInfoTS = lastRefreshTS; + + m_assetPath = AssetDatabase.GUIDToAssetPath(guid); + string assetPath = m_assetPath; +#if FR2_DEBUG + Debug.Log("LoadAssetInfo: " + m_assetPath); +#endif + + if (string.IsNullOrEmpty(assetPath)) + { + state = FR2_AssetState.MISSING; + return; + } + +#if FR2_DEBUG + // if (!assetPath.StartsWith("Assets/", StringComparison.Ordinal)) + if (!FR2_Cache.ASSET_ROOT_ALLOW.Any(x=> assetPath.StartsWith(x, StringComparison.Ordinal))) + { + + Debug.LogWarning("Something wrong ! Should never be here !\n" + assetPath + "\n" + guid); + + return; + } +#endif + + var info = new FileInfo(assetPath); + m_assetName = info.Name; + + string assetName = m_assetName; + m_extension = info.Extension.ToLower(); + m_assetFolder = assetPath.Substring(7, Mathf.Max(0, assetPath.Length - assetName.Length - 7)); + + int assetTime = FR2_Unity.Epoch(info.LastWriteTime); + + // check meta timestamp as well + var metaInfo = new FileInfo(assetPath + ".meta"); + int metaTime = FR2_Unity.Epoch(metaInfo.LastWriteTime); + + // 7 = "Assets/".Length + loaded = stamp == Mathf.Max(metaTime, assetTime); + + if (Directory.Exists(info.FullName)) + { + type = FR2_AssetType.FOLDER; + } + else if (File.Exists(info.FullName)) + { + if (type == FR2_AssetType.UNKNOWN) + { + GuessAssetType(); + } + + m_fileSize = info.Length; + m_inEditor = assetPath.Contains("/Editor/") || assetPath.Contains("/Editor Default Resources/"); + m_inResources = assetPath.Contains("/Resources/"); + m_inStreamingAsset = assetPath.Contains("/StreamingAssets/"); + m_inPlugins = assetPath.Contains("/Plugins/"); + + m_fileInfoHash = info.Length + info.Extension; + m_isAssetFile = assetPath.EndsWith(".asset", StringComparison.Ordinal); + } + else + { + state = FR2_AssetState.MISSING; + } + } + + internal void LoadContent(bool force) + { + LoadAssetInfo(); + + if (IsMissing || type == FR2_AssetType.NON_READABLE) + { + return; + } + + if (type == FR2_AssetType.DLL) + { +#if FR2_DEBUG + Debug.LogWarning("Parsing DLL not yet supportted "); +#endif + return; + } + + if (loaded && !force) + { + return; + } + + // Check for file / folder changes & validate if file / folder exist + int newStamp = stamp; + var exist = true; + + FileSystemInfo info; + + if (IsFolder) + { + info = new DirectoryInfo(assetPath); + } + else + { + info = new FileInfo(assetPath); + } + + exist = info.Exists; + int assetTime = FR2_Unity.Epoch(info.LastWriteTime); + + // check meta timestamp as well + var metaInfo = new FileInfo(assetPath + ".meta"); + int metaTime = FR2_Unity.Epoch(metaInfo.LastWriteTime); + + newStamp = Mathf.Max(assetTime, metaTime); + + if (!exist) + { + state = FR2_AssetState.MISSING; + return; + } + + loaded = true; + if (newStamp == stamp && !force) + { +#if FR2_DEBUG + Debug.Log("Unchanged : " + stamp + ":" + assetName + ":" + type); +#endif + return; // nothing changed + } + + stamp = newStamp; + + ClearUseGUIDs(); + + + if (IsFolder) + { + LoadFolder(); + } + else if (IsReferencable) + { + // LoadYAML(); + LoadYAML2(); + } + else if (IsBinaryAsset) + { + LoadBinaryAsset(); + } + else if (IsScript) + { + // LoadScript(); + } + } + + internal void AddUseGUID(string fguid, int fFileId = -1, bool checkExist = true) + { + // if (checkExist && UseGUIDs.ContainsKey(fguid)) return; + if (!IsValidGUID(fguid)) + { + return; + } + + if (!UseGUIDs.ContainsKey(fguid)) + { + UseGUIDsList.Add(new Classes + { + guid = fguid, + ids = new List() + }); + UseGUIDs.Add(fguid, new HashSet()); + } + + if (fFileId != -1) + { + if (UseGUIDs[fguid].Contains(fFileId)) + { + return; + } + + UseGUIDs[fguid].Add(fFileId); + Classes i = UseGUIDsList.FirstOrDefault(x => x.guid == fguid); + if (i != null) + { + i.ids.Add(fFileId); + } + } + } + + // ----------------------------- STATIC --------------------------------------- + + internal static int SortByExtension(FR2_Asset a1, FR2_Asset a2) + { + if (a1 == null) + { + return -1; + } + + if (a2 == null) + { + return 1; + } + + int result = string.Compare(a1.extension, a2.extension, StringComparison.Ordinal); + return result == 0 ? string.Compare(a1.assetName, a2.assetName, StringComparison.Ordinal) : result; + } + + internal static List FindUsage(FR2_Asset asset) + { + if (asset == null) + { + return null; + } + + List refs = FR2_Cache.Api.FindAssets(asset.UseGUIDs.Keys.ToArray(), true); + + //if (asset.ScriptUsage != null) + //{ + // for (var i = 0; i < asset.ScriptUsage.Count; i++) + // { + // var symbolList = FR2_Cache.Api.FindAllSymbol(asset.ScriptUsage[i]); + // if (symbolList.Contains(asset)) continue; + + // var symbol = symbolList[0]; + // if (symbol == null || refs.Contains(symbol)) continue; + // refs.Add(symbol); + // } + //} + + return refs; + } + + internal static List FindUsedBy(FR2_Asset asset) + { + return asset.UsedByMap.Values.ToList(); + } + + internal static List FindUsageGUIDs(FR2_Asset asset, bool includeScriptSymbols) + { + var result = new HashSet(); + if (asset == null) + { + Debug.LogWarning("Asset invalid : " + asset.assetName); + return result.ToList(); + } + + // for (var i = 0;i < asset.UseGUIDs.Count; i++) + // { + // result.Add(asset.UseGUIDs[i]); + // } + foreach (KeyValuePair> item in asset.UseGUIDs) + { + result.Add(item.Key); + } + + //if (!includeScriptSymbols) return result.ToList(); + + //if (asset.ScriptUsage != null) + //{ + // for (var i = 0; i < asset.ScriptUsage.Count; i++) + // { + // var symbolList = FR2_Cache.Api.FindAllSymbol(asset.ScriptUsage[i]); + // if (symbolList.Contains(asset)) continue; + + // var symbol = symbolList[0]; + // if (symbol == null || result.Contains(symbol.guid)) continue; + + // result.Add(symbol.guid); + // } + //} + + return result.ToList(); + } + + internal static List FindUsedByGUIDs(FR2_Asset asset) + { + return asset.UsedByMap.Keys.ToList(); + } + + internal float Draw(Rect r, bool highlight, bool drawPath = true, IWindow window = null, + bool showFileSize = false) + { +//, bool hasMouse + bool singleLine = r.height <= 18f; + float rw = r.width; + bool selected = FR2_Selection.IsSelect(guid); + + r.height = 16f; + bool hasMouse = Event.current.type == EventType.MouseUp && r.Contains(Event.current.mousePosition); + + if (hasMouse && Event.current.button == 1) + { + var menu = new GenericMenu(); + if (extension == ".prefab") + { + menu.AddItem(new GUIContent("Edit in Scene"), false, EditPrefab); + } + + menu.AddItem(new GUIContent("Open"), false, Open); + menu.AddItem(new GUIContent("Ping"), false, Ping); + menu.AddItem(new GUIContent(guid), false, CopyGUID); + //menu.AddItem(new GUIContent("Reload"), false, Reload); + + menu.AddSeparator(string.Empty); + + + if (selected) + { + menu.AddDisabledItem(new GUIContent("Add to Selection")); + menu.AddItem(new GUIContent("Remove from Selection"), false, RemoveFromSelection); + } + else + { + menu.AddItem(new GUIContent("Add to Selection"), false, AddToSelection); + menu.AddDisabledItem(new GUIContent("Remove from Selection")); + } + + menu.AddItem(new GUIContent("Copy path"), false, CopyAssetPath); + menu.AddItem(new GUIContent("Copy full path"), false, CopyAssetPathFull); + + //if (IsScript) + //{ + // menu.AddSeparator(string.Empty); + // AddArray(menu, ScriptSymbols, "+ ", "Definitions", "No Definition", false); + + // menu.AddSeparator(string.Empty); + // AddArray(menu, ScriptUsage, "-> ", "Depends", "No Dependency", true); + //} + + menu.ShowAsContext(); + Event.current.Use(); + } + + if (IsMissing) + { + if (!singleLine) + { + r.y += 16f; + } + + if (Event.current.type != EventType.Repaint) + { + return 0; + } + + GUI.Label(r, "(missing) " + guid, EditorStyles.whiteBoldLabel); + return 0; + } + + //if (IsScript) + //{ + // var w = 40f; + // var rr = r; + // rr.x += r.width - w; + // rr.width = w; + + // GUI.Label(rr, + // (ScriptSymbols != null ? "" + ScriptSymbols.Count : "-") + "|" + + // (ScriptUsage != null ? "" + ScriptUsage.Count : "-")); + //} + + //var usageRect = LeftRect(20f, ref r); + + Rect iconRect = LeftRect(16f, ref r); + if (Event.current.type == EventType.Repaint) + { + Texture icon = AssetDatabase.GetCachedIcon(assetPath); + if (icon != null) + { + GUI.DrawTexture(iconRect, icon); + } + } + + + if (Event.current.type == EventType.MouseDown && Event.current.button == 0) + { + Rect pingRect = FR2_Setting.PingRow ? new Rect(0, r.y, r.x + r.width, r.height) : iconRect; + if (pingRect.Contains(Event.current.mousePosition)) + { + if (Event.current.control || Event.current.command) + { + if (selected) + { + RemoveFromSelection(); + } + else + { + AddToSelection(); + } + + if (window != null) + { + window.Repaint(); + } + } + + Ping(); + //Event.current.Use(); + } + } + + if (Event.current.type != EventType.Repaint) + { + return 0; + } + + if (UsedByMap != null && UsedByMap.Count > 0) + { + var str = new GUIContent(UsedByMap.Count.ToString()); + Rect countRect = iconRect; + countRect.xMin -= 16f; + GUI.Label(countRect, str); + } + + float pathW = drawPath ? EditorStyles.miniLabel.CalcSize(new GUIContent(assetFolder)).x : 0; + float nameW = EditorStyles.boldLabel.CalcSize(new GUIContent(assetName)).x; + Color cc = FR2_Cache.Api.setting.SelectedColor; + + if (singleLine) + { + Rect lbRect = LeftRect(pathW + nameW, ref r); + + if (highlight || selected) + { + Color c = GUI.color; + GUI.color = cc; + GUI.DrawTexture(lbRect, EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + if (drawPath) + { + GUI.Label(LeftRect(pathW, ref lbRect), assetFolder, EditorStyles.miniLabel); + lbRect.xMin -= 4f; + GUI.Label(lbRect, assetName, EditorStyles.boldLabel); + } + else + { + GUI.Label(lbRect, assetName); + } + } + else + { + if (drawPath) + { + GUI.Label(new Rect(r.x, r.y + 16f, r.width, r.height), assetFolder, EditorStyles.miniLabel); + } + + Rect lbRect = LeftRect(nameW, ref r); + if (highlight || selected) + { + Color c = GUI.color; + GUI.color = cc; + GUI.DrawTexture(lbRect, EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + GUI.Label(lbRect, assetName, EditorStyles.boldLabel); + } + + if (window != null && window.IsFocusingDuplicate) + { + RightRect(100f, ref r); + } + + if (showFileSize) + { + RightRect(10f, ref r); //margin + Rect fsRect = RightRect(40f, ref r); // filesize label + + if (fileSizeText == null) + { + fileSizeText = new GUIContent(FR2_Helper.GetfileSizeString(fileSize)); + } + + if (fileSizeTextStyle == null) + { + fileSizeTextStyle = new GUIStyle(EditorStyles.miniLabel) {alignment = TextAnchor.MiddleRight}; + } + + GUI.Label(fsRect, fileSizeText, fileSizeTextStyle); + } + + + //var margin = 15; + //float sub = window != null && window.IsFocusingDuplicate ? 100 : 40; + //var re = new Rect(r.x + r.width - sub, r.y, 20, r.height); + + if (FR2_Setting.ShowUsedByClassed && HashUsedByClassesIds != null) + { + foreach (int item in HashUsedByClassesIds) + { + if (!HashClassesNormal.ContainsKey(item)) + { + continue; + } + + string name = HashClassesNormal[item]; + Type t = null; + if (!HashClasses.TryGetValue(item, out t)) + { + t = FR2_Unity.GetType(name); + HashClasses.Add(item, t); + } + + //GUIContent content = new GUIContent(EditorGUIUtility.ObjectContent(null, t).image, name); + GUIContent content; + if (!cacheImage.TryGetValue(name, out content)) + { + content = new GUIContent(EditorGUIUtility.ObjectContent(null, t).image, name); + cacheImage.Add(name, content); + } + + GUI.Label(RightRect(15f, ref r), content, fileSizeTextStyle); +// GUI.Label(re, content); +// re.x -= margin; + // Debug.Log(item); + } + } + + if (Event.current.type == EventType.Repaint) + { + return rw < pathW + nameW ? 32f : 18f; + } + + return r.height; + } + + private Rect LeftRect(float w, ref Rect rect) + { + rect.x += w; + rect.width -= w; + return new Rect(rect.x - w, rect.y, w, rect.height); + } + + private Rect RightRect(float w, ref Rect rect) + { + rect.width -= w; + return new Rect(rect.x + rect.width, rect.y, w, rect.height); + } + + internal GenericMenu AddArray(GenericMenu menu, List list, string prefix, string title, + string emptyTitle, bool showAsset, int max = 10) + { + //if (list.Count > 0) + //{ + // if (list.Count > max) + // { + // prefix = string.Format("{0} _{1}/", title, list.Count) + prefix; + // } + + // //for (var i = 0; i < list.Count; i++) + // //{ + // // var def = list[i]; + // // var suffix = showAsset ? "/" + FR2_Cache.Api.FindSymbol(def).assetName : string.Empty; + // // menu.AddItem(new GUIContent(prefix + def + suffix), false, () => OpenScript(def)); + // //} + //} + //else + { + menu.AddItem(new GUIContent(emptyTitle), true, null); + } + + return menu; + } + + internal void CopyGUID() + { + EditorGUIUtility.systemCopyBuffer = guid; + Debug.Log(guid); + } + + internal void CopyName() + { + EditorGUIUtility.systemCopyBuffer = assetName; + Debug.Log(assetName); + } + + internal void CopyAssetPath() + { + EditorGUIUtility.systemCopyBuffer = assetPath; + Debug.Log(assetPath); + } + + internal void CopyAssetPathFull() + { + string fullName = new FileInfo(assetPath).FullName; + EditorGUIUtility.systemCopyBuffer = fullName; + Debug.Log(fullName); + } + + internal void AddToSelection() + { + if (!FR2_Selection.IsSelect(guid)) + { + FR2_Selection.AppendSelection(guid); + } + + //var list = Selection.objects.ToList(); + //var obj = FR2_Unity.LoadAssetAtPath(assetPath); + //if (!list.Contains(obj)) + //{ + // list.Add(obj); + // Selection.objects = list.ToArray(); + //} + } + + internal void RemoveFromSelection() + { + if (FR2_Selection.IsSelect(guid)) + { + FR2_Selection.RemoveSelection(guid); + } + } + + internal void Ping() + { + EditorGUIUtility.PingObject( + AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)) + ); + } + + internal void Open() + { + AssetDatabase.OpenAsset( + AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)) + ); + } + + internal void EditPrefab() + { + Object prefab = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)); + Object.Instantiate(prefab); + } + + //internal void OpenScript(string definition) + //{ + // var asset = FR2_Cache.Api.FindSymbol(definition); + // if (asset == null) return; + + // EditorGUIUtility.PingObject( + // AssetDatabase.LoadAssetAtPath(asset.assetPath, typeof(Object)) + // ); + //} + + internal void Reload() + { + LoadAssetInfo(); + LoadContent(true); + } + + // ----------------------------- SERIALIZED UTILS --------------------------------------- + + private static SerializedProperty[] xGetSerializedProperties(Object go, bool processArray) + { + var so = new SerializedObject(go); + so.Update(); + var result = new List(); + + SerializedProperty iterator = so.GetIterator(); + while (iterator.NextVisible(true)) + { + SerializedProperty copy = iterator.Copy(); + + if (processArray && iterator.isArray) + { + result.AddRange(xGetSOArray(copy)); + } + else + { + result.Add(copy); + } + } + + return result.ToArray(); + } + + internal static List xGetSOArray(SerializedProperty prop) + { + int size = prop.arraySize; + var result = new List(); + + for (var i = 0; i < size; i++) + { + SerializedProperty p = prop.GetArrayElementAtIndex(i); + + if (p.isArray) + { + result.AddRange(xGetSOArray(p.Copy())); + } + else + { + result.Add(p.Copy()); + } + } + + return result; + } + + // ----------------------------- LOAD ASSETS --------------------------------------- + + internal void LoadGameObject(GameObject go) + { + Component[] compList = go.GetComponentsInChildren(); + for (var i = 0; i < compList.Length; i++) + { + LoadSerialized(compList[i]); + } + } + + internal void LoadSerialized(Object target) + { + SerializedProperty[] props = xGetSerializedProperties(target, true); + + for (var i = 0; i < props.Length; i++) + { + if (props[i].propertyType != SerializedPropertyType.ObjectReference) + { + continue; + } + + Object refObj = props[i].objectReferenceValue; + if (refObj == null) + { + continue; + } + + string refGUID = AssetDatabase.AssetPathToGUID( + AssetDatabase.GetAssetPath(refObj) + ); + + //Debug.Log("Found Reference BinaryAsset <" + assetPath + "> : " + refGUID + ":" + refObj); + AddUseGUID(refGUID); + } + } + + internal void LoadTerrainData(TerrainData terrain) + { +#if UNITY_2018_3_OR_NEWER + TerrainLayer[] arr0 = terrain.terrainLayers; + for (var i = 0; i < arr0.Length; i++) + { + string aPath = AssetDatabase.GetAssetPath(arr0[i]); + string refGUID = AssetDatabase.AssetPathToGUID(aPath); + AddUseGUID(refGUID); + } +#endif + + + DetailPrototype[] arr = terrain.detailPrototypes; + + for (var i = 0; i < arr.Length; i++) + { + string aPath = AssetDatabase.GetAssetPath(arr[i].prototypeTexture); + string refGUID = AssetDatabase.AssetPathToGUID(aPath); + AddUseGUID(refGUID); + } + + TreePrototype[] arr2 = terrain.treePrototypes; + for (var i = 0; i < arr2.Length; i++) + { + string aPath = AssetDatabase.GetAssetPath(arr2[i].prefab); + string refGUID = AssetDatabase.AssetPathToGUID(aPath); + AddUseGUID(refGUID); + } + + FR2_Unity.TerrainTextureData[] arr3 = FR2_Unity.GetTerrainTextureDatas(terrain); + for (var i = 0; i < arr3.Length; i++) + { + FR2_Unity.TerrainTextureData texs = arr3[i]; + for (var k = 0; k < texs.textures.Length; k++) + { + Texture2D tex = texs.textures[k]; + if (tex == null) + { + continue; + } + + string aPath = AssetDatabase.GetAssetPath(tex); + if (string.IsNullOrEmpty(aPath)) + { + continue; + } + + string refGUID = AssetDatabase.AssetPathToGUID(aPath); + if (string.IsNullOrEmpty(refGUID)) + { + continue; + } + + AddUseGUID(refGUID); + } + } + } + + private void ClearUseGUIDs() + { +#if FR2_DEBUG + Debug.Log("ClearUseGUIDs: " + assetPath); +#endif + + UseGUIDs.Clear(); + UseGUIDsList.Clear(); + } + + internal void LoadBinaryAsset() + { + ClearUseGUIDs(); + + //var assets = AssetDatabase.LoadAllAssetsAtPath(assetPath); + //for (var i = 0;i < assets.Length; i++){ + // Debug.Log(i + " : "+ assets[i].name + ":" + assets[i].GetType() + "\n" + + // //EditorUtility.GetAssetPath(assets[i]) + "\n" + // assets[i].GetHashCode() + // ); + //} + + Object assetData = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)); + if (assetData is GameObject) + { + type = FR2_AssetType.MODEL; + LoadGameObject(assetData as GameObject); + } + else if (assetData is TerrainData) + { + type = FR2_AssetType.TERRAIN; + LoadTerrainData(assetData as TerrainData); + } + + //Debug.Log("LoadBinaryAsset :: " + assetData + ":" + type); + + assetData = null; + FR2_Unity.UnloadUnusedAssets(); + } + + internal void LoadYAML() + { + if (!File.Exists(assetPath)) + { + state = FR2_AssetState.MISSING; + return; + } + + string text = string.Empty; + try + { + text = File.ReadAllText(assetPath); + } +#if FR2_DEBUG + catch (Exception e) + { + Debug.LogWarning("Guess Asset Type error :: " + e + "\n" + assetPath); +#else + catch + { +#endif + state = FR2_AssetState.MISSING; + return; + } + +#if FR2_DEBUG + Debug.Log("LoadYAML: " + assetPath); +#endif + + //if(assetPath.Contains("Myriad Pro - Bold SDF")) + //{ + // Debug.Log("no ne"); + //} + // PERFORMANCE HOG! + // var matches = Regex.Matches(text, @"\bguid: [a-f0-9]{32}\b"); + MatchCollection matches = Regex.Matches(text, @".*guid: [a-f0-9]{32}.*\n"); + + foreach (Match match in matches) + { + Match guidMatch = Regex.Match(match.Value, @"\bguid: [a-f0-9]{32}\b"); + string refGUID = guidMatch.Value.Replace("guid: ", string.Empty); + + Match fileIdMatch = Regex.Match(match.Value, @"\bfileID: ([0-9]*).*"); + int id = -1; + try + { + id = int.Parse(fileIdMatch.Groups[1].Value) / 100000; + } + catch { } + + AddUseGUID(refGUID, id); + } + + //var idx = text.IndexOf("guid: "); + //var counter=0; + //while (idx != -1) + //{ + // var guid = text.Substring(idx + 6, 32); + // if (UseGUIDs.Contains(guid)) continue; + // AddUseGUID(guid); + + // idx += 39; + // if (idx > text.Length-40) break; + + // //Debug.Log(assetName + ":" + guid); + // idx = text.IndexOf("guid: ", idx + 39); + // if (counter++ > 100) break; + //} + + //if (counter > 100){ + // Debug.LogWarning("Never finish on " + assetName); + //} + } + + internal void LoadYAML2() + { + if (!File.Exists(assetPath)) + { + state = FR2_AssetState.MISSING; + return; + } + + if (m_isAssetFile) + { + var s = AssetDatabase.LoadAssetAtPath(assetPath); + if (s != null) + { + return; + } + } + + // var text = string.Empty; + try + { + using (var sr = new StreamReader(assetPath)) + { + while (sr.Peek() >= 0) + { + string line = sr.ReadLine(); + int index = line.IndexOf("guid: "); + if (index < 0) + { + continue; + } + + string refGUID = line.Substring(index + 6, 32); + int indexFileId = line.IndexOf("fileID: "); + int fileID = -1; + if (indexFileId >= 0) + { + indexFileId += 8; + string fileIDStr = + line.Substring(indexFileId, line.IndexOf(',', indexFileId) - indexFileId); + try + { + fileID = int.Parse(fileIDStr) / 100000; + } + catch { } + } + + AddUseGUID(refGUID, fileID); + } + } + +#if FR2_DEBUG + if (UseGUIDsList.Count > 0) + { + Debug.Log(assetPath + ":" + UseGUIDsList.Count); + } +#endif + } +#if FR2_DEBUG + catch (Exception e) + { + Debug.LogWarning("Guess Asset Type error :: " + e + "\n" + assetPath); +#else + catch + { +#endif + state = FR2_AssetState.MISSING; + } + } + + internal void LoadFolder() + { + if (!Directory.Exists(assetPath)) + { + state = FR2_AssetState.MISSING; + return; + } + + try + { + string[] files = Directory.GetFiles(assetPath); + string[] dirs = Directory.GetDirectories(assetPath); + + foreach (string f in files) + { + if (f.EndsWith(".meta", StringComparison.Ordinal)) + { + continue; + } + + string fguid = AssetDatabase.AssetPathToGUID(f); + if (string.IsNullOrEmpty(fguid)) + { + continue; + } + + // AddUseGUID(fguid, true); + AddUseGUID(fguid); + } + + foreach (string d in dirs) + { + string fguid = AssetDatabase.AssetPathToGUID(d); + if (string.IsNullOrEmpty(fguid)) + { + continue; + } + + // AddUseGUID(fguid, true); + AddUseGUID(fguid); + } + } +#if FR2_DEBUG + catch (Exception e) + { + Debug.LogWarning("LoadFolder() error :: " + e + "\n" + assetPath); +#else + catch + { +#endif + state = FR2_AssetState.MISSING; + } + + //Debug.Log("Load Folder :: " + assetName + ":" + type + ":" + UseGUIDs.Count); + } + + internal void LoadScript() + { + ScriptSymbols.Clear(); + ScriptTokens.Clear(); + + string text = string.Empty; + + if (!File.Exists(assetPath)) + { + state = FR2_AssetState.MISSING; + return; + } + + try + { + text = File.ReadAllText(assetPath); + } +#if FR2_DEBUG + catch (Exception e) + { + Debug.LogWarning("LoadScript() error :: " + e + "\n" + assetPath); +#else + catch + { +#endif + state = FR2_AssetState.MISSING; + return; + } + + int idx = -1; + int l = text.Length; + + int matchIdx; + int matchCount; + //bool isSymbol = false; + + //Debug.Log("loading ... " + assetName); + //string lastKeyword = null; + //string lastWord = null; + var currentScope = new List(); + var braceLevel = 0; + + var stMap = new Dictionary(); + + while (++idx < l) + { + char c = text[idx]; + + // Skip comments + if (c == '/' && idx < l - 1) + { + char c1 = text[idx + 1]; + + if (c1 == '/') + { + //line comment + idx++; + + while (++idx < l) + { + c1 = text[idx]; + if (c1 == '\r' || c1 == '\n') + { + break; + } + } + } + else if (c1 == '*') + { + //block comment + idx++; + + while (++idx < l) + { + c1 = text[idx]; + if (c1 != '*' || idx == l - 1) + { + continue; + } + + c1 = text[idx + 1]; + if (c1 == '/') + { + break; + } + } + } + } + + // Skip strings + if (c == '"' && idx < l - 2) + { + //var fromIdx = idx; + + while (++idx < l) + { + char c1 = text[idx]; + if (c1 == '"' && text[idx - 1] != '\\') + { + break; + } + } + + //Debug.Log("Skip string \n" + text.Substring(fromIdx, idx-fromIdx)); + continue; + } + + if (c == '{') + { + //if (braceLevel == currentScope.Count && lastWord != null && (lastKeyword == "class" || lastKeyword == "namespace")) { + // currentScope.Add(lastKeyword); + // lastWord = null; + + //} + + braceLevel++; +#if FR2_DEBUG_BRACE_LEVEL + Debug.Log("------->" + braceLevel + "\n" + text.Substring(idx, Mathf.Min(l-idx, 20))); // +#endif + } + else if (c == '}') + { +#if FR2_DEBUG_BRACE_LEVEL + Debug.Log("<--------" + braceLevel + ":" + currentScope[currentScope.Count - 1] + ":" + "\n" + text.Substring(idx, Mathf.Min(l-idx, 20))); // +#endif + + if (currentScope.Count > 0 && braceLevel == currentScope.Count) + { +#if FR2_DEBUG_BRACE_LEVEL + Debug.Log("out scope : " + currentScope[currentScope.Count - 1]); +#endif + + currentScope.RemoveAt(currentScope.Count - 1); + } + + braceLevel--; + } + + if (!char.IsLetter(c) && c != '_') + { + continue; + } + + matchIdx = idx; + matchCount = 1; + + while (++idx < l && char.IsLetterOrDigit(c = text[idx]) || c == '_') + { + matchCount++; + } + + if (matchIdx > 0 && text[matchIdx - 1] == '.') + { + continue; //skip function / method names + } + + if (text[matchIdx] == '_') + { + continue; // skip names starts with _ + } + + string word = text.Substring(matchIdx, matchCount); + + //skip using and var + if (word == "using" && char.IsWhiteSpace(text[matchIdx + matchCount])) + { + while (idx++ < l - 2) + { + c = text[idx]; + if (c == '\n' || c == '\r') + { + break; + } + } + + //Debug.Log("skip using ... " + text.Substring(matchIdx, idx-matchIdx)); + //isSymbol = false; + continue; + } + + if (word == "var" && char.IsWhiteSpace(text[matchIdx + matchCount])) + { + while (idx++ < l - 2) + { + c = text[idx]; + if (c == ';' || c == '=' || char.IsLetterOrDigit(c)) + { + break; + } + } + } + + if (SCRIPT_KEYWORDS.Contains(word)) + { + bool isSymbol = SCRIPT_SYMBOL.Contains(word); + bool isScope = word == "namespace" || word == "class"; + var hasBrace = false; + + if (isSymbol || isScope) + { + int fromIdx = idx; + var hasChar = false; + + while (idx++ < l - 2) + { + c = text[idx]; + if (c == '{' || c == ':' || c == '<' || hasChar && char.IsWhiteSpace(c)) + { + break; + } + + if (!hasChar) + { + hasChar = char.IsLetter(c) || c == '_'; + } + } + + while (char.IsWhiteSpace(c)) + { + //fast forward to first non-whitespace character + idx++; + if (idx >= text.Length) + { + break; + } + + c = text[idx]; + } + + hasBrace = c == '{'; + + string nextWord = text.Substring(fromIdx, idx - fromIdx).Trim(); + + if (word == "delegate") + { + fromIdx = idx; + while (idx++ < l - 2) + { + c = text[idx]; + if (!char.IsLetterOrDigit(c) && c != '_') + { + break; + } + } + + nextWord = text.Substring(fromIdx, idx - fromIdx).Trim(); + +//#if FR2_DEBUG_SYMBOL +// Debug.Log("Delegate detected ! " + nextWord); +//#endif + } + + if (isSymbol) + { + string symb; + string ns = currentScope.Count > 0 + ? string.Join(".", currentScope.ToArray()) + "." + : string.Empty; + if (stMap.TryGetValue(nextWord, out symb)) + { + if (symb == "@token") + { + stMap[nextWord] = ns + nextWord; + } + else + { +#if FR2_DEV + Debug.LogWarning("Not yet support same symbol name definitions <" + ns + nextWord + "> : " + symb); +#endif + } + } + else + { + stMap.Add(nextWord, ns + nextWord); + } + +//#if FR2_DEBUG_SYMBOL +// Debug.LogWarning(word + " : " + (ns + nextWord)); +//#endif + } + + if (isScope) + { + currentScope.Add(nextWord); + } + + if (c == ':' && isSymbol) + { + //extends + fromIdx = idx + 1; + while (idx++ < l - 2) + { + c = text[idx]; + if (c == '{') + { + break; + } + } + + hasBrace = true; + nextWord = text.Substring(fromIdx, idx - fromIdx).Trim(); + + if (!stMap.ContainsKey(nextWord)) + { + stMap.Add(nextWord, "@token"); + } + } + + if (hasBrace) + { + braceLevel++; +#if FR2_DEBUG_BRACE_LEVEL + Debug.Log("------->" + braceLevel + "\n" + text.Substring(idx, Mathf.Min(l-idx, 20))); // +#endif + } + } + + continue; + } + + if (matchCount < 2) + { + continue; // skip short names + } + + if (char.ToLower(text[matchIdx]) == text[matchIdx]) + { + continue; //starts with lowercase character + } + + //if (isSymbol){ + // if (!ScriptSymbols.Contains(word)){ + // //Debug.Log("Symbol --------- " + word); + + // ScriptSymbols.Add(word); + // if (ScriptTokens.Contains(word)) ScriptTokens.Remove(word); + // } + //} else + + if (!stMap.ContainsKey(word)) + { + bool isFuncCall = idx < l - 2 && text[idx + 1] == '('; + if (isFuncCall) + { + continue; //skip funtion calls + } + + stMap.Add(word, "@token"); + } + + //isSymbol = false; + } + + foreach (KeyValuePair item in stMap) + { + if (item.Value == "@token") + { + ScriptTokens.Add(item.Key); + +#if FR2_DEBUG_SYMBOL + Debug.Log("Add Token : " + item.Key); +#endif + } + else + { + ScriptSymbols.Add(item.Value); + +#if FR2_DEBUG_SYMBOL + Debug.Log("Add Symbol : " + item.Value); +#endif + } + } + } + + // ----------------------------- REPLACE GUIDS --------------------------------------- + + internal bool ReplaceReference(string fromGUID, string toGUID, TerrainData terrain = null) + { + if (IsMissing) + { + return false; + } + + if (IsReferencable) + { + string text = string.Empty; + + if (!File.Exists(assetPath)) + { + state = FR2_AssetState.MISSING; + return false; + } + + try + { + text = File.ReadAllText(assetPath).Replace("\r", "\n"); + File.WriteAllText(assetPath, text.Replace(fromGUID, toGUID)); + // AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.Default); + return true; + } + catch (Exception e) + { + state = FR2_AssetState.MISSING; +//#if FR2_DEBUG + Debug.LogWarning("Replace Reference error :: " + e + "\n" + assetPath); +//#endif + } + + return false; + } + + if (type == FR2_AssetType.TERRAIN) + { + var fromObj = FR2_Unity.LoadAssetWithGUID(fromGUID); + var toObj = FR2_Unity.LoadAssetWithGUID(toGUID); + var found = 0; + // var terrain = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Object)) as TerrainData; + + if (fromObj is Texture2D) + { + DetailPrototype[] arr = terrain.detailPrototypes; + for (var i = 0; i < arr.Length; i++) + { + if (arr[i].prototypeTexture == (Texture2D) fromObj) + { + found++; + arr[i].prototypeTexture = (Texture2D) toObj; + } + } + + terrain.detailPrototypes = arr; + FR2_Unity.ReplaceTerrainTextureDatas(terrain, (Texture2D) fromObj, (Texture2D) toObj); + } + + if (fromObj is GameObject) + { + TreePrototype[] arr2 = terrain.treePrototypes; + for (var i = 0; i < arr2.Length; i++) + { + if (arr2[i].prefab == (GameObject) fromObj) + { + found++; + arr2[i].prefab = (GameObject) toObj; + } + } + + terrain.treePrototypes = arr2; + } + + // EditorUtility.SetDirty(terrain); + // AssetDatabase.SaveAssets(); + + fromObj = null; + toObj = null; + terrain = null; + // FR2_Unity.UnloadUnusedAssets(); + + return found > 0; + } + + Debug.LogWarning("Something wrong, should never be here - Ignored <" + assetPath + + "> : not a readable type, can not replace ! " + type); + return false; + } + + [Serializable] + private class Classes + { + public string guid; + public List ids; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Asset.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Asset.cs.meta new file mode 100644 index 0000000..09a6b79 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Asset.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7f1ed5d1134de134a9e052ef368e3a84 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_AssetType.cs b/Assets/Scripts/Editor/FR2/FR2_AssetType.cs new file mode 100644 index 0000000..11d660e --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_AssetType.cs @@ -0,0 +1,298 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class AssetType + { + // ------------------------------- STATIC ----------------------------- + + internal static readonly AssetType[] FILTERS = + { + new AssetType("Scene", ".unity"), + new AssetType("Prefab", ".prefab"), + new AssetType("Model", ".3df", ".3dm", ".3dmf", ".3dv", ".3dx", ".c5d", ".lwo", ".lws", ".ma", ".mb", + ".mesh", ".vrl", ".wrl", ".wrz", ".fbx", ".dae", ".3ds", ".dxf", ".obj", ".skp", ".max", ".blend"), + new AssetType("Material", ".mat", ".cubemap", ".physicsmaterial"), + new AssetType("Texture", ".ai", ".apng", ".png", ".bmp", ".cdr", ".dib", ".eps", ".exif", ".ico", ".icon", + ".j", ".j2c", ".j2k", ".jas", ".jiff", ".jng", ".jp2", ".jpc", ".jpe", ".jpeg", ".jpf", ".jpg", "jpw", + "jpx", "jtf", ".mac", ".omf", ".qif", ".qti", "qtif", ".tex", ".tfw", ".tga", ".tif", ".tiff", ".wmf", + ".psd", ".exr", ".rendertexture"), + new AssetType("Video", ".asf", ".asx", ".avi", ".dat", ".divx", ".dvx", ".mlv", ".m2l", ".m2t", ".m2ts", + ".m2v", ".m4e", ".m4v", "mjp", ".mov", ".movie", ".mp21", ".mp4", ".mpe", ".mpeg", ".mpg", ".mpv2", + ".ogm", ".qt", ".rm", ".rmvb", ".wmv", ".xvid", ".flv"), + new AssetType("Audio", ".mp3", ".wav", ".ogg", ".aif", ".aiff", ".mod", ".it", ".s3m", ".xm"), + new AssetType("Script", ".cs", ".js", ".boo", ".h"), + new AssetType("Text", ".txt", ".json", ".xml", ".bytes", ".sql"), + new AssetType("Shader", ".shader", ".cginc"), + new AssetType("Animation", ".anim", ".controller", ".overridecontroller", ".mask"), + new AssetType("Unity Asset", ".asset", ".guiskin", ".flare", ".fontsettings", ".prefs"), + new AssetType("Others") // + }; + + private static FR2_Ignore _ignore; + public HashSet extension; + public string name; + + public AssetType(string name, params string[] exts) + { + this.name = name; + extension = new HashSet(); + for (var i = 0; i < exts.Length; i++) + { + extension.Add(exts[i]); + } + } + + private static FR2_Ignore ignore + { + get + { + if (_ignore == null) + { + _ignore = new FR2_Ignore(); + } + + return _ignore; + } + } + + public static int GetIndex(string ext) + { + for (var i = 0; i < FILTERS.Length - 1; i++) + { + if (FILTERS[i].extension.Contains(ext)) + { + return i; + } + } + + return FILTERS.Length - 1; //Others + } + + public static bool DrawSearchFilter() + { + int n = FILTERS.Length; + var nCols = 4; + int nRows = Mathf.CeilToInt(n / (float) nCols); + var result = false; + + EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); + { + if (GUILayout.Button("All", EditorStyles.toolbarButton) && !FR2_Setting.IsIncludeAllType()) + { + FR2_Setting.IncludeAllType(); + result = true; + } + + if (GUILayout.Button("None", EditorStyles.toolbarButton) && FR2_Setting.GetExcludeType() != -1) + { + FR2_Setting.ExcludeAllType(); + result = true; + } + } + EditorGUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + for (var i = 0; i < nCols; i++) + { + GUILayout.BeginVertical(); + for (var j = 0; j < nRows; j++) + { + int idx = i * nCols + j; + if (idx >= n) + { + break; + } + + bool s = !FR2_Setting.IsTypeExcluded(idx); + bool s1 = GUILayout.Toggle(s, FILTERS[idx].name); + if (s1 != s) + { + result = true; + FR2_Setting.ToggleTypeExclude(idx); + } + } + + GUILayout.EndVertical(); + if ((i + 1) * nCols >= n) + { + break; + } + } + + GUILayout.EndHorizontal(); + + + return result; + } + + public static void SetDirtyIgnore() + { + ignore.SetDirty(); + } + + public static bool DrawIgnoreFolder() + { + var change = false; + ignore.Draw(); + + + // FR2_Helper.GuiLine(); + // List lst = FR2_Setting.IgnoreFolder.ToList(); + // bool change = false; + // pos = EditorGUILayout.BeginScrollView(pos); + // for(int i =0; i < lst.Count; i++) + // { + // GUILayout.BeginHorizontal(); + // { + // if(GUILayout.Button("X", GUILayout.Width(30))) + // { + // change = true; + // FR2_Setting.RemoveIgnore(lst[i]); + // } + // GUILayout.Label(lst[i]); + // }GUILayout.EndHorizontal(); + // } + // EditorGUILayout.EndScrollView(); + return change; + } + + + private class FR2_Ignore + { + public readonly FR2_TreeUI2.GroupDrawer groupIgnore; + private bool dirty; + private Dictionary refs; + + public FR2_Ignore() + { + groupIgnore = new FR2_TreeUI2.GroupDrawer(DrawGroup, DrawItem); + ApplyFiter(); + } + + private void DrawItem(Rect r, string guid) + { + FR2_Ref rf; + if (!refs.TryGetValue(guid, out rf)) + { + return; + } + + if (rf.depth == 1) //mode != Mode.Dependency && + { + Color c = GUI.color; + GUI.color = Color.blue; + GUI.DrawTexture(new Rect(r.x - 4f, r.y + 2f, 2f, 2f), EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + rf.asset.Draw(r, false, FR2_Setting.GroupMode != FR2_RefDrawer.Mode.Folder, null); + + + Rect drawR = r; + drawR.x = drawR.x + drawR.width - 50f; // (groupDrawer.TreeNoScroll() ? 60f : 70f) ; + drawR.width = 30; + drawR.y += 1; + drawR.height -= 2; + + if (GUI.Button(drawR, "X", EditorStyles.miniButton)) + { + FR2_Setting.RemoveIgnore(rf.asset.assetPath); + } + } + + private void DrawGroup(Rect r, string id, int childCound) + { + GUI.Label(r, id, EditorStyles.boldLabel); + if (childCound <= 1) + { + return; + } + + Rect drawR = r; + drawR.x = drawR.x + drawR.width - 50f; // (groupDrawer.TreeNoScroll() ? 60f : 70f) ; + drawR.width = 30; + drawR.y += 1; + drawR.height -= 2; + + if (GUI.Button(drawR, "*X", EditorStyles.miniButton)) + { + List lst = refs.Values.Where(x => x.group == id).ToList(); + for (var i = 0; i < lst.Count; i++) + { + FR2_Setting.RemoveIgnore(lst[i].asset.assetPath); + } + } + } + + public void SetDirty() + { + dirty = true; + } + //private float sizeRatio { + // get{ + // if(FR2_Window.window != null) + // return FR2_Window.window.sizeRatio; + // return .3f; + // } + //} + + public void Draw() + { + if (dirty) + { + ApplyFiter(); + } + + if (refs == null) + { + return; + } + + // Rect rect = FR2_Window.window == null ? new Rect(): FR2_Window.window.GetBotPanelRect(); + // GUILayout.BeginArea(rect); + groupIgnore.Draw(); + // GUILayout.EndArea(); + } + + + private void ApplyFiter() + { + dirty = false; + refs = new Dictionary(); + + foreach (KeyValuePair> item in FR2_Setting.IgnoreFiltered) + foreach (string item2 in item.Value) + { + string guid = AssetDatabase.AssetPathToGUID(item2); + if (string.IsNullOrEmpty(guid)) + { + continue; + } + + FR2_Asset asset = FR2_Cache.Api.Get(guid, true); + var r = new FR2_Ref(0, 0, asset, null, item.Key); + refs.Add(guid, r); + } + + groupIgnore.Reset + ( + refs.Values.ToList(), + rf => rf.asset != null ? rf.asset.guid : "", + GetGroup, + SortGroup + ); + } + + private string GetGroup(FR2_Ref rf) + { + return rf.group; + } + + private void SortGroup(List groups) { } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_AssetType.cs.meta b/Assets/Scripts/Editor/FR2/FR2_AssetType.cs.meta new file mode 100644 index 0000000..4402cfd --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_AssetType.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: af50e16ff6b530b4b808183a3ae0722b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Cache.cs b/Assets/Scripts/Editor/FR2/FR2_Cache.cs new file mode 100644 index 0000000..788e62f --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Cache.cs @@ -0,0 +1,1880 @@ +//#define FR2_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + [InitializeOnLoad] + public class FR2_CacheHelper : AssetPostprocessor + { + private const int MARGIN = 5; + private const int SIZE = 5; + private static HashSet scenes; + private static HashSet guidsIgnore; + + static FR2_CacheHelper() + { + EditorApplication.update -= InitHelper; + EditorApplication.update += InitHelper; + } + + private static void InitHelper() + { + if (EditorApplication.isCompiling) + { + return; + } + + // if (EditorApplication.isPlayingOrWillChangePlaymode) return; + if (!FR2_Cache.isReady) + { + return; + } + + if (!FR2_Cache.Api.disabled) + { + InitListScene(); + InitIgnore(); + +#if UNITY_2018_1_OR_NEWER + EditorBuildSettings.sceneListChanged -= InitListScene; + EditorBuildSettings.sceneListChanged += InitListScene; +#endif + + EditorApplication.projectWindowItemOnGUI -= OnGUIProjectItem; + EditorApplication.projectWindowItemOnGUI += OnGUIProjectItem; + + FR2_Cache.onReady -= OnCacheReady; + FR2_Cache.onReady += OnCacheReady; + } + + EditorApplication.update -= InitHelper; + } + + // private class AssetModificationHelper: UnityEditor.AssetModificationProcessor + // { + // static void OnWillCreateAsset(string assetName) + // { + // FR2_Cache.Api.makeDirty(); + // } + // static AssetDeleteResult OnWillDeleteAsset(string name,RemoveAssetOptions options) + // { + // FR2_Cache.Api.makeDirty(); + // return AssetDeleteResult.DidDelete; + // } + // private static AssetMoveResult OnWillMoveAsset(string sourcePath, string destinationPath) + // { + // FR2_Cache.Api.makeDirty(); + // AssetMoveResult assetMoveResult = AssetMoveResult.DidMove; + + // // Perform operations on the asset and set the value of 'assetMoveResult' accordingly. + + // return assetMoveResult; + // } + // static string[] OnWillSaveAssets(string[] paths) + // { + // FR2_Cache.Api.makeDirty(); + // return paths; + // } + // } + + private static void OnCacheReady() + { + InitIgnore(); + } + + public static void InitIgnore() + { + guidsIgnore = new HashSet(); + foreach (string item in FR2_Setting.IgnoreAsset) + { + string guid = AssetDatabase.AssetPathToGUID(item); + if (guidsIgnore.Contains(guid)) + { + continue; + } + + guidsIgnore.Add(guid); + } + } + + private static void InitListScene() + { + scenes = new HashSet(); + // string[] scenes = new string[sceneCount]; + foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes) + { + string sce = AssetDatabase.AssetPathToGUID(scene.path); + // Debug.Log(scene.path + " " + sce); + if (scenes.Contains(sce)) + { + continue; + } + + scenes.Add(sce); + } + } + + private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, + string[] movedAssets, + string[] movedFromAssetPaths) + { + if (EditorApplication.isUpdating || EditorApplication.isPlaying) + { + return; + } + //Debug.Log("OnPostProcessAllAssets : "+ FR2_Cache.Api.isReady + ":" + importedAssets.Length + ":" + deletedAssets.Length + ":" + movedAssets.Length + ":" + movedFromAssetPaths.Length); + + if (!FR2_Cache.isReady) + { +#if FR2_DEBUG + Debug.Log("Not ready, will refresh anyway !"); +#endif + return; + } + + for (var i = 0; i < importedAssets.Length; i++) + { + if (importedAssets[i] == FR2_Cache.CachePath) + { + continue; + } + + string guid = AssetDatabase.AssetPathToGUID(importedAssets[i]); + if (!FR2_Asset.IsValidGUID(guid)) + { + continue; + } + + if (FR2_Cache.Api.AssetMap.ContainsKey(guid)) + { + FR2_Cache.Api.RefreshAsset(guid, true); + +#if FR2_DEBUG + Debug.Log("Changed : " + importedAssets[i]); +#endif + + continue; + } + + FR2_Cache.Api.AddAsset(guid); +#if FR2_DEBUG + Debug.Log("New : " + importedAssets[i]); +#endif + } + + for (var i = 0; i < deletedAssets.Length; i++) + { + string guid = AssetDatabase.AssetPathToGUID(deletedAssets[i]); + FR2_Cache.Api.RemoveAsset(guid); + +#if FR2_DEBUG + Debug.Log("Deleted : " + deletedAssets[i]); +#endif + } + + for (var i = 0; i < movedAssets.Length; i++) + { + string guid = AssetDatabase.AssetPathToGUID(movedAssets[i]); + FR2_Asset asset = FR2_Cache.Api.Get(guid); + if (asset != null) + { + asset.LoadAssetInfo(); + } + } + +#if FR2_DEBUG + Debug.Log("Changes :: " + importedAssets.Length + ":" + FR2_Cache.Api.workCount); +#endif + + if (FR2_Cache.Api.workCount > 0) + { + FR2_Cache.Api.Check4Usage(); + } + } + + private static void OnGUIProjectItem(string guid, Rect rect) + { + if (scenes.Contains(guid)) + { + var r = new Rect(rect.x - MARGIN, rect.y + MARGIN, SIZE, SIZE); + + if (EditorGUIUtility.isProSkin) + { + EditorGUI.DrawRect(r, new Color32(72, 150, 191, 255)); + } + else + { + EditorGUI.DrawRect(r, Color.blue); + } + } + + if (guidsIgnore.Contains(guid)) + { + var r = new Rect(rect.x + rect.width - 8, rect.y + MARGIN, 3, 3); + EditorGUI.DrawRect(r, Color.red); + } + + if (!FR2_Cache.isReady) + { + return; // not ready + } + + if (!FR2_Setting.ShowReferenceCount) + { + return; + } + + FR2_Cache api = FR2_Cache.Api; + if (FR2_Cache.Api.AssetMap == null) + { + FR2_Cache.Api.Check4Changes(false, false); + } + + FR2_Asset item; + + if (!api.AssetMap.TryGetValue(guid, out item)) + { + return; + } + + if (item == null || item.UsedByMap == null) + { + return; + } + + if (item.UsedByMap.Count > 0) + { + var content = new GUIContent(item.UsedByMap.Count.ToString()); + float w = EditorStyles.miniLabel.CalcSize(content).x; + var r = new Rect(rect.x - w, rect.y, w, 16f); + if (r.x < -4) + { + r.x = -4f; + } + + GUI.Label(r, content, EditorStyles.miniLabel); + } + } + } + + [Serializable] + public class FR2_Setting + { + private static FR2_Setting d; + internal static bool showSettings; + + private static HashSet _hashIgnore; + private static Dictionary> _IgnoreFiltered; + public static Action OnIgnoreChange; + public bool alternateColor = true; + public int excludeTypes; //32-bit type Mask + + public FR2_RefDrawer.Mode groupMode; + public List listIgnore = new List(); + public bool pingRow = true; + + public bool referenceCount = true; + + //public bool scanScripts = false; + public Color32 rowColor = new Color32(0, 0, 0, 12); + public Color32 ScanColor = new Color32(0, 204, 102, 255); + + public Color SelectedColor = new Color(0, 0f, 1f, 0.25f); + public bool showFileSize; + public bool showSelection; + + public bool showUsedByClassed = true; + public FR2_RefDrawer.Sort sortMode; + + public int treeIndent = 10; + + /* + Doesn't have a settings option - I will include one in next update + + 2. Hide the reference number - Should be in the setting above so will be coming next + 3. Cache file path should be configurable - coming next in the setting + 4. Disable / Selectable color in alternative rows - coming next in the setting panel + 5. Applied filters aren't saved - Should be fixed in next update too + 6. Hide Selection part - should be com as an option so you can quickly toggle it on or off + 7. Click whole line to ping - coming next by default and can adjustable in the setting panel + + */ + + internal static FR2_Setting s + { + get { return FR2_Cache.Api ? FR2_Cache.Api.setting : d == null ? d = new FR2_Setting() : d; } + } + + public static bool ShowUsedByClassed + { + get { return s.showUsedByClassed; } + } + + public static bool ShowFileSize + { + get { return s.showUsedByClassed; } + } + + public static int TreeIndent + { + get { return s.treeIndent; } + set + { + if (s.treeIndent == value) + { + return; + } + + s.treeIndent = value; + setDirty(); + } + } + + public static bool ShowReferenceCount + { + get { return s.referenceCount; } + set + { + if (s.referenceCount == value) + { + return; + } + + s.referenceCount = value; + setDirty(); + } + } + + public static bool ShowSelection + { + get { return s.showSelection; } + set + { + if (s.showSelection == value) + { + return; + } + + s.showSelection = value; + setDirty(); + } + } + + public static bool AlternateRowColor + { + get { return s.alternateColor; } + set + { + if (s.alternateColor == value) + { + return; + } + + s.alternateColor = value; + setDirty(); + } + } + + public static Color32 RowColor + { + get { return s.rowColor; } + set + { + if (s.rowColor.Equals(value)) + { + return; + } + + s.rowColor = value; + setDirty(); + } + } + + public static bool PingRow + { + get { return s.pingRow; } + set + { + if (s.pingRow == value) + { + return; + } + + s.pingRow = value; + setDirty(); + } + } + + public static HashSet IgnoreAsset + { + get + { + if (_hashIgnore == null) + { + _hashIgnore = new HashSet(); + if (s == null || s.listIgnore == null) + { + return _hashIgnore; + } + + for (var i = 0; i < s.listIgnore.Count; i++) + { + if (_hashIgnore.Contains(s.listIgnore[i])) + { + continue; + } + + _hashIgnore.Add(s.listIgnore[i]); + } + } + + return _hashIgnore; + } + } + + public static Dictionary> IgnoreFiltered + { + get + { + if (_IgnoreFiltered == null) + { + initIgnoreFiltered(); + } + + return _IgnoreFiltered; + } + } + //static public bool ScanScripts + //{ + // get { return s.scanScripts; } + // set { + // if (s.scanScripts == value) return; + // s.scanScripts = value; setDirty(); + // } + //} + + public static FR2_RefDrawer.Mode GroupMode + { + get { return s.groupMode; } + set + { + if (s.groupMode.Equals(value)) + { + return; + } + + s.groupMode = value; + setDirty(); + } + } + + public static FR2_RefDrawer.Sort SortMode + { + get { return s.sortMode; } + set + { + if (s.sortMode.Equals(value)) + { + return; + } + + s.sortMode = value; + setDirty(); + } + } + + public static bool HasTypeExcluded + { + get { return s.excludeTypes != 0; } + } + + private static void setDirty() + { + if (FR2_Cache.Api != null) + { + EditorUtility.SetDirty(FR2_Cache.Api); + } + } + + private static void initIgnoreFiltered() + { + FR2_Asset.ignoreTS = Time.realtimeSinceStartup; + + _IgnoreFiltered = new Dictionary>(); + var lst = new List(s.listIgnore); + lst = lst.OrderBy(x => x.Length).ToList(); + int count = lst.Count; + for (var i = 0; i < count; i++) + { + string str = lst[i]; + _IgnoreFiltered.Add(str, new List {str}); + for (int j = count - 1; j > i; j--) + { + if (lst[j].StartsWith(str)) + { + _IgnoreFiltered[str].Add(lst[j]); + lst.RemoveAt(j); + count--; + } + } + } + } + + public static void AddIgnore(string path) + { + if (string.IsNullOrEmpty(path) || IgnoreAsset.Contains(path) || path == "Assets") + { + return; + } + + s.listIgnore.Add(path); + _hashIgnore.Add(path); + AssetType.SetDirtyIgnore(); + FR2_CacheHelper.InitIgnore(); + initIgnoreFiltered(); + + FR2_Asset.ignoreTS = Time.realtimeSinceStartup; + if (OnIgnoreChange != null) + { + OnIgnoreChange(); + } + } + + + public static void RemoveIgnore(string path) + { + if (!IgnoreAsset.Contains(path)) + { + return; + } + + _hashIgnore.Remove(path); + s.listIgnore.Remove(path); + AssetType.SetDirtyIgnore(); + FR2_CacheHelper.InitIgnore(); + initIgnoreFiltered(); + + FR2_Asset.ignoreTS = Time.realtimeSinceStartup; + if (OnIgnoreChange != null) + { + OnIgnoreChange(); + } + } + + public static bool IsTypeExcluded(int type) + { + return (s.excludeTypes >> type & 1) != 0; + } + + public static void ToggleTypeExclude(int type) + { + bool v = (s.excludeTypes >> type & 1) != 0; + if (v) + { + s.excludeTypes &= ~(1 << type); + } + else + { + s.excludeTypes |= 1 << type; + } + + setDirty(); + } + + public static int GetExcludeType() + { + return s.excludeTypes; + } + + public static bool IsIncludeAllType() + { + // Debug.Log ((AssetType.FILTERS.Length & s.excludeTypes) + " " + Mathf.Pow(2, AssetType.FILTERS.Length) ); + return s.excludeTypes == 0 || Mathf.Abs(s.excludeTypes) == Mathf.Pow(2, AssetType.FILTERS.Length); + } + + public static void ExcludeAllType() + { + s.excludeTypes = -1; + } + + public static void IncludeAllType() + { + s.excludeTypes = 0; + } + + public void DrawSettings() + { + if (FR2_Unity.DrawToggle(ref pingRow, "Full Row click to Ping")) + { + setDirty(); + } + + GUILayout.BeginHorizontal(); + { + if (FR2_Unity.DrawToggle(ref alternateColor, "Alternate Odd & Even Row Color")) + { + setDirty(); + FR2_Unity.RepaintFR2Windows(); + } + + EditorGUI.BeginDisabledGroup(!alternateColor); + { + Color c = EditorGUILayout.ColorField(rowColor); + if (!c.Equals(rowColor)) + { + rowColor = c; + setDirty(); + FR2_Unity.RepaintFR2Windows(); + } + } + EditorGUI.EndDisabledGroup(); + } + GUILayout.EndHorizontal(); + + if (FR2_Unity.DrawToggle(ref referenceCount, "Show Usage Count in Project panel")) + { + setDirty(); + FR2_Unity.RepaintProjectWindows(); + } + + if (FR2_Unity.DrawToggle(ref showSelection, "Show Selection")) + { + setDirty(); + FR2_Unity.RepaintFR2Windows(); + } + + if (FR2_Unity.DrawToggle(ref showUsedByClassed, "Show Asset Type in use")) + { + setDirty(); + FR2_Unity.RepaintFR2Windows(); + } + + GUILayout.BeginHorizontal(); + { + Color c = EditorGUILayout.ColorField("Duplicate Scan Color", ScanColor); + if (!c.Equals(ScanColor)) + { + ScanColor = c; + setDirty(); + FR2_Unity.RepaintFR2Windows(); + } + } + GUILayout.EndHorizontal(); + } + } + + public class FR2_Cache : ScriptableObject + { + internal const string CACHE_VERSION = "2.0"; + internal const int FORCE_REFRESH_DURATION = 60 * 60 * 24; // force refresh once per day + internal const string DEFAULT_CACHE_PATH = "Assets/FR2_Cache.asset"; + + internal static int cacheStamp; + internal static Action onReady; + + internal static bool _triedToLoadCache; + internal static FR2_Cache _cache; + + internal static string _cacheGUID; + + internal static string _cachePath; + + internal static string[] ASSET_ROOT_ALLOW = + { + "Assets/", + "ProjectSettings/" + }; + + [SerializeField] private bool _autoRefresh; + + + [SerializeField] private string _curCacheVersion; + + [SerializeField] private bool _disabled; + [SerializeField] public List AssetList; + + + [NonSerialized] internal Dictionary AssetMap; + private int frameSkipped; + + public int priority = 3; + [NonSerialized] internal List queueLoadContent; + [NonSerialized] internal List queueUsedBy; + + + internal bool ready; + [NonSerialized] internal Dictionary> ScriptMap; + [SerializeField] internal FR2_Setting setting; + + // ----------------------------------- INSTANCE ------------------------------------- + + [SerializeField] public int timeStamp; + [NonSerialized] internal int workCount; + + internal static string CacheGUID + { + get + { + if (!string.IsNullOrEmpty(_cacheGUID)) + { + return _cacheGUID; + } + + if (_cache != null) + { + _cachePath = AssetDatabase.GetAssetPath(_cache); + _cacheGUID = AssetDatabase.AssetPathToGUID(_cachePath); + return _cacheGUID; + } + + return null; + } + } + + internal static string CachePath + { + get + { + if (!string.IsNullOrEmpty(_cachePath)) + { + return _cachePath; + } + + if (_cache != null) + { + _cachePath = AssetDatabase.GetAssetPath(_cache); + return _cachePath; + } + + return null; + } + } + + public bool Dirty { get; private set; } + + internal static FR2_Cache Api + { + get + { + if (_cache != null) + { + return _cache; + } + + if (!_triedToLoadCache) + { + TryLoadCache(); + } + + return _cache; + } + } + + internal bool autoRefresh + { + get { return _autoRefresh; } + set + { + if (_autoRefresh == value) + { + return; + } + + _autoRefresh = value; + + if (_autoRefresh) + { + Debug.LogWarning("Auto refresh is ON !"); + Check4Changes(!EditorApplication.isPlaying, true); + } + else + { + Debug.LogWarning("Auto refresh is OFF !"); + } + } + } + + internal bool disabled + { + get { return _disabled; } + set + { + if (_disabled == value) + { + return; + } + + _disabled = value; + + if (_disabled) + { + //Debug.LogWarning("FR2 is disabled - Stopping all works !"); + ready = false; + EditorApplication.update -= AsyncProcess; + } + else + { + Check4Changes(!EditorApplication.isPlaying, true); + } + } + } + + internal static bool isReady + { + get + { + if (!_triedToLoadCache) + { + TryLoadCache(); + } + + return _cache != null && _cache.ready; + } + } + + internal static bool hasCache + { + get + { + if (!_triedToLoadCache) + { + TryLoadCache(); + } + + return _cache != null; + } + } + + internal float progress + { + get + { + int n = workCount - queueLoadContent.Count - queueUsedBy.Count; + return workCount == 0 ? 1 : n / (float) workCount; + } + } + + public static bool CheckSameVersion() + { + // Debug.Log((_cache == null) + " " + _cache._curCacheVersion ); + if (_cache == null) + { + return false; + } + + return _cache._curCacheVersion == CACHE_VERSION; + } + + public void makeDirty() + { + Dirty = true; + } + + private static void FoundCache(bool savePrefs, bool writeFile) + { + _cachePath = AssetDatabase.GetAssetPath(_cache); + /* + if(_cache._curCacheVersion != CACHE_VERSION) + { + EditorGUILayout.HelpBox("Incompatible cache version found, need a full refresh may take time!", UnityEditor.MessageType.Warning); + + #if FR2_DEBUG + Debug.Log("Different cache version ["+ _cache._curCacheVersion + "] :: <"+ CACHE_VERSION + ">"); + #endif + + try{ + if(!string.IsNullOrEmpty(_cachePath)) + { + AssetDatabase.DeleteAsset(_cachePath); + } + } + catch {} + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + + return; + } + */ + + int elapseTime = FR2_Unity.Epoch(DateTime.Now) - _cache.timeStamp; + _cache.Check4Changes(!EditorApplication.isPlaying, elapseTime > FORCE_REFRESH_DURATION); + _cacheGUID = AssetDatabase.AssetPathToGUID(_cachePath); + + if (savePrefs) + { + EditorPrefs.SetString("fr2_cache.guid", _cacheGUID); + } + + if (writeFile) + { + File.WriteAllText("Library/fr2_cache.guid", _cacheGUID); + } + } + + private static bool RestoreCacheFromGUID(string guid, bool savePrefs, bool writeFile) + { + if (string.IsNullOrEmpty(guid)) + { + return false; + } + + string path = AssetDatabase.GUIDToAssetPath(guid); + if (string.IsNullOrEmpty(path)) + { + return false; + } + + return RestoreCacheFromPath(path, savePrefs, writeFile); + } + + private static bool RestoreCacheFromPath(string path, bool savePrefs, bool writeFile) + { + if (string.IsNullOrEmpty(path)) + { + return false; + } + + _cache = FR2_Unity.LoadAssetAtPath(path); + if (_cache != null) + { + FoundCache(savePrefs, writeFile); + } + + return _cache != null; + } + + private static void TryLoadCache() + { + _triedToLoadCache = true; + + if (RestoreCacheFromPath(DEFAULT_CACHE_PATH, false, false)) + { + return; + } + + // Check EditorPrefs + string pref = EditorPrefs.GetString("fr2_cache.guid", string.Empty); + if (RestoreCacheFromGUID(pref, false, false)) + { + return; + } + + // Read GUID from File + if (File.Exists("Library/fr2_cache.guid")) + { + if (RestoreCacheFromGUID(File.ReadAllText("Library/fr2_cache.guid"), true, false)) + { + return; + } + } + + // Search whole project + string[] allAssets = AssetDatabase.GetAllAssetPaths(); + for (var i = 0; i < allAssets.Length; i++) + { + if (allAssets[i].EndsWith("/FR2_Cache.asset", StringComparison.Ordinal)) + { + RestoreCacheFromPath(allAssets[i], true, true); + break; + } + } + } + + internal static void DeleteCache() + { + if (_cache == null) + { + return; + } + + try + { + if (!string.IsNullOrEmpty(_cachePath)) + { + AssetDatabase.DeleteAsset(_cachePath); + } + } + catch { } + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + } + + internal static void CreateCache() + { + _cache = CreateInstance(); + _cache._curCacheVersion = CACHE_VERSION; + string path = Application.dataPath + DEFAULT_CACHE_PATH + .Substring(0, DEFAULT_CACHE_PATH.LastIndexOf('/') + 1).Replace("Assets", string.Empty); + + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + + AssetDatabase.CreateAsset(_cache, DEFAULT_CACHE_PATH); + EditorUtility.SetDirty(_cache); + AssetDatabase.SaveAssets(); + + FoundCache(true, true); + _cache.Check4Changes(!EditorApplication.isPlaying, true); + } + + internal static List FindUsage(string[] listGUIDs) + { + if (!isReady) + { + return null; + } + + List refs = Api.FindAssets(listGUIDs, true); + + for (var i = 0; i < refs.Count; i++) + { + List tmp = FR2_Asset.FindUsage(refs[i]); + + for (var j = 0; j < tmp.Count; j++) + { + FR2_Asset itm = tmp[j]; + if (refs.Contains(itm)) + { + continue; + } + + refs.Add(itm); + } + } + + return refs.Select(item => item.guid).ToList(); + } + + private void OnEnable() + { +#if FR2_DEBUG + Debug.Log("OnEnabled : " + _cache); +#endif + if (_cache == null) + { + _cache = this; + } + + Check4Changes(!EditorApplication.isPlayingOrWillChangePlaymode, false); + } + + internal void Clear() + { + if (AssetList != null) + { + AssetList.Clear(); + } + + if (queueLoadContent != null) + { + queueLoadContent.Clear(); + } + + if (queueUsedBy != null) + { + queueUsedBy.Clear(); + } + + if (AssetMap != null) + { + AssetMap.Clear(); + } + + Check4Changes(!EditorApplication.isPlaying, true); + } + + internal void AddSymbol(string symbol, FR2_Asset asset) + { + List list; + if (ScriptMap == null) + { + return; + } + + string[] arr = symbol.Split('.'); + string id = arr[arr.Length - 1]; + + if (!ScriptMap.TryGetValue(id, out list)) + { + list = new List(); + ScriptMap.Add(id, list); + } + else if (list.Contains(asset)) + { + return; + } + + list.Add(asset); + } + + //internal void AddSymbols(FR2_Asset asset) + //{ + // for (var j = 0; j < asset.ScriptSymbols.Count; j++) + // { + // AddSymbol(asset.ScriptSymbols[j], asset); + // } + //} + + //internal FR2_Asset FindSymbol(string symbol) + //{ + // List list; + // if (!ScriptMap.TryGetValue(symbol, out list)) return null; + // return list[0]; + //} + + //internal List FindAllSymbol(string symbol) + //{ + // List list; + // if (!ScriptMap.TryGetValue(symbol, out list)) return null; + // return list; + //} + + internal void ReadFromCache() + { + if (AssetList == null) + { + AssetList = new List(); + } + + if (queueLoadContent == null) + { + queueLoadContent = new List(); + } + + if (queueUsedBy == null) + { + queueUsedBy = new List(); + } + + if (AssetMap == null) + { + AssetMap = new Dictionary(_cache.AssetList.Count); + } + + if (ScriptMap == null) + { + ScriptMap = new Dictionary>(); + } + + queueLoadContent.Clear(); + queueUsedBy.Clear(); + ScriptMap.Clear(); + AssetMap.Clear(); + + for (var i = 0; i < _cache.AssetList.Count; i++) + { + FR2_Asset item = _cache.AssetList[i]; + //item.LoadAssetInfo(); + if (AssetMap.ContainsKey(item.guid)) + { + Debug.LogWarning("Something wrong, cache found twice <" + item.guid + ">"); + continue; + } + + AssetMap.Add(item.guid, item); + } + } + + internal void ReadFromProject(bool force) + { + List paths = AssetDatabase.GetAllAssetPaths().ToList(); + + paths.RemoveAll(item => !ASSET_ROOT_ALLOW.Any(x => item.StartsWith(x))); + string[] guids = paths.Select(item => AssetDatabase.AssetPathToGUID(item)).ToArray(); + // paths.ForEach(x=> Debug.Log(x)); + cacheStamp++; + + // Check for new assets + for (var i = 0; i < guids.Length; i++) + { + if (!FR2_Asset.IsValidGUID(guids[i])) + { + continue; + } + + FR2_Asset asset; + + if (AssetMap.TryGetValue(guids[i], out asset)) + { + asset.m_cacheStamp = cacheStamp; + continue; + } + + ; + + // New asset + AddAsset(guids[i]); + } + + // Check for deleted assets + for (int i = AssetList.Count - 1; i >= 0; i--) + { + if (AssetList[i].cacheStamp != cacheStamp) + { + RemoveAsset(AssetList[i]); + } + } + + // Refresh definition list + //for (var i = 0; i < AssetList.Count; i++) + //{ + // AddSymbols(AssetList[i]); + //} + + if (force) + { + timeStamp = FR2_Unity.Epoch(DateTime.Now); + workCount += AssetMap.Count; + queueLoadContent.AddRange(AssetMap.Values.ToList()); + } + } + + internal void Check4Changes(bool checkProject, bool checkContent) + { +#if FR2_DEBUG + Debug.Log(string.Format("Check4Changes : checkProject={0} checkContent={1}", checkProject, checkContent)); +#endif + + // if(checkContent) + // { + // if(_cache.AssetList!= null) _cache.AssetList.Clear(); + // if(_cache.AssetMap!= null) _cache.AssetMap.Clear(); + // } + //if (EditorApplication.isCompiling || EditorApplication.isPlayingOrWillChangePlaymode) return; + ready = false; + ReadFromCache(); + + if (checkProject) + { + ReadFromProject(checkContent); + } + + Check4Usage(); + +#if FR2_DEBUG + Debug.Log("After checking :: WorkCount :: " + workCount); +#endif + } + + internal void RefreshAsset(string guid, bool force) + { + if (!AssetMap.ContainsKey(guid)) + { + return; + } + + RefreshAsset(AssetMap[guid], force); + } + + internal void RefreshSelection() + { + string[] list = FR2_Unity.Selection_AssetGUIDs; + for (var i = 0; i < list.Length; i++) + { + RefreshAsset(list[i], true); + } + + Check4Work(); + } + + internal void RefreshAsset(FR2_Asset asset, bool force) + { +#if FR2_DEBUG + Debug.Log("RefreshAsset: " + asset.guid + ":" + workCount); +#endif + + workCount++; + + if (force) + { + asset.MarkAsDirty(); + + if (asset.type == FR2_AssetType.FOLDER && !asset.IsMissing) + { + string[] dirs = Directory.GetDirectories(asset.assetPath, "*", SearchOption.AllDirectories); + //refresh children directories as well + + for (var i = 0; i < dirs.Length; i++) + { + string guid = AssetDatabase.AssetPathToGUID(dirs[i]); + FR2_Asset child = Api.Get(guid); + if (child == null) + { + continue; + } + + workCount++; + child.MarkAsDirty(); + queueLoadContent.Add(child); + } + } + } + + queueLoadContent.Add(asset); + } + + internal void AddAsset(string guid) + { + if (AssetMap.ContainsKey(guid)) + { + Debug.LogWarning("guid already exist <" + guid + ">"); + return; + } + + FR2_Asset first = AssetList.FirstOrDefault(item => item.guid == guid); + if (first != null) + { + Debug.LogWarning("Should catch asset import ! " + first.assetPath); + first.LoadAssetInfo(); + RefreshAsset(first, true); + return; + } + + var asset = new FR2_Asset(guid); + asset.m_cacheStamp = cacheStamp; + + AssetList.Add(asset); + AssetMap.Add(guid, asset); + + // Do not load content for FR2_Cache asset + if (guid == CacheGUID) + { + return; + } + + workCount++; + queueLoadContent.Add(asset); + } + + internal void RemoveAsset(string guid) + { + if (!AssetMap.ContainsKey(guid)) + { + return; + } + + RemoveAsset(AssetMap[guid]); + } + + internal void RemoveAsset(FR2_Asset asset) + { + AssetList.Remove(asset); + + // Deleted Asset : still in the map but not in the AssetList + asset.state = FR2_AssetState.MISSING; + + //for (var i = 0; i < asset.ScriptSymbols.Count; i++) + //{ + // var s = asset.ScriptSymbols[i]; + // var l = FindAllSymbol(s); + // if (l != null && l.Contains(asset)) l.Remove(asset); + //} + } + + internal void Check4Usage() + { + queueUsedBy.Clear(); + queueUsedBy.AddRange(AssetMap.Values.ToArray()); + workCount += queueUsedBy.Count; + + for (var i = 0; i < queueUsedBy.Count; i++) + { + FR2_Asset q = queueUsedBy[i]; + + if (q.UsedByMap == null) + { + q.UsedByMap = new Dictionary(); + q.ScriptUsage = new List(); + } + else + { + q.UsedByMap.Clear(); + q.ScriptUsage.Clear(); + } + } + + ready = workCount > 0; + Check4Work(); + } + + internal void Check4Work() + { + if (disabled || workCount == 0) + { + return; + } + + ready = false; + EditorApplication.update -= AsyncProcess; + EditorApplication.update += AsyncProcess; + } + + //public float asyncDelay = 0.5f; + //public const float FRAME_DURATION = 1/5000f; + + internal void AsyncProcess() + { + if (this == null) + { + return; + } + + //EditorApplication.isPlayingOrWillChangePlaymode || + if (EditorApplication.isCompiling || EditorApplication.isUpdating) + { + return; + } + + //Debug.Log("Async process :: "); + if (frameSkipped++ < 10 - 2 * priority) + { + return; + } + + frameSkipped = 0; + + float t = Time.realtimeSinceStartup; + +#if FR2_DEBUG + //Debug.Log(Mathf.Round(t) + " : " + progress*workCount + "/" + workCount + ":" + isReady); +#endif + + if (!AsyncWork(queueLoadContent, AsyncLoadContent, t)) + { + return; + } + + if (!AsyncWork(queueUsedBy, AsyncUsedBy, t)) + { + return; + } + + workCount = 0; + ready = true; + EditorApplication.update -= AsyncProcess; + EditorUtility.SetDirty(this); + //AssetDatabase.SaveAssets(); //DO NOT SAVE ASSET ! + + + //var windows = Resources.FindObjectsOfTypeAll(); + //for (var i = 0; i < windows.Length; i++) + //{ + // windows[i].Repaint(); + //} + + //Refresh selection + if (onReady != null) + { + onReady(); + } + } + + internal bool AsyncWork(List arr, Action action, float t) + { + float FRAME_DURATION = 1 / 1000f * (priority * 5 + 1); //prevent zero + + int c = arr.Count; + var counter = 0; + + while (c-- > 0) + { + T last = arr[c]; + arr.RemoveAt(c); + action(c, last); + //workCount--; + + float dt = Time.realtimeSinceStartup - t - FRAME_DURATION; + if (dt >= 0) + { + return false; + } + + counter++; + } + + return true; + } + + internal void AsyncLoadContent(int idx, FR2_Asset asset) + { + asset.LoadContent(false); + + //Debug.Log("AsyncLoadContent:" + idx + ":" + asset.guid + ":" + asset.UseGUIDs.Count); + + //if (asset.ScriptSymbols.Count > 0) + //{ + // AddSymbols(asset); + // //if (asset.assetName == "Script1.cs") Debug.Log(asset.assetName + " ---> " + asset.ScriptTokens.Count + ":" + asset.ScriptSymbols.Count); + //} + } + + internal void AsyncUsedBy(int idx, FR2_Asset asset) + { + if (AssetMap == null) + { + Check4Changes(!EditorApplication.isPlaying, false); + } + + if (asset.IsFolder) + { + return; + } + + //for (var i = 0; i < asset.ScriptTokens.Count; i++) + //{ + // var token = asset.ScriptTokens[i]; + // var all = FindAllSymbol(token); + + // if (all == null) continue; + + // //Debug.Log(asset.assetName + " :: Find <" + token + "> ---> " + all.Count); + + // asset.ScriptUsage.Add(token); //definition found ! + + // for (var j = 0; j < all.Count; j++) + // { + // // add to usage list + // if (all[j].IsMissing || all[j].UsedByMap == null) continue; + + // if (!all[j].UsedByMap.ContainsKey(asset.guid)) + // { + // all[j].AddUsedBy(asset.guid, asset); + // } + // } + //} + + foreach (KeyValuePair> item in asset.UseGUIDs) + { + FR2_Asset tAsset; + if (AssetMap.TryGetValue(item.Key, out tAsset)) + { + if (tAsset == null || tAsset.UsedByMap == null) + { + continue; + } + + if (!tAsset.UsedByMap.ContainsKey(asset.guid)) + { + tAsset.AddUsedBy(asset.guid, asset); + } + } + } + + // for (var i = 0; i < asset.UseGUIDs.Count; i++) + // { + // FR2_Asset tAsset; + // if (AssetMap.TryGetValue(asset.UseGUIDs[i], out tAsset)) + // { + // if (tAsset == null || tAsset.UsedByMap == null) continue; + + // if (!tAsset.UsedByMap.ContainsKey(asset.guid)) + // { + // tAsset.AddUsed(asset.guid, asset); + // } + // } + // } + } + + + //---------------------------- Dependencies ----------------------------- + + internal FR2_Asset Get(string guid, bool isForce = false) + { + // string path = AssetDatabase.GUIDToAssetPath(guid); + // if (!isForce && !string.IsNullOrEmpty(path)) + // { + // foreach (var item in FR2_Setting.IgnoreFiltered.Keys) + // { + // if (path.StartsWith(item)) + // { + // FR2_Window.isNoticeIgnore = true; + // return null; + // } + // } + // } + + return AssetMap.ContainsKey(guid) ? AssetMap[guid] : null; + } + + internal List FindAssetsOfType(FR2_AssetType type) + { + var result = new List(); + foreach (KeyValuePair item in AssetMap) + { + if (item.Value.type != type) + { + continue; + } + + result.Add(item.Value); + } + + return result; + } + + internal List FindAssets(string[] guids, bool scanFolder) + { + if (AssetMap == null) + { + Check4Changes(!EditorApplication.isPlaying, false); + } + + var result = new List(); + + if (!isReady) + { +#if FR2_DEBUG + Debug.LogWarning("Cache not ready !"); +#endif + return result; + } + + var folderList = new List(); + + if (guids.Length == 0) + { + return result; + } + + for (var i = 0; i < guids.Length; i++) + { + string guid = guids[i]; + FR2_Asset asset; + if (!AssetMap.TryGetValue(guid, out asset)) + { + continue; + } + + if (asset.IsMissing) + { + continue; + } + + if (asset.IsFolder) + { + if (!folderList.Contains(asset)) + { + folderList.Add(asset); + } + } + else + { + result.Add(asset); + } + } + + if (!scanFolder || folderList.Count == 0) + { + return result; + } + + int count = folderList.Count; + for (var i = 0; i < count; i++) + { + FR2_Asset item = folderList[i]; + + // for (var j = 0; j < item.UseGUIDs.Count; j++) + // { + // FR2_Asset a; + // if (!AssetMap.TryGetValue(item.UseGUIDs[j], out a)) continue; + foreach (KeyValuePair> useM in item.UseGUIDs) + { + FR2_Asset a; + if (!AssetMap.TryGetValue(useM.Key, out a)) + { + continue; + } + + if (a.IsMissing) + { + continue; + } + + if (a.IsFolder) + { + if (!folderList.Contains(a)) + { + folderList.Add(a); + count++; + } + } + else + { + result.Add(a); + } + } + } + + return result; + } + + //---------------------------- Dependencies ----------------------------- + + internal List> ScanSimilar(Action IgnoreWhenScan, Action IgnoreFolderWhenScan) + { + if (AssetMap == null) + { + Check4Changes(!EditorApplication.isPlaying, true); + } + + var dict = new Dictionary>(); + foreach (KeyValuePair item in AssetMap) + { + if (item.Value == null) + { + continue; + } + + if (item.Value.IsMissing || item.Value.IsFolder) + { + continue; + } + + if (item.Value.inPlugins) + { + continue; + } + + if (item.Value.inEditor) + { + continue; + } + + // if (item.Value.extension != ".png" && item.Value.extension != ".jpg") continue; + if (FR2_Setting.IsTypeExcluded(AssetType.GetIndex(item.Value.extension))) + { + // Debug.LogWarning("ignore: " +item.Value.assetPath); + if (IgnoreWhenScan != null) + { + IgnoreWhenScan(); + } + + continue; + } + + var isBreak = false; + foreach (string ignore in FR2_Setting.IgnoreFiltered.Keys) + { + if (item.Value.assetPath.StartsWith(ignore)) + { + isBreak = true; + if (IgnoreFolderWhenScan != null) + { + IgnoreFolderWhenScan(); + } + + // Debug.Log("ignore " + item.Value.assetPath + " path ignore " + ignore); + break; + } + } + + if (isBreak) + { + continue; + } + + + string hash = item.Value.fileInfoHash; + if (string.IsNullOrEmpty(hash)) + { +#if FR2_DEBUG + Debug.LogWarning("Hash can not be null! "); +#endif + continue; + } + + List list; + if (!dict.TryGetValue(hash, out list)) + { + list = new List(); + dict.Add(hash, list); + } + + list.Add(item.Value); + } + + List> result = dict.Values.Where(item => item.Count > 1).ToList(); + + result.Sort((item1, item2) => { return item2[0].fileSize.CompareTo(item1[0].fileSize); }); + + return result.Select(l => l.Select(i => i.assetPath).ToList()).ToList(); + } + + + //internal List ScanDuplication(){ + // if (AssetMap == null) Check4Changes(false); + + // var dict = new Dictionary(); + // foreach (var item in AssetMap){ + // if (item.Value.IsMissing || item.Value.IsFolder) continue; + // var hash = item.Value.GetFileInfoHash(); + // FR2_DuplicateInfo info; + + // if (!dict.TryGetValue(hash, out info)){ + // info = new FR2_DuplicateInfo(hash, item.Value.fileSize); + // dict.Add(hash, info); + // } + + // info.assets.Add(item.Value); + // } + + // var result = new List(); + // foreach (var item in dict){ + // if (item.Value.assets.Count > 1){ + // result.Add(item.Value); + // } + // } + + // result.Sort((item1, item2)=>{ + // return item2.fileSize.CompareTo(item1.fileSize); + // }); + + // return result; + //} + + internal List ScanUnused() + { + if (AssetMap == null) + { + Check4Changes(!EditorApplication.isPlaying, false); + } + + var result = new List(); + foreach (KeyValuePair item in AssetMap) + { + FR2_Asset v = item.Value; + if (v.IsMissing || v.inEditor || v.IsScript || v.inResources || v.inPlugins || v.inStreamingAsset || + v.IsFolder) + { + continue; + } + + if (v.UsedByMap.Count == 0 && !FR2_Asset.IGNORE_UNUSED_GUIDS.Contains(v.guid)) + { + result.Add(v); + } + } + + result.Sort((item1, item2) => + { + if (item1.extension == item2.extension) + { + return item1.assetPath.CompareTo(item2.assetPath); + } + + return item1.extension.CompareTo(item2.extension); + }); + return result; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Cache.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Cache.cs.meta new file mode 100644 index 0000000..117c49b --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Cache.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 933e0cc22e789714c87e348a699023d7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs b/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs new file mode 100644 index 0000000..dba7ad1 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs @@ -0,0 +1,46 @@ +using UnityEditor; +using UnityEngine; +using vietlabs.fr2; + +[CustomEditor(typeof(FR2_Cache))] +internal class FR2_CacheEditor : Editor +{ + private static string inspectGUID; + private static int index; + + public override void OnInspectorGUI() + { + var c = (FR2_Cache) target; + + GUILayout.Label("Total : " + c.AssetList.Count); + + c.priority = EditorGUILayout.IntSlider("Priority", c.priority, 0, 5); + + + Object s = Selection.activeObject; + if (s == null) + { + return; + } + + string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(s)); + + if (inspectGUID != guid) + { + inspectGUID = guid; + index = c.AssetList.FindIndex(item => item.guid == guid); + } + + if (index != -1) + { + if (index >= c.AssetList.Count) + { + index = 0; + } + + serializedObject.Update(); + SerializedProperty prop = serializedObject.FindProperty("AssetList").GetArrayElementAtIndex(index); + EditorGUILayout.PropertyField(prop, true); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs.meta b/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs.meta new file mode 100644 index 0000000..ab92749 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_CacheEditor.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f9b9c04ea6b703343b8aff08a26cf9aa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs b/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs new file mode 100644 index 0000000..e2dff97 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs @@ -0,0 +1,912 @@ +//#define FR2_DEBUG + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; +using CBParams = System.Collections.Generic.List>; +using Object = UnityEngine.Object; + +namespace vietlabs.fr2 +{ + //internal class FR2_DuplicateAsset : FR2_TreeItemUI + //{ + // public FR2_Asset asset; + + // public FR2_DuplicateAsset(FR2_Asset asset) + // { + // this.asset = asset; + // } + + // protected override void Draw(Rect r) + // { + // var drawR = r; + // drawR.xMin -= 16f; + // asset.Draw(drawR, false, true, window); + + // var bRect = r; + // bRect.xMin += bRect.width - 50f; + // if (GUI.Button(bRect, "Use", EditorStyles.miniButton)) + // { + // EditorGUIUtility.systemCopyBuffer = asset.guid; + // Debug.Log("guid: " + asset.guid + " systemCopyBuffer " + EditorGUIUtility.systemCopyBuffer); + // Selection.objects = (parent as FR2_DuplicateFolder).children.Select( + // a => FR2_Unity.LoadAssetAtPath(((FR2_DuplicateAsset) a).asset.assetPath) + // ).ToArray(); + // FR2_Export.MergeDuplicate(); + // } + + // //if (GUI.Button(bRect, "Remove Others", EditorStyles.miniButton)) + // //{ + // // EditorGUIUtility.systemCopyBuffer = asset.guid; + // // Selection.objects = (parent as FR2_DuplicateFolder).children.Select( + // // a => FR2_Unity.LoadAssetAtPath(((FR2_DuplicateAsset)a).asset.assetPath) + // // ).ToArray(); + // // FR2_Export.MergeDuplicate(); + // //} + // } + //} + + //internal class FR2_DuplicateFolder : FR2_TreeItemUI + //{ + // private static FR2_FileCompare comparer; + // public string assetPath; + // public string count; + // public string filesize; + // public string label; + + // public FR2_DuplicateFolder(List list) + // { + // list.Sort((item1, item2) => { return item1.CompareTo(item2); }); + + // var first = true; + // for (var i = 0; i < list.Count; i++) + // { + // var item = list[i]; + // var asset = FR2_Cache.Api.Get(AssetDatabase.AssetPathToGUID(item)); + + // if (asset == null) + // { + // Debug.LogWarning("Something wrong, asset not found <" + item + ">"); + // continue; + // } + + // if (first) + // { + // first = false; + // label = asset.assetName; + // count = list.Count.ToString(); + // filesize = GetfileSizeString(asset.fileSize); + // assetPath = item; + // } + + // AddChild(new FR2_DuplicateAsset(asset)); + // } + // } + + // private string GetfileSizeString(long fileSize) + // { + // return fileSize <= 1024 + // ? fileSize + " B" + // : fileSize <= 1024*1024 + // ? Mathf.RoundToInt(fileSize/1024f) + " KB" + // : Mathf.RoundToInt(fileSize/1024f/1024f) + " MB"; + // } + + // protected override void Draw(Rect r) + // { + // var tex = AssetDatabase.GetCachedIcon(assetPath); + // var rect = r; + + // if (tex != null) + // { + // rect.width = 16f; + // GUI.DrawTexture(rect, tex); + // } + + // rect = r; + // rect.xMin += 16f; + // GUI.Label(rect, label, EditorStyles.boldLabel); + + // rect = r; + // rect.xMin += rect.width - 50f; + // GUI.Label(rect, filesize, EditorStyles.miniLabel); + + // rect = r; + // rect.xMin += rect.width - 70f; + // GUI.Label(rect, count, EditorStyles.miniLabel); + + // rect = r; + // rect.xMin += rect.width - 70f; + // } + //} + internal class FR2_DuplicateTree2 : IRefDraw + { + private const float TimeDelayDelete = .5f; + + private static readonly FR2_FileCompare fc = new FR2_FileCompare(); + private readonly FR2_TreeUI2.GroupDrawer groupDrawer; + private CBParams cacheAssetList; + private bool caseSensitive; + private Dictionary> dicIndex; //index, list + + private bool dirty; + private int excludeCount; + private string guidPressDelete; + private List list; + private Dictionary refs; + public int scanExcludeByIgnoreCount; + public int scanExcludeByTypeCount; + private string searchTerm = ""; + private bool showFilter; + private bool showIgnore; + private float TimePressDelete; + + public FR2_DuplicateTree2(IWindow window) + { + this.window = window; + groupDrawer = new FR2_TreeUI2.GroupDrawer(DrawGroup, DrawAsset); + } + + public IWindow window { get; set; } + + + public bool Draw() + { + if (dirty) + { + RefreshView(cacheAssetList); + } + + + if (fc.nChunks2 > 0 && fc.nScaned < fc.nChunks2) + { + FR2_Cache api = FR2_Cache.Api; + float w = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = 70f; + api.priority = EditorGUILayout.IntSlider("Priority", api.priority, 0, 5); + EditorGUIUtility.labelWidth = w; + + Rect rect = GUILayoutUtility.GetRect(1, Screen.width, 18f, 18f); + float p = fc.nScaned / (float) fc.nChunks2; + + EditorGUI.ProgressBar(rect, p, string.Format("Scanning {0} / {1}", fc.nScaned, fc.nChunks2)); + GUILayout.FlexibleSpace(); + return true; + } + + DrawHeader(); + groupDrawer.Draw(); + return false; + } + + public int ElementCount() + { + return list == null ? 0 : list.Count; + } + + private void DrawAsset(Rect r, string guid) + { + FR2_Ref rf; + if (!refs.TryGetValue(guid, out rf)) + { + return; + } + + if (rf.depth == 1) //mode != Mode.Dependency && + { + Color c = GUI.color; + GUI.color = Color.blue; + GUI.DrawTexture(new Rect(r.x - 4f, r.y + 2f, 2f, 2f), EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + rf.asset.Draw(r, false, FR2_Setting.GroupMode != FR2_RefDrawer.Mode.Folder, window, false); + + Texture tex = AssetDatabase.GetCachedIcon(rf.asset.assetPath); + if (tex == null) + { + return; + } + + Rect drawR = r; + drawR.x = drawR.x + drawR.width - 60f; // (groupDrawer.TreeNoScroll() ? 60f : 70f) ; + drawR.width = 40f; + drawR.y += 1; + drawR.height -= 2; + + if (GUI.Button(drawR, "Use", EditorStyles.miniButton)) + { + if (FR2_Export.IsMergeProcessing) + { + Debug.LogWarning("Previous merge is processing"); + } + else + { + AssetDatabase.SaveAssets(); + EditorGUIUtility.systemCopyBuffer = rf.asset.guid; + EditorGUIUtility.systemCopyBuffer = rf.asset.guid; + // Debug.Log("guid: " + rf.asset.guid + " systemCopyBuffer " + EditorGUIUtility.systemCopyBuffer); + int index = rf.index; + Selection.objects = list.Where(x => x.index == index) + .Select(x => FR2_Unity.LoadAssetAtPath(x.asset.assetPath)).ToArray(); + FR2_Export.MergeDuplicate(); + } + } + + if (rf.asset.UsageCount() > 0) + { + return; + } + + drawR.x -= 25; + drawR.width = 20; + if (wasPreDelete(guid)) + { + Color col = GUI.color; + GUI.color = Color.red; + if (GUI.Button(drawR, "X", EditorStyles.miniButton)) + { + guidPressDelete = null; + AssetDatabase.DeleteAsset(rf.asset.assetPath); + } + + GUI.color = col; + window.WillRepaint = true; + } + else + { + if (GUI.Button(drawR, "X", EditorStyles.miniButton)) + { + guidPressDelete = guid; + TimePressDelete = Time.realtimeSinceStartup; + window.WillRepaint = true; + } + } + } + + private bool wasPreDelete(string guid) + { + if (guidPressDelete == null || guid != guidPressDelete) + { + return false; + } + + if (Time.realtimeSinceStartup - TimePressDelete < TimeDelayDelete) + { + return true; + } + + guidPressDelete = null; + return false; + } + + private void DrawGroup(Rect r, string label, int childCount) + { + // GUI.Label(r, label + " (" + childCount + ")", EditorStyles.boldLabel); + FR2_Asset asset = dicIndex[label][0].asset; + + Texture tex = AssetDatabase.GetCachedIcon(asset.assetPath); + Rect rect = r; + + if (tex != null) + { + rect.width = 16f; + GUI.DrawTexture(rect, tex); + } + + rect = r; + rect.xMin += 16f; + GUI.Label(rect, asset.assetName, EditorStyles.boldLabel); + + rect = r; + rect.xMin += rect.width - 50f; + GUI.Label(rect, FR2_Helper.GetfileSizeString(asset.fileSize), EditorStyles.miniLabel); + + rect = r; + rect.xMin += rect.width - 70f; + GUI.Label(rect, childCount.ToString(), EditorStyles.miniLabel); + + rect = r; + rect.xMin += rect.width - 70f; + } + + + // private List duplicated; + + public void Reset(CBParams assetList) + { + fc.Reset(assetList, OnUpdateView, RefreshView); + } + + private void OnUpdateView(CBParams assetList) { } + + public bool isExclueAnyItem() + { + return excludeCount > 0 || scanExcludeByTypeCount > 0; + } + + public bool isExclueAnyItemByIgnoreFolder() + { + return scanExcludeByIgnoreCount > 0; + } + + // void OnActive + private void RefreshView(CBParams assetList) + { + cacheAssetList = assetList; + dirty = false; + list = new List(); + refs = new Dictionary(); + dicIndex = new Dictionary>(); + if (assetList == null) + { + return; + } + + int minScore = searchTerm.Length; + string term1 = searchTerm; + if (!caseSensitive) + { + term1 = term1.ToLower(); + } + + string term2 = term1.Replace(" ", string.Empty); + excludeCount = 0; + + for (var i = 0; i < assetList.Count; i++) + { + var lst = new List(); + for (var j = 0; j < assetList[i].Count; j++) + { + string guid = AssetDatabase.AssetPathToGUID(assetList[i][j]); + if (string.IsNullOrEmpty(guid)) + { + continue; + } + + if (refs.ContainsKey(guid)) + { + continue; + } + + FR2_Asset asset = FR2_Cache.Api.Get(guid); + if (asset == null) + { + continue; + } + + var fr2 = new FR2_Ref(i, 0, asset, null); + + if (FR2_Setting.IsTypeExcluded(fr2.type)) + { + excludeCount++; + continue; //skip this one + } + + if (string.IsNullOrEmpty(searchTerm)) + { + fr2.matchingScore = 0; + list.Add(fr2); + lst.Add(fr2); + refs.Add(guid, fr2); + continue; + } + + //calculate matching score + string name1 = fr2.asset.assetName; + if (!caseSensitive) + { + name1 = name1.ToLower(); + } + + string name2 = name1.Replace(" ", string.Empty); + + int score1 = FR2_Unity.StringMatch(term1, name1); + int score2 = FR2_Unity.StringMatch(term2, name2); + + fr2.matchingScore = Mathf.Max(score1, score2); + if (fr2.matchingScore > minScore) + { + list.Add(fr2); + lst.Add(fr2); + refs.Add(guid, fr2); + } + } + + dicIndex.Add(i.ToString(), lst); + } + + ResetGroup(); + } + + private void ResetGroup() + { + //folderDrawer.GroupByAssetType(list); + groupDrawer.Reset(list, + rf => rf.asset.guid + , GetGroup, SortGroup); + if (window != null) + { + window.Repaint(); + } + } + + private string GetGroup(FR2_Ref rf) + { + return rf.index.ToString(); + } + + private void SortGroup(List groups) + { + // groups.Sort( (item1, item2) => + // { + // if (item1 == "Others" || item2 == "Selection") return 1; + // if (item2 == "Others" || item1 == "Selection") return -1; + // return item1.CompareTo(item2); + // }); + } + + public void SetDirty() + { + dirty = true; + } + + public void RefreshSort() { } + + private void DrawHeader() + { +//draw filter + EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); + { + DrawSearch(); + GUILayout.Space(5); + Color col = GUI.color; + GUI.color = FR2_Cache.Api.setting.ScanColor; + if (GUILayout.Button("Scan", EditorStyles.toolbarButton, GUILayout.Width(60))) + { + FR2_Cache.onReady -= OnCacheReady; + FR2_Cache.onReady += OnCacheReady; + FR2_Cache.Api.Check4Changes(true, true); + } + + GUI.color = col; + } + EditorGUILayout.EndHorizontal(); + } + + private void OnCacheReady() + { + scanExcludeByTypeCount = 0; + Reset(FR2_Cache.Api.ScanSimilar(IgnoreTypeWhenScan, IgnoreFolderWhenScan)); + FR2_Cache.onReady -= OnCacheReady; + } + + private void IgnoreTypeWhenScan() + { + scanExcludeByTypeCount++; + } + + private void IgnoreFolderWhenScan() + { + scanExcludeByIgnoreCount++; + } + + private void DrawSearch(string searchLable = "") + { + if (FR2_RefDrawer.toolbarSearchField == null) + { + FR2_RefDrawer.InitSearchStyle(); + } + + GUILayout.BeginHorizontal(EditorStyles.toolbar); + { + bool v = GUILayout.Toggle(caseSensitive, "Aa", EditorStyles.toolbarButton, GUILayout.Width(24f)); + if (v != caseSensitive) + { + caseSensitive = v; + dirty = true; + } + + GUILayout.Space(2f); + string value = GUILayout.TextField(searchTerm, FR2_RefDrawer.toolbarSearchField); + if (searchTerm != value) + { + searchTerm = value; + dirty = true; + } + + GUIStyle style = string.IsNullOrEmpty(searchTerm) + ? FR2_RefDrawer.toolbarSearchFieldCancelButtonEmpty + : FR2_RefDrawer.toolbarSearchFieldCancelButton; + if (GUILayout.Button("Cancel", style)) + { + searchTerm = string.Empty; + dirty = true; + } + + GUILayout.Space(2f); + } + GUILayout.EndHorizontal(); + } + } + + internal class FR2_FileCompare + { + public static HashSet HashChunksNotComplete; + internal static int streamClosedCount; + private CBParams cacheList; + public List deads = new List(); + public List heads = new List(); + + public int nChunks; + public int nChunks2; + public int nScaned; + public Action OnCompareComplete; + + public Action OnCompareUpdate; + private int streamCount; + + public void Reset(CBParams list, Action onUpdate, Action onComplete) + { + nChunks = 0; + nScaned = 0; + nChunks2 = 0; + streamCount = streamClosedCount = 0; + HashChunksNotComplete = new HashSet(); + + if (heads.Count > 0) + { + for (var i = 0; i < heads.Count; i++) + { + heads[i].CloseChunk(); + } + } + + deads.Clear(); + heads.Clear(); + + OnCompareUpdate = onUpdate; + OnCompareComplete = onComplete; + if (list.Count <= 0) + { + OnCompareComplete(new CBParams()); + return; + } + + cacheList = list; + for (var i = 0; i < list.Count; i++) + { + var file = new FileInfo(list[i][0]); + int nChunk = Mathf.CeilToInt(file.Length / (float) FR2_Head.chunkSize); + nChunks2 += nChunk; + } + + // for(int i =0;i< list.Count;i++) + // { + // AddHead(list[i]); + // } + AddHead(cacheList[cacheList.Count - 1]); + cacheList.RemoveAt(cacheList.Count - 1); + + EditorApplication.update -= ReadChunkAsync; + EditorApplication.update += ReadChunkAsync; + } + + public FR2_FileCompare AddHead(List files) + { + if (files.Count < 2) + { + Debug.LogWarning("Something wrong ! head should not contains < 2 elements"); + } + + var chunkList = new List(); + for (var i = 0; i < files.Count; i++) + { + streamCount++; + // Debug.Log("new stream " + files[i]); + chunkList.Add(new FR2_Chunk + { + file = files[i], + stream = new FileStream(files[i], FileMode.Open, FileAccess.Read), + buffer = new byte[FR2_Head.chunkSize] + }); + } + + var file = new FileInfo(files[0]); + int nChunk = Mathf.CeilToInt(file.Length / (float) FR2_Head.chunkSize); + + heads.Add(new FR2_Head + { + fileSize = file.Length, + currentChunk = 0, + nChunk = nChunk, + chunkList = chunkList + }); + + nChunks += nChunk; + + return this; + } + + private bool checkCompleteAllCurFile() + { + return streamClosedCount + HashChunksNotComplete.Count >= streamCount; //-1 for safe + } + + private void ReadChunkAsync() + { + bool alive = ReadChunk(); + HashChunksNotComplete.RemoveWhere(x => x.stream == null || !x.stream.CanRead); + if (cacheList.Count > 0 && checkCompleteAllCurFile()) //complete all chunk + { + int numCall = FR2_Cache.Api.priority; // - 2; + if (numCall <= 0) + { + numCall = 1; + } + + for (var i = 0; i < numCall; i++) + { + if (cacheList.Count <= 0) + { + break; + } + + AddHead(cacheList[cacheList.Count - 1]); + cacheList.RemoveAt(cacheList.Count - 1); + } + } + + var update = false; + + for (int i = heads.Count - 1; i >= 0; i--) + { + FR2_Head h = heads[i]; + if (h.isDead) + { + h.CloseChunk(); + heads.RemoveAt(i); + if (h.chunkList.Count > 1) + { + update = true; + deads.Add(h); + } + } + } + + if (update) + { + Trigger(OnCompareUpdate); + } + + if (!alive && cacheList.Count <= 0 && checkCompleteAllCurFile() + ) //&& cacheList.Count <= 0 complete all chunk and cache list empty + { + foreach (FR2_Chunk item in HashChunksNotComplete) + { + if (item.stream != null && item.stream.CanRead) + { + item.stream.Close(); + item.stream = null; + } + } + + HashChunksNotComplete.Clear(); + // Debug.Log("complete "); + nScaned = nChunks; + EditorApplication.update -= ReadChunkAsync; + Trigger(OnCompareComplete); + } + } + + private void Trigger(Action cb) + { + if (cb == null) + { + return; + } + + CBParams list = deads.Select(item => item.GetFiles()).ToList(); + +//#if FR2_DEBUG +// Debug.Log("Callback ! " + deads.Count + ":" + heads.Count); +//#endif + cb(list); + } + + private bool ReadChunk() + { + var alive = false; + for (var i = 0; i < heads.Count; i++) + { + FR2_Head h = heads[i]; + if (h.isDead) + { + Debug.LogWarning("Should never be here : " + h.chunkList[0].file); + continue; + } + + nScaned++; + alive = true; + h.ReadChunk(); + h.CompareChunk(heads); + break; + } + + //if (!alive) return false; + + //alive = false; + //for (var i = 0; i < heads.Count; i++) + //{ + // var h = heads[i]; + // if (h.isDead) continue; + + // h.CompareChunk(heads); + // alive |= !h.isDead; + //} + + return alive; + } + } + + internal class FR2_Head + { + public const int chunkSize = 10240; + + public List chunkList; + public int currentChunk; + + public long fileSize; + + public int nChunk; + public int size; //last stream read size + + public bool isDead + { + get { return currentChunk == nChunk || chunkList.Count == 1; } + } + + public List GetFiles() + { + return chunkList.Select(item => item.file).ToList(); + } + + public void AddToDict(byte b, FR2_Chunk chunk, Dictionary> dict) + { + List list; + if (!dict.TryGetValue(b, out list)) + { + list = new List(); + dict.Add(b, list); + } + + list.Add(chunk); + } + + public void CloseChunk() + { + for (var i = 0; i < chunkList.Count; i++) + { + // Debug.Log("stream close"); + FR2_FileCompare.streamClosedCount++; + chunkList[i].stream.Close(); + chunkList[i].stream = null; + } + } + + public void ReadChunk() + { +#if FR2_DEBUG + if (currentChunk == 0) Debug.LogWarning("Read <" + chunkList[0].file + "> " + currentChunk + ":" + nChunk); +#endif + if (currentChunk == nChunk) + { + Debug.LogWarning("Something wrong, should dead <" + isDead + ">"); + return; + } + + int from = currentChunk * chunkSize; + size = (int) Mathf.Min(fileSize - from, chunkSize); + + for (var i = 0; i < chunkList.Count; i++) + { + FR2_Chunk chunk = chunkList[i]; + chunk.size = size; + chunk.stream.Read(chunk.buffer, 0, size); + } + + currentChunk++; + } + + public void CompareChunk(List heads) + { + int idx = chunkList.Count; + byte[] buffer = chunkList[idx - 1].buffer; + + while (--idx >= 0) + { + FR2_Chunk chunk = chunkList[idx]; + int diff = FirstDifferentIndex(buffer, chunk.buffer, size); + if (diff == -1) + { + continue; + } +#if FR2_DEBUG + Debug.Log(string.Format( + " --> Different found at : idx={0} diff={1} size={2} chunk={3}", + idx, diff, size, currentChunk)); +#endif + + byte v = buffer[diff]; + var d = new Dictionary>(); //new heads + chunkList.RemoveAt(idx); + FR2_FileCompare.HashChunksNotComplete.Add(chunk); + + AddToDict(chunk.buffer[diff], chunk, d); + + for (int j = idx - 1; j >= 0; j--) + { + FR2_Chunk tChunk = chunkList[j]; + byte tValue = tChunk.buffer[diff]; + if (tValue == v) + { + continue; + } + + idx--; + FR2_FileCompare.HashChunksNotComplete.Add(tChunk); + chunkList.RemoveAt(j); + AddToDict(tChunk.buffer[diff], tChunk, d); + } + + foreach (KeyValuePair> item in d) + { + List list = item.Value; + if (list.Count == 1) + { +#if FR2_DEBUG + Debug.Log(" --> Dead head found for : " + list[0].file); +#endif + } + else if (list.Count > 1) // 1 : dead head + { +#if FR2_DEBUG + Debug.Log(" --> NEW HEAD : " + list[0].file); +#endif + heads.Add(new FR2_Head + { + nChunk = nChunk, + fileSize = fileSize, + currentChunk = currentChunk - 1, + chunkList = list + }); + } + } + } + } + + internal static int FirstDifferentIndex(byte[] arr1, byte[] arr2, int maxIndex) + { + for (var i = 0; i < maxIndex; i++) + { + if (arr1[i] != arr2[i]) + { + return i; + } + } + + return -1; + } + } + + internal class FR2_Chunk + { + public byte[] buffer; + public string file; + public long size; + public FileStream stream; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs.meta new file mode 100644 index 0000000..ad3f33a --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Duplicate.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d5c2f1d0a3c6acc4a9cf0d8f013f14d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Export.cs b/Assets/Scripts/Editor/FR2/FR2_Export.cs new file mode 100644 index 0000000..3976d05 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Export.cs @@ -0,0 +1,442 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class FR2_Export + { + // private static int processIndex; + private const int maxThread = 5; + + //[MenuItem("Assets/FR2/Tools/Merge Duplicates")] + + private static Dictionary listReplace; + private static List lstThreads; + public static bool IsMergeProcessing { get; private set; } + + [MenuItem("Assets/FR2/Toggle Ignore", false, 19)] + private static void Ignore() + { + Object[] actives = Selection.objects; + for (var i = 0; i < actives.Length; i++) + { + string path = AssetDatabase.GetAssetPath(actives[i]); + if (path.Equals(FR2_Cache.DEFAULT_CACHE_PATH)) + { + continue; + } + + if (FR2_Setting.IgnoreAsset.Contains(path)) + { + FR2_Setting.RemoveIgnore(path); + } + else + { + FR2_Setting.AddIgnore(path); + } + } + } + + [MenuItem("Assets/FR2/Copy GUID", false, 20)] + private static void CopyGUID() + { + EditorGUIUtility.systemCopyBuffer = AssetDatabase.AssetPathToGUID( + AssetDatabase.GetAssetPath(Selection.activeObject) + ); + } + + [MenuItem("Assets/FR2/Export Selection", false, 21)] + private static void ExportSelection() + { + FR2_Unity.ExportSelection(); + } + + [MenuItem("Assets/FR2/Select Dependencies (assets I use)", false, 22)] + private static void SelectDependencies_wtme() + { + SelectDependencies(false); + } + + [MenuItem("Assets/FR2/Select Dependencies included me", false, 23)] + private static void SelectDependencies_wme() + { + SelectDependencies(true); + } + + //[MenuItem("Assets/FR2/Select")] + [MenuItem("Assets/FR2/Select Used (assets used me)", false, 24)] + private static void SelectUsed_wtme() + { + SelectUsed(false); + } + + [MenuItem("Assets/FR2/Select Used included me", false, 25)] + private static void SelectUsed_wme() + { + SelectUsed(true); + } + + [MenuItem("Assets/FR2/Export Dependencies", false, 40)] + private static void ExportDependencies() + { + Selection.objects = GetSelectionDependencies().ToArray(); + FR2_Unity.ExportSelection(); + } + + [MenuItem("Assets/FR2/Export Assets (no scripts)", false, 41)] + private static void ExportAsset() + { + List list = GetSelectionDependencies(); + for (int i = list.Count - 1; i >= 0; i--) + { + if (list[i] is MonoScript) + { + list.RemoveAt(i); + } + } + + //Debug.Log(i + ":" + list[i] + ":" + list[i].GetType()); + Selection.objects = list.ToArray(); + FR2_Unity.ExportSelection(); + } + + public static void MergeDuplicate() + { + // for (int i = 0; i < Selection.objects.Length; i++) + // { + // Object item = Selection.objects[i]; + // Debug.Log(item.name); + // } + string guid = EditorGUIUtility.systemCopyBuffer; + // var wat = new System.Diagnostics.Stopwatch(); + // wat.Start(); + //validate clipboard guid + string gPath = AssetDatabase.GUIDToAssetPath(guid); + if (string.IsNullOrEmpty(gPath) || !gPath.StartsWith("Assets/")) + { + Debug.LogWarning("Invalid guid <" + guid + "> in clipboard, can not replace !"); + return; + } + + List guids = FR2_Unity.Selection_AssetGUIDs.ToList(); + if (!guids.Contains(guid)) + { + Debug.LogWarning("Clipboard guid <" + guid + + "> not found in Selection, you may not intentionally replace selection assets by clipboard guid"); + return; + } + + guids.Remove(guid); + if (guids.Count == 0) + { + Debug.LogWarning("No new asset selected to replace, must select all duplications to replace"); + return; + } + + List assetList = FR2_Cache.Api.FindAssets(guids.ToArray(), false); + // var dictAsset = new Dictionary(); + + //replace one by one + listReplace = new Dictionary(); + lstThreads = new List(); + for (int i = assetList.Count - 1; i >= 0; i--) + { + // Debug.Log("FR2 Replace GUID : " + assetList[i].guid + " ---> " + guid + " : " + assetList[i].UsedByMap.Count + " assets updated"); + string fromId = assetList[i].guid; + + List arr = assetList[i].UsedByMap.Values.ToList(); + for (var j = 0; j < arr.Count; j++) + { + FR2_Asset a = arr[j]; + if (!listReplace.ContainsKey(a.assetPath)) + { + listReplace.Add(a.assetPath, new ProcessReplaceData()); + } + + listReplace[a.assetPath].datas.Add(new ReplaceData + { + from = fromId, + to = guid, + asset = a + }); + } + } + + foreach (KeyValuePair item in listReplace) + { + item.Value.processIndex = item.Value.datas.Count - 1; + } + + IsMergeProcessing = true; + EditorApplication.update -= ApplicationUpdate; + EditorApplication.update += ApplicationUpdate; + + // for (var i = assetList.Count - 1; i >= 0; i--) + // { + // // Debug.Log("FR2 Replace GUID : " + assetList[i].guid + " ---> " + guid + " : " + assetList[i].UsedByMap.Count + " assets updated"); + // var from = assetList[i].guid; + + // var arr = assetList[i].UsedByMap.Values.ToList(); + // for (var j = 0; j < arr.Count; j ++) + // { + // var a = arr[j]; + // var result = a.ReplaceReference(from, guid); + + // if (result && !dictAsset.ContainsKey(a.guid)) + // { + // dictAsset.Add(a.guid, 1); + // } + // } + // } + // Debug.Log("Time replace guid " + wat.ElapsedMilliseconds); + // wat = new System.Diagnostics.Stopwatch(); + // wat.Start(); + // var listRefresh = dictAsset.Keys.ToList(); + // for (var i = 0; i < listRefresh.Count; i++) + // { + // FR2_Cache.Api.RefreshAsset(listRefresh[i], true); + // } + + // FR2_Cache.Api.RefreshSelection(); + // FR2_Cache.Api.Check4Usage(); + // AssetDatabase.Refresh(); + // Debug.Log("Time replace guid " + wat.ElapsedMilliseconds); + } + + private static void ApplicationUpdate() + { + bool notComplete = listReplace.Where(x => x.Value.processIndex >= 0).Count() > 0; + if (lstThreads.Count <= 0 && notComplete) + { + foreach (KeyValuePair item in listReplace) + { + if (item.Value.processIndex >= 0) + { + ReplaceData a = item.Value.datas[item.Value.processIndex--]; + a.isTerrian = a.asset.type == FR2_AssetType.TERRAIN; + if (a.isTerrian) + { + a.terrainData = + AssetDatabase.LoadAssetAtPath(a.asset.assetPath, typeof(Object)) as TerrainData; + } + + var thread = new Thread( + delegate() + { + lock (a) + { + a.isSucess = a.asset.ReplaceReference(a.from, a.to, a.terrainData); + // Debug.Log(a.asset.assetPath+" "+ a.isSucess); + } + }); + lstThreads.Add(thread); + thread.Start(); + } + } + } + + for (int i = lstThreads.Count - 1; i >= 0; i--) + { + if (!lstThreads[i].IsAlive) + { + lstThreads.RemoveAt(i); + } + } + + foreach (KeyValuePair item in listReplace) + { + List lst = item.Value.datas; + for (var i = 0; i < lst.Count; i++) + { + ReplaceData data = lst[i]; + if (!data.isUpdated && data.isSucess) + { + data.isUpdated = true; + if (data.isTerrian) + { + EditorUtility.SetDirty(data.terrainData); + AssetDatabase.SaveAssets(); + data.terrainData = null; + FR2_Unity.UnloadUnusedAssets(); + } + else + { + AssetDatabase.ImportAsset(data.asset.assetPath, ImportAssetOptions.Default); + } + } + } + } + + + if (lstThreads.Count <= 0 && !notComplete) //complete + { + var guidsRefreshed = new HashSet(); + EditorApplication.update -= ApplicationUpdate; + foreach (KeyValuePair item in listReplace) + { + List lst = item.Value.datas; + for (var i = 0; i < lst.Count; i++) + { + ReplaceData data = lst[i]; + if (data.isSucess && !guidsRefreshed.Contains(data.asset.guid)) + { + guidsRefreshed.Add(data.asset.guid); + FR2_Cache.Api.RefreshAsset(data.asset.guid, true); + } + } + } + + lstThreads = null; + listReplace = null; + FR2_Cache.Api.RefreshSelection(); + FR2_Cache.Api.Check4Usage(); + // EditorUtility.SetDirty(FR2_Cache.Api); + AssetDatabase.Refresh(); + IsMergeProcessing = false; + } + } + + + //[MenuItem("Assets/FR2/Tools/Fix Model Import Material")] + //public static void FixModelImportMaterial(){ + // if (Selection.activeObject == null) return; + // CreatePrefabReplaceModel((GameObject)Selection.activeObject); + //} + + //[MenuItem("GameObject/FR2/Paste Materials", false, 10)] + //public static void PasteMaterials(){ + // if (Selection.activeObject == null) return; + + // var r = Selection.activeGameObject.GetComponent(); + // Undo.RecordObject(r, "Replace Materials"); + // r.materials = model_materials; + // EditorUtility.SetDirty(r); + //} + + //[MenuItem("GameObject/FR2/Copy Materials", false, 10)] + //public static void CopyMaterials(){ + // if (Selection.activeObject == null) return; + // var r = Selection.activeGameObject.GetComponent(); + // if (r == null) return; + // model_materials = r.sharedMaterials; + //} + + //-------------------------- APIs ---------------------- + + private static void SelectDependencies(bool includeMe) + { + List list = FR2_Cache.Api.FindAssets(FR2_Unity.Selection_AssetGUIDs, false); + var dict = new Dictionary(); + + if (includeMe) + { + AddToDict(dict, list.ToArray()); + } + + for (var i = 0; i < list.Count; i++) + { + AddToDict(dict, FR2_Asset.FindUsage(list[i]).ToArray()); + } + + Selection.objects = dict.Values.ToArray(); + } + + private static void SelectUsed(bool includeMe) + { + List list = FR2_Cache.Api.FindAssets(FR2_Unity.Selection_AssetGUIDs, false); + var dict = new Dictionary(); + + if (includeMe) + { + AddToDict(dict, list.ToArray()); + } + + for (var i = 0; i < list.Count; i++) + { + AddToDict(dict, list[i].UsedByMap.Values.ToArray()); + } + + Selection.objects = dict.Values.ToArray(); + } + + + //-------------------------- UTILS --------------------- + + internal static void AddToDict(Dictionary dict, params FR2_Asset[] list) + { + for (var j = 0; j < list.Length; j++) + { + string guid = list[j].guid; + if (!dict.ContainsKey(guid)) + { + string assetPath = AssetDatabase.GUIDToAssetPath(guid); + dict.Add(guid, FR2_Unity.LoadAssetAtPath(assetPath)); + } + } + } + + private static List GetSelectionDependencies() + { + if (!FR2_Cache.isReady) + { + Debug.LogWarning("FR2 cache not yet ready, please open Window > FR2_Window !"); + return null; + } + + return FR2_Cache.FindUsage(FR2_Unity.Selection_AssetGUIDs).Select( + guid => + { + string assetPath = AssetDatabase.GUIDToAssetPath(guid); + return FR2_Unity.LoadAssetAtPath(assetPath); + } + ).ToList(); + } + + private class ProcessReplaceData + { + public readonly List datas = new List(); + public int processIndex; + } + + private class ReplaceData + { + public FR2_Asset asset; + public string from; + public bool isSucess; + public bool isTerrian; + public bool isUpdated; + public TerrainData terrainData; + public string to; + } + + // AssetDatabase.ImportAsset(oAssetPath, ImportAssetOptions.Default); + // importer.importMaterials = false; + // var importer = AssetImporter.GetAtPath(oAssetPath) as ModelImporter; + // var nModel = AssetDatabase.LoadAssetAtPath(oAssetPath); + + // // Reimport model with importMaterial = false + // var extension = Path.GetExtension(oAssetPath); + + // model_materials = model.GetComponent().sharedMaterials; + // var oGUID = AssetDatabase.AssetPathToGUID(oAssetPath); + + // var oAssetPath = AssetDatabase.GetAssetPath(model); + // if (model == null) return; + //{ + //static void CreatePrefabReplaceModel(GameObject model) + + //static Material[] model_materials; + + // //create prefab from new model + // var prefabPath = oAssetPath.Replace(extension, ".prefab"); + // var clone = (GameObject)Object.Instantiate(nModel); + // clone.GetComponent().sharedMaterials = model_materials; + // PrefabUtility.CreatePrefab(prefabPath, clone, ReplacePrefabOptions.ReplaceNameBased); + // AssetDatabase.SaveAssets(); + // GameObject.DestroyImmediate(clone); + //} + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Export.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Export.cs.meta new file mode 100644 index 0000000..872d84c --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Export.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b543c2ce7dc56c2418505cbb6cb7852d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Helper.cs b/Assets/Scripts/Editor/FR2/FR2_Helper.cs new file mode 100644 index 0000000..1e04ccb --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Helper.cs @@ -0,0 +1,211 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace vietlabs.fr2 +{ + public class FR2_Helper + { + internal static readonly AssetType[] FILTERS = + { + new AssetType("Scene", ".unity"), + new AssetType("Prefab", ".prefab"), + new AssetType("Model", ".3df", ".3dm", ".3dmf", ".3dv", ".3dx", ".c5d", ".lwo", ".lws", ".ma", ".mb", + ".mesh", ".vrl", ".wrl", ".wrz", ".fbx", ".dae", ".3ds", ".dxf", ".obj", ".skp", ".max", ".blend"), + new AssetType("Material", ".mat", ".cubemap", ".physicsmaterial"), + new AssetType("Texture", ".ai", ".apng", ".png", ".bmp", ".cdr", ".dib", ".eps", ".exif", ".ico", ".icon", + ".j", ".j2c", ".j2k", ".jas", ".jiff", ".jng", ".jp2", ".jpc", ".jpe", ".jpeg", ".jpf", ".jpg", "jpw", + "jpx", "jtf", ".mac", ".omf", ".qif", ".qti", "qtif", ".tex", ".tfw", ".tga", ".tif", ".tiff", ".wmf", + ".psd", ".exr", ".rendertexture"), + new AssetType("Video", ".asf", ".asx", ".avi", ".dat", ".divx", ".dvx", ".mlv", ".m2l", ".m2t", ".m2ts", + ".m2v", ".m4e", ".m4v", "mjp", ".mov", ".movie", ".mp21", ".mp4", ".mpe", ".mpeg", ".mpg", ".mpv2", + ".ogm", ".qt", ".rm", ".rmvb", ".wmv", ".xvid", ".flv"), + new AssetType("Audio", ".mp3", ".wav", ".ogg", ".aif", ".aiff", ".mod", ".it", ".s3m", ".xm"), + new AssetType("Script", ".cs", ".js", ".boo"), + new AssetType("Text", ".txt", ".json", ".xml", ".bytes", ".sql"), + new AssetType("Shader", ".shader", ".cginc"), + new AssetType("Animation", ".anim", ".controller", ".overridecontroller", ".mask"), + new AssetType("Unity Asset", ".asset", ".guiskin", ".flare", ".fontsettings", ".prefs"), + new AssetType("Others") // + }; + + public static IEnumerable getAllObjsInCurScene() + { + // foreach (GameObject obj in Object.FindObjectsOfType(typeof(GameObject))) + // { + // yield return obj; + // } + + + for (var j = 0; j < SceneManager.sceneCount; j++) + { + Scene scene = SceneManager.GetSceneAt(j); + foreach (GameObject item in GetGameObjectsInScene(scene)) + { + yield return item; + } + } + + if (EditorApplication.isPlaying) + { + //dont destroy scene + GameObject temp = null; + try + { + temp = new GameObject(); + Object.DontDestroyOnLoad(temp); + Scene dontDestroyOnLoad = temp.scene; + Object.DestroyImmediate(temp); + temp = null; + + foreach (GameObject item in GetGameObjectsInScene(dontDestroyOnLoad)) + { + yield return item; + } + } + finally + { + if (temp != null) + { + Object.DestroyImmediate(temp); + } + } + } + } + + private static IEnumerable GetGameObjectsInScene(Scene scene) + { + var rootObjects = new List(); + scene.GetRootGameObjects(rootObjects); + + // iterate root objects and do something + for (var i = 0; i < rootObjects.Count; ++i) + { + GameObject gameObject = rootObjects[i]; + + foreach (GameObject item in getAllChild(gameObject)) + { + yield return item; + } + + yield return gameObject; + } + } + + public static IEnumerable getAllChild(GameObject target) + { + if (target.transform.childCount > 0) + { + for (var i = 0; i < target.transform.childCount; i++) + { + yield return target.transform.GetChild(i).gameObject; + foreach (GameObject item in getAllChild(target.transform.GetChild(i).gameObject)) + { + yield return item; + } + } + } + } + + public static IEnumerable GetAllRefObjects(GameObject obj) + { + Component[] components = obj.GetComponents(); + foreach (Component com in components) + { + if (com == null) + { + continue; + } + + var serialized = new SerializedObject(com); + SerializedProperty it = serialized.GetIterator().Copy(); + while (it.NextVisible(true)) + { + if (it.propertyType != SerializedPropertyType.ObjectReference) + { + continue; + } + + if (it.objectReferenceValue == null) + { + continue; + } + + yield return it.objectReferenceValue; + } + } + } + + public static int StringMatch(string pattern, string input) + { + if (input == pattern) + { + return int.MaxValue; + } + + if (input.Contains(pattern)) + { + return int.MaxValue - 1; + } + + var pidx = 0; + var score = 0; + var tokenScore = 0; + + for (var i = 0; i < input.Length; i++) + { + char ch = input[i]; + if (ch == pattern[pidx]) + { + tokenScore += tokenScore + 1; //increasing score for continuos token + pidx++; + if (pidx >= pattern.Length) + { + break; + } + } + else + { + tokenScore = 0; + } + + score += tokenScore; + } + + return score; + } + + public static int GetIndex(string ext) + { + for (var i = 0; i < FILTERS.Length - 1; i++) + { + if (FILTERS[i].extension.Contains(ext)) + { + return i; + } + } + + return FILTERS.Length - 1; //Others + } + + public static void GuiLine(int i_height = 1) + + { + Rect rect = EditorGUILayout.GetControlRect(false, i_height); + + rect.height = i_height; + + EditorGUI.DrawRect(rect, new Color(0.5f, 0.5f, 0.5f, 1)); + } + + public static string GetfileSizeString(long fileSize) + { + return fileSize <= 1024 + ? fileSize + " B" + : fileSize <= 1024 * 1024 + ? Mathf.RoundToInt(fileSize / 1024f) + " KB" + : Mathf.RoundToInt(fileSize / 1024f / 1024f) + " MB"; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Helper.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Helper.cs.meta new file mode 100644 index 0000000..d65176b --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Helper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3ba0d9bfe79ff94ca52a3bd6b6870d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Ref.cs b/Assets/Scripts/Editor/FR2/FR2_Ref.cs new file mode 100644 index 0000000..d007284 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Ref.cs @@ -0,0 +1,1514 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace vietlabs.fr2 +{ + public class FR2_SceneRef : FR2_Ref + { + internal static Dictionary CacheType = new Dictionary(); + + + // ------------------------- Ref in scene + private static Action> onFindRefInSceneComplete; + private static Dictionary refs = new Dictionary(); + private static string[] cacheAssetGuids; + public string sceneFullPath = ""; + public string scenePath = ""; + public string targetType; + public HashSet usingType = new HashSet(); + + public FR2_SceneRef(int index, int depth, FR2_Asset asset, FR2_Asset by) : base(index, depth, asset, by) + { + isSceneRef = false; + } + + public FR2_SceneRef(int depth, Object target) : base(0, depth, null, null) + { + component = target; + this.depth = depth; + isSceneRef = true; + var obj = target as GameObject; + if (obj == null) + { + var com = target as Component; + if (com != null) + { + obj = com.gameObject; + } + } + + scenePath = FR2_Unity.GetGameObjectPath(obj, false); + if (component == null) + { + return; + } + + sceneFullPath = scenePath + component.name; + targetType = component.GetType().Name; + } + + public static IWindow window { get; set; } + + public override bool isSelected() + { + return component == null ? false : FR2_Selection.HScene.Contains(component); + } + + public void Draw(Rect r, IWindow window) + { + bool selected = isSelected(); + var margin = 2; + var left = new Rect(r); + left.width = r.width / 3f; + var right = new Rect(r); + right.x += left.width + margin; + right.width = r.width * 2f / 3 - margin; + + if ( /* FR2_Setting.PingRow && */ Event.current.type == EventType.MouseDown && Event.current.button == 0) + { + Rect pingRect = FR2_Setting.PingRow + ? new Rect(0, r.y, r.x + r.width, r.height) + : left; + if (pingRect.Contains(Event.current.mousePosition)) + { + if (Event.current.control || Event.current.command) + { + if (selected) + { + FR2_Selection.RemoveSelection(this); + } + else + { + FR2_Selection.AppendSelection(this); + } + + if (window != null) + { + window.Repaint(); + } + } + + EditorGUIUtility.PingObject(component); + //Event.current.Use(); + } + } + + + EditorGUI.ObjectField(left, GUIContent.none, component, typeof(GameObject), true); + + + bool drawPath = FR2_Setting.GroupMode != FR2_RefDrawer.Mode.Folder; + float pathW = drawPath ? EditorStyles.miniLabel.CalcSize(new GUIContent(scenePath)).x : 0; + string assetName = component.name; + // if(usingType!= null && usingType.Count > 0) + // { + // assetName += " -> "; + // foreach(var item in usingType) + // { + // assetName += item + " - "; + // } + // assetName = assetName.Substring(0, assetName.Length - 3); + // } + Color cc = FR2_Cache.Api.setting.SelectedColor; + + var lableRect = new Rect( + right.x, + right.y, + pathW + EditorStyles.boldLabel.CalcSize(new GUIContent(assetName)).x, + right.height); + if (selected) + { + Color c = GUI.color; + GUI.color = cc; + GUI.DrawTexture(lableRect, EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + if (drawPath) + { + GUI.Label(LeftRect(pathW, ref right), scenePath, EditorStyles.miniLabel); + right.xMin -= 4f; + GUI.Label(right, assetName, EditorStyles.boldLabel); + } + else + { + GUI.Label(right, assetName); + } + + + if (!FR2_Setting.ShowUsedByClassed || usingType == null) + { + return; + } + + float sub = 10; + var re = new Rect(r.x + r.width - sub, r.y, 20, r.height); + Type t = null; + foreach (string item in usingType) + { + string name = item; + if (!CacheType.TryGetValue(item, out t)) + { + t = FR2_Unity.GetType(name); + // if (t == null) + // { + // continue; + // } + CacheType.Add(item, t); + } + + GUIContent content; + var width = 0.0f; + if (!FR2_Asset.cacheImage.TryGetValue(name, out content)) + { + if (t == null) + { + content = new GUIContent(name); + } + else + { + Texture text = EditorGUIUtility.ObjectContent(null, t).image; + if (text == null) + { + content = new GUIContent(name); + } + else + { + content = new GUIContent(text, name); + } + } + + + FR2_Asset.cacheImage.Add(name, content); + } + + if (content.image == null) + { + width = EditorStyles.label.CalcSize(content).x; + } + else + { + width = 20; + } + + re.x -= width; + re.width = width; + + GUI.Label(re, content); + re.x -= margin; // margin; + } + + + // var nameW = EditorStyles.boldLabel.CalcSize(new GUIContent(assetName)).x; + } + + private Rect LeftRect(float w, ref Rect rect) + { + rect.x += w; + rect.width -= w; + return new Rect(rect.x - w, rect.y, w, rect.height); + } + + // ------------------------- Scene use scene objects + public static Dictionary FindSceneUseSceneObjects(GameObject[] targets) + { + var results = new Dictionary(); + GameObject[] objs = Selection.gameObjects; + for (var i = 0; i < objs.Length; i++) + { + if (FR2_Unity.IsInAsset(objs[i])) + { + continue; + } + + string key = objs[i].GetInstanceID().ToString(); + if (!results.ContainsKey(key)) + { + results.Add(key, new FR2_SceneRef(0, objs[i])); + } + + Component[] coms = objs[i].GetComponents(); + Dictionary> SceneCache = FR2_SceneCache.Api.cache; + for (var j = 0; j < coms.Length; j++) + { + HashSet hash = null; + if (SceneCache.TryGetValue(coms[j], out hash)) + { + foreach (FR2_SceneCache.HashValue item in hash) + { + if (item.isSceneObject) + { + Object obj = item.target; + string key1 = obj.GetInstanceID().ToString(); + if (!results.ContainsKey(key1)) + { + results.Add(key1, new FR2_SceneRef(1, obj)); + } + } + } + } + } + } + + return results; + } + + // ------------------------- Scene in scene + public static Dictionary FindSceneInScene(GameObject[] targets) + { + var results = new Dictionary(); + GameObject[] objs = Selection.gameObjects; + for (var i = 0; i < objs.Length; i++) + { + if (FR2_Unity.IsInAsset(objs[i])) + { + continue; + } + + string key = objs[i].GetInstanceID().ToString(); + if (!results.ContainsKey(key)) + { + results.Add(key, new FR2_SceneRef(0, objs[i])); + } + + + foreach (KeyValuePair> item in FR2_SceneCache.Api.cache) + foreach (FR2_SceneCache.HashValue item1 in item.Value) + { + // if(item.Key.gameObject.name == "ScenesManager") + // Debug.Log(item1.objectReferenceValue); + GameObject ob = null; + if (item1.target is GameObject) + { + ob = item1.target as GameObject; + } + else + { + var com = item1.target as Component; + if (com == null) + { + continue; + } + + ob = com.gameObject; + } + + if (ob == null) + { + continue; + } + + if (ob != objs[i]) + { + continue; + } + + key = item.Key.GetInstanceID().ToString(); + if (!results.ContainsKey(key)) + { + results.Add(key, new FR2_SceneRef(1, item.Key)); + } + + (results[key] as FR2_SceneRef).usingType.Add(item1.target.GetType().FullName); + } + } + + return results; + } + + public static Dictionary FindRefInScene(string[] assetGUIDs, bool depth, + Action> onComplete, IWindow win) + { + // var watch = new System.Diagnostics.Stopwatch(); + // watch.Start(); + window = win; + cacheAssetGuids = assetGUIDs; + onFindRefInSceneComplete = onComplete; + if (FR2_SceneCache.ready) + { + FindRefInScene(); + } + else + { + FR2_SceneCache.onReady -= FindRefInScene; + FR2_SceneCache.onReady += FindRefInScene; + } + + return refs; + } + + private static void FindRefInScene() + { + refs = new Dictionary(); + for (var i = 0; i < cacheAssetGuids.Length; i++) + { + FR2_Asset asset = FR2_Cache.Api.Get(cacheAssetGuids[i]); + if (asset == null) + { + continue; + } + + Add(refs, asset, 0); + + ApplyFilter(refs, asset); + } + + if (onFindRefInSceneComplete != null) + { + onFindRefInSceneComplete(refs); + } + + FR2_SceneCache.onReady -= FindRefInScene; + // UnityEngine.Debug.Log("Time find ref in scene " + watch.ElapsedMilliseconds); + } + + private static void FilterAll(Dictionary refs, Object obj, string targetPath) + { + // ApplyFilter(refs, obj, targetPath); + } + + private static void ApplyFilter(Dictionary refs, FR2_Asset asset) + { + string targetPath = AssetDatabase.GUIDToAssetPath(asset.guid); + if (string.IsNullOrEmpty(targetPath)) + { + return; // asset not found - might be deleted! + } + + //asset being moved! + if (targetPath != asset.assetPath) + { + asset.LoadAssetInfo(); + } + + Object target = AssetDatabase.LoadAssetAtPath(targetPath, typeof(Object)); + if (target == null) + { + Debug.LogWarning("target is null"); + return; + } + + bool targetIsGameobject = target is GameObject; + + if (targetIsGameobject) + { + foreach (GameObject item in FR2_Unity.getAllObjsInCurScene()) + { + if (FR2_Unity.CheckIsPrefab(item)) + { + string itemGUID = FR2_Unity.GetPrefabParent(item); + // Debug.Log(item.name + " itemGUID: " + itemGUID); + // Debug.Log(target.name + " asset.guid: " + asset.guid); + if (itemGUID == asset.guid) + { + Add(refs, item, 1); + } + } + } + } + + string dir = Path.GetDirectoryName(targetPath); + if (FR2_SceneCache.Api.folderCache.ContainsKey(dir)) + { + foreach (Component item in FR2_SceneCache.Api.folderCache[dir]) + { + if (FR2_SceneCache.Api.cache.ContainsKey(item)) + { + foreach (FR2_SceneCache.HashValue item1 in FR2_SceneCache.Api.cache[item]) + { + if (targetPath == AssetDatabase.GetAssetPath(item1.target)) + { + Add(refs, item, 1); + } + } + } + } + } + } + + private static void Add(Dictionary refs, FR2_Asset asset, int depth) + { + string targetId = asset.guid; + if (!refs.ContainsKey(targetId)) + { + refs.Add(targetId, new FR2_Ref(0, depth, asset, null)); + } + } + + private static void Add(Dictionary refs, Object target, int depth) + { + string targetId = target.GetInstanceID().ToString(); + if (!refs.ContainsKey(targetId)) + { + refs.Add(targetId, new FR2_SceneRef(depth, target)); + } + } + } + + public class FR2_Ref + { + public FR2_Asset addBy; + public FR2_Asset asset; + public Object component; + public int depth; + public string group; + public int index; + + public bool isSceneRef; + public int matchingScore; + public int type; + + public FR2_Ref(int index, int depth, FR2_Asset asset, FR2_Asset by) + { + this.index = index; + this.depth = depth; + + this.asset = asset; + if (asset != null) + { + type = AssetType.GetIndex(asset.extension); + } + + addBy = by; + // isSceneRef = false; + } + + public FR2_Ref(int index, int depth, FR2_Asset asset, FR2_Asset by, string group) : this(index, depth, asset, + by) + { + this.group = group; + // isSceneRef = false; + } + + public string GetSceneObjId() + { + if (component == null) + { + return string.Empty; + } + + return component.GetInstanceID().ToString(); + } + + public virtual bool isSelected() + { + return FR2_Selection.IsSelect(asset.guid); + } + + + // public FR2_Ref(int depth, UnityEngine.Object target) + // { + // this.component = target; + // this.depth = depth; + // // isSceneRef = true; + // } + internal List Append(Dictionary dict, params string[] guidList) + { + var result = new List(); + + if (FR2_Cache.Api.disabled) + { + return result; + } + + if (!FR2_Cache.isReady) + { + Debug.LogWarning("Cache not yet ready! Please wait!"); + return result; + } + + //filter to remove items that already in dictionary + for (var i = 0; i < guidList.Length; i++) + { + string guid = guidList[i]; + if (dict.ContainsKey(guid)) + { + continue; + } + + FR2_Asset child = FR2_Cache.Api.Get(guid); + if (child == null) + { + continue; + } + + var r = new FR2_Ref(dict.Count, depth + 1, child, asset); + if (!asset.IsFolder) + { + dict.Add(guid, r); + } + + result.Add(r); + } + + return result; + } + + internal void AppendUsedBy(Dictionary result, bool deep) + { + // var list = Append(result, FR2_Asset.FindUsedByGUIDs(asset).ToArray()); + // if (!deep) return; + + // // Add next-level + // for (var i = 0;i < list.Count;i ++) + // { + // list[i].AppendUsedBy(result, true); + // } + + Dictionary h = asset.UsedByMap; + List list = deep ? new List() : null; + + foreach (KeyValuePair kvp in h) + { + string guid = kvp.Key; + if (result.ContainsKey(guid)) + { + continue; + } + + FR2_Asset child = FR2_Cache.Api.Get(guid); + if (child == null) + { + continue; + } + + if (child.IsMissing) + { + continue; + } + + var r = new FR2_Ref(result.Count, depth + 1, child, asset); + if (!asset.IsFolder) + { + result.Add(guid, r); + } + + if (deep) + { + list.Add(r); + } + } + + if (!deep) + { + return; + } + + foreach (FR2_Ref item in list) + { + item.AppendUsedBy(result, true); + } + } + + internal void AppendUsage(Dictionary result, bool deep) + { + Dictionary> h = asset.UseGUIDs; + List list = deep ? new List() : null; + + foreach (KeyValuePair> kvp in h) + { + string guid = kvp.Key; + if (result.ContainsKey(guid)) + { + continue; + } + + FR2_Asset child = FR2_Cache.Api.Get(guid); + if (child == null) + { + continue; + } + + if (child.IsMissing) + { + continue; + } + + var r = new FR2_Ref(result.Count, depth + 1, child, asset); + if (!asset.IsFolder) + { + result.Add(guid, r); + } + + if (deep) + { + list.Add(r); + } + } + + if (!deep) + { + return; + } + + foreach (FR2_Ref item in list) + { + item.AppendUsage(result, true); + } + } + + // --------------------- STATIC UTILS ----------------------- + + internal static Dictionary FindRefs(string[] guids, bool usageOrUsedBy, bool addFolder) + { + var dict = new Dictionary(); + var list = new List(); + + for (var i = 0; i < guids.Length; i++) + { + string guid = guids[i]; + if (dict.ContainsKey(guid)) + { + continue; + } + + FR2_Asset asset = FR2_Cache.Api.Get(guid); + if (asset == null) + { + continue; + } + + var r = new FR2_Ref(i, 0, asset, null); + if (!asset.IsFolder || addFolder) + { + dict.Add(guid, r); + } + + list.Add(r); + } + + for (var i = 0; i < list.Count; i++) + { + if (usageOrUsedBy) + { + list[i].AppendUsage(dict, true); + } + else + { + list[i].AppendUsedBy(dict, true); + } + } + + //var result = dict.Values.ToList(); + //result.Sort((item1, item2)=>{ + // return item1.index.CompareTo(item2.index); + //}); + + return dict; + } + + + public static Dictionary FindUsage(string[] guids) + { + return FindRefs(guids, true, true); + } + + public static Dictionary FindUsedBy(string[] guids) + { + return FindRefs(guids, false, true); + } + + public static Dictionary FindUsageScene(GameObject[] objs, bool depth) + { + var dict = new Dictionary(); + // var list = new List(); + + for (var i = 0; i < objs.Length; i++) + { + if (FR2_Unity.IsInAsset(objs[i])) + { + continue; //only get in scene + } + + //add selection + if (!dict.ContainsKey(objs[i].GetInstanceID().ToString())) + { + dict.Add(objs[i].GetInstanceID().ToString(), new FR2_SceneRef(0, objs[i])); + } + + foreach (Object item in FR2_Unity.GetAllRefObjects(objs[i])) + { + AppendUsageScene(dict, item); + } + + if (depth) + { + foreach (GameObject child in FR2_Unity.getAllChild(objs[i])) + foreach (Object item2 in FR2_Unity.GetAllRefObjects(child)) + { + AppendUsageScene(dict, item2); + } + } + } + + return dict; + } + + private static void AppendUsageScene(Dictionary dict, Object obj) + { + string path = AssetDatabase.GetAssetPath(obj); + if (string.IsNullOrEmpty(path)) + { + return; + } + + string guid = AssetDatabase.AssetPathToGUID(path); + if (string.IsNullOrEmpty(guid)) + { + return; + } + + if (dict.ContainsKey(guid)) + { + return; + } + + FR2_Asset asset = FR2_Cache.Api.Get(guid); + if (asset == null) + { + return; + } + + var r = new FR2_Ref(0, 1, asset, null); + dict.Add(guid, r); + } + } + + + public class FR2_RefDrawer : IRefDraw + { + public enum Mode + { + Dependency, + Type, + Extension, + Folder, + None + } + + public enum Sort + { + Type, + Path, + Size + } + + public static GUIStyle toolbarSearchField; + public static GUIStyle toolbarSearchFieldCancelButton; + public static GUIStyle toolbarSearchFieldCancelButtonEmpty; + + private readonly FR2_TreeUI2.GroupDrawer groupDrawer; + private readonly bool showSearch = true; + private bool caseSensitive; + + // STATUS + private bool dirty; + + public bool displayFileSize = false; + + private int excludeCount; + + public bool isDrawRefreshSceneCache; + public string Lable; + private List list; + private Dictionary refs; + + // FILTERING + //static Sort sort; + //static Mode mode; + //static HashSet excludes = new HashSet(); + // static string searchTerm = string.Empty; + private string searchTerm = string.Empty; + private bool selectFilter; + private bool showContent = true; + private bool showIgnore; + + + // ORIGINAL + private FR2_Asset[] source; + + public FR2_RefDrawer(IWindow window) + { + this.window = window; + groupDrawer = new FR2_TreeUI2.GroupDrawer(DrawGroup, DrawAsset); + } + + public IWindow window { get; set; } + + // public void Draw(string searchLable ="", bool showRefreshSceneCache = false) + public bool Draw() + { + if (refs == null || refs.Count == 0) + { + return false; + } + + if (dirty || list == null) + { + ApplyFilter(); + } + + // if (showSearch) + DrawSearch(Lable, isDrawRefreshSceneCache); + // DrawSearch(searchLable,showRefreshSceneCache); + + if (!showContent) + { + return false; + } + + groupDrawer.Draw(); + return false; + } + + public int ElementCount() + { + if (refs == null) + { + return 0; + } + + return refs.Count; + // return refs.Where(x => x.Value.depth != 0).Count(); + } + + public void SetRefs(Dictionary dictRefs) + { + refs = dictRefs; + } + + private void DrawGroup(Rect r, string label, int childCount) + { + if (FR2_Setting.GroupMode == Mode.Folder) + { + Texture tex = AssetDatabase.GetCachedIcon("Assets"); + GUI.DrawTexture(new Rect(r.x - 2f, r.y - 2f, 16f, 16f), tex); + r.xMin += 16f; + } + + GUI.Label(r, label + " (" + childCount + ")", EditorStyles.boldLabel); + + + bool hasMouse = Event.current.type == EventType.MouseUp && r.Contains(Event.current.mousePosition); + + if (hasMouse && Event.current.button == 1) + { + var menu = new GenericMenu(); + menu.AddItem(new GUIContent("Select"), false, () => + { + string[] ids = groupDrawer.GetChildren(label); + FR2_Selection.ClearSelection(); + for (var i = 0; i < ids.Length; i++) + { + FR2_Ref rf; + if (!refs.TryGetValue(ids[i], out rf)) + { + continue; + } + + FR2_Selection.AppendSelection(rf); + } + + + // FR2_Selection.h.Clear(); + // for (var i = 0; i < ids.Length; i++) + // { + // FR2_Selection.h.Add(ids[i]); + // } + }); + menu.AddItem(new GUIContent("Append Selection"), false, () => + { + string[] ids = groupDrawer.GetChildren(label); + for (var i = 0; i < ids.Length; i++) + { + FR2_Ref rf; + if (!refs.TryGetValue(ids[i], out rf)) + { + continue; + } + + FR2_Selection.AppendSelection(rf); + } + }); + menu.AddItem(new GUIContent("Remove From Selection"), false, () => + { + string[] ids = groupDrawer.GetChildren(label); + for (var i = 0; i < ids.Length; i++) + { + FR2_Ref rf; + if (!refs.TryGetValue(ids[i], out rf)) + { + continue; + } + + FR2_Selection.RemoveSelection(rf); + // if (FR2_Selection.h.Contains(ids[i])) + // { + // FR2_Selection.h.Remove(ids[i]); + // } + } + }); + + menu.ShowAsContext(); + Event.current.Use(); + } + } + + private void DrawAsset(Rect r, string guid) + { + FR2_Ref rf; + if (!refs.TryGetValue(guid, out rf)) + { + return; + } + + if (rf.depth == 1) //mode != Mode.Dependency && + { + Color c = GUI.color; + GUI.color = Color.blue; + GUI.DrawTexture(new Rect(r.x - 4f, r.y + 2f, 2f, 2f), EditorGUIUtility.whiteTexture); + GUI.color = c; + } + + if (rf.isSceneRef) + { + if (rf.component == null) + { + return; + } + + var re = rf as FR2_SceneRef; + if (re != null) + { + re.Draw(r, window); + } + } + else + { + rf.asset.Draw(r, false, FR2_Setting.GroupMode != Mode.Folder, window, true); + } + } + + private string GetGroup(FR2_Ref rf) + { + // Debug.Log(Lable + " " + FR2_Setting.GroupMode); + if (FR2_Setting.GroupMode == Mode.None) + { + return string.Empty; + } + + if (rf.depth == 0) + { + return "Selection"; + } + + FR2_SceneRef sr = null; + if (rf.isSceneRef) + { + sr = rf as FR2_SceneRef; + if (sr == null) + { + return string.Empty; + } + } + + switch (FR2_Setting.GroupMode) + { + case Mode.Extension: return rf.isSceneRef ? sr.targetType : rf.asset.extension; + case Mode.Type: + { + return rf.isSceneRef ? sr.targetType : AssetType.FILTERS[rf.type].name; + } + + case Mode.Folder: return rf.isSceneRef ? sr.scenePath : rf.asset.assetFolder; + + case Mode.Dependency: + { + return rf.depth == 1 ? "Direct Usage" : "Indirect Usage"; + } + } + + return string.Empty; + } + + private void SortGroup(List groups) + { + groups.Sort((item1, item2) => + { + if (item1 == "Others" || item2 == "Selection") + { + return 1; + } + + if (item2 == "Others" || item1 == "Selection") + { + return -1; + } + + return item1.CompareTo(item2); + }); + } + + public FR2_RefDrawer Reset(string[] assetGUIDs, bool isUsage) + { + //Debug.Log("Reset :: " + assetGUIDs.Length + "\n" + string.Join("\n", assetGUIDs)); + + if (isUsage) + { + refs = FR2_Ref.FindUsage(assetGUIDs); + } + else + { + refs = FR2_Ref.FindUsedBy(assetGUIDs); + } + + //RefreshFolders(); + + // Remove folders && items in assetGUIDs + //var map = new Dictionary(); + //for (var i = 0;i < assetGUIDs.Length; i++) + //{ + // map.Add(assetGUIDs[i], i); + //} + + //for (var i = refs.Count-1; i>=0; i--) + //{ + // var a = refs[i].asset; + // if (!a.IsFolder) continue; // && !map.ContainsKey(refs[i].asset.guid) + // refs.RemoveAt(i); //Remove folders and items in Selection + //} + + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + public FR2_RefDrawer Reset(GameObject[] objs, bool findDept, bool findPrefabInAsset) + { + refs = FR2_Ref.FindUsageScene(objs, findDept); + + var guidss = new List(); + Dictionary> dependent = FR2_SceneCache.Api.prefabDependencies; + foreach (GameObject gameObject in objs) + { + HashSet hash; + if (!dependent.TryGetValue(gameObject, out hash)) + { + continue; + } + + foreach (string guid in hash) + { + guidss.Add(guid); + } + } + + Dictionary usageRefs1 = FR2_Ref.FindUsage(guidss.ToArray()); + foreach (KeyValuePair kvp in usageRefs1) + { + if (refs.ContainsKey(kvp.Key)) + { + continue; + } + + if (guidss.Contains(kvp.Key)) + { + kvp.Value.depth = 1; + } + + refs.Add(kvp.Key, kvp.Value); + } + + + if (findPrefabInAsset) + { + var guids = new List(); + for (var i = 0; i < objs.Length; i++) + { + string guid = FR2_Unity.GetPrefabParent(objs[i]); + if (string.IsNullOrEmpty(guid)) + { + continue; + } + + guids.Add(guid); + } + + Dictionary usageRefs = FR2_Ref.FindUsage(guids.ToArray()); + foreach (KeyValuePair kvp in usageRefs) + { + if (refs.ContainsKey(kvp.Key)) + { + continue; + } + + if (guids.Contains(kvp.Key)) + { + kvp.Value.depth = 1; + } + + refs.Add(kvp.Key, kvp.Value); + } + } + + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + //ref in scene + public FR2_RefDrawer Reset(string[] assetGUIDs, IWindow window) + { + refs = FR2_SceneRef.FindRefInScene(assetGUIDs, true, SetRefInScene, window); + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + private void SetRefInScene(Dictionary data) + { + refs = data; + dirty = true; + if (list != null) + { + list.Clear(); + } + } + + //scene in scene + public FR2_RefDrawer ResetSceneInScene(GameObject[] objs) + { + refs = FR2_SceneRef.FindSceneInScene(objs); + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + public FR2_RefDrawer ResetSceneUseSceneObjects(GameObject[] objs) + { + refs = FR2_SceneRef.FindSceneUseSceneObjects(objs); + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + public FR2_RefDrawer ResetUnusedAsset() + { + List lst = FR2_Cache.Api.ScanUnused(); + + refs = lst.ToDictionary(x => x.guid, x => new FR2_Ref(0, 1, x, null)); + dirty = true; + if (list != null) + { + list.Clear(); + } + + return this; + } + + public void RefreshSort() + { + if (list == null) + { + return; + } + + + if (list.Count > 0 && list[0].isSceneRef == false && FR2_Setting.SortMode == Sort.Size) + { + list = list.OrderByDescending(x => x.asset.fileSize).ToList(); + } + else + { + list.Sort((r1, r2) => + { + if (r1.isSceneRef && r2.isSceneRef) + { + var rs1 = r1 as FR2_SceneRef; + var rs2 = r2 as FR2_SceneRef; + if (rs1 != null && rs2 != null) + { + return SortAsset(rs1.sceneFullPath, rs2.sceneFullPath, + rs1.targetType, rs2.targetType, + FR2_Setting.SortMode == Sort.Path); + } + } + + if (r1.isSceneRef) + { + return 0; + } + + if (r2.isSceneRef) + { + return 1; + } + + int v = string.IsNullOrEmpty(searchTerm) ? 0 : r2.matchingScore.CompareTo(r1.matchingScore); + if (v != 0) + { + return v; + } + + return SortAsset( + r1.asset.assetPath, r2.asset.assetPath, + r1.asset.extension, r2.asset.extension, + FR2_Setting.SortMode == Sort.Path + ); + }); + } + + + //folderDrawer.GroupByAssetType(list); + groupDrawer.Reset(list, + rf => rf.isSceneRef ? rf.GetSceneObjId() : rf.asset.guid + , GetGroup, SortGroup); + } + + public bool isExclueAnyItem() + { + return excludeCount > 0; + } + + private void ApplyFilter() + { + dirty = false; + + if (refs == null) + { + return; + } + + if (list == null) + { + list = new List(); + } + else + { + list.Clear(); + } + + int minScore = searchTerm.Length; + + string term1 = searchTerm; + if (!caseSensitive) + { + term1 = term1.ToLower(); + } + + string term2 = term1.Replace(" ", string.Empty); + + excludeCount = 0; + + foreach (KeyValuePair item in refs) + { + FR2_Ref r = item.Value; + + if (r.depth == 0 && !FR2_Setting.ShowSelection) + { + continue; + } + + if (FR2_Setting.IsTypeExcluded(r.type)) + { + excludeCount++; + continue; //skip this one + } + + if (!showSearch || string.IsNullOrEmpty(searchTerm)) + { + r.matchingScore = 0; + list.Add(r); + continue; + } + + //calculate matching score + string name1 = r.isSceneRef ? (r as FR2_SceneRef).sceneFullPath : r.asset.assetName; + if (!caseSensitive) + { + name1 = name1.ToLower(); + } + + string name2 = name1.Replace(" ", string.Empty); + + int score1 = FR2_Unity.StringMatch(term1, name1); + int score2 = FR2_Unity.StringMatch(term2, name2); + + r.matchingScore = Mathf.Max(score1, score2); + if (r.matchingScore > minScore) + { + list.Add(r); + } + } + + RefreshSort(); + } + + public void SetDirty() + { + dirty = true; + } + + private int SortAsset(string term11, string term12, string term21, string term22, bool swap) + { + if (string.IsNullOrEmpty(term11)) + { + return -1; + } + + if (string.IsNullOrEmpty(term22)) + { + return 1; + } + + int v1 = term11.CompareTo(term12); + int v2 = term21.CompareTo(term22); + return swap ? v1 == 0 ? v2 : v1 : v2 == 0 ? v1 : v2; + } + + public static void InitSearchStyle() + { + toolbarSearchField = "ToolbarSearchTextFieldPopup"; + toolbarSearchFieldCancelButton = "ToolbarSearchCancelButton"; + toolbarSearchFieldCancelButtonEmpty = "ToolbarSearchCancelButtonEmpty"; + } + + private void DrawSearch(string searchLable = "", bool showRefreshSceneCache = false) + { + if (toolbarSearchField == null) + { + InitSearchStyle(); + } + + if (showRefreshSceneCache && !FR2_SceneCache.ready) + { + Rect rect = GUILayoutUtility.GetRect(1, Screen.width, 18f, 18f); + int cur = FR2_SceneCache.Api.current, total = FR2_SceneCache.Api.total; + EditorGUI.ProgressBar(rect, cur * 1f / total, string.Format("{0} / {1}", cur, total)); + } + + GUILayout.BeginHorizontal(EditorStyles.toolbar); + { + if (!string.IsNullOrEmpty(searchLable)) + { + if (showContent) + { + GUILayout.BeginHorizontal(GUILayout.Width(120f)); + } + + { + showContent = EditorGUILayout.Foldout(showContent, searchLable); + } + if (showContent) + { + GUILayout.EndHorizontal(); + } + } + + if (!showContent) + { + GUILayout.EndHorizontal(); + return; + } + + bool v = GUILayout.Toggle(caseSensitive, "Aa", EditorStyles.toolbarButton, GUILayout.Width(24f)); + if (v != caseSensitive) + { + caseSensitive = v; + dirty = true; + } + + GUILayout.Space(2f); + string value = GUILayout.TextField(searchTerm, toolbarSearchField); + if (searchTerm != value) + { + searchTerm = value; + dirty = true; + } + + GUIStyle style = string.IsNullOrEmpty(searchTerm) + ? toolbarSearchFieldCancelButtonEmpty + : toolbarSearchFieldCancelButton; + if (GUILayout.Button("Cancel", style)) + { + searchTerm = string.Empty; + dirty = true; + } + + GUILayout.Space(2f); + var width = 24; + if (showRefreshSceneCache) + { + Color col = GUI.color; + if (FR2_SceneCache.Api.Dirty) + { + GUI.color = new Color32(255, 0, 0, 196); + } + + Color color = GUI.contentColor; + GUI.contentColor = EditorGUIUtility.isProSkin + ? new Color(0.9f, 0.9f, 0.9f, 1f) + : new Color(0.1f, 0.1f, 0.1f, 1f); + + if (GUILayout.Button(FR2_WindowBase.Icon.icons.Refresh, EditorStyles.toolbarButton, + GUILayout.Width(width))) + { + FR2_Asset.lastRefreshTS = Time.realtimeSinceStartup; + FR2_SceneCache.Api.refreshCache(window); + } + + GUI.contentColor = color; + + if (FR2_SceneCache.Api.Dirty) + { + GUI.color = col; + } + } + // else + // { + // var color = GUI.contentColor; + // GUI.contentColor = Color.black; + + // if(GUILayout.Button(FR2_Window.Icon.icons.Refresh, EditorStyles.toolbarButton, GUILayout.Width(width))) + // { + // FR2_Cache.Api.Check4Changes(true, true); + // FR2_SceneCache.Api.SetDirty(); + // } + + // GUI.contentColor = color; + // } + } + GUILayout.EndHorizontal(); + } + + public Dictionary getRefs() + { + return refs; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Ref.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Ref.cs.meta new file mode 100644 index 0000000..966f890 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Ref.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6db5b6c2e2bbb4f2093a7cd892ececca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs b/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs new file mode 100644 index 0000000..8326f5b --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs @@ -0,0 +1,384 @@ +#if UNITY_2018_3_OR_NEWER +#define SUPPORT_NESTED_PREFAB +#endif + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; +#if UNITY_2017_1_OR_NEWER +using UnityEditor.SceneManagement; +using UnityEngine.SceneManagement; +#endif +#if SUPPORT_NESTED_PREFAB +using UnityEditor.Experimental.SceneManagement; + +#endif + + +namespace vietlabs.fr2 +{ + public class FR2_SceneCache + { + private static FR2_SceneCache _api; + public static Action onReady; + public static bool ready = true; + private Dictionary> _cache = new Dictionary>(); + public int current; + public Dictionary> folderCache = new Dictionary>(); + + private List listGO; + + //public HashSet prefabDependencies = new HashSet(); + public Dictionary> prefabDependencies = + new Dictionary>(); + + public int total; + private IWindow window; + + public FR2_SceneCache() + { +#if UNITY_2018_1_OR_NEWER + EditorApplication.hierarchyChanged -= OnSceneChanged; + EditorApplication.hierarchyChanged += OnSceneChanged; +#else + EditorApplication.hierarchyWindowChanged -= OnSceneChanged; + EditorApplication.hierarchyWindowChanged += OnSceneChanged; +#endif + +#if UNITY_2018_2_OR_NEWER + EditorSceneManager.activeSceneChangedInEditMode -= OnSceneChanged; + EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged; +#endif + +#if UNITY_2017_1_OR_NEWER + SceneManager.activeSceneChanged -= OnSceneChanged; + SceneManager.activeSceneChanged += OnSceneChanged; + + SceneManager.sceneLoaded -= OnSceneChanged; + SceneManager.sceneLoaded += OnSceneChanged; + + Undo.postprocessModifications -= OnModify; + Undo.postprocessModifications += OnModify; +#endif + +#if SUPPORT_NESTED_PREFAB + PrefabStage.prefabStageOpened -= prefabOnpen; + PrefabStage.prefabStageClosing += prefabClose; + PrefabStage.prefabStageOpened -= prefabOnpen; + PrefabStage.prefabStageClosing += prefabClose; + + +#endif + } + + public static FR2_SceneCache Api + { + get + { + if (_api == null) + { + _api = new FR2_SceneCache(); + } + + return _api; + } + } + + public bool Dirty { get; private set; } = true; + + public Dictionary> cache + { + get + { + if (_cache == null) + { + refreshCache(window); + } + + return _cache; + } + } + + public void refreshCache(IWindow window) + { + if (window == null) + { + return; + } + + // if(!ready) return; + this.window = window; + + _cache = new Dictionary>(); + folderCache = new Dictionary>(); + prefabDependencies = new Dictionary>(); + + ready = false; + + List listRootGO = null; + +#if SUPPORT_NESTED_PREFAB + + if (PrefabStageUtility.GetCurrentPrefabStage() != null) + { + GameObject rootPrefab = PrefabStageUtility.GetCurrentPrefabStage().prefabContentsRoot; + if (rootPrefab != null) + { + listRootGO = new List {rootPrefab}; + } + } + +#else +#endif + if (listRootGO == null) + { + listGO = FR2_Unity.getAllObjsInCurScene().ToList(); + } + else + { + listGO = new List(); + foreach (GameObject item in listRootGO) + { + listGO.AddRange(FR2_Unity.getAllChild(item, true)); + } + } + + total = listGO.Count; + current = 0; + // Debug.Log("refresh cache total " + total); + EditorApplication.update -= OnUpdate; + EditorApplication.update += OnUpdate; + + // foreach (var item in FR2_Helper.getAllObjsInCurScene()) + // { + // // Debug.Log("object in scene: " + item.name); + // Component[] components = item.GetComponents(); + // foreach (var com in components) + // { + // if(com == null) continue; + // SerializedObject serialized = new SerializedObject(com); + // SerializedProperty it = serialized.GetIterator().Copy(); + // while (it.NextVisible(true)) + // { + + // if (it.propertyType != SerializedPropertyType.ObjectReference) continue; + // if (it.objectReferenceValue == null) continue; + + // if(!_cache.ContainsKey(com)) _cache.Add(com, new HashSet()); + // if(!_cache[com].Contains(it)) + // _cache[com].Add(it.Copy()); + // } + // } + // } + Dirty = false; + } + + private void OnUpdate() + { + for (var i = 0; i < 5 * FR2_Cache.Api.priority; i++) + { + if (listGO == null || listGO.Count <= 0) + { + //done + // Debug.Log("done"); + EditorApplication.update -= OnUpdate; + ready = true; + Dirty = false; + listGO = null; + if (onReady != null) + { + onReady(); + } + + if (window != null) + { + window.OnSelectionChange(); + } + + return; + } + + int index = listGO.Count - 1; + + GameObject go = listGO[index]; + if (go == null) + { + continue; + } + + string prefabGUID = FR2_Unity.GetPrefabParent(go); + if (!string.IsNullOrEmpty(prefabGUID)) + { + Transform parent = go.transform.parent; + while (parent != null) + { + GameObject g = parent.gameObject; + if (!prefabDependencies.ContainsKey(g)) + { + prefabDependencies.Add(g, new HashSet()); + } + + prefabDependencies[g].Add(prefabGUID); + parent = parent.parent; + } + } + + Component[] components = go.GetComponents(); + + foreach (Component com in components) + { + if (com == null) + { + continue; + } + + var serialized = new SerializedObject(com); + SerializedProperty it = serialized.GetIterator().Copy(); + while (it.NextVisible(true)) + { + if (it.propertyType != SerializedPropertyType.ObjectReference) + { + continue; + } + + if (it.objectReferenceValue == null) + { + continue; + } + + var isSceneObject = true; + string path = AssetDatabase.GetAssetPath(it.objectReferenceValue); + if (!string.IsNullOrEmpty(path)) + { + string dir = Path.GetDirectoryName(path); + if (!string.IsNullOrEmpty(dir)) + { + isSceneObject = false; + if (!folderCache.ContainsKey(dir)) + { + folderCache.Add(dir, new HashSet()); + } + + if (!folderCache[dir].Contains(com)) + { + folderCache[dir].Add(com); + } + } + } + + if (!_cache.ContainsKey(com)) + { + _cache.Add(com, new HashSet()); + } + + _cache[com].Add(new HashValue + {target = it.objectReferenceValue, isSceneObject = isSceneObject}); + + // if (!_cache.ContainsKey(com)) _cache.Add(com, new HashSet()); + // if (!_cache[com].Contains(it)) + // _cache[com].Add(it.Copy()); + // string path = AssetDatabase.GetAssetPath(it.objectReferenceValue); + + // if (string.IsNullOrEmpty(path)) continue; + // string dir = System.IO.Path.GetDirectoryName(path); + // if (string.IsNullOrEmpty(dir)) continue; + // if (!folderCache.ContainsKey(dir)) folderCache.Add(dir, new HashSet()); + // if (!folderCache[dir].Contains(com)) + // folderCache[dir].Add(com); + } + } + + listGO.RemoveAt(index); + current++; + } + } + + private void OnSceneChanged() + { + if (!Application.isPlaying) + { + Api.refreshCache(window); + return; + } + + SetDirty(); + } + +#if UNITY_2017_1_OR_NEWER + private UndoPropertyModification[] OnModify(UndoPropertyModification[] modifications) + { + for (var i = 0; i < modifications.Length; i++) + { + if (modifications[i].currentValue.objectReference != null) + { + SetDirty(); + break; + } + } + + return modifications; + } +#endif + + + public void SetDirty() + { + Dirty = true; + } + + + public class HashValue + { + public bool isSceneObject; + + public Object target; + //public SerializedProperty pro; + +// public HashValue(SerializedProperty pro, bool isSceneObject) +// { +// //this.pro = pro; +// this.isSceneObject = isSceneObject; +// } + } +#if SUPPORT_NESTED_PREFAB + + private void prefabClose(PrefabStage obj) + { + if (!Application.isPlaying) + { + Api.refreshCache(window); + return; + } + + SetDirty(); + } + + private void prefabOnpen(PrefabStage obj) + { + if (!Application.isPlaying) + { + Api.refreshCache(window); + return; + } + + SetDirty(); + } +#endif + +#if UNITY_2017_1_OR_NEWER + private void OnSceneChanged(Scene scene, LoadSceneMode mode) + { + OnSceneChanged(); + } + + private void OnSceneChanged(Scene arg0, Scene arg1) + { + OnSceneChanged(); + } +#endif + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs.meta b/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs.meta new file mode 100644 index 0000000..f9d8eb1 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_SceneCache.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 658977c5b6e84344581803c8025947d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs b/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs new file mode 100644 index 0000000..d88f827 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs @@ -0,0 +1,237 @@ +using System; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +#if UNITY_5_3_OR_NEWER +#endif + +namespace vietlabs.fr2 +{ + public class FR2_SceneWindow : FR2_WindowBase, IHasCustomMenu + { + public override bool ShowScene + { + get { return true; } + } + + //[MenuItem("Window/Find Reference 2/Scene")] + private static void ShowWindow() + { + var _window = CreateInstance(); + _window.InitIfNeeded(); + FR2_Unity.SetWindowTitle(_window, "FR2 Scene"); + _window.Show(); + } + + [NonSerialized] internal FR2_RefDrawer RefInScene; + + [NonSerialized] internal FR2_RefDrawer RefSceneInScene; + + internal int level; + private Vector2 scrollPos; + private string tempGUID; + private Object tempObject; + + [NonSerialized] internal FR2_RefDrawer SceneUsesDrawer; //scene use another scene objects + + + private void OnEnable() + { + resizerStyle = new GUIStyle(); + resizerStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D; + } + + protected override void InitIfNeeded() + { + if (SceneUsesDrawer != null) + { + return; + } + + SceneUsesDrawer = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + RefInScene = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + RefSceneInScene = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + + + FR2_Cache.onReady -= OnReady; + FR2_Cache.onReady += OnReady; + + FR2_Setting.OnIgnoreChange -= OnSelectionChange; + FR2_Setting.OnIgnoreChange += OnSelectionChange; + +#if UNITY_2018_OR_NEWER + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode -= OnSceneChanged; + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged; +#elif UNITY_2017_OR_NEWER + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged -= OnSceneChanged; + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged += OnSceneChanged; +#endif + //Debug.Log(" FR2_Window ---> Init"); + } +#if UNITY_2018_OR_NEWER + private void OnSceneChanged(Scene arg0, Scene arg1) + { + if (IsFocusingFindInScene || IsFocusingSceneToAsset || IsFocusingSceneInScene) + { + OnSelectionChange(); + } + } +#endif + protected override void OnReady() + { + OnSelectionChange(); + } + + + public override void OnSelectionChange() + { + isNoticeIgnore = false; + if (!FR2_Cache.isReady) + { + return; + } + + if (lockSelection) + { + return; + } + + if (focusedWindow == null) + { + return; + } + + if (SceneUsesDrawer == null) + { + InitIfNeeded(); + } + + ids = FR2_Unity.Selection_AssetGUIDs; + + //ignore selection on asset when selected any object in scene + if (Selection.gameObjects.Length > 0 && !FR2_Unity.IsInAsset(Selection.gameObjects[0])) + { + ids = new string[0]; + } + + if (IsFocusingSceneInScene) + { + RefSceneInScene.ResetSceneInScene(Selection.gameObjects); + } + + if (IsFocusingUses) + { + SceneUsesDrawer.ResetSceneUseSceneObjects(Selection.gameObjects); + } + + if (IsFocusingFindInScene) + { + RefInScene.Reset(ids, this as IWindow); + } + + level = 0; + + EditorApplication.delayCall += Repaint; + } + + + protected override void OnGUI() + { + if (!CheckDrawHeader()) + { + return; + } + + Rect rectTop = GetTopPanelRect(); + Rect rectBot = GetBotPanelRect(); + + RefDrawConfig config1 = null, config2 = null, config3 = null; + var drawTool = false; + var drawCount = 0; + if (IsFocusingUses || IsFocusingSceneToAsset) + { + drawTool = GetDrawConfig(SceneUsesDrawer, out config1); + } + else if (IsFocusingSceneInScene || IsFocusingFindInScene || IsFocusingUsedBy) + { + if (RefSceneInScene.ElementCount() <= 0) + { + drawTool = GetDrawConfig(RefInScene, out config1); + } + else + { + drawTool = GetDrawConfig(RefSceneInScene, out config2); + } + } + + if (!IsFocusingGUIDs && !IsFocusingUnused) + { + drawCount += DrawConfig(config1, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config2, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config3, rectTop, rectBot, ref willRepaint); + } + + if (drawTool) + { + drawCount++; + GUILayout.BeginArea(rectBot); + DrawTool(); + GUILayout.EndArea(); + } + + DrawFooter(); + OnAfterGUI(drawCount); + } + + protected override void maskDirty() + { + RefInScene.SetDirty(); + RefSceneInScene.SetDirty(); + SceneUsesDrawer.SetDirty(); + } + + protected override void RefreshSort() + { + RefInScene.RefreshSort(); + RefSceneInScene.RefreshSort(); + SceneUsesDrawer.RefreshSort(); + } + + protected override bool checkNoticeFilter() + { + var rsl = false; + if (IsFocusingFindInScene && !rsl) + { + rsl = RefInScene.isExclueAnyItem(); + } + + if (IsFocusingSceneInScene && !rsl) + { + rsl = RefSceneInScene.isExclueAnyItem(); + } + + return rsl; + } + + protected override bool checkNoticeIgnore() + { + bool rsl = isNoticeIgnore; + return rsl; + } + + private string[] ids; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs.meta b/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs.meta new file mode 100644 index 0000000..97eb99b --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_SceneWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 026fd8cec188743acb7e03ee6101aab9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Selection.cs b/Assets/Scripts/Editor/FR2/FR2_Selection.cs new file mode 100644 index 0000000..03f5045 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Selection.cs @@ -0,0 +1,131 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class FR2_Selection + { + public static HashSet h = new HashSet(); + + public static HashSet HScene = new HashSet(); + private static bool dirty; + private static HashSet __cache; + + private static HashSet cache + { + get + { + if (__cache == null || dirty) + { + dirty = false; + __cache = new HashSet(); + + foreach (string item in h) + { + __cache.Add(item); + } + + foreach (Object item in HScene) + { + __cache.Add(item.GetInstanceID().ToString()); + } + } + + return __cache; + } + } + + public static int SelectionCount + { + get { return h.Count + HScene.Count; } + } + + public static void Commit() + { + var list = new List(); + foreach (string guid in h) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + // var obj = AssetDatabase.LoadAssetAtPath(path); + Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Object)); + list.Add(obj); + } + + foreach (Object obj in HScene) + { + list.Add(obj); + } + + Selection.objects = list.ToArray(); + } + + + public static bool IsSelect(string guid) + { + return cache.Contains(guid); + + //return h.Contains(guid); + } + + public static void RemoveSelection(string guid) + { + if (!h.Remove(guid)) + { + dirty = true; + HScene.RemoveWhere(x => x.GetInstanceID().ToString() == guid); + } + } + + private static bool IsSelect(Object obj) + { + return HScene.Contains(obj); + } + + public static void ClearSelection() + { + dirty = true; + h.Clear(); + HScene.Clear(); + } + + public static void AppendSelection(string guid) + { + if (IsSelect(guid)) + { + return; + } + + dirty = true; + h.Add(guid); + } + + public static void AppendSelection(FR2_Ref rf) + { + if (rf.isSceneRef) + { + HScene.Add(rf.component); + } + else + { + h.Add(rf.asset.guid); + } + + dirty = true; + } + + public static void RemoveSelection(FR2_Ref rf) + { + if (rf.isSceneRef) + { + HScene.Remove(rf.component); + } + else + { + h.Remove(rf.asset.guid); + } + + dirty = true; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Selection.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Selection.cs.meta new file mode 100644 index 0000000..3e23d88 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Selection.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6b62a2942a0a19948b601dc0be99a527 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs b/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs new file mode 100644 index 0000000..fdb2b94 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs @@ -0,0 +1,405 @@ +#define DEV_MODE + +using System; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class FR2_TreeUI + { + public float itemH = 16f; + private Vector2 position; + + private FR2_TreeItemUI root; + public int selected; + public Color selectedColor = new Color32(0, 0, 255, 100); + private Rect visibleRect; + + public void Draw(FR2_TreeItemUI root, bool drawRoot = true) + { + EventType evtType = Event.current.type; + Rect r = GUILayoutUtility.GetRect(1f, Screen.width, itemH, Screen.height); + + if (evtType != EventType.Layout) + { + visibleRect = r; + } + + int n = root.GetNVisible(Mathf.Max(root._treeStamp, 1)); + var contentRect = new Rect(0f, 0f, 1f, n * itemH); + int nVisible = Mathf.RoundToInt(visibleRect.height / itemH) + 1; + int min = Mathf.Max(0, Mathf.FloorToInt(position.y / itemH)); + int max = Mathf.Min(min + nVisible, n); + bool noScroll = contentRect.height < visibleRect.height; + + //Debug.Log("Drawing :: " + min + ":" + max + ":" + n); + + if (noScroll) + { + position = Vector2.zero; + } + + position = GUI.BeginScrollView(visibleRect, position, contentRect); + { + var rect = new Rect(0, 0, r.width - (noScroll ? 4f : itemH), itemH); + var current = 0; + if (drawRoot) + { + root.Draw(min, max, ref rect, ref current); + } + else + { + root.DrawChildren(min, max, ref rect, ref current); + } + } + + GUI.EndScrollView(); + } + + public void Draw(List list) where T : FR2_TreeItemUI + { + if (root == null) + { + root = new FR2_TreeItemUI(); + for (var i = 0; i < list.Count; i++) + { + root.AddChild(list[i]); + } + } + + Draw(root, false); + } + + public void Draw(List objList, Action itemDrawer) + { + Draw(objList.Count, (idx, r, hasMouse) => { itemDrawer(idx, r, objList[idx]); }); + + //var evtType = Event.current.type; + //Rect r = GUILayoutUtility.GetRect(1f, Screen.width, 16f, Screen.height); + + //if (evtType != EventType.layout){ + // visibleRect = r; + //} + + //var n = objList.Count; + //var contentRect = new Rect(0f, 0f, 1f, n * itemH); + //var nVisible = Mathf.RoundToInt(visibleRect.height/itemH) + 1; + //var min = Mathf.Max(0, Mathf.FloorToInt(position.y / itemH)); + //var max = Mathf.Min(min + nVisible, n); + //var noScroll = contentRect.height < visibleRect.height; + + //if (noScroll) position = Vector2.zero; + + //position = GUI.BeginScrollView(visibleRect, position, contentRect); + //{ + // var rect = new Rect (0, 0, r.width - (noScroll ? 4f : 16f), itemH); + // for (var i = min; i drawer, bool repaintOnly = false) + { + EventType evtType = Event.current.type; + Rect r = GUILayoutUtility.GetRect(1f, Screen.width, itemH, Screen.height); + + if (evtType != EventType.Layout) + { + visibleRect = r; + } + + if (!repaintOnly || evtType == EventType.Repaint) + { + var contentRect = new Rect(0f, 0f, 1f, n * itemH); + int nVisible = Mathf.RoundToInt(visibleRect.height / itemH) + 1; + int min = Mathf.Max(0, Mathf.FloorToInt(position.y / itemH)); + int max = Mathf.Min(min + nVisible, n); + bool noScroll = contentRect.height < visibleRect.height; + + if (noScroll) + { + position = Vector2.zero; + } + + position = GUI.BeginScrollView(visibleRect, position, contentRect); + + //Debug.Log(min + ":" + max + ":" + n); + + for (int i = min; i < max; i++) + { + var rr = new Rect(0, itemH * i, Screen.width, itemH); + + if (i == selected) + { + Color c = GUI.color; + GUI.color = selectedColor; + { + GUI.DrawTexture(rr, EditorGUIUtility.whiteTexture); + } + GUI.color = c; + } + + bool containsMouse = rr.Contains(Event.current.mousePosition); + bool hasMouse = Event.current.type == EventType.MouseDown && containsMouse; + + drawer(i, rr, hasMouse); + + if (Event.current.type == EventType.MouseUp && containsMouse) + { + selected = i; + Event.current.Use(); + } + } + + GUI.EndScrollView(); + } + } + } + + public class FR2_TreeItemUI + { + private const float arrowWidth = 14f; + + // -------------------------- DRAWER ---------------------------- + private static GUIStyle foldStyle; + + // -------------------------- PARENT / CHILDREN ---------------------------- + + protected bool _expand = true; + + protected int _itemHeight = 16; + protected int _nFakeSize; + protected int _nVisible; + internal int _treeStamp; + internal List children = new List(); + + // -------------------------- PARENT / CHILDREN ---------------------------- + + internal FR2_TreeItemUI parent; + + public virtual int GetNVisible(int stamp) + { + if (!_expand) + { + return 1 + _nFakeSize; + } + + if (_treeStamp == stamp) + { + return _nVisible + _nFakeSize; + } + + RefreshVisibleCount(stamp); + return _nVisible + _nFakeSize; + } + + public void ToggleExpand() + { + int delta = _nVisible - 1; + _expand = !_expand; + SetDeltaVisible(_expand ? delta : -delta, _treeStamp); + } + + private void RefreshVisibleCount(int stamp) + { + _treeStamp = stamp; + _nVisible = 1; + + for (var i = 0; i < children.Count; i++) + { + FR2_TreeItemUI c = children[i]; + _nVisible += c.GetNVisible(stamp); + } + } + + private void SetDeltaVisible(int delta, int stamp) + { + _treeStamp = stamp; + _nVisible += delta; + + if (parent != null) + { + parent.SetDeltaVisible(delta, stamp); + } + else + { + GetNVisible(++stamp); + } + } + + public FR2_TreeItemUI AddChild(FR2_TreeItemUI child) + { +#if DEV_MODE + { + if (!IsValidChild(child)) + { + return this; + } + + if (child.parent == this) + { + Debug.LogWarning("Child.parent already == this"); + return this; + } + + if (children.Contains(child)) + { + Debug.LogWarning("Something broken, child already in this.children list <" + child + + "> but its parent not set to this"); + return this; + } + } +#endif + + if (child.parent != null) + { + child.parent.RemoveChild(child); + } + + child.parent = this; + children.Add(child); + + int delta = child.GetNVisible(_treeStamp); + SetDeltaVisible(delta, _treeStamp); + return this; + } + + public FR2_TreeItemUI RemoveChild(FR2_TreeItemUI child) + { +#if DEV_MODE + { + if (!IsValidChild(child)) + { + return this; + } + + if (child.parent != this) + { + Debug.LogWarning("child.parent != this, can not remove"); + return this; + } + + if (!children.Contains(child)) + { + Debug.LogWarning( + "Something broken, child.parent == this but this.children does not contains child"); + return this; + } + } +#endif + + + child.parent = null; + children.Remove(child); + + //Recursive update nVIsible items up the tree + int delta = child.GetNVisible(_treeStamp); + SetDeltaVisible(-delta, _treeStamp); + + return this; + } + +#if DEV_MODE + private bool IsValidChild(FR2_TreeItemUI child) + { + if (child == null) + { + Debug.LogWarning("Child should not be null <" + child + ">"); + return false; + } + + //if (child.target == null){ + // Debug.LogWarning("Child's target should not be null <" + child + ">"); + // return false; + //} + return true; + } +#endif + + public virtual void DrawChildren(int from, int to, ref Rect r, ref int current) + { + for (var i = 0; i < children.Count; i++) + { + children[i].Draw(from, to, ref r, ref current); + if (current >= to) + { + return; + } + } + } + + public virtual void Draw(int from, int to, ref Rect r, ref int current) + { + if (current >= to) + { + Debug.LogWarning("Out of view " + current + ":" + from + ":" + to + ":" + this); + return; //finish drawing + } + + int n = _nFakeSize + 1; + int h = _itemHeight * n; + + if (current + n >= from) + { + //partially / fully visible ? just draw + + if (children.Count > 0) + { + // DrawTexture expand / collapse arrow + Rect arrowRect = r; + arrowRect.width = arrowWidth; + EditorGUI.BeginChangeCheck(); + + if (foldStyle == null) + { + foldStyle = "IN Foldout"; + } + + GUI.Toggle(arrowRect, _expand, GUIContent.none, foldStyle); + + if (EditorGUI.EndChangeCheck()) + { + ToggleExpand(); + } + } + + Rect drawRect = r; + drawRect.x += arrowWidth; + drawRect.width -= arrowWidth; + drawRect.height = h; + Draw(drawRect); + } + + current += n; + r.y += h; + + if (!_expand || current >= to) + { + return; + } + + r.x += arrowWidth; + r.width -= arrowWidth; + + for (var i = 0; i < children.Count; i++) + { + children[i].Draw(from, to, ref r, ref current); + if (current >= to) + { + return; + } + } + + r.x -= arrowWidth; + r.width += arrowWidth; + } + + protected virtual void Draw(Rect r) { } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs.meta b/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs.meta new file mode 100644 index 0000000..a539a3b --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_TreeUI.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6c8689dad9c3ed341b7088135cb83be6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs b/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs new file mode 100644 index 0000000..f34357e --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs @@ -0,0 +1,385 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class FR2_TreeUI2 + { + internal Drawer drawer; + + private Vector2 position; + private TreeItem rootItem; + internal Rect visibleRect; + + public FR2_TreeUI2(Drawer drawer) + { + this.drawer = drawer; + } + + public void Reset(params string[] root) + { + position = Vector2.zero; + + rootItem = new TreeItem + { + tree = this, + id = "$root", + height = 0, + depth = -1, + _isOpen = true, + highlight = false, + childCount = root.Length + }; + + rootItem.RefreshChildren(root); + rootItem.DeepOpen(); + } + + public void Draw() + { + EventType evtType = Event.current.type; + Rect r = GUILayoutUtility.GetRect(1f, Screen.width, 16f, Screen.height); + + if (evtType != EventType.Layout) + { + visibleRect = r; + } + + var contentRect = new Rect(0f, 0f, 1f, rootItem.childrenHeight); + bool noScroll = contentRect.height < visibleRect.height; + if (noScroll) + { + position = Vector2.zero; + } + + var minY = (int) position.y; + var maxY = (int) (position.y + visibleRect.height); + contentRect.x -= FR2_Setting.TreeIndent; + + TreeItem.DrawCall = 0; + TreeItem.DrawRender = 0; + position = GUI.BeginScrollView(visibleRect, position, contentRect); + { + var rect = new Rect(0, 0, r.width - (noScroll ? 4f : 16f), 16f); + var index = 0; + rootItem.Draw(ref index, ref rect, minY, maxY); + } + + GUI.EndScrollView(); + } + + public bool NoScroll() + { + return rootItem.childrenHeight < visibleRect.height; + } + + // ------------------------ DELEGATE -------------- + + public class Drawer + { + public virtual int GetHeight(string id) + { + return 16; + } + + public virtual int GetChildCount(string id) + { + return 0; + } + + public virtual string[] GetChildren(string id) + { + return null; + } + + public virtual void Draw(Rect r, TreeItem item) + { + GUI.Label(r, item.id); + } + } + + public class GroupDrawer : Drawer + { + public Action drawGroup; + public Action drawItem; + private Dictionary> groupDict; + private FR2_TreeUI2 tree; + + public GroupDrawer(Action drawGroup, Action drawItem) + { + this.drawItem = drawItem; + this.drawGroup = drawGroup; + } + + // ----------------- TREE WRAPPER ------------------ + public bool TreeNoScroll() + { + return tree.NoScroll(); + } + + public void Reset(List items, Func idFunc, Func groupFunc, + Action> customGroupSort = null) + { + groupDict = new Dictionary>(); + + for (var i = 0; i < items.Count; i++) + { + List list; + + string groupName = groupFunc(items[i]); + string itemId = idFunc(items[i]); + + if (!groupDict.TryGetValue(groupName, out list)) + { + list = new List(); + groupDict.Add(groupName, list); + } + + list.Add(itemId); + } + + if (tree == null) + { + tree = new FR2_TreeUI2(this); + } + + List groups = groupDict.Keys.ToList(); + + //if (groups.Count == 1) //single group : Flat list + //{ + // var v = groupDict[groups[0]]; + // tree.Reset(v.ToArray()); + // groupDict.Clear(); + //} else + + { //multiple groups + + if (customGroupSort != null) + { + customGroupSort(groups); + } + else + { + groups.Sort(); + } + + tree.Reset(groups.ToArray()); + } + } + + public void Draw() + { + if (tree != null) + { + tree.Draw(); + } + } + + // ----------------- DRAWER WRAPPER ------------------ + + public override int GetChildCount(string id) + { + List group; + if (groupDict.TryGetValue(id, out group)) + { + return group.Count; + } + + return 0; + } + + public override string[] GetChildren(string id) + { + List group; + if (groupDict.TryGetValue(id, out group)) + { + return group.ToArray(); + } + + return null; + } + + public override void Draw(Rect r, TreeItem item) + { + List group; + if (groupDict.TryGetValue(item.id, out group)) + { + drawGroup(r, item.id, item.childCount); + return; + } + + drawItem(r, item.id); + } + } + + // ------------------------ TreeItem2 -------------- + + public class TreeItem + { + public static int DrawCall; + public static int DrawRender; + + internal bool _isOpen; + + public int childCount; + public List children; + public int childrenHeight; + public int depth; // item depth + + public int height; + public bool highlight; + + public string id; // item id + + internal TreeItem parent; + //static Color COLOR = new Color(0f, 0f, 0f, 0.05f); + + internal FR2_TreeUI2 tree; + + public bool IsOpen + { + get { return _isOpen; } + set + { + if (_isOpen == value || childCount == 0) + { + return; + } + + _isOpen = value; + + if (_isOpen) + { + if (children == null) + { + RefreshChildren(tree.drawer.GetChildren(id)); + } + + //Update height for all parents + TreeItem p = parent; + while (p != null) + { + p.childrenHeight += childrenHeight; + p = p.parent; + } + } + else + { + //Update height for all parents + TreeItem p = parent; + while (p != null) + { + p.childrenHeight -= childrenHeight; + p = p.parent; + } + } + } + } + + internal void DeepOpen() + { + IsOpen = true; + if (children == null) + { + return; + } + + for (var i = 0; i < children.Count; i++) + { + children[i].DeepOpen(); + } + } + + internal void Draw(ref int index, ref Rect rect, int minY, int maxY) + { + DrawCall++; + + // if (DrawCall < 10) + // { + // Debug.Log(index + ":" + rect + ":" + minY + ":" + maxY + ":" + height + ":" + childrenHeight); + // } + + //var skipDraw = (rect.y >= maxY) || (height <=0); + float min = rect.y; + float max = rect.y + height; + bool interMin = min >= minY && min <= maxY; + bool interMax = max >= minY && max <= maxY; + + if (height > 0 && (interMin || interMax)) + { + DrawRender++; + rect.height = height; + + if (index % 2 == 1 && FR2_Setting.AlternateRowColor) + { + Color o = GUI.color; + GUI.color = FR2_Setting.RowColor; + // GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture); + GUI.DrawTexture(new Rect(rect.x - FR2_Setting.TreeIndent, rect.y, rect.width, rect.height), + EditorGUIUtility.whiteTexture); + GUI.color = o; + } + + float x = (depth + 1) * 16f; + tree.drawer.Draw(new Rect(x, rect.y, rect.width - x, rect.height), this); + + if (childCount > 0) + { + IsOpen = GUI.Toggle(new Rect(rect.x + x - 16f, rect.y, 16f, 16f), IsOpen, string.Empty, + EditorStyles.foldout); + } + + index++; + rect.y += height; + } + else + { + rect.y += height; + } + + if (_isOpen && rect.y <= maxY) //draw children + { + for (var i = 0; i < children.Count; i++) + { + children[i].Draw(ref index, ref rect, minY, maxY); + if (rect.y > maxY) + { + break; + } + } + } + } + + internal void RefreshChildren(string[] childrenIDs) + { + childCount = childrenIDs.Length; + childrenHeight = 0; + children = new List(); + + for (var i = 0; i < childCount; i++) + { + string itemId = childrenIDs[i]; + + var item = new TreeItem + { + tree = tree, + parent = this, + + id = itemId, + depth = depth + 1, + highlight = false, + + height = tree.drawer.GetHeight(itemId), + childCount = tree.drawer.GetChildCount(itemId) + }; + + childrenHeight += item.height; + children.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs.meta b/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs.meta new file mode 100644 index 0000000..f020362 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_TreeUI2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c0367155479c84189ad956f35f707b7c +timeCreated: 1493613697 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Unity.cs b/Assets/Scripts/Editor/FR2/FR2_Unity.cs new file mode 100644 index 0000000..ea75ded --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Unity.cs @@ -0,0 +1,724 @@ +#if UNITY_5_3_OR_NEWER +#define UNITY_4_3_OR_NEWER +#define UNITY_4_4_OR_NEWER +#define UNITY_4_5_OR_NEWER +#define UNITY_4_6_OR_NEWER +#define UNITY_4_7_OR_NEWER +#define UNITY_5_0_OR_NEWER +#define UNITY_5_1_OR_NEWER +#define UNITY_5_2_OR_NEWER +#else + #if UNITY_5 + #define UNITY_4_3_OR_NEWER + #define UNITY_4_4_OR_NEWER + #define UNITY_4_5_OR_NEWER + #define UNITY_4_6_OR_NEWER + #define UNITY_4_7_OR_NEWER + + #if UNITY_5_0 + #define UNITY_5_0_OR_NEWER + #elif UNITY_5_1 + #define UNITY_5_0_OR_NEWER + #define UNITY_5_1_OR_NEWER + #elif UNITY_5_2 + #define UNITY_5_0_OR_NEWER + #define UNITY_5_1_OR_NEWER + #define UNITY_5_2_OR_NEWER + #endif + #else + #if UNITY_4_3 + #define UNITY_4_3_OR_NEWER + #elif UNITY_4_4 + #define UNITY_4_3_OR_NEWER + #define UNITY_4_4_OR_NEWER + #elif UNITY_4_5 + #define UNITY_4_3_OR_NEWER + #define UNITY_4_4_OR_NEWER + #define UNITY_4_5_OR_NEWER + #elif UNITY_4_6 + #define UNITY_4_3_OR_NEWER + #define UNITY_4_4_OR_NEWER + #define UNITY_4_5_OR_NEWER + #define UNITY_4_6_OR_NEWER + #elif UNITY_4_7 + #define UNITY_4_3_OR_NEWER + #define UNITY_4_4_OR_NEWER + #define UNITY_4_5_OR_NEWER + #define UNITY_4_6_OR_NEWER + #define UNITY_4_7_OR_NEWER + #endif + #endif +#endif + + +#if UNITY_5_3_OR_NEWER +#define UNITY_SCENE_MANAGER +#endif + +using System; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; +#if UNITY_SCENE_MANAGER +using UnityEngine.SceneManagement; + +#endif +namespace vietlabs.fr2 +{ + public class FR2_Unity + { + internal static readonly AssetType[] FILTERS = + { + new AssetType("Scene", ".unity"), + new AssetType("Prefab", ".prefab"), + new AssetType("Model", ".3df", ".3dm", ".3dmf", ".3dv", ".3dx", ".c5d", ".lwo", ".lws", ".ma", ".mb", + ".mesh", ".vrl", ".wrl", ".wrz", ".fbx", ".dae", ".3ds", ".dxf", ".obj", ".skp", ".max", ".blend"), + new AssetType("Material", ".mat", ".cubemap", ".physicsmaterial"), + new AssetType("Texture", ".ai", ".apng", ".png", ".bmp", ".cdr", ".dib", ".eps", ".exif", ".ico", ".icon", + ".j", ".j2c", ".j2k", ".jas", ".jiff", ".jng", ".jp2", ".jpc", ".jpe", ".jpeg", ".jpf", ".jpg", "jpw", + "jpx", "jtf", ".mac", ".omf", ".qif", ".qti", "qtif", ".tex", ".tfw", ".tga", ".tif", ".tiff", ".wmf", + ".psd", ".exr", ".rendertexture"), + new AssetType("Video", ".asf", ".asx", ".avi", ".dat", ".divx", ".dvx", ".mlv", ".m2l", ".m2t", ".m2ts", + ".m2v", ".m4e", ".m4v", "mjp", ".mov", ".movie", ".mp21", ".mp4", ".mpe", ".mpeg", ".mpg", ".mpv2", + ".ogm", ".qt", ".rm", ".rmvb", ".wmv", ".xvid", ".flv"), + new AssetType("Audio", ".mp3", ".wav", ".ogg", ".aif", ".aiff", ".mod", ".it", ".s3m", ".xm"), + new AssetType("Script", ".cs", ".js", ".boo"), + new AssetType("Text", ".txt", ".json", ".xml", ".bytes", ".sql"), + new AssetType("Shader", ".shader", ".cginc"), + new AssetType("Animation", ".anim", ".controller", ".overridecontroller", ".mask"), + new AssetType("Unity Asset", ".asset", ".guiskin", ".flare", ".fontsettings", ".prefs"), + new AssetType("Others") // + }; + + public static string[] Selection_AssetGUIDs + { + get + { +#if UNITY_5_0_OR_NEWER + return Selection.assetGUIDs; +#else + var mInfo = + typeof(Selection).GetProperty("assetGUIDs", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); + if (mInfo != null){ + return (string[]) mInfo.GetValue(null, null); + } + Debug.LogWarning("Unity changed ! Selection.assetGUIDs not found !"); + return new string[0]; +#endif + } + } + + //private static Texture2D _whiteTexture; + //public static Texture2D whiteTexture { + // get { + // return EditorGUIUtility.whiteTexture; + + // #if UNITY_5_0_OR_NEWER + // return EditorGUIUtility.whiteTexture; + // #else + // if (_whiteTexture != null) return _whiteTexture; + // _whiteTexture = new Texture2D(1,1, TextureFormat.RGBA32, false); + // _whiteTexture.SetPixel(0, 0, Color.white); + // _whiteTexture.hideFlags = HideFlags.DontSave; + // return _whiteTexture; + // #endif + // } + //} + + public static T LoadAssetAtPath(string path) where T : Object + { +#if UNITY_5_1_OR_NEWER + return AssetDatabase.LoadAssetAtPath(path); +#else + return (T)AssetDatabase.LoadAssetAtPath(path, typeof(T)); +#endif + } + + public static void SetWindowTitle(EditorWindow window, string title) + { +#if UNITY_5_1_OR_NEWER + window.titleContent = new GUIContent(title); +#else + window.title = title; +#endif + } + + public static void GetCompilingPhase(string path, out bool isPlugin, out bool isEditor) + { +#if (UNITY_5_2_0 || UNITY_5_2_1) && !UNITY_5_2_OR_NEWER + bool oldSystem = true; +#else + var oldSystem = false; +#endif + + // ---- Old system: Editor for the plugin should be Plugins/Editor + if (oldSystem) + { + bool isPluginEditor = path.StartsWith("Assets/Plugins/Editor/", StringComparison.Ordinal) + || path.StartsWith("Assets/Standard Assets/Editor/", StringComparison.Ordinal) + || path.StartsWith("Assets/Pro Standard Assets/Editor/", + StringComparison.Ordinal); + + if (isPluginEditor) + { + isPlugin = true; + isEditor = true; + return; + } + } + + isPlugin = path.StartsWith("Assets/Plugins/", StringComparison.Ordinal) + || path.StartsWith("Assets/Standard Assets/", StringComparison.Ordinal) + || path.StartsWith("Assets/Pro Standard Assets/", StringComparison.Ordinal); + + isEditor = oldSystem && isPlugin ? false : path.Contains("/Editor/"); + } + + public static T LoadAssetWithGUID(string guid) where T : Object + { + if (string.IsNullOrEmpty(guid)) + { + return null; + } + + string path = AssetDatabase.GUIDToAssetPath(guid); + if (string.IsNullOrEmpty(path)) + { + return null; + } + +#if UNITY_5_1_OR_NEWER + return AssetDatabase.LoadAssetAtPath(path); +#else + return (T)AssetDatabase.LoadAssetAtPath(path, typeof(T)); +#endif + } + + public static void UnloadUnusedAssets() + { +#if UNITY_5_0_OR_NEWER + EditorUtility.UnloadUnusedAssetsImmediate(); +#else + EditorUtility.UnloadUnusedAssets(); +#endif + Resources.UnloadUnusedAssets(); + } + + internal static int Epoch(DateTime time) + { + return (int) (time.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; + } + + internal static bool DrawToggle(ref bool v, string label) + { + bool v1 = GUILayout.Toggle(v, label); + if (v1 != v) + { + v = v1; + return true; + } + + return false; + } + + internal static bool DrawToggleToolbar(ref bool v, string label, float width) + { + bool v1 = GUILayout.Toggle(v, label, EditorStyles.toolbarButton, GUILayout.Width(width)); + if (v1 != v) + { + v = v1; + return true; + } + + return false; + } + + internal static bool DrawToggleToolbar(ref bool v, GUIContent icon, float width) + { + bool v1 = GUILayout.Toggle(v, icon, EditorStyles.toolbarButton, GUILayout.Width(width)); + if (v1 != v) + { + v = v1; + return true; + } + + return false; + } + + internal static bool DrawToggle(bool v, string label, Action setter) + { + bool v1 = GUILayout.Toggle(v, label); + if (v1 != v) + { + if (setter != null) + { + setter(v1); + } + + return true; + } + + return false; + } + + internal static EditorWindow FindEditor(string className) + { + EditorWindow[] list = Resources.FindObjectsOfTypeAll(); + foreach (EditorWindow item in list) + { + if (item.GetType().FullName == className) + { + return item; + } + } + + return null; + } + + internal static void RepaintAllEditor(string className) + { + EditorWindow[] list = Resources.FindObjectsOfTypeAll(); + + foreach (EditorWindow item in list) + { +#if FR2_DEV + Debug.Log(item.GetType().FullName); +#endif + + if (item.GetType().FullName != className) + { + continue; + } + + item.Repaint(); + } + } + + internal static void RepaintProjectWindows() + { + RepaintAllEditor("UnityEditor.ProjectBrowser"); + } + + internal static void RepaintFR2Windows() + { + RepaintAllEditor("vietlabs.fr2.FR2_Window"); + } + + internal static void ExportSelection() + { + Type packageExportT = null; + + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + packageExportT = assembly.GetType("UnityEditor.PackageExport"); + if (packageExportT != null) + { + break; + } + } + + if (packageExportT == null) + { + Debug.LogWarning("Export Package Error : UnityEditor.PackageExport not found !"); + return; + } + + EditorWindow panel = EditorWindow.GetWindow(packageExportT, true, "Exporting package"); +#if UNITY_5_2_OR_NEWER + var prop = "m_IncludeDependencies"; +#else + var prop = "m_bIncludeDependencies"; +#endif + + FieldInfo fieldInfo = packageExportT.GetField(prop, BindingFlags.NonPublic | BindingFlags.Instance); + if (fieldInfo == null) + { + Debug.LogWarning("Export Package error : " + prop + " not found !"); + return; + } + + MethodInfo methodInfo = + packageExportT.GetMethod("BuildAssetList", BindingFlags.NonPublic | BindingFlags.Instance); + if (methodInfo == null) + { + Debug.LogWarning("Export Package error : BuildAssetList method not found !"); + return; + } + + fieldInfo.SetValue(panel, false); + methodInfo.Invoke(panel, null); + panel.Repaint(); + } + + + public static Type GetType(string typeName) + { + Type type = Type.GetType(typeName); + if (type != null) + { + return type; + } + + foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) + { + type = a.GetType(typeName); + if (type != null) + { + return type; + } + } + + return null; + } + + public static IEnumerable GetAllChild(Transform root) + { + yield return root; + if (root.childCount <= 0) + { + yield break; + } + + for (var i = 0; i < root.childCount; i++) + { + foreach (Transform item in GetAllChild(root.GetChild(i))) + { + yield return item; + } + } + } + + public static IEnumerable getAllObjsInCurScene() + { +#if UNITY_SCENE_MANAGER + for (var j = 0; j < SceneManager.sceneCount; j++) + { + Scene scene = SceneManager.GetSceneAt(j); + foreach (GameObject item in GetGameObjectsInScene(scene)) + { + yield return item; + } + } + + if (EditorApplication.isPlaying) + { + //dont destroy scene + GameObject temp = null; + try + { + temp = new GameObject(); + Object.DontDestroyOnLoad(temp); + Scene dontDestroyOnLoad = temp.scene; + Object.DestroyImmediate(temp); + temp = null; + + foreach (GameObject item in GetGameObjectsInScene(dontDestroyOnLoad)) + { + yield return item; + } + } + finally + { + if (temp != null) + { + Object.DestroyImmediate(temp); + } + } + } +#else + foreach (Transform obj in Resources.FindObjectsOfTypeAll(typeof(Transform))) + { + GameObject o = obj.gameObject; + yield return o; + } +#endif + } +#if UNITY_SCENE_MANAGER + private static IEnumerable GetGameObjectsInScene(Scene scene) + { + var rootObjects = new List(); + if (!scene.isLoaded) + { + yield break; + } + + scene.GetRootGameObjects(rootObjects); + + // iterate root objects and do something + for (var i = 0; i < rootObjects.Count; ++i) + { + GameObject gameObject = rootObjects[i]; + + foreach (GameObject item in getAllChild(gameObject)) + { + yield return item; + } + + yield return gameObject; + } + } +#endif + public static IEnumerable getAllChild(GameObject target, bool returnMe = false) + { + if (returnMe) + { + yield return target; + } + + if (target.transform.childCount > 0) + { + for (var i = 0; i < target.transform.childCount; i++) + { + yield return target.transform.GetChild(i).gameObject; + foreach (GameObject item in getAllChild(target.transform.GetChild(i).gameObject, false)) + { + yield return item; + } + } + } + } + + public static IEnumerable GetAllRefObjects(GameObject obj) + { + Component[] components = obj.GetComponents(); + foreach (Component com in components) + { + if (com == null) + { + continue; + } + + var serialized = new SerializedObject(com); + SerializedProperty it = serialized.GetIterator().Copy(); + while (it.NextVisible(true)) + { + if (it.propertyType != SerializedPropertyType.ObjectReference) + { + continue; + } + + if (it.objectReferenceValue == null) + { + continue; + } + + yield return it.objectReferenceValue; + } + } + } + + public static int StringMatch(string pattern, string input) + { + if (input == pattern) + { + return int.MaxValue; + } + + if (input.Contains(pattern)) + { + return int.MaxValue - 1; + } + + var pidx = 0; + var score = 0; + var tokenScore = 0; + + for (var i = 0; i < input.Length; i++) + { + char ch = input[i]; + if (ch == pattern[pidx]) + { + tokenScore += tokenScore + 1; //increasing score for continuos token + pidx++; + if (pidx >= pattern.Length) + { + break; + } + } + else + { + tokenScore = 0; + } + + score += tokenScore; + } + + return score; + } + + public static int GetIndex(string ext) + { + for (var i = 0; i < FILTERS.Length - 1; i++) + { + if (FILTERS[i].extension.Contains(ext)) + { + return i; + } + } + + return FILTERS.Length - 1; //Others + } + + public static void GuiLine(int i_height = 1) + + { + Rect rect = EditorGUILayout.GetControlRect(false, i_height); + + rect.height = i_height; + + EditorGUI.DrawRect(rect, new Color(0.5f, 0.5f, 0.5f, 1)); + } + + public static bool IsInAsset(GameObject obj) + { + //#if UNITY_5_3_OR_NEWER + // this not working in new empty created scene + //return string.IsNullOrEmpty(obj.scene.name); + //#else + return !string.IsNullOrEmpty(AssetDatabase.GetAssetPath(obj)); + //#endif + } + + public static string GetPrefabParent(Object obj) + { +#if UNITY_2018_2_OR_NEWER + string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(obj); + return AssetDatabase.AssetPathToGUID(prefabPath); +#else + var prefab = PrefabUtility.GetPrefabParent(obj); + return AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(prefab)); +#endif + } + + public static string GetGameObjectPath(GameObject obj, bool includeMe = true) + { + if (obj == null) + { + return string.Empty; + } + + string path = includeMe ? "/" + obj.name : "/"; + while (obj.transform.parent != null) + { + obj = obj.transform.parent.gameObject; + path = "/" + obj.name + path; + } + + path = path.TrimStart('/'); + return path; + } + + public static bool CheckIsPrefab(GameObject obj) + { +#if UNITY_2018_3_OR_NEWER + // var t = PrefabUtility.GetPrefabAssetType(obj); + // var isPrefab = (t != PrefabAssetType.NotAPrefab) && (t != PrefabAssetType.MissingAsset); + return PrefabUtility.IsAnyPrefabInstanceRoot(obj); +#else + return PrefabUtility.GetPrefabType(obj) != PrefabType.None; +#endif + } + + public static TerrainTextureData[] GetTerrainTextureDatas(TerrainData data) + { +#if UNITY_2018_3_OR_NEWER + var arr = new TerrainTextureData[data.terrainLayers.Length]; + for (var i = 0; i < data.terrainLayers.Length; i++) + { + TerrainLayer layer = data.terrainLayers[i]; + arr[i] = new TerrainTextureData + ( + layer.normalMapTexture, + layer.maskMapTexture, + layer.diffuseTexture + ); + } + + return arr; +#else + var arr = new TerrainTextureData[data.splatPrototypes.Length]; + for(int i = 0; i < data.splatPrototypes.Length; i++) + { + var layer = data.splatPrototypes[i]; + arr[i] = new TerrainTextureData + ( + layer.normalMap, + layer.texture + ); + } + return arr; +#endif + } + + public static int ReplaceTerrainTextureDatas(TerrainData terrain, Texture2D fromObj, Texture2D toObj) + { + var found = 0; +#if UNITY_2018_3_OR_NEWER + TerrainLayer[] arr3 = terrain.terrainLayers; + for (var i = 0; i < arr3.Length; i++) + { + if (arr3[i].normalMapTexture == fromObj) + { + found++; + arr3[i].normalMapTexture = toObj; + } + + if (arr3[i].maskMapTexture == fromObj) + { + found++; + arr3[i].maskMapTexture = toObj; + } + + if (arr3[i].diffuseTexture == fromObj) + { + found++; + arr3[i].diffuseTexture = toObj; + } + } + + terrain.terrainLayers = arr3; +#else + var arr3 = terrain.splatPrototypes; + for (var i = 0; i < arr3.Length; i++) + { + if (arr3[i].texture == fromObj) + { + found++; + arr3[i].texture = toObj; + } + + if (arr3[i].normalMap == fromObj) + { + found++; + arr3[i].normalMap = toObj; + } + } + + terrain.splatPrototypes = arr3; +#endif + return found; + } + + public class TerrainTextureData + { + public Texture2D[] textures; + + public TerrainTextureData(params Texture2D[] param) + { + var count = 0; + if (param != null) + { + count = param.Length; + } + + textures = new Texture2D[count]; + for (var i = 0; i < count; i++) + { + textures[i] = param[i]; + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Unity.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Unity.cs.meta new file mode 100644 index 0000000..16057bd --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Unity.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7d62736a417e747e481e3aa85951cd18 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs b/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs new file mode 100644 index 0000000..b4be223 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs @@ -0,0 +1,121 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public class FR2_UsedInBuild : IRefDraw + { + private readonly FR2_TreeUI2.GroupDrawer groupDrawer; + + private bool dirty; + private readonly FR2_RefDrawer drawer; + private Dictionary refs; + + public FR2_UsedInBuild(IWindow window) + { + this.window = window; + drawer = new FR2_RefDrawer(window); + dirty = true; + drawer.displayFileSize = true; + drawer.SetDirty(); + } + + public IWindow window { get; set; } + + + public int ElementCount() + { + return refs == null ? 0 : refs.Count; + } + + public bool Draw() + { + //Debug.Log("draw"); + if (dirty) + { + RefreshView(); + } + + return drawer.Draw(); + } + + public void SetDirty() + { + drawer.SetDirty(); + } + + public void RefreshView() + { + var scenes = new HashSet(); + // string[] scenes = new string[sceneCount]; + foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes) + { + if (scene == null) + { + continue; + } + + if (scene.enabled == false) + { + continue; + } + + string sce = AssetDatabase.AssetPathToGUID(scene.path); + + if (scenes.Contains(sce)) + { + continue; + } + + scenes.Add(sce); + } + + refs = FR2_Ref.FindUsage(scenes.ToArray()); + + foreach (string VARIABLE in scenes) + { + FR2_Ref asset = null; + if (!refs.TryGetValue(VARIABLE, out asset)) + { + continue; + } + + + asset.depth = 1; + } + + List list = FR2_Cache.Api.AssetList; + int count = list.Count; + for (var i = 0; i < count; i++) + { + FR2_Asset item = list[i]; + if (item.inEditor) continue; + + if (item.inPlugins) + { + if (item.type == FR2_AssetType.SCENE) continue; + } + + if (item.inResources || item.inStreamingAsset || item.inPlugins) + { + if (refs.ContainsKey(item.guid)) + { + continue; + } + + refs.Add(item.guid, new FR2_Ref(0, 1, item, null)); + } + } + + drawer.SetRefs(refs); + dirty = false; + } + + internal void RefreshSort() + { + drawer.RefreshSort(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs.meta b/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs.meta new file mode 100644 index 0000000..4ed681c --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_UsedInBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0eebac9e6cbe431ca16d9cb27500785 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_Window.cs b/Assets/Scripts/Editor/FR2/FR2_Window.cs new file mode 100644 index 0000000..b7eeaae --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Window.cs @@ -0,0 +1,406 @@ +using System; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +#if UNITY_5_3_OR_NEWER +#endif + +namespace vietlabs.fr2 +{ + // filter, ignore anh huong ket qua thi hien mau do + // optimize lag duplicate khi use + public class FR2_Window : FR2_WindowBase, IHasCustomMenu + { + [NonSerialized] internal FR2_DuplicateTree2 Duplicated; + + private string[] ids; + + internal int level; + + + private Object[] objs; + [NonSerialized] internal FR2_RefDrawer RefUnUse; + [NonSerialized] internal FR2_RefDrawer SceneToAssetDrawer; + private Vector2 scrollPos; + + + private string tempGUID; + private Object tempObject; + [NonSerialized] internal FR2_RefDrawer UsedByDrawer; + [NonSerialized] internal FR2_UsedInBuild UsedInBuild; + + + [NonSerialized] internal FR2_RefDrawer UsesDrawer; + + public override bool ShowScene + { + get { return false; } + } + + //[MenuItem("Window/Find Reference 2/Assets")] + private static void ShowWindow() + { + var _window = CreateInstance(); + _window.InitIfNeeded(); + FR2_Unity.SetWindowTitle(_window, "FR2 Assets"); + _window.Show(); + } + + + private void OnEnable() + { + resizerStyle = new GUIStyle(); + resizerStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D; + } + + protected override void InitIfNeeded() + { + { + if (UsesDrawer != null) + { + return; + } + + UsesDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets" + }; + UsedByDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets" + }; + Duplicated = new FR2_DuplicateTree2(this); + SceneToAssetDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets", + isDrawRefreshSceneCache = true + }; + RefUnUse = new FR2_RefDrawer(this) + { + Lable = "Unsed Asset", + isDrawRefreshSceneCache = false + }; + + UsedInBuild = new FR2_UsedInBuild(this); + } + + + FR2_Cache.onReady -= OnReady; + FR2_Cache.onReady += OnReady; + + FR2_Setting.OnIgnoreChange -= OnSelectionChange; + FR2_Setting.OnIgnoreChange += OnSelectionChange; + //Debug.Log(" FR2_Window ---> Init"); + } + + protected override void OnReady() + { + OnSelectionChange(); + if (IsFocusingUnused) + { + RefUnUse.ResetUnusedAsset(); + } + } + + public override void OnSelectionChange() + { + isNoticeIgnore = false; + if (!FR2_Cache.isReady) + { + return; + } + + if (lockSelection) + { + return; + } + + if (focusedWindow == null) + { + return; + } + + if (UsesDrawer == null) + { + InitIfNeeded(); + } + + ids = FR2_Unity.Selection_AssetGUIDs; + + //ignore selection on asset when selected any object in scene + if (Selection.gameObjects.Length > 0 && !FR2_Unity.IsInAsset(Selection.gameObjects[0])) + { + ids = new string[0]; + } + + level = 0; + if (IsFocusingSceneToAsset) + { + SceneToAssetDrawer.Reset(Selection.gameObjects, true, true); + } + + if (IsFocusingUses) + { + UsesDrawer.Reset(ids, true); + } + + if (IsFocusingUsedBy) + { + UsedByDrawer.Reset(ids, false); + } + + + if (IsFocusingGUIDs) + { + objs = new Object[ids.Length]; + for (var i = 0; i < ids.Length; i++) + { + objs[i] = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(ids[i]) + ); + } + } + + if (IsFocusingUsedInBuild) { } + + EditorApplication.delayCall += Repaint; + } + + + // public static Rect windowRect; + + + //return true if draw tool along + + + protected override void OnGUI() + { + if (!CheckDrawHeader()) + { + Debug.Log("return"); + return; + } + + //if (Selected.Count == 0){ + // GUILayout.Label("Nothing selected"); + //} + Rect rectTop = GetTopPanelRect(); + Rect rectBot = GetBotPanelRect(); + + RefDrawConfig config1 = null, config2 = null, config3 = null; + var drawTool = false; + var drawCount = 0; + if (IsFocusingUses || IsFocusingSceneToAsset) + { + Debug.Log("draw 1"); + drawTool = GetDrawConfig(UsesDrawer, SceneToAssetDrawer, out config1, out config2); + + //drawTool = GetDrawConfig(UsesDrawer, SceneToAssetDrawer, out config1, out config2); + } + else if (IsFocusingSceneInScene || IsFocusingFindInScene || IsFocusingUsedBy) + { + Debug.Log("draw 2"); + drawTool = GetDrawConfig(UsedByDrawer, out config2); + } + else if (IsFocusingDuplicate) + { + Debug.Log("draw 3"); + drawTool = GetDrawConfig(Duplicated, out config1); + } + else if (IsFocusingGUIDs) + { + Debug.Log("draw 4"); + drawCount++; + if (AnyToolInBot) + { + GUILayout.BeginArea(rectTop); + DrawGUIDs(); + GUILayout.EndArea(); + drawTool = true; + } + else + { + DrawGUIDs(); + drawTool = false; + } + } + else if (IsFocusingUnused) + { + Debug.Log("draw 5"); + drawCount++; + if (AnyToolInBot) + { + GUILayout.BeginArea(rectTop); + RefUnUse.Draw(); + GUILayout.EndArea(); + drawTool = true; + } + else + { + RefUnUse.Draw(); + drawTool = false; + } + } + else if (IsFocusingUsedInBuild) + { + Debug.Log("draw :" + IsFocusingUsedInBuild); + drawTool = GetDrawConfig(UsedInBuild, out config1); + } + + if (!IsFocusingGUIDs && !IsFocusingUnused) + { + Debug.Log("!IsFocusingGUIDs"); + drawCount += DrawConfig(config1, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config2, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config3, rectTop, rectBot, ref willRepaint); + } + + if (drawTool) + { + drawCount++; + GUILayout.BeginArea(rectBot); + DrawTool(); + GUILayout.EndArea(); + } + + DrawFooter(); + + OnAfterGUI(drawCount); + } + + + protected override void maskDirty() + { + UsedByDrawer.SetDirty(); + UsesDrawer.SetDirty(); + Duplicated.SetDirty(); + SceneToAssetDrawer.SetDirty(); + RefUnUse.SetDirty(); + + UsedInBuild.SetDirty(); + } + + protected override void RefreshSort() + { + UsedByDrawer.RefreshSort(); + UsesDrawer.RefreshSort(); + Duplicated.RefreshSort(); + SceneToAssetDrawer.RefreshSort(); + RefUnUse.RefreshSort(); + UsedInBuild.RefreshSort(); + } + // public bool isExcludeByFilter; + + protected override bool checkNoticeFilter() + { + var rsl = false; + + if (IsFocusingUsedBy && !rsl) + { + rsl = UsedByDrawer.isExclueAnyItem(); + } + + if (IsFocusingDuplicate) + { + return Duplicated.isExclueAnyItem(); + } + + if (IsFocusingUses && rsl == false) + { + rsl = UsesDrawer.isExclueAnyItem(); + } + + if (IsFocusingSceneToAsset && rsl == false) + { + rsl = SceneToAssetDrawer.isExclueAnyItem(); + } + + //tab use by + return rsl; + } + + protected override bool checkNoticeIgnore() + { + bool rsl = isNoticeIgnore; + return rsl; + } + + private void DrawGUIDs() + { + GUILayout.Label("GUID to Object", EditorStyles.boldLabel); + GUILayout.BeginHorizontal(); + { + string guid = EditorGUILayout.TextField(tempGUID ?? string.Empty); + EditorGUILayout.ObjectField(tempObject, typeof(Object), false, GUILayout.Width(120f)); + + if (GUILayout.Button("Paste", EditorStyles.miniButton, GUILayout.Width(70f))) + { + guid = EditorGUIUtility.systemCopyBuffer; + } + + if (guid != tempGUID && !string.IsNullOrEmpty(guid)) + { + tempGUID = guid; + + tempObject = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(tempGUID) + ); + } + } + GUILayout.EndHorizontal(); + GUILayout.Space(10f); + if (objs == null || ids == null) + { + return; + } + + //GUILayout.Label("Selection", EditorStyles.boldLabel); + if (ids.Length == objs.Length) + { + scrollPos = GUILayout.BeginScrollView(scrollPos); + { + for (var i = 0; i < ids.Length; i++) + { + GUILayout.BeginHorizontal(); + { + EditorGUILayout.ObjectField(objs[i], typeof(Object), false); + string idi = ids[i]; + GUILayout.TextField(idi, GUILayout.Width(240f)); + if (GUILayout.Button("Copy", EditorStyles.miniButton, GUILayout.Width(50f))) + { + EditorGUIUtility.systemCopyBuffer = tempGUID = idi; + + if (!string.IsNullOrEmpty(tempGUID)) + { + tempObject = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(tempGUID) + ); + } + + //Debug.Log(EditorGUIUtility.systemCopyBuffer); + } + } + GUILayout.EndHorizontal(); + } + } + GUILayout.EndScrollView(); + } + + // GUILayout.FlexibleSpace(); + // GUILayout.FlexibleSpace(); + GUILayout.BeginHorizontal(); + if (GUILayout.Button("Merge Selection To")) + { + FR2_Export.MergeDuplicate(); + } + + EditorGUILayout.ObjectField(tempObject, typeof(Object), false, GUILayout.Width(120f)); + GUILayout.EndHorizontal(); + GUILayout.Space(5f); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_Window.cs.meta b/Assets/Scripts/Editor/FR2/FR2_Window.cs.meta new file mode 100644 index 0000000..a4714c2 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_Window.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 29dffe27204f9d5459147d239a58a521 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs b/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs new file mode 100644 index 0000000..a373a71 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs @@ -0,0 +1,500 @@ +using System; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +#if UNITY_5_3_OR_NEWER +#endif + +namespace vietlabs.fr2 +{ + // filter, ignore anh huong ket qua thi hien mau do + // optimize lag duplicate khi use + public class FR2_WindowAll : FR2_WindowBase, IHasCustomMenu + { + public override bool ShowScene + { + get { return false; } + } + + [MenuItem("Window/Find Reference 2")] + private static void ShowWindow() + { + var _window = CreateInstance(); + _window.InitIfNeeded(); + FR2_Unity.SetWindowTitle(_window, "FR2"); + _window.Show(); + } + + [NonSerialized] internal FR2_UsedInBuild UsedInBuild; + [NonSerialized] internal FR2_DuplicateTree2 Duplicated; + [NonSerialized] internal FR2_RefDrawer RefUnUse; + [NonSerialized] internal FR2_RefDrawer UsesDrawer; + [NonSerialized] internal FR2_RefDrawer UsedByDrawer; + [NonSerialized] internal FR2_RefDrawer SceneToAssetDrawer; + + + [NonSerialized] internal FR2_RefDrawer RefInScene; + [NonSerialized] internal FR2_RefDrawer SceneUsesDrawer; //scene use another scene objects + [NonSerialized] internal FR2_RefDrawer RefSceneInScene; + + internal int level; + private Vector2 scrollPos; + private string tempGUID; + private Object tempObject; + + + private void OnEnable() + { + resizerStyle = new GUIStyle(); + resizerStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D; + Repaint(); + } + + protected override void InitIfNeeded() + { + { + if (UsesDrawer != null) + { + return; + } + + UsesDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets" + }; + UsedByDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets" + }; + Duplicated = new FR2_DuplicateTree2(this); + SceneToAssetDrawer = new FR2_RefDrawer(this) + { + Lable = "Assets", + isDrawRefreshSceneCache = false + }; + RefUnUse = new FR2_RefDrawer(this) + { + Lable = "Unsed Asset", + isDrawRefreshSceneCache = false + }; + UsedInBuild = new FR2_UsedInBuild(this); + } + + if (SceneUsesDrawer != null) + { + return; + } + + SceneUsesDrawer = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + RefInScene = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + RefSceneInScene = new FR2_RefDrawer(this) + { + Lable = "Scene Objects", + isDrawRefreshSceneCache = true + }; + + lockSelection = false; + +#if UNITY_2018_OR_NEWER + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode -= OnSceneChanged; + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChangedInEditMode += OnSceneChanged; +#elif UNITY_2017_OR_NEWER + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged -= OnSceneChanged; + UnityEditor.SceneManagement.EditorSceneManager.activeSceneChanged += OnSceneChanged; +#endif + + FR2_Cache.onReady -= OnReady; + FR2_Cache.onReady += OnReady; + + FR2_Setting.OnIgnoreChange -= OnSelectionChange; + FR2_Setting.OnIgnoreChange += OnSelectionChange; + + Repaint(); + } + +#if UNITY_2018_OR_NEWER + private void OnSceneChanged(Scene arg0, Scene arg1) + { + if (IsFocusingFindInScene || IsFocusingSceneToAsset || IsFocusingSceneInScene) + { + OnSelectionChange(); + } + } +#endif + protected override void OnReady() + { + OnSelectionChange(); + if (IsFocusingUnused) + { + RefUnUse.ResetUnusedAsset(); + } + } + + public override void OnSelectionChange() + { + Repaint(); + + isNoticeIgnore = false; + if (!FR2_Cache.isReady) + { + return; + } + + if (lockSelection) + { + return; + } + + if (focusedWindow == null) + { + return; + } + + if (SceneUsesDrawer == null) + { + InitIfNeeded(); + } + + if (UsesDrawer == null) + { + InitIfNeeded(); + } + + ids = FR2_Unity.Selection_AssetGUIDs; + + //ignore selection on asset when selected any object in scene + if (Selection.gameObjects.Length > 0 && !FR2_Unity.IsInAsset(Selection.gameObjects[0])) + { + ids = new string[0]; + } + + level = 0; + if (IsFocusingSceneToAsset) + { + SceneToAssetDrawer.Reset(Selection.gameObjects, true, true); + } + + if (IsFocusingUses) + { + UsesDrawer.Reset(ids, true); + } + + if (IsFocusingUsedBy) + { + UsedByDrawer.Reset(ids, false); + } + + if (IsFocusingSceneInScene) + { + RefSceneInScene.ResetSceneInScene(Selection.gameObjects); + } + + if (IsFocusingUses) + { + SceneUsesDrawer.ResetSceneUseSceneObjects(Selection.gameObjects); + } + + if (IsFocusingFindInScene) + { + RefInScene.Reset(ids, this as IWindow); + } + + if (IsFocusingGUIDs) + { + objs = new Object[ids.Length]; + for (var i = 0; i < ids.Length; i++) + { + objs[i] = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(ids[i]) + ); + } + } + + + if (FR2_SceneCache.Api.Dirty && !Application.isPlaying) + { + FR2_SceneCache.Api.refreshCache(this); + } + + EditorApplication.delayCall -= Repaint; + EditorApplication.delayCall += Repaint; + } + + + // public static Rect windowRect; + + + //return true if draw tool along + + + protected override void OnGUI() + { + if (!CheckDrawHeader()) + { + return; + } + + //if (Selected.Count == 0){ + // GUILayout.Label("Nothing selected"); + //} + Rect rectTop = GetTopPanelRect(); + Rect rectBot = GetBotPanelRect(); + + RefDrawConfig config1 = null, config2 = null, config3 = null; + var drawTool = false; + var drawCount = 0; + if (IsFocusingUses || IsFocusingSceneToAsset) + { + if (UsesDrawer.ElementCount() <= 0) + { + drawTool = GetDrawConfig(SceneUsesDrawer, SceneToAssetDrawer, out config1, out config2); + } + else + { + drawTool = GetDrawConfig(UsesDrawer, out config3); + } + } + else if (IsFocusingSceneInScene || IsFocusingFindInScene || IsFocusingUsedBy) + { + if (RefSceneInScene.ElementCount() <= 0) + { + drawTool = GetDrawConfig(RefInScene, UsedByDrawer, out config1, out config2); + } + else + { + drawTool = GetDrawConfig(RefSceneInScene, out config3); + } + } + else if (IsFocusingDuplicate) + { + drawTool = GetDrawConfig(Duplicated, out config1); + } + else if (IsFocusingGUIDs) + { + drawCount++; + if (AnyToolInBot) + { + GUILayout.BeginArea(rectTop); + DrawGUIDs(); + GUILayout.EndArea(); + drawTool = true; + } + else + { + DrawGUIDs(); + drawTool = false; + } + } + else if (IsFocusingUnused) + { + drawCount++; + if (AnyToolInBot) + { + GUILayout.BeginArea(rectTop); + RefUnUse.Draw(); + GUILayout.EndArea(); + drawTool = true; + } + else + { + RefUnUse.Draw(); + drawTool = false; + } + } + else if (IsFocusingUsedInBuild) + { + //Debug.Log("draw :" + IsFocusingUsedInBuild); + //drawTool = GetDrawConfig(UsedInBuild, out config1); + UsedInBuild.Draw(); + } + + if (!IsFocusingGUIDs && !IsFocusingUnused) + { + drawCount += DrawConfig(config1, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config2, rectTop, rectBot, ref willRepaint); + drawCount += DrawConfig(config3, rectTop, rectBot, ref willRepaint); + } + + if (drawTool) + { + drawCount++; + GUILayout.BeginArea(rectBot); + DrawTool(); + GUILayout.EndArea(); + } + + DrawFooter(); + + OnAfterGUI(drawCount); + } + + protected override void OnTabChanged() + { + if (IsFocusingUsedInBuild) + { + UsedInBuild.RefreshView(); + } + } + + protected override void maskDirty() + { + UsedByDrawer.SetDirty(); + UsesDrawer.SetDirty(); + Duplicated.SetDirty(); + SceneToAssetDrawer.SetDirty(); + RefUnUse.SetDirty(); + + RefInScene.SetDirty(); + RefSceneInScene.SetDirty(); + SceneUsesDrawer.SetDirty(); + UsedInBuild.SetDirty(); + } + + protected override void RefreshSort() + { + UsedByDrawer.RefreshSort(); + UsesDrawer.RefreshSort(); + Duplicated.RefreshSort(); + SceneToAssetDrawer.RefreshSort(); + RefUnUse.RefreshSort(); + + UsedInBuild.RefreshSort(); + } + // public bool isExcludeByFilter; + + protected override bool checkNoticeFilter() + { + var rsl = false; + + if (IsFocusingUsedBy && !rsl) + { + rsl = UsedByDrawer.isExclueAnyItem(); + } + + if (IsFocusingDuplicate) + { + return Duplicated.isExclueAnyItem(); + } + + if (IsFocusingUses && rsl == false) + { + rsl = UsesDrawer.isExclueAnyItem(); + } + + if (IsFocusingSceneToAsset && rsl == false) + { + rsl = SceneToAssetDrawer.isExclueAnyItem(); + } + + + if (IsFocusingFindInScene && !rsl) + { + rsl = RefInScene.isExclueAnyItem(); + } + + if (IsFocusingSceneInScene && !rsl) + { + rsl = RefSceneInScene.isExclueAnyItem(); + } + + //tab use by + return rsl; + } + + protected override bool checkNoticeIgnore() + { + bool rsl = isNoticeIgnore; + return rsl; + } + + + private Object[] objs; + private string[] ids; + + private void DrawGUIDs() + { + GUILayout.Label("GUID to Object", EditorStyles.boldLabel); + GUILayout.BeginHorizontal(); + { + string guid = EditorGUILayout.TextField(tempGUID ?? string.Empty); + EditorGUILayout.ObjectField(tempObject, typeof(Object), false, GUILayout.Width(120f)); + + if (GUILayout.Button("Paste", EditorStyles.miniButton, GUILayout.Width(70f))) + { + guid = EditorGUIUtility.systemCopyBuffer; + } + + if (guid != tempGUID && !string.IsNullOrEmpty(guid)) + { + tempGUID = guid; + + tempObject = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(tempGUID) + ); + } + } + GUILayout.EndHorizontal(); + GUILayout.Space(10f); + if (objs == null || ids == null) + { + return; + } + + //GUILayout.Label("Selection", EditorStyles.boldLabel); + if (ids.Length == objs.Length) + { + scrollPos = GUILayout.BeginScrollView(scrollPos); + { + for (var i = 0; i < ids.Length; i++) + { + GUILayout.BeginHorizontal(); + { + EditorGUILayout.ObjectField(objs[i], typeof(Object), false); + string idi = ids[i]; + GUILayout.TextField(idi, GUILayout.Width(240f)); + if (GUILayout.Button("Copy", EditorStyles.miniButton, GUILayout.Width(50f))) + { + EditorGUIUtility.systemCopyBuffer = tempGUID = idi; + + if (!string.IsNullOrEmpty(tempGUID)) + { + tempObject = FR2_Unity.LoadAssetAtPath + ( + AssetDatabase.GUIDToAssetPath(tempGUID) + ); + } + + //Debug.Log(EditorGUIUtility.systemCopyBuffer); + } + } + GUILayout.EndHorizontal(); + } + } + GUILayout.EndScrollView(); + } + + // GUILayout.FlexibleSpace(); + // GUILayout.FlexibleSpace(); + GUILayout.BeginHorizontal(); + if (GUILayout.Button("Merge Selection To")) + { + FR2_Export.MergeDuplicate(); + } + + EditorGUILayout.ObjectField(tempObject, typeof(Object), false, GUILayout.Width(120f)); + GUILayout.EndHorizontal(); + GUILayout.Space(5f); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs.meta b/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs.meta new file mode 100644 index 0000000..803580f --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_WindowAll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59de5c9b86a054d2bba67e3b35d00a6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs b/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs new file mode 100644 index 0000000..c831b21 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs @@ -0,0 +1,735 @@ +using System; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace vietlabs.fr2 +{ + public interface IWindow + { + bool IsFocusingDuplicate { get; } + bool WillRepaint { get; set; } + void Repaint(); + void OnSelectionChange(); + Dictionary GetUsedByRefs(); + } + + internal interface IRefDraw + { + IWindow window { get; } + int ElementCount(); + bool Draw(); + } + + internal class RefDrawConfig + { + public bool drawGlobal; + public bool drawInTop; + public bool isDraw; + public bool isDrawTool; + public IRefDraw refDrawer; + + public RefDrawConfig(IRefDraw drawer) + { + refDrawer = drawer; + } + } + // internal class ShareData + // { + // //internal static Dictionary UsedBy; + // } + + public abstract class FR2_WindowBase : EditorWindow, IWindow + { + public virtual bool ShowScene { get; } + + internal class Icon + { + static Icon _icon; + + public GUIContent Refresh; + public GUIContent Lock; + public GUIContent LockOn; + public GUIContent Setting; + + public static Icon icons => _icon ??= new Icon + { + Refresh = EditorGUIUtility.IconContent("d_Refresh"), + Lock = EditorGUIUtility.IconContent("LockIcon"), + LockOn = EditorGUIUtility.IconContent("LockIcon-On"), + Setting = EditorGUIUtility.IconContent("d_SettingsIcon", "Settings") + }; + } + + protected int selectedTab; + + protected bool IsFocusingUses + { + get { return selectedTab == 0; } + } + + protected bool IsFocusingUsedBy + { + get { return selectedTab == 1; } + } + + public bool IsFocusingDuplicate + { + get { return selectedTab == 2; } + } + + protected bool IsFocusingUnused + { + get { return selectedTab == 4; } + } + + protected bool IsFocusingGUIDs + { + get { return selectedTab == 3; } + } + + protected bool IsFocusingUsedInBuild + { + get { return selectedTab == 5; } + } + + protected bool IsFocusingFindInScene + { + get { return selectedTab == 1; } + } + + protected bool IsFocusingSceneToAsset + { + get { return selectedTab == 0; } + } + + protected bool IsFocusingSceneInScene + { + get { return selectedTab == 1; } + } + + public bool WillRepaint { get; set; } + protected bool showFilter, showSetting, showIgnore; + + protected static GUIContent[] TOOLBARS = + { + new GUIContent("Uses"), + new GUIContent("Used By"), + new GUIContent("Duplicate"), + new GUIContent("GUIDs"), + new GUIContent("Unused Assets"), + new GUIContent("Uses In Build") + }; + + [NonSerialized] protected bool lockSelection; + [NonSerialized] internal List Selected; + public float sizeRatio = 0.5f; + protected Rect resizer; + protected bool isResizing; + protected GUIStyle resizerStyle; + + public static bool isNoticeIgnore; + + public void AddItemsToMenu(GenericMenu menu) + { + FR2_Cache api = FR2_Cache.Api; + if (api == null) + { + return; + } + + menu.AddDisabledItem(new GUIContent("FR2 - v2.4.3")); + menu.AddSeparator(string.Empty); + + menu.AddItem(new GUIContent("Enable"), !api.disabled, () => { api.disabled = !api.disabled; }); + + menu.AddItem(new GUIContent("Clear Selection"), false, () => { FR2_Selection.ClearSelection(); }); + + menu.AddItem(new GUIContent("Commit Selection (" + FR2_Selection.SelectionCount + ")"), false, + FR2_Selection.Commit); + + menu.AddItem(new GUIContent("Refresh"), false, () => + { + FR2_Asset.lastRefreshTS = Time.realtimeSinceStartup; + FR2_Cache.Api.Check4Changes(true, true); + FR2_SceneCache.Api.SetDirty(); + }); + +#if FR2_DEV + menu.AddItem(new GUIContent("Refresh Usage"), false, () => FR2_Cache.Api.Check4Usage()); + menu.AddItem(new GUIContent("Refresh Selected"), false, ()=> FR2_Cache.Api.RefreshSelection()); + menu.AddItem(new GUIContent("Clear Cache"), false, () => FR2_Cache.Api.Clear()); +#endif + } + + protected virtual void OnTabChanged() { } + + protected abstract void InitIfNeeded(); + public abstract void OnSelectionChange(); + protected abstract void OnGUI(); + protected abstract void RefreshSort(); + protected abstract void maskDirty(); + protected abstract bool checkNoticeFilter(); + protected abstract bool checkNoticeIgnore(); + + protected abstract void OnReady(); + + +#if UNITY_2018_OR_NEWER + protected void OnSceneChanged(Scene arg0, Scene arg1) + { + if (IsFocusingFindInScene || IsFocusingSceneToAsset || IsFocusingSceneInScene) + { + OnSelectionChange(); + } + } +#endif + + protected bool willRepaint; + + protected bool CheckDrawHeader() + { + if (EditorApplication.isCompiling) + { + EditorGUILayout.HelpBox("Compiling scripts, please wait!", MessageType.Warning); + Repaint(); + return false; + } + + if (EditorApplication.isUpdating) + { + EditorGUILayout.HelpBox("Importing assets, please wait!", MessageType.Warning); + Repaint(); + return false; + } + + InitIfNeeded(); + + if (EditorSettings.serializationMode != SerializationMode.ForceText) + { + EditorGUILayout.HelpBox("FR2 requires serialization mode set to FORCE TEXT!", MessageType.Warning); + if (GUILayout.Button("FORCE TEXT")) + { + EditorSettings.serializationMode = SerializationMode.ForceText; + } + + return false; + } + + if (FR2_Cache.hasCache && !FR2_Cache.CheckSameVersion()) + { + EditorGUILayout.HelpBox("Incompatible cache version found, need a full refresh may take time!", + MessageType.Warning); + if (GUILayout.Button("Scan project")) + { + FR2_Cache.DeleteCache(); + FR2_Cache.CreateCache(); + } + + return false; + } + + if (!FR2_Cache.isReady) + { + if (!FR2_Cache.hasCache) + { + EditorGUILayout.HelpBox( + "FR2 cache not found!\nFirst scan may takes quite some time to finish but you would be able to work normally while the scan works in background...", + MessageType.Warning); + if (GUILayout.Button("Scan project")) + { + FR2_Cache.CreateCache(); + } + + return false; + } + + if (!DrawEnable()) + { + return false; + } + + FR2_Cache api = FR2_Cache.Api; + string text = "Refreshing ... " + (int) (api.progress * api.workCount) + " / " + api.workCount; + Rect rect = GUILayoutUtility.GetRect(1f, Screen.width, 18f, 18f); + EditorGUI.ProgressBar(rect, api.progress, text); + Repaint(); + return false; + } + + + if (!DrawEnable()) + { + return false; + } + + willRepaint = Event.current.type == EventType.ScrollWheel; + int newTab = selectedTab; + + GUILayout.BeginHorizontal(EditorStyles.toolbar); + { + Color color = GUI.contentColor; + GUI.contentColor = EditorGUIUtility.isProSkin + ? new Color(0.9f, 0.9f, 0.9f, 1f) + : new Color(0.1f, 0.1f, 0.1f, 1f); + + GUIContent icon = Icon.icons.Lock; + if (lockSelection) + { + icon = Icon.icons.LockOn; + } + + bool v = GUILayout.Toggle(lockSelection, icon, EditorStyles.toolbarButton, GUILayout.Width(21f)); + + GUI.contentColor = color; + + if (v != lockSelection) + { + lockSelection = v; + if (lockSelection == false) + { + OnSelectionChange(); + } + + willRepaint = true; + } + + + for (var i = 0; i < TOOLBARS.Length; i++) + { + if (ShowScene && i > 1) + { + break; + } + + bool isSelected = selectedTab == i; + bool b = GUILayout.Toggle(isSelected, TOOLBARS[i], EditorStyles.toolbarButton); + if (b != isSelected) + { + newTab = i; + } + } + + // newTab = GUILayout.Toolbar(selectedTab, TOOLBARS); + } + GUILayout.EndHorizontal(); + + if (newTab != selectedTab) + { + selectedTab = newTab; + OnTabChanged(); + // Check4Changes means delay calls to OnReady :: Refresh ! + //if (FR2_Cache.Api.isReady) FR2_Cache.Api.Check4Changes(); + OnReady(); + } + + if (Selected == null) + { + Selected = new List(); + } + + return true; + } + + protected void OnAfterGUI(int drawCount) + { + if (willRepaint || WillRepaint || !FR2_SceneCache.ready) + { + WillRepaint = false; + Repaint(); + } + + if (drawCount > 1) + { + DrawResizer(); + ProcessEvents(Event.current); + } + + if (GUI.changed) + { + Repaint(); + } + } + + protected bool DrawEnable() + { + FR2_Cache api = FR2_Cache.Api; + if (api == null) + { + return false; + } + + bool v = api.disabled; + + if (v) + { + EditorGUILayout.HelpBox("Find References 2 is disabled!", MessageType.Warning); + if (GUILayout.Button("Enable")) + { + api.disabled = !api.disabled; + Repaint(); + } + + return !api.disabled; + } + + if (!api.ready) + { + float w = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = 70f; + api.priority = EditorGUILayout.IntSlider("Priority", api.priority, 0, 5); + EditorGUIUtility.labelWidth = w; + } + + return !api.disabled; + } + + protected bool AnyToolInBot + { + get { return FR2_Setting.showSettings || showIgnore || showFilter; } + } + + internal bool GetDrawConfig(IRefDraw refDrawer, out RefDrawConfig config) + { + bool drawTool = AnyToolInBot; + config = new RefDrawConfig(refDrawer); + config.drawGlobal = !drawTool; + config.drawInTop = drawTool; + config.isDraw = true; + return drawTool; + } + + internal bool GetDrawConfig(IRefDraw refTop, IRefDraw refBot, out RefDrawConfig config1, + out RefDrawConfig config2) + { + var drawTool = true; + config1 = new RefDrawConfig(refTop); + config2 = new RefDrawConfig(refBot); + config1.isDraw = config1.refDrawer.ElementCount() > 0; + config2.isDraw = config2.refDrawer.ElementCount() > 0; + + if (AnyToolInBot) + { + if (refTop.ElementCount() > 0) + { + config1.drawInTop = true; + if (refBot.ElementCount() > 0) + { + drawTool = false; + config2.isDrawTool = true; + } + } + else + { + config2.drawInTop = true; + } + } + else + { + drawTool = false; + if (refTop.ElementCount() > 0) + { + config1.drawInTop = true; + if (refBot.ElementCount() > 0) + { + config2.drawInTop = false; + } + else + { + config1.drawGlobal = true; + } + } + else + { + // config2.drawInTop = true; + config2.drawGlobal = true; + } + } + + return drawTool; + } + + internal int DrawConfig(RefDrawConfig config, Rect rectTop, Rect rectBot, ref bool WillRepaint) + { + if (config == null) + { + return 0; + } + + if (config.refDrawer == null) + { + return 0; + } + + if (!config.isDraw) + { + return 0; + } + + var willRepaint = false; + if (config.drawGlobal) + { + willRepaint = config.refDrawer.Draw(); + } + else + { + if (config.drawInTop) + { + GUILayout.BeginArea(rectTop); + willRepaint = config.refDrawer.Draw(); + GUILayout.EndArea(); + } + else if (config.isDrawTool) + { + GUILayout.BeginArea(rectBot); + willRepaint = config.refDrawer.Draw(); + DrawTool(); + GUILayout.EndArea(); + } + else + { + GUILayout.BeginArea(rectBot); + willRepaint = config.refDrawer.Draw(); + GUILayout.EndArea(); + } + } + + if (willRepaint) + { + WillRepaint = true; + } + + return 1; + } + + protected void DrawTool() + { + if (showFilter) + { + if (AssetType.DrawSearchFilter()) + { + maskDirty(); + } + } + else if (showIgnore) + { + GUILayout.BeginHorizontal(EditorStyles.toolbar); + GUILayout.Label("Ignores"); + // showContent = EditorGUILayout.Foldout(showContent, searchLable); + GUILayout.EndHorizontal(); + + if (AssetType.DrawIgnoreFolder()) + { + maskDirty(); + } + } + else if (FR2_Setting.showSettings) + { + FR2_Setting.s.DrawSettings(); + } + } + + public Rect GetTopPanelRect() + { + return new Rect(0, 17, position.width, position.height * sizeRatio - 20); + } + + public Rect GetBotPanelRect() + { + return new Rect(0, position.height * sizeRatio + 5, position.width, + position.height * (1 - sizeRatio) - 5 - paddingBot); + } + + private void DrawResizer() + { + resizer = new Rect(0, position.height * sizeRatio - 5f, position.width, 10f); + + Vector2 a = resizer.position + Vector2.up * 5f; + GUILayout.BeginArea(new Rect(a.x, a.y, position.width, 1), resizerStyle); + // GUILayout.BeginArea(new Rect(resizer.position + (Vector2.up * 5f), new Vector2(position.width, 1)), resizerStyle); + GUILayout.EndArea(); + + EditorGUIUtility.AddCursorRect(resizer, MouseCursor.ResizeVertical); + } + + protected void ProcessEvents(Event e) + { + switch (e.type) + { + case EventType.MouseDown: + if (e.button == 0 && resizer.Contains(e.mousePosition)) + { + isResizing = true; + } + + break; +#if UNITY_5_3_OR_NEWER + case EventType.MouseLeaveWindow: +#endif + case EventType.MouseUp: + isResizing = false; + break; + } + + Resize(e); + } + + private void Resize(Event e) + { + if (isResizing) + { + sizeRatio = e.mousePosition.y / position.height; + normalizeSize(); + Repaint(); + } + } + + private void normalizeSize() + { + if (sizeRatio * position.height < paddingTop) + { + sizeRatio = paddingTop / position.height; + } + + if (position.height - sizeRatio * position.height < paddingBot) + { + sizeRatio = (position.height - paddingBot) * 1f / position.height; + } + } + + private const float paddingTop = 70; + private const float paddingBot = 25; + + protected void DrawFooter() + { + GUILayout.FlexibleSpace(); + + + GUILayout.BeginHorizontal(EditorStyles.toolbar); + { + Color color = GUI.contentColor; + GUI.contentColor = EditorGUIUtility.isProSkin + ? new Color(0.9f, 0.9f, 0.9f, 1f) + : new Color(0.1f, 0.1f, 0.1f, 1f); + + if (FR2_Unity.DrawToggleToolbar(ref FR2_Setting.showSettings, Icon.icons.Setting, 21f)) + { + maskDirty(); + if (FR2_Setting.showSettings) + { + showFilter = showIgnore = false; + } + } + + GUI.contentColor = color; + + bool v = checkNoticeFilter(); + string content = !FR2_Setting.IsIncludeAllType() ? "*Filter" : "Filter"; + if (v) + { + Color oc = GUI.backgroundColor; + GUI.backgroundColor = Color.red; + v = GUILayout.Toggle(showFilter, content, EditorStyles.toolbarButton, GUILayout.Width(50f)); + GUI.backgroundColor = oc; + } + else + { + v = GUILayout.Toggle(showFilter, content, EditorStyles.toolbarButton, GUILayout.Width(50f)); + } + + if (v != showFilter) + { + showFilter = v; + if (showFilter) + { + FR2_Setting.showSettings = showIgnore = false; + } + } + + v = checkNoticeIgnore(); + content = FR2_Setting.IgnoreAsset.Count > 0 ? "*Ignore" : "Ignore"; + if (v) + { + Color oc = GUI.backgroundColor; + GUI.backgroundColor = Color.red; + v = GUILayout.Toggle(showIgnore, content, EditorStyles.toolbarButton, GUILayout.Width(50f)); + GUI.backgroundColor = oc; + } + else + { + v = GUILayout.Toggle(showIgnore, content, EditorStyles.toolbarButton, GUILayout.Width(50f)); + } + + // var i = GUILayout.Toggle(showIgnore, content, EditorStyles.toolbarButton, GUILayout.Width(50f)); + if (v != showIgnore) + { + showIgnore = v; + if (v) + { + showFilter = FR2_Setting.showSettings = false; + } + } + + bool ss = FR2_Setting.ShowSelection; + v = GUILayout.Toggle(ss, "Selection", EditorStyles.toolbarButton, GUILayout.Width(60f)); + if (v != ss) + { + FR2_Setting.ShowSelection = v; + maskDirty(); + } + + if (FR2_Selection.SelectionCount > 0) + { + if (GUILayout.Button("Commit Selection [" + FR2_Selection.SelectionCount + "]", + EditorStyles.toolbarButton)) + { + FR2_Selection.Commit(); + } + + if (GUILayout.Button("Clear Selection", EditorStyles.toolbarButton)) + { + FR2_Selection.ClearSelection(); + } + } + + + GUILayout.FlexibleSpace(); + + + if (!IsFocusingDuplicate && !IsFocusingGUIDs) + { + float o = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = 42f; + + FR2_RefDrawer.Mode ov = FR2_Setting.GroupMode; + var vv = (FR2_RefDrawer.Mode) EditorGUILayout.EnumPopup("Group", ov, GUILayout.Width(122f)); + if (vv != ov) + { + FR2_Setting.GroupMode = vv; + maskDirty(); + } + + GUILayout.Space(4f); + EditorGUIUtility.labelWidth = 30f; + + FR2_RefDrawer.Sort s = FR2_Setting.SortMode; + var vvv = (FR2_RefDrawer.Sort) EditorGUILayout.EnumPopup("Sort", s, GUILayout.Width(100f)); + if (vvv != s) + { + FR2_Setting.SortMode = vvv; + RefreshSort(); + } + + EditorGUIUtility.labelWidth = o; + } + } + + GUILayout.EndHorizontal(); + } + + public Dictionary GetUsedByRefs() + { + return null; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs.meta b/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs.meta new file mode 100644 index 0000000..2b31d22 --- /dev/null +++ b/Assets/Scripts/Editor/FR2/FR2_WindowBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 846de4aca6426f74c8cacda9de44511f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: