Compare commits
585 Commits
v.1.2.0_an
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90af1ffd08 | ||
|
|
405413a212 | ||
|
|
9488ff2513 | ||
|
|
2a42432a18 | ||
|
|
874e4f85fc | ||
|
|
62c2e9cfc3 | ||
|
|
49bafa2fac | ||
|
|
7739b7d291 | ||
|
|
f0f4c639c0 | ||
|
|
b6d20fe9cd | ||
|
|
f7a4d2aa47 | ||
|
|
f3cac19afe | ||
|
|
8538803485 | ||
|
|
be63ed686d | ||
|
|
67e9e2606f | ||
|
|
7a015b49c0 | ||
|
|
8910eb7a9a | ||
|
|
7736db2fd8 | ||
|
|
f7e06bbbb0 | ||
|
|
9c606c912c | ||
|
|
b29592f4ba | ||
|
|
93870ca319 | ||
|
|
10a8fb1bd4 | ||
|
|
f0a42fe98e | ||
|
|
3cb8082e95 | ||
|
|
000bf11a3c | ||
|
|
94bf2f7e8d | ||
|
|
ecb8126410 | ||
|
|
fb5452c195 | ||
|
|
bbba324be0 | ||
|
|
0d8ae2d971 | ||
|
|
10fdfacc3d | ||
|
|
c664cf5dad | ||
|
|
a758dcc6cb | ||
|
|
1868e0240b | ||
|
|
915b2d063d | ||
|
|
0a437537bc | ||
|
|
28e0b2c050 | ||
|
|
aa3289de03 | ||
|
|
7193f5dcbe | ||
|
|
bb32c2d7d7 | ||
|
|
4edac166cb | ||
|
|
9281fa7205 | ||
|
|
5aa8a23495 | ||
| d4be4b43e6 | |||
| fa077c8263 | |||
|
|
ed8226641d | ||
|
|
093f14b332 | ||
|
|
0a47f14639 | ||
|
|
49d3ec38f9 | ||
|
|
d9229a681c | ||
| 3a4eb9b1bb | |||
|
|
5ff0c61668 | ||
|
|
122cc3b38b | ||
|
|
9c9fe3ec54 | ||
|
|
3eb1cf0802 | ||
|
|
56ef059eb8 | ||
|
|
ee98d9f79a | ||
|
|
2f51ae1ae6 | ||
|
|
3930c8fdd7 | ||
|
|
2867004de9 | ||
|
|
b36d71eaf3 | ||
|
|
b8252ea632 | ||
|
|
7a978d23e6 | ||
|
|
ab7b5bc5fc | ||
|
|
f63a371e34 | ||
|
|
0c30b628b5 | ||
|
|
41b3ffa70d | ||
|
|
931b027788 | ||
| 1d7a2b6d8a | |||
| 9f66ce34ac | |||
|
|
6ca3d26981 | ||
|
|
e5c0e0e410 | ||
|
|
956e0fc450 | ||
|
|
6b868e2614 | ||
| 195a4fcb6c | |||
|
|
14753f4ff0 | ||
|
|
9679193809 | ||
|
|
4472be6385 | ||
|
|
83a73f90f2 | ||
|
|
f850de3096 | ||
|
|
0bffde22a1 | ||
|
|
34a91873b6 | ||
|
|
bfe54cca00 | ||
|
|
abfddf5100 | ||
|
|
e66680a204 | ||
|
|
08c82f82bc | ||
|
|
b8f3b9530e | ||
|
|
cdae36a0c5 | ||
|
|
22619de917 | ||
|
|
55f0519824 | ||
|
|
cabbc6f24a | ||
|
|
c9f70b1833 | ||
|
|
e998aa73de | ||
|
|
41eb07e262 | ||
|
|
9e29e2b527 | ||
|
|
78ebbdb287 | ||
|
|
68fe25fc5f | ||
| 0f7a10bd19 | |||
|
|
1777464ea5 | ||
|
|
d38336d49c | ||
|
|
17072fed51 | ||
|
|
6c60435457 | ||
|
|
2b3f91e516 | ||
|
|
4a06d0df69 | ||
|
|
6c37c72e4a | ||
|
|
380bb080da | ||
|
|
f7f9b292c0 | ||
|
|
ab0b38c501 | ||
|
|
928dd46290 | ||
|
|
bf52ed6083 | ||
|
|
2ae155b480 | ||
|
|
16d550aefa | ||
|
|
8304af85ef | ||
|
|
135658321b | ||
|
|
c86b965ee6 | ||
|
|
e2473b1d64 | ||
|
|
a959e8a3a3 | ||
|
|
262f74311e | ||
|
|
09c0fb8c4f | ||
|
|
d4272eb86b | ||
|
|
130d25ec22 | ||
|
|
06cecef8fc | ||
|
|
949da0fdfd | ||
|
|
98cd8bd9c9 | ||
| 5575d26087 | |||
|
|
c6fb5ee0a8 | ||
|
|
9d023efcb6 | ||
|
|
a2b50a8315 | ||
|
|
2c40d73a0e | ||
|
|
2f9f35b98d | ||
|
|
f76dd842fc | ||
|
|
0abc5d6ab5 | ||
|
|
a38f6816e3 | ||
|
|
18d2e5c1fe | ||
|
|
68ca7492e6 | ||
| cc805c09f7 | |||
|
|
77fd785a44 | ||
|
|
962103db4c | ||
|
|
b9393f591d | ||
|
|
1b3c0bc18b | ||
|
|
fcbb2a6c65 | ||
|
|
b71c87b4b8 | ||
|
|
ebb7db4e18 | ||
|
|
d9a9716798 | ||
|
|
3a986f6b7a | ||
|
|
8722d4b433 | ||
|
|
e1a49e73d9 | ||
|
|
738f80d84b | ||
|
|
f4c431f50c | ||
|
|
45ce3c75c4 | ||
|
|
3ff2e9085e | ||
|
|
06d05d2fe8 | ||
|
|
401c2bd48f | ||
|
|
de5805d1dc | ||
|
|
e5a7bad0a9 | ||
|
|
992b6f5f6f | ||
|
|
f0f95f01d7 | ||
|
|
9d5afff839 | ||
|
|
d127666db5 | ||
|
|
00e53beccd | ||
|
|
07c3c5334a | ||
|
|
97cc288db3 | ||
|
|
c83be5ae7f | ||
|
|
4f9e75da7a | ||
|
|
4821b24301 | ||
|
|
ba57353ad0 | ||
|
|
41cfc6c2b9 | ||
|
|
bb625cb8e8 | ||
|
|
59cf73eed0 | ||
|
|
e8447938f9 | ||
|
|
c429cb382b | ||
| b72212aa71 | |||
| f48cd9d74a | |||
|
|
ea95ca7f2c | ||
|
|
91e6c226a5 | ||
|
|
43d34f274e | ||
| cfd7a48e82 | |||
|
|
e65320206a | ||
|
|
f93c89c162 | ||
|
|
16b6f9b4bc | ||
|
|
8a961ae07b | ||
|
|
eeede315a6 | ||
|
|
00e6d5389f | ||
|
|
07fb378809 | ||
| 7e4834769d | |||
|
|
81a5a71a20 | ||
|
|
24dbb7aa0b | ||
|
|
ba70479f0c | ||
|
|
2460664dc9 | ||
|
|
71b7f13375 | ||
|
|
6f3e35243a | ||
|
|
8cf8056ef4 | ||
|
|
da59410f2b | ||
|
|
a071da067a | ||
|
|
22a2bb1a5e | ||
|
|
d72c8beab6 | ||
|
|
930ea28eff | ||
|
|
122043a733 | ||
| 779c698170 | |||
|
|
01d6a4b439 | ||
|
|
55c5ad0741 | ||
|
|
c710842d63 | ||
|
|
4756312d3c | ||
|
|
70c822b986 | ||
|
|
798fb612d3 | ||
|
|
24a0670365 | ||
|
|
f40b937012 | ||
|
|
0d8a07e5fa | ||
|
|
5f5d13a898 | ||
|
|
60cb67ca4d | ||
|
|
a68d772eb3 | ||
|
|
0aa578ce70 | ||
|
|
1d74ee3b77 | ||
|
|
78c5077f5b | ||
|
|
6cfbfbbe50 | ||
|
|
02f32f15df | ||
|
|
d47ae896cd | ||
|
|
267d580dad | ||
|
|
1815903a06 | ||
|
|
33e280187a | ||
|
|
c686640095 | ||
|
|
16da88351d | ||
|
|
d32e88ac01 | ||
|
|
0b59c2d77d | ||
| fb7e273422 | |||
|
|
83016a2aef | ||
|
|
9ca3f79c89 | ||
|
|
641cccf3c0 | ||
|
|
7057163384 | ||
|
|
1ba9f51ff8 | ||
|
|
8ec42e8a10 | ||
| 5ddfb7eb01 | |||
|
|
e003e236ec | ||
|
|
92508925bb | ||
|
|
0942c88d19 | ||
|
|
505a7cb8fb | ||
|
|
edfc1d0b46 | ||
|
|
37979729e0 | ||
|
|
5c3b431d25 | ||
|
|
9a44044fa6 | ||
|
|
1e766a87c7 | ||
|
|
71058ccfee | ||
|
|
6f5f4d94e9 | ||
|
|
299b03213f | ||
|
|
6266224727 | ||
|
|
e4b953c193 | ||
| d1306fbb31 | |||
|
|
1ef890c2b4 | ||
|
|
03956d8ecb | ||
|
|
0c0be394ac | ||
|
|
beb7ae495c | ||
|
|
1b9826fced | ||
|
|
8b235c7e3a | ||
|
|
f07e452b82 | ||
|
|
f4a61a5cbd | ||
|
|
c58757a314 | ||
|
|
9f0867dea5 | ||
|
|
fcf516ac7f | ||
|
|
7d6398835a | ||
|
|
41434625e2 | ||
|
|
f6e906a646 | ||
|
|
6050a42478 | ||
|
|
a2ff24f5a6 | ||
|
|
c30e9d729c | ||
|
|
a5e8643589 | ||
|
|
9a29a4b382 | ||
|
|
37ec3978b5 | ||
|
|
29526815ba | ||
|
|
88632884bc | ||
|
|
56fbcd4a6e | ||
|
|
3d37d44aa7 | ||
|
|
292198793e | ||
|
|
3ea4515098 | ||
|
|
b92f858295 | ||
| 5e7537ebb0 | |||
|
|
442320c2be | ||
|
|
188a85d723 | ||
|
|
9b95508c42 | ||
|
|
bddd14fdd4 | ||
|
|
448aa0659e | ||
|
|
c54a6c48b9 | ||
|
|
b6345dce5a | ||
|
|
b0ca1e6132 | ||
|
|
916c9d9a69 | ||
|
|
94f5ea647f | ||
|
|
b044273afc | ||
|
|
79c4fd7907 | ||
|
|
74681e64c7 | ||
|
|
8a7e4ec47c | ||
|
|
33e84e5cc1 | ||
|
|
c0aeccf71a | ||
|
|
f12896f346 | ||
|
|
b3f490c9ac | ||
|
|
94a532d553 | ||
|
|
6792ac4fd7 | ||
|
|
ae1aeba1c5 | ||
|
|
c8ac729532 | ||
|
|
1cf27e1a54 | ||
|
|
f78213bce1 | ||
|
|
91dc07f589 | ||
|
|
7eed36b812 | ||
|
|
ca342100a2 | ||
|
|
1ecdf0cd14 | ||
|
|
bdcf3f995b | ||
|
|
2a8107ddce | ||
|
|
d924919e22 | ||
|
|
83a5666725 | ||
|
|
a022065ef5 | ||
|
|
78b27b7607 | ||
|
|
53caadd7e5 | ||
|
|
bcb9e60c73 | ||
|
|
0d50692a4f | ||
|
|
35d8383450 | ||
|
|
e528334190 | ||
|
|
e2abf80e5d | ||
|
|
769cfbe34d | ||
|
|
753fba3b0d | ||
|
|
ee5e11f045 | ||
|
|
ab0c8d0559 | ||
|
|
6f784eb8e3 | ||
|
|
cccce0625e | ||
|
|
94fcea9026 | ||
|
|
b42736678e | ||
|
|
d6eb5dfbe9 | ||
|
|
0ba16ffa0c | ||
|
|
1c44759790 | ||
|
|
833a583f97 | ||
|
|
37da32c547 | ||
|
|
bbb5804a24 | ||
|
|
50e9a27318 | ||
|
|
ebf9ec6209 | ||
|
|
565322e62a | ||
|
|
abbde65fff | ||
|
|
1275c6494f | ||
|
|
a86dbc2116 | ||
|
|
575a7a90f7 | ||
|
|
2b78eb4cc0 | ||
|
|
845c800565 | ||
|
|
4117053230 | ||
|
|
d9110872bf | ||
|
|
0679e04395 | ||
|
|
9345d10d6c | ||
|
|
c88edc50e5 | ||
|
|
96f2d2fae8 | ||
|
|
c3a6f1e5b8 | ||
|
|
e0009f528e | ||
|
|
9b1f58562b | ||
|
|
22b2cadb96 | ||
|
|
7f05bf4024 | ||
|
|
f409368faa | ||
|
|
760e3878f4 | ||
|
|
178c761583 | ||
|
|
d84ffd490d | ||
|
|
75abb7d2bb | ||
|
|
ad6e8b1402 | ||
|
|
0a231c3f94 | ||
|
|
00c9bd3bfe | ||
|
|
47d4ccd4a6 | ||
|
|
96a0a976e6 | ||
|
|
771b713f6d | ||
|
|
4ef44130e9 | ||
|
|
00e06273ad | ||
|
|
bcf3982203 | ||
|
|
eaed3e859e | ||
|
|
17a349c66d | ||
|
|
2a8cfe31e9 | ||
|
|
ce6127b71d | ||
|
|
9f0fd56ab4 | ||
|
|
da10987311 | ||
|
|
a6d3bb1803 | ||
|
|
97ce41a1e3 | ||
|
|
862e9200e7 | ||
| 63c531b066 | |||
|
|
6bfab0547f | ||
|
|
f49e729db2 | ||
|
|
27308ff7fd | ||
|
|
1e970493b3 | ||
|
|
6ea9e710b0 | ||
|
|
e0e91933e8 | ||
|
|
f0e3749794 | ||
|
|
dc1b6c9838 | ||
|
|
37bd501110 | ||
|
|
4094f79f7b | ||
|
|
06f81a091a | ||
|
|
bd58628e2d | ||
|
|
34953bab97 | ||
|
|
9ff6dbeee0 | ||
|
|
8638d3f2e2 | ||
|
|
0dcdf0fe9d | ||
|
|
57131fb59b | ||
|
|
8dadc9e37d | ||
|
|
1e1e4835d3 | ||
|
|
b5f498ad7c | ||
|
|
6eeff31530 | ||
|
|
c715f838f8 | ||
|
|
35193331ef | ||
|
|
b8d0930d6c | ||
|
|
b4f2b23cb2 | ||
|
|
29ffd0dc36 | ||
|
|
5b27f2c252 | ||
|
|
1d12b1c1e8 | ||
|
|
0c3788b90d | ||
|
|
026350ff6a | ||
|
|
6bd690e738 | ||
|
|
81d593d09a | ||
|
|
91c0c3b104 | ||
|
|
4da792de57 | ||
|
|
c36cb3f9e5 | ||
|
|
57b1dded5f | ||
|
|
ebbd97f8af | ||
|
|
059c6ca56b | ||
|
|
11283750f3 | ||
|
|
2c07878a4d | ||
|
|
65bbbaa0cc | ||
|
|
a586912584 | ||
|
|
5fe814b753 | ||
|
|
dbb30676a2 | ||
|
|
2dd0c48961 | ||
|
|
d83509fc3f | ||
|
|
d19f63d08a | ||
|
|
c028971870 | ||
|
|
de30482954 | ||
|
|
581c9a8f6e | ||
|
|
980d92839d | ||
|
|
67dfdf94c6 | ||
|
|
5e469d538f | ||
|
|
d3b124c536 | ||
|
|
fd2c59552e | ||
|
|
5587b000e9 | ||
|
|
976a5d0e7c | ||
|
|
82dbf388e5 | ||
|
|
7089eb2821 | ||
|
|
e936d45746 | ||
|
|
eead0cc118 | ||
|
|
1ac93875aa | ||
|
|
58c151899f | ||
|
|
e8b7ee6f1e | ||
|
|
32fd1db301 | ||
|
|
81d9203fed | ||
|
|
20802d3bea | ||
|
|
aa3f69a043 | ||
|
|
3d439234a4 | ||
|
|
ac9253f074 | ||
|
|
27be90073a | ||
|
|
4bc0e14cdf | ||
|
|
ea75430a03 | ||
|
|
4dc5debc7c | ||
|
|
0e962c43ff | ||
|
|
6f0a9720b2 | ||
|
|
0d901aff71 | ||
|
|
68614b6ba8 | ||
|
|
cbf95861d6 | ||
|
|
d1d8b37743 | ||
|
|
45ab702c1c | ||
|
|
1cd3210514 | ||
|
|
df9fb7cabb | ||
|
|
284fbe9bc3 | ||
|
|
5666c71d2b | ||
|
|
29f0e84ee0 | ||
|
|
8089bc6e16 | ||
|
|
8c9945cc63 | ||
|
|
24b7793c44 | ||
|
|
072f845722 | ||
|
|
48c9e677c0 | ||
|
|
ca627fc958 | ||
|
|
2bd4d0aece | ||
|
|
8ec159b939 | ||
|
|
c15bf48f06 | ||
|
|
e4aa6e2edd | ||
|
|
f7fe141786 | ||
|
|
f0889cb678 | ||
|
|
2877a0418f | ||
|
|
b67cd42d94 | ||
|
|
c04ae2e751 | ||
|
|
9d1d98ddd5 | ||
|
|
9d6334e76e | ||
|
|
b9ee339355 | ||
|
|
332789283b | ||
|
|
afc6b61916 | ||
|
|
81d7dc4bd0 | ||
|
|
cc21b09f91 | ||
|
|
0b8306ff1b | ||
|
|
82b8c6a181 | ||
|
|
7d0f23df51 | ||
|
|
1c4236a20f | ||
|
|
667e9dbe11 | ||
|
|
71fe08b57c | ||
|
|
cb1331708c | ||
|
|
d6046b2e7d | ||
|
|
b188be5dd4 | ||
|
|
f08af571e2 | ||
|
|
b3b9e59f4a | ||
|
|
cd1cea12fa | ||
|
|
27d17254a7 | ||
|
|
3a690240f9 | ||
|
|
1dbe2391dc | ||
|
|
79f1369068 | ||
|
|
1daeabac42 | ||
|
|
eb1a197cc0 | ||
|
|
4e0cd6c8d8 | ||
|
|
67a46e7d06 | ||
|
|
f2b6ce6233 | ||
|
|
44d66bb6c2 | ||
|
|
df29ad47ea | ||
|
|
3c50b60ccd | ||
|
|
2ac1249b99 | ||
|
|
a8a49eeb86 | ||
|
|
a6665b8fc3 | ||
|
|
7722e968e3 | ||
|
|
66bf185bd7 | ||
|
|
6533c64892 | ||
|
|
b5c144a98e | ||
|
|
ec67afe68b | ||
|
|
c1af1c8dcf | ||
|
|
eeae9e8382 | ||
|
|
7f99b9d771 | ||
|
|
dccabf26e2 | ||
|
|
ed5e2f1dc7 | ||
|
|
f470bacdbb | ||
|
|
5d690de886 | ||
|
|
8bcf0d01e2 | ||
|
|
c7b4a4a064 | ||
|
|
efd26331b4 | ||
| 7a34de2a39 | |||
| 456deab80a | |||
|
|
b460d9d8c5 | ||
|
|
c180b32e81 | ||
|
|
5bffd844c1 | ||
|
|
0ec05b592c | ||
|
|
ca7f897efe | ||
|
|
2b11c3a6b0 | ||
|
|
be98aa91d8 | ||
|
|
6097fc7c7f | ||
|
|
8cef52f549 | ||
|
|
7b7ee7aa0c | ||
|
|
b3091fbf49 | ||
|
|
d716440747 | ||
|
|
5051d418c8 | ||
|
|
1f6c432163 | ||
|
|
ca460b1b01 | ||
|
|
644a3f5cc3 | ||
|
|
57234a1738 | ||
|
|
5444cab3db | ||
|
|
7837455596 | ||
|
|
bd50d89651 | ||
|
|
5d5606c887 | ||
| 524c4367c2 | |||
|
|
519480c7dd | ||
| 8f2527bb76 | |||
|
|
e4df3deb60 | ||
|
|
ad82aba16d | ||
|
|
20aa364195 | ||
|
|
9b4ab7f785 | ||
|
|
f3b4bbb154 | ||
|
|
713c7b8f87 | ||
|
|
b36941172c | ||
|
|
7134e96cc8 | ||
|
|
0f64030d8e | ||
|
|
72775fbd50 | ||
|
|
deae480ef3 | ||
|
|
6441196517 | ||
|
|
033c2e8d63 | ||
|
|
46e7fbc5de | ||
|
|
02481f50b4 | ||
|
|
17798bf02e | ||
|
|
1c829259d9 | ||
|
|
06f20dfc8e | ||
|
|
06797a20de | ||
|
|
cd3a75c78f | ||
|
|
3ace779c74 | ||
|
|
eb6a23021e | ||
|
|
50a2298e84 | ||
|
|
f8c3dc9bb0 | ||
|
|
01427a9f4c | ||
|
|
4316bca531 | ||
|
|
0a5e37baa3 | ||
|
|
e4446afdec | ||
|
|
81f6b85711 | ||
|
|
60a2c2ee3a | ||
|
|
b2e11a015e | ||
|
|
a6cda907f0 | ||
|
|
3bcb923eda | ||
|
|
30564f7a52 | ||
|
|
a192c8660a |
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cd642f9c5d7126f47898e5dc9520a8ff
|
guid: 0c41a7273e266a0468c52d3a52652dbd
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace BFEditor.Build
|
||||||
|
{
|
||||||
|
public class CompareAssetBundleWindow : EditorWindow
|
||||||
|
{
|
||||||
|
private string newestABPath = "";
|
||||||
|
private string lastABPath = "";
|
||||||
|
public bool IsAndroid = true;
|
||||||
|
private List<string> ABList = new List<string>();
|
||||||
|
Vector2 resultScrollPos;
|
||||||
|
public CompareAssetBundleWindow()
|
||||||
|
{
|
||||||
|
titleContent = new GUIContent("AssetBundle对比");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
GetNewestABPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnGUI()
|
||||||
|
{
|
||||||
|
GUILayout.Space(18);
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label("当前版本AB路径");
|
||||||
|
GUILayout.TextField(newestABPath, GUILayout.Width(600));
|
||||||
|
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||||
|
{
|
||||||
|
string openPath = EditorUtility.OpenFolderPanel("select ab path", newestABPath, "");
|
||||||
|
if (openPath.CompareTo("") != 0){
|
||||||
|
newestABPath = openPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.Space(10);
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label("上个版本AB路径");
|
||||||
|
GUILayout.TextField(lastABPath, GUILayout.Width(600));
|
||||||
|
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||||
|
{
|
||||||
|
string openPath = EditorUtility.OpenFolderPanel("select ab path", lastABPath, "");
|
||||||
|
if (openPath.CompareTo("") != 0){
|
||||||
|
lastABPath = openPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.Space(10);
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Space(150);
|
||||||
|
if (GUILayout.Button("对比", GUILayout.Width(200), GUILayout.Height(40)))
|
||||||
|
{
|
||||||
|
CheckMD5AndAssetHash();
|
||||||
|
}
|
||||||
|
|
||||||
|
GUILayout.Space(100);
|
||||||
|
if (GUILayout.Button("使用上个版本的AB修复", GUILayout.Width(200), GUILayout.Height(40)))
|
||||||
|
{
|
||||||
|
UseLastABFix();
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.Space(30);
|
||||||
|
|
||||||
|
DrawResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawResult()
|
||||||
|
{
|
||||||
|
resultScrollPos = GUILayout.BeginScrollView(resultScrollPos, GUILayout.Width(800), GUILayout.Height(620));
|
||||||
|
for (int i = ABList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var path = ABList[i];
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Space(20);
|
||||||
|
EditorGUILayout.TextField(path);
|
||||||
|
|
||||||
|
GUILayout.Space(10);
|
||||||
|
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
}
|
||||||
|
GUILayout.EndScrollView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckMD5AndAssetHash()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(newestABPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(lastABPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ABList.Clear();
|
||||||
|
var manifestPath = System.IO.Path.Combine(newestABPath, "asset_bundle_manifest.ab");
|
||||||
|
var manifestAB = AssetBundle.LoadFromFile(manifestPath);
|
||||||
|
var Manifest = manifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||||
|
manifestAB.Unload(false);
|
||||||
|
|
||||||
|
var lastManifestPath = System.IO.Path.Combine(lastABPath, "asset_bundle_manifest.ab");
|
||||||
|
var lastManifestAB = AssetBundle.LoadFromFile(lastManifestPath);
|
||||||
|
var lastManifest = lastManifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||||
|
lastManifestAB.Unload(false);
|
||||||
|
|
||||||
|
var allAB = Manifest.GetAllAssetBundles();
|
||||||
|
foreach(var path in allAB)
|
||||||
|
{
|
||||||
|
if (path.Contains("ab_config.bytes") || path.Contains("asset_bundle_manifest.ab"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var fullPathA = Path.Combine(newestABPath, path);
|
||||||
|
var fullPathB = Path.Combine(lastABPath, path);
|
||||||
|
if (File.Exists(fullPathB) && BF.GameLaunchUtils.GetFileMD5(fullPathA).CompareTo(BF.GameLaunchUtils.GetFileMD5(fullPathB)) != 0)
|
||||||
|
{
|
||||||
|
if (Manifest.GetAssetBundleHash(path) == lastManifest.GetAssetBundleHash(path))
|
||||||
|
{
|
||||||
|
// md5 不一致但是AssetHash一致的情况
|
||||||
|
ABList.Add(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UseLastABFix()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(newestABPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(lastABPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ABList.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach(var path in ABList)
|
||||||
|
{
|
||||||
|
var fullPathA = Path.Combine(newestABPath, path);
|
||||||
|
var fullPathB = Path.Combine(lastABPath, path);
|
||||||
|
File.Copy(fullPathB, fullPathA, true);
|
||||||
|
}
|
||||||
|
var version = newestABPath.Substring(newestABPath.Replace("\\", "/").LastIndexOf("/") + 1);
|
||||||
|
AssetBundleUtils.RegenerateABConfigMd5(newestABPath, version);
|
||||||
|
|
||||||
|
ABList.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ShowWindow()
|
||||||
|
{
|
||||||
|
var window = GetWindow<CompareAssetBundleWindow>();
|
||||||
|
window.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetNewestABPath()
|
||||||
|
{
|
||||||
|
var bundleCachePath = IsAndroid ? Application.dataPath + "/../HistoryAssetBundles" : Application.dataPath + "/../HistoryAssetBundles/IOS";
|
||||||
|
var dirInfo = new DirectoryInfo(bundleCachePath);
|
||||||
|
var dirs = dirInfo.GetDirectories();
|
||||||
|
if (dirs.Length == 0)
|
||||||
|
{
|
||||||
|
newestABPath = "";
|
||||||
|
lastABPath = "";
|
||||||
|
}
|
||||||
|
if (dirs.Length == 1)
|
||||||
|
{
|
||||||
|
newestABPath = dirs[0].FullName;
|
||||||
|
lastABPath = "";
|
||||||
|
}
|
||||||
|
var hightestIndex = 0;
|
||||||
|
var secondIndex = 0;
|
||||||
|
for (var i = 1; i < dirs.Length; i++)
|
||||||
|
{
|
||||||
|
if (dirs[i].FullName.CompareTo(dirs[hightestIndex].FullName) > 0)
|
||||||
|
{
|
||||||
|
secondIndex = hightestIndex;
|
||||||
|
hightestIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newestABPath = dirs[hightestIndex].FullName;
|
||||||
|
if (hightestIndex > 0)
|
||||||
|
{
|
||||||
|
lastABPath = dirs[secondIndex].FullName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 92d1c3826af024ff1a77c6c7d7983c7d
|
guid: ea05efeb3467b0947b735c8fe281cb8c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@ -192,10 +192,34 @@ namespace BFEditor.Build
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MenuItem("打包工具/AssetBundles/对比上一个版本AB Android", priority = 207)]
|
||||||
|
static void CompareLastVersionABAndroid()
|
||||||
|
{
|
||||||
|
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||||
|
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||||
|
window.IsAndroid = true;
|
||||||
|
window.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("打包工具/AssetBundles/对比上一个版本AB IOS", priority = 208)]
|
||||||
|
static void CompareLastVersionABIOS()
|
||||||
|
{
|
||||||
|
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||||
|
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||||
|
window.IsAndroid = false;
|
||||||
|
window.Show();
|
||||||
|
}
|
||||||
|
|
||||||
[MenuItem("打包工具/打包窗口", priority = 301)]
|
[MenuItem("打包工具/打包窗口", priority = 301)]
|
||||||
static void ShowBuildWindow()
|
static void ShowBuildWindow()
|
||||||
{
|
{
|
||||||
BuildProjectWindow.ShowWindow();
|
BuildProjectWindow.ShowWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MenuItem("打包工具/Android转换为AAB工程", priority = 401)]
|
||||||
|
static void ConvertAndroidStudioToAAB()
|
||||||
|
{
|
||||||
|
BuildAndroidUtils.ConvertToAAB();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@ namespace BFEditor.Build
|
|||||||
|
|
||||||
public class BuildProjectWindow : EditorWindow
|
public class BuildProjectWindow : EditorWindow
|
||||||
{
|
{
|
||||||
|
private static int versionCode = 18;
|
||||||
|
private static string versionName = "1.6.5";
|
||||||
BFPlatformOptions platform = BFPlatformOptions.AndroidDev;
|
BFPlatformOptions platform = BFPlatformOptions.AndroidDev;
|
||||||
const string ANDROID_DEV_PACKAGE_NAME = "com.juzu.b6.dev.android";
|
const string ANDROID_DEV_PACKAGE_NAME = "com.juzu.b6.dev.android";
|
||||||
const string ANDROID_RELEASE_PACKAGE_NAME = "com.juzu.b6.release.android";
|
const string ANDROID_RELEASE_PACKAGE_NAME = "com.juzu.b6.release.android";
|
||||||
@ -34,7 +36,7 @@ namespace BFEditor.Build
|
|||||||
platform = (BFPlatformOptions)EditorGUILayout.EnumPopup("", platform);
|
platform = (BFPlatformOptions)EditorGUILayout.EnumPopup("", platform);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
EditorGUILayout.LabelField("版本: 0.1.0");
|
EditorGUILayout.LabelField("版本: " + versionName);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
string packageName;
|
string packageName;
|
||||||
@ -70,7 +72,8 @@ namespace BFEditor.Build
|
|||||||
if (GUILayout.Button("一键打包"))
|
if (GUILayout.Button("一键打包"))
|
||||||
{
|
{
|
||||||
var buildInfo = new BuildInfo();
|
var buildInfo = new BuildInfo();
|
||||||
buildInfo.version = "0.1.0";
|
buildInfo.version = versionName;
|
||||||
|
buildInfo.version_code = versionCode;
|
||||||
buildInfo.mode = mode;
|
buildInfo.mode = mode;
|
||||||
buildInfo.bundleName = packageName;
|
buildInfo.bundleName = packageName;
|
||||||
buildInfo.skipVersion = skipVersion;
|
buildInfo.skipVersion = skipVersion;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using UnityEditor;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEditor.Build.Reporting;
|
using UnityEditor.Build.Reporting;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
@ -29,8 +30,14 @@ namespace BFEditor.Build
|
|||||||
static string GoogleCommonProjectPath = Application.dataPath + "/../BFVersions/android/google_common";
|
static string GoogleCommonProjectPath = Application.dataPath + "/../BFVersions/android/google_common";
|
||||||
static string GPAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-gp"; // gp删档测试渠道
|
static string GPAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-gp"; // gp删档测试渠道
|
||||||
static string GPOfficialAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-google"; // gp正式渠道
|
static string GPOfficialAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-google"; // gp正式渠道
|
||||||
|
static string PublishAsProjectPath = Application.dataPath + "/../BFVersions/android/publish_release";
|
||||||
static string SignShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
static string SignShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||||
static string GpAlginShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
static string GpAlginShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||||
|
static HashSet<string> AABInPackageFileHashSet = new HashSet<string>()
|
||||||
|
{
|
||||||
|
"bin",
|
||||||
|
"UnityServicesProjectConfiguration.json"
|
||||||
|
};
|
||||||
|
|
||||||
static BuildAndroidUtils()
|
static BuildAndroidUtils()
|
||||||
{
|
{
|
||||||
@ -282,6 +289,7 @@ namespace BFEditor.Build
|
|||||||
else if(buildInfo.IsGPChannel())
|
else if(buildInfo.IsGPChannel())
|
||||||
{
|
{
|
||||||
MergeProject(buildInfo, GoogleAsProjectPath);
|
MergeProject(buildInfo, GoogleAsProjectPath);
|
||||||
|
FixGradleVersion(buildInfo.version_code, buildInfo.version);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -391,13 +399,19 @@ namespace BFEditor.Build
|
|||||||
static void FixGradleVersion(int versionCode, string versionName)
|
static void FixGradleVersion(int versionCode, string versionName)
|
||||||
{
|
{
|
||||||
Debug.Log("[bfinfo]修正build.gradle: VersionCode " + versionCode + " VersionName " + versionName);
|
Debug.Log("[bfinfo]修正build.gradle: VersionCode " + versionCode + " VersionName " + versionName);
|
||||||
var gradleFilePath = Path.Combine(GradleExcuteProjectPath, "build.gradle");
|
var gradleFilePath = Path.Combine(PublishAsProjectPath, "launcher", "build.gradle");
|
||||||
var text = File.ReadAllText(gradleFilePath);
|
var text = File.ReadAllText(gradleFilePath);
|
||||||
var regex = new Regex("versionCode 1");
|
var regex = new Regex("versionCode 1");
|
||||||
text = regex.Replace(text, string.Format("versionCode {0}", versionCode));
|
text = regex.Replace(text, string.Format("versionCode {0}", versionCode));
|
||||||
regex = new Regex("versionName '0.1'");
|
var regex2 = new Regex("versionName '0.1.0'");
|
||||||
text = regex.Replace(text, string.Format("versionName '{0}'", versionName));
|
text = regex2.Replace(text, string.Format("versionName '{0}'", versionName));
|
||||||
File.WriteAllText(gradleFilePath, text);
|
File.WriteAllText(gradleFilePath, text);
|
||||||
|
|
||||||
|
var gradleFilePath2 = Path.Combine(PublishAsProjectPath, "unityLibrary", "build.gradle");
|
||||||
|
var text2 = File.ReadAllText(gradleFilePath2);
|
||||||
|
text2 = regex.Replace(text2, string.Format("versionCode {0}", versionCode));
|
||||||
|
text2 = regex2.Replace(text2, string.Format("versionName '{0}'", versionName));
|
||||||
|
File.WriteAllText(gradleFilePath2, text2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -543,5 +557,77 @@ namespace BFEditor.Build
|
|||||||
tmp.Abort();
|
tmp.Abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ConvertToAAB()
|
||||||
|
{
|
||||||
|
var installTimePackDirPath = Path.Combine(PublishAsProjectPath, "../", "dz_google_abb", "install_time_pack");
|
||||||
|
var targetDirPath = Path.Combine(PublishAsProjectPath, "install_time_pack");
|
||||||
|
if (Directory.Exists(targetDirPath))
|
||||||
|
{
|
||||||
|
Directory.Delete(targetDirPath, true);
|
||||||
|
Directory.CreateDirectory(targetDirPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(targetDirPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
BFEditorUtils.CopyDir(installTimePackDirPath, targetDirPath);
|
||||||
|
|
||||||
|
var abDirPath = Path.Combine(PublishAsProjectPath, "unityLibrary/src/main/assets");
|
||||||
|
var destFolderName = Path.Combine(PublishAsProjectPath, "install_time_pack/src/main/assets");
|
||||||
|
var dirInfo = new DirectoryInfo(abDirPath);
|
||||||
|
var floders = dirInfo.GetDirectories();
|
||||||
|
for (var i = 0; i < floders.Length; i++)
|
||||||
|
{
|
||||||
|
if (AABInPackageFileHashSet.Contains(floders[i].Name))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var newDir = Path.Combine(destFolderName, floders[i].Name);
|
||||||
|
if (!Directory.Exists(newDir))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(newDir);
|
||||||
|
}
|
||||||
|
BFEditorUtils.CopyDir(floders[i].FullName, newDir);
|
||||||
|
Directory.Delete(floders[i].FullName, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
var files = dirInfo.GetFiles();
|
||||||
|
for (var i = 0; i < files.Length; i++)
|
||||||
|
{
|
||||||
|
var file = files[i];
|
||||||
|
if (AABInPackageFileHashSet.Contains(file.Name))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var destFile = Path.Combine(destFolderName, file.Name);
|
||||||
|
if (File.Exists(destFile))
|
||||||
|
{
|
||||||
|
File.Delete(destFile);
|
||||||
|
}
|
||||||
|
File.Move(file.FullName, destFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
var settingsGradleFilePath = Path.Combine(PublishAsProjectPath, "settings.gradle");
|
||||||
|
var text = File.ReadAllText(settingsGradleFilePath);
|
||||||
|
var appendText = "include ':install_time_pack'";
|
||||||
|
if (!text.EndsWith(appendText))
|
||||||
|
{
|
||||||
|
text = text + "\n" + appendText;
|
||||||
|
}
|
||||||
|
File.WriteAllText(settingsGradleFilePath, text);
|
||||||
|
|
||||||
|
var buildGradlePath = Path.Combine(PublishAsProjectPath, "launcher/build.gradle");
|
||||||
|
var buildGradleText = File.ReadAllText(buildGradlePath);
|
||||||
|
var regex2 = new Regex("assetPacks = [\":install_time_pack\"]");
|
||||||
|
if (!regex2.IsMatch(buildGradleText))
|
||||||
|
{
|
||||||
|
var regex22 = new Regex("android {");
|
||||||
|
buildGradleText = regex22.Replace(buildGradleText, "android {\n assetPacks = [\":install_time_pack\"]");
|
||||||
|
}
|
||||||
|
File.WriteAllText(buildGradlePath, buildGradleText);
|
||||||
|
Debug.Log("Android转换为AAB工程完成");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,18 +20,25 @@ namespace BFEditor
|
|||||||
// }
|
// }
|
||||||
const string BOARD_EXCEL_KEY = "bf_board_excel_key";
|
const string BOARD_EXCEL_KEY = "bf_board_excel_key";
|
||||||
const string BOARD_GRID_TYPE_KEY = "bf_board_grid_type_key";
|
const string BOARD_GRID_TYPE_KEY = "bf_board_grid_type_key";
|
||||||
|
const string BOARD_GRID_EDGE_KEY = "bf_board_grid_edge_key";
|
||||||
int gridCount = 49;
|
int gridCount = 49;
|
||||||
string battleImgDirectory = "Assets/arts/textures/ui/battle/";
|
string battleImgDirectory = "Assets/arts/textures/ui/battle/";
|
||||||
string boardFilepath;
|
string boardFilepath;
|
||||||
string boardGridTypePath;
|
string boardGridTypePath;
|
||||||
|
string boardGridEdgePath;
|
||||||
string boardFiledName = "board";
|
string boardFiledName = "board";
|
||||||
|
string boardEdgeFiledName = "grid_edge";
|
||||||
string randomTypeStr = "";
|
string randomTypeStr = "";
|
||||||
|
string boardEdgeStr = "";
|
||||||
int curIndex = 1;
|
int curIndex = 1;
|
||||||
int maxRow = 7;
|
int maxRow = 7;
|
||||||
Dictionary<int, Dictionary<string, string>> boardGridTypeDict = new Dictionary<int, Dictionary<string, string>>();
|
Dictionary<int, Dictionary<string, string>> boardGridTypeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||||
Dictionary<int, JArray> boardDict = new Dictionary<int, JArray>();
|
Dictionary<int, JArray> boardDict = new Dictionary<int, JArray>();
|
||||||
Dictionary<int, JArray> outPutBoardDict = new Dictionary<int, JArray>();
|
Dictionary<int, JArray> outPutBoardDict = new Dictionary<int, JArray>();
|
||||||
Dictionary<string, Texture> imgDict = new Dictionary<string, Texture>();
|
Dictionary<string, Texture> imgDict = new Dictionary<string, Texture>();
|
||||||
|
Dictionary<int, Dictionary<string, string>> boardGridEdgeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||||
|
Dictionary<int, JArray> edgeDict = new Dictionary<int, JArray>();
|
||||||
|
Dictionary<int, JArray> outPutBoardEdgeDict = new Dictionary<int, JArray>();
|
||||||
bool loadExcelOver = false;
|
bool loadExcelOver = false;
|
||||||
Dictionary<int, string> elementTypeImgDict = new Dictionary<int, string>(){
|
Dictionary<int, string> elementTypeImgDict = new Dictionary<int, string>(){
|
||||||
[1] = "red_1",
|
[1] = "red_1",
|
||||||
@ -55,6 +62,12 @@ namespace BFEditor
|
|||||||
{
|
{
|
||||||
boardGridTypePath = "选择grid_type配置表路径";
|
boardGridTypePath = "选择grid_type配置表路径";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boardGridEdgePath = GetBoardGridEdgePath();
|
||||||
|
if (boardGridEdgePath.Equals(""))
|
||||||
|
{
|
||||||
|
boardGridEdgePath = "选择grid_edge_type配置表路径";
|
||||||
|
}
|
||||||
string[] paths = Directory.GetFiles(battleImgDirectory);
|
string[] paths = Directory.GetFiles(battleImgDirectory);
|
||||||
foreach(var path in paths)
|
foreach(var path in paths)
|
||||||
{
|
{
|
||||||
@ -86,6 +99,16 @@ namespace BFEditor
|
|||||||
PlayerPrefs.SetString(BOARD_GRID_TYPE_KEY, path);
|
PlayerPrefs.SetString(BOARD_GRID_TYPE_KEY, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string GetBoardGridEdgePath()
|
||||||
|
{
|
||||||
|
return PlayerPrefs.GetString(BOARD_GRID_EDGE_KEY, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetBoardGridEdgePath(string path)
|
||||||
|
{
|
||||||
|
PlayerPrefs.SetString(BOARD_GRID_EDGE_KEY, path);
|
||||||
|
}
|
||||||
|
|
||||||
BoardEditorWindow()
|
BoardEditorWindow()
|
||||||
{
|
{
|
||||||
this.titleContent = new GUIContent("棋盘编辑器");
|
this.titleContent = new GUIContent("棋盘编辑器");
|
||||||
@ -114,6 +137,20 @@ namespace BFEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label("grid_edge 路径", GUILayout.Width(100));
|
||||||
|
GUILayout.Space(10);
|
||||||
|
GUILayout.TextField(boardGridEdgePath, GUILayout.Width(300));
|
||||||
|
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||||
|
{
|
||||||
|
string openPath = EditorUtility.OpenFilePanel("选择配置表", GetBoardGridEdgePath(), "");
|
||||||
|
if (openPath.CompareTo("") != 0)
|
||||||
|
{
|
||||||
|
boardGridEdgePath = openPath;
|
||||||
|
SetBoardGridEdgePath(openPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
GUILayout.Space(10);
|
GUILayout.Space(10);
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
@ -305,6 +342,74 @@ namespace BFEditor
|
|||||||
boardDict[curIndex] = ja;
|
boardDict[curIndex] = ja;
|
||||||
}
|
}
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
GUILayout.EndVertical();
|
||||||
|
GUILayout.EndArea();
|
||||||
|
GUILayout.BeginArea(new Rect(730, 650, 500, 500));
|
||||||
|
GUILayout.BeginVertical();
|
||||||
|
GUILayout.Label("棋盘边缘元素");
|
||||||
|
boardEdgeStr = GUILayout.TextField(boardEdgeStr, GUILayout.Width(400), GUILayout.Height(100));
|
||||||
|
if(GUILayout.Button("加载边缘元素配置", GUILayout.Width(110)))
|
||||||
|
{
|
||||||
|
JArray edgeJo = edgeDict[curIndex];
|
||||||
|
string str = "[";
|
||||||
|
for (int i = 0; i < edgeJo.Count; i++)
|
||||||
|
{
|
||||||
|
JArray gridInfo = (JArray)edgeJo[i];
|
||||||
|
if (gridInfo.Count < 3)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
string s = "{";
|
||||||
|
for (int j = 0; j < 3; j++)
|
||||||
|
{
|
||||||
|
s = s + gridInfo[j].ToString();
|
||||||
|
if(j != 2)
|
||||||
|
{
|
||||||
|
s = s + ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s = s + "}";
|
||||||
|
str = str + s;
|
||||||
|
if (i != edgeJo.Count)
|
||||||
|
{
|
||||||
|
str = str + ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boardEdgeStr = str;
|
||||||
|
}
|
||||||
|
if(GUILayout.Button("重新刷新边缘元素", GUILayout.Width(110)))
|
||||||
|
{
|
||||||
|
string[] units = boardEdgeStr.Split('{');
|
||||||
|
List<string> edgeList = new List<string>();
|
||||||
|
for (int i = 0; i < units.Length; i++)
|
||||||
|
{
|
||||||
|
string formatStr = units[i].Replace("[", "").Replace("]", "").Replace(" ", "").Replace("}", "");
|
||||||
|
string[] unitList = formatStr.Split(',');
|
||||||
|
if (unitList.Length >= 3)
|
||||||
|
{
|
||||||
|
string str = "[";
|
||||||
|
for(int j = 0; j < 3; j++)
|
||||||
|
{
|
||||||
|
str = str + unitList[j];
|
||||||
|
if (j != 2)
|
||||||
|
{
|
||||||
|
str = str + ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = str + "]";
|
||||||
|
edgeList.Add(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JArray ja = new JArray();
|
||||||
|
for (int i = 0; i < edgeList.Count; i++)
|
||||||
|
{
|
||||||
|
JArray unit = (JArray)JsonConvert.DeserializeObject(edgeList[i]);
|
||||||
|
ja.Add(unit);
|
||||||
|
}
|
||||||
|
edgeDict[curIndex] = ja;
|
||||||
|
}
|
||||||
|
GUILayout.EndVertical();
|
||||||
GUILayout.EndArea();
|
GUILayout.EndArea();
|
||||||
if(GUI.Button(new Rect(1050, 10, 100, 30), "导出到Excel"))
|
if(GUI.Button(new Rect(1050, 10, 100, 30), "导出到Excel"))
|
||||||
{
|
{
|
||||||
@ -357,6 +462,21 @@ namespace BFEditor
|
|||||||
boardGridTypeDict[key] = dict;
|
boardGridTypeDict[key] = dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 读取grid_edge_type配置表
|
||||||
|
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardGridEdgePath, pythonToolPath);
|
||||||
|
string boardGridEdgeJson = File.ReadAllText(tempPath);
|
||||||
|
jsonObj = (JObject)JsonConvert.DeserializeObject(boardGridEdgeJson);
|
||||||
|
foreach (var item in jsonObj)
|
||||||
|
{
|
||||||
|
int key = int.Parse(item.Key);
|
||||||
|
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||||
|
foreach (var item2 in (JObject)item.Value)
|
||||||
|
{
|
||||||
|
dict[item2.Key] = item2.Value.ToString();
|
||||||
|
}
|
||||||
|
boardGridEdgeDict[key] = dict;
|
||||||
|
}
|
||||||
|
|
||||||
// 读取boardFile配置表
|
// 读取boardFile配置表
|
||||||
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardFilepath, pythonToolPath);
|
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardFilepath, pythonToolPath);
|
||||||
string boardFileJson = File.ReadAllText(tempPath);
|
string boardFileJson = File.ReadAllText(tempPath);
|
||||||
@ -369,6 +489,12 @@ namespace BFEditor
|
|||||||
boardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
boardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||||
outPutBoardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
outPutBoardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||||
}
|
}
|
||||||
|
if (item.Value[boardEdgeFiledName] != null)
|
||||||
|
{
|
||||||
|
int key = int.Parse(item.Key);
|
||||||
|
edgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||||
|
outPutBoardEdgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadExcelOver = true;
|
loadExcelOver = true;
|
||||||
@ -394,7 +520,7 @@ namespace BFEditor
|
|||||||
void DragBoard()
|
void DragBoard()
|
||||||
{
|
{
|
||||||
Texture img;
|
Texture img;
|
||||||
GUI.DrawTexture(new Rect(0, 150, 702, 702), boardImg);
|
GUI.DrawTexture(new Rect(0, 200, 702, 702), boardImg);
|
||||||
if(!loadExcelOver)
|
if(!loadExcelOver)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -406,7 +532,7 @@ namespace BFEditor
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.BeginArea(new Rect(0, 150, 702, 702));
|
GUILayout.BeginArea(new Rect(0, 200, 702, 702));
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
JArray jo = boardDict[curIndex];
|
JArray jo = boardDict[curIndex];
|
||||||
int posIndex = 0;
|
int posIndex = 0;
|
||||||
@ -452,9 +578,52 @@ namespace BFEditor
|
|||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
|
if (edgeDict.ContainsKey(curIndex))
|
||||||
|
{
|
||||||
|
JArray edgeJo = edgeDict[curIndex];
|
||||||
|
for (int i = 0; i < edgeJo.Count; i++)
|
||||||
|
{
|
||||||
|
JArray gridInfo = (JArray)edgeJo[i];
|
||||||
|
if(gridInfo.Count < 3)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int posId = (int)gridInfo[0];
|
||||||
|
int edgeType = (int)gridInfo[1];
|
||||||
|
int dir = (int)gridInfo[2];
|
||||||
|
// 绘制类型
|
||||||
|
if(boardGridEdgeDict[edgeType].ContainsKey("icon"))
|
||||||
|
{
|
||||||
|
string icon = boardGridEdgeDict[edgeType]["icon"];
|
||||||
|
if (imgDict.ContainsKey(icon))
|
||||||
|
{
|
||||||
|
int row = posId / 10;
|
||||||
|
int col = posId % 10;
|
||||||
|
img = imgDict[icon];
|
||||||
|
if (dir == 1)
|
||||||
|
{
|
||||||
|
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16, 92, 32), img);
|
||||||
|
}
|
||||||
|
else if (dir == 2)
|
||||||
|
{
|
||||||
|
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16 + textureWidth, 92, 32), img);
|
||||||
|
}
|
||||||
|
else if (dir == 3)
|
||||||
|
{
|
||||||
|
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||||
|
}
|
||||||
|
else if (dir == 4)
|
||||||
|
{
|
||||||
|
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16 + textureWidth, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GUILayout.EndArea();
|
GUILayout.EndArea();
|
||||||
|
|
||||||
GUILayout.BeginArea(new Rect(730, 150, 510 * 7, 550 / 7 * maxRow));
|
GUILayout.BeginArea(new Rect(730, 200, 510 * 7, 550 / 7 * maxRow));
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("棋盘配置信息", GUILayout.Width(100), GUILayout.Height(30));
|
GUILayout.Label("棋盘配置信息", GUILayout.Width(100), GUILayout.Height(30));
|
||||||
|
|||||||
@ -136,71 +136,17 @@ namespace BFEditor
|
|||||||
var configFileInfos = configDirInfo.GetFiles(suffix, SearchOption.TopDirectoryOnly);
|
var configFileInfos = configDirInfo.GetFiles(suffix, SearchOption.TopDirectoryOnly);
|
||||||
|
|
||||||
// 检查棋盘文件格式
|
// 检查棋盘文件格式
|
||||||
|
checkBoard("chapter_board", env, sb);
|
||||||
|
checkBoard("chapter_board_bossrush", env, sb);
|
||||||
|
checkBoard("chapter_board_daily_challenge", env, sb);
|
||||||
|
checkBoard("chapter_board_dungeon_armor", env, sb);
|
||||||
|
checkBoard("chapter_board_dungeon_equip", env, sb);
|
||||||
|
checkBoard("chapter_board_dungeon_gold", env, sb);
|
||||||
|
checkBoard("chapter_board_dungeon_shards", env, sb);
|
||||||
|
checkBoard("chapter_board_rune", env, sb);
|
||||||
|
checkBoard("activity_pvp_board", env, sb);
|
||||||
|
checkBoard("arena_board", env, sb);
|
||||||
|
|
||||||
var luaScriptString = @"local cfg = require('app/config/chapter_board')
|
|
||||||
if not cfg or not cfg.data then
|
|
||||||
return ''
|
|
||||||
end
|
|
||||||
cfg = cfg.data
|
|
||||||
local tempMap = {}
|
|
||||||
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
|
||||||
if not tempMap[cfgId] then
|
|
||||||
tempMap[cfgId] = true
|
|
||||||
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(errorInfo, ' ' .. errorStr)
|
|
||||||
end
|
|
||||||
|
|
||||||
local errorInfo = {}
|
|
||||||
for k, info in pairs(cfg) do
|
|
||||||
local board = info.board
|
|
||||||
if not board then
|
|
||||||
addErrorInfo(errorInfo, k, '没有board字段,请检查')
|
|
||||||
end
|
|
||||||
|
|
||||||
if #board < 49 then
|
|
||||||
addErrorInfo(errorInfo, k, '没有board长度不足,请检查,当前长度为' .. #board)
|
|
||||||
end
|
|
||||||
|
|
||||||
for index, v in ipairs(board) do
|
|
||||||
if not v[1] then
|
|
||||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有格子类型')
|
|
||||||
end
|
|
||||||
if not v[2] then
|
|
||||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有元素类型')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local mystery_box_board = info.mystery_box_board
|
|
||||||
if mystery_box_board then
|
|
||||||
for index, v in ipairs(mystery_box_board) do
|
|
||||||
if not v[1] then
|
|
||||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有格子类型')
|
|
||||||
end
|
|
||||||
if not v[2] then
|
|
||||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有元素类型')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #errorInfo > 0 then
|
|
||||||
return table.concat(errorInfo, '\n');
|
|
||||||
end
|
|
||||||
|
|
||||||
return ''";
|
|
||||||
var resultStr = env.DoString(luaScriptString);
|
|
||||||
if (resultStr.Length > 0)
|
|
||||||
{
|
|
||||||
foreach(var strObj in resultStr)
|
|
||||||
{
|
|
||||||
var str = Convert.ToString(strObj);
|
|
||||||
if(!String.IsNullOrEmpty(str))
|
|
||||||
{
|
|
||||||
sb.Append(str + "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查monster
|
// 检查monster
|
||||||
string monsterConfigListLua = "{";
|
string monsterConfigListLua = "{";
|
||||||
@ -213,7 +159,7 @@ namespace BFEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
monsterConfigListLua += "}";
|
monsterConfigListLua += "}";
|
||||||
luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
var luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
||||||
luaScriptString += @"local str = {}
|
luaScriptString += @"local str = {}
|
||||||
for i, name in ipairs(MONSTER_LIST) do
|
for i, name in ipairs(MONSTER_LIST) do
|
||||||
if name ~= 'monster_base' and name ~= 'monster_position' and name ~= 'monster_position_base' then
|
if name ~= 'monster_base' and name ~= 'monster_position' and name ~= 'monster_position_base' then
|
||||||
@ -230,7 +176,7 @@ namespace BFEditor
|
|||||||
return table.concat(str, '\n');
|
return table.concat(str, '\n');
|
||||||
end
|
end
|
||||||
return ''";
|
return ''";
|
||||||
resultStr = env.DoString(luaScriptString);
|
var resultStr = env.DoString(luaScriptString);
|
||||||
if (resultStr.Length > 0)
|
if (resultStr.Length > 0)
|
||||||
{
|
{
|
||||||
foreach(var strObj in resultStr)
|
foreach(var strObj in resultStr)
|
||||||
@ -299,6 +245,76 @@ namespace BFEditor
|
|||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void checkBoard(string configName, LuaEnv env, in StringBuilder sb)
|
||||||
|
{
|
||||||
|
var luaScriptString = @"
|
||||||
|
if not cfg or not cfg.data then
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
cfg = cfg.data
|
||||||
|
local tempMap = {}
|
||||||
|
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
||||||
|
if not tempMap[cfgId] then
|
||||||
|
tempMap[cfgId] = true
|
||||||
|
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(errorInfo, ' ' .. errorStr)
|
||||||
|
end
|
||||||
|
|
||||||
|
local errorInfo = {}
|
||||||
|
for k, info in pairs(cfg) do
|
||||||
|
local board = info.board or info.board_daily_challenge
|
||||||
|
if not board then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' 没有board字段,请检查')
|
||||||
|
else
|
||||||
|
if #board < 49 then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' 没有board长度不足,请检查,当前长度为' .. #board)
|
||||||
|
end
|
||||||
|
|
||||||
|
for index, v in ipairs(board) do
|
||||||
|
if not v[1] then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有格子类型')
|
||||||
|
end
|
||||||
|
if not v[2] then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有元素类型')
|
||||||
|
elseif v[2] > 5 or v[2] < 0 then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '元素类型不合法,当前为' .. v[2])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local mystery_box_board = info.mystery_box_board
|
||||||
|
if mystery_box_board then
|
||||||
|
for index, v in ipairs(mystery_box_board) do
|
||||||
|
if not v[1] then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有格子类型')
|
||||||
|
end
|
||||||
|
if not v[2] then
|
||||||
|
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有元素类型')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #errorInfo > 0 then
|
||||||
|
return table.concat(errorInfo, '\n');
|
||||||
|
end
|
||||||
|
|
||||||
|
return ''";
|
||||||
|
var resultStr = env.DoString(" local cfg = require('app/config/" + configName + "')\n" + "local configName = '" + configName + "'\n" + luaScriptString);
|
||||||
|
if (resultStr.Length > 0)
|
||||||
|
{
|
||||||
|
foreach(var strObj in resultStr)
|
||||||
|
{
|
||||||
|
var str = Convert.ToString(strObj);
|
||||||
|
if(!String.IsNullOrEmpty(str))
|
||||||
|
{
|
||||||
|
sb.Append(str + "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static bool FastExportExcelToLua(bool isDeveloper, string designExcelPath)
|
public static bool FastExportExcelToLua(bool isDeveloper, string designExcelPath)
|
||||||
{
|
{
|
||||||
failFlag = false;
|
failFlag = false;
|
||||||
|
|||||||
@ -104,7 +104,7 @@ namespace BFEditor
|
|||||||
[MenuItem("其他工具/棋盘编辑器", false, 9)]
|
[MenuItem("其他工具/棋盘编辑器", false, 9)]
|
||||||
public static void CreateBoardEditorWindow()
|
public static void CreateBoardEditorWindow()
|
||||||
{
|
{
|
||||||
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 850), true);
|
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 1000), true);
|
||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,8 +11,8 @@ public class JenkinsAdapter {
|
|||||||
/// 构建版本号
|
/// 构建版本号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static string BuildVersion = (int.Parse(DateTime.Now.ToString("yyMMddHH"))).ToString();
|
private static string BuildVersion = (int.Parse(DateTime.Now.ToString("yyMMddHH"))).ToString();
|
||||||
private static int versionCode = 9;
|
private static int versionCode = 10;
|
||||||
private static string versionName = "1.3.0";
|
private static string versionName = "1.4.0";
|
||||||
|
|
||||||
[MenuItem("Jenkins/JenkinsBuildIos")]
|
[MenuItem("Jenkins/JenkinsBuildIos")]
|
||||||
public static void CommandLineBuildIos() {
|
public static void CommandLineBuildIos() {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -8,19 +8,28 @@
|
|||||||
url "https://maven.google.com"
|
url "https://maven.google.com"
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16, Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
url "https://android-sdk.is.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48, Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
url "https://maven.google.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://repo.maven.apache.org/maven2/" // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
url "https://cboost.jfrog.io/artifactory/chartboost-ads/" // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://artifact.bytedance.com/repository/pangle/" // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
url "https://repo.maven.apache.org/maven2/" // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://sdk.tapjoy.com/" // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/" // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://artifact.bytedance.com/repository/pangle/" // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://sdk.tapjoy.com/" // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://jitpack.io/" // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||||
}
|
}
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
jcenter()
|
||||||
@ -34,42 +43,50 @@ apply plugin: 'com.android.library'
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
// Android Resolver Dependencies Start
|
// Android Resolver Dependencies Start
|
||||||
implementation 'com.adcolony:sdk:4.8.0' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40
|
||||||
|
implementation 'com.adcolony:sdk:4.8.0' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
||||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
|
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
|
||||||
implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||||
implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||||
implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||||
implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||||
implementation 'com.applovin:applovin-sdk:11.7.1' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15
|
implementation 'com.applovin:applovin-sdk:11.10.1' // Assets/ThirdParty/MaxSdk/AppLovin/Editor/Dependencies.xml:4
|
||||||
|
implementation 'com.appsflyer:adrevenue:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:4
|
||||||
implementation 'com.appsflyer:af-android-sdk:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
implementation 'com.appsflyer:af-android-sdk:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
||||||
|
implementation 'com.appsflyer:unity-adrevenue-generic-wrapper:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:5
|
||||||
implementation 'com.appsflyer:unity-wrapper:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
implementation 'com.appsflyer:unity-wrapper:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||||
implementation 'com.chartboost:chartboost-sdk:9.2.0' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
implementation 'com.chartboost:chartboost-sdk:9.3.1' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||||
implementation 'com.facebook.android:audience-network-sdk:6.12.0' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
implementation 'com.facebook.android:audience-network-sdk:6.16.0' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
||||||
implementation 'com.facebook.android:facebook-applinks:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:6
|
implementation 'com.facebook.android:facebook-applinks:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:6
|
||||||
implementation 'com.facebook.android:facebook-core:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:5
|
implementation 'com.facebook.android:facebook-core:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:5
|
||||||
implementation 'com.facebook.android:facebook-gamingservices:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:9
|
implementation 'com.facebook.android:facebook-gamingservices:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:9
|
||||||
implementation 'com.facebook.android:facebook-login:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:7
|
implementation 'com.facebook.android:facebook-login:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:7
|
||||||
implementation 'com.facebook.android:facebook-share:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:8
|
implementation 'com.facebook.android:facebook-share:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:8
|
||||||
implementation 'com.fyber:marketplace-sdk:8.2.2' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
implementation 'com.fyber:marketplace-sdk:8.2.4' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||||
implementation 'com.google.android.gms:play-services-ads:21.5.0' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
implementation 'com.google.android.gms:play-services-ads:22.2.0' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
||||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
||||||
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
||||||
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.14' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.15' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
||||||
implementation 'com.ironsource.adapters:admobadapter:4.3.35' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
implementation 'com.ironsource.adapters:admobadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
||||||
implementation 'com.ironsource.adapters:applovinadapter:4.3.37' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
implementation 'com.ironsource.adapters:applovinadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
||||||
implementation 'com.ironsource.adapters:chartboostadapter:4.3.11' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
implementation 'com.ironsource.adapters:chartboostadapter:4.3.12' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
||||||
implementation 'com.ironsource.adapters:facebookadapter:4.3.39' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
implementation 'com.ironsource.adapters:facebookadapter:4.3.45' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
||||||
implementation 'com.ironsource.adapters:fyberadapter:4.3.24' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
implementation 'com.ironsource.adapters:fyberadapter:4.3.28' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
||||||
implementation 'com.ironsource.adapters:liftoffadapter:4.3.5' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16
|
implementation 'com.ironsource.adapters:mintegraladapter:4.3.19' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48
|
||||||
implementation 'com.ironsource.adapters:pangleadapter:4.3.17' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
implementation 'com.ironsource.adapters:pangleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
||||||
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.24' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.25' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
||||||
implementation 'com.ironsource.adapters:unityadsadapter:4.3.27' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
implementation 'com.ironsource.adapters:unityadsadapter:4.3.33' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||||
implementation 'com.ironsource.sdk:mediationsdk:7.3.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
implementation 'com.ironsource.adapters:vungleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||||
implementation 'com.pangle.global:ads-sdk:5.0.0.8' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
implementation 'com.ironsource.sdk:mediationsdk:7.5.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
||||||
|
implementation 'com.mbridge.msdk.oversea:mbbanner:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24
|
||||||
|
implementation 'com.mbridge.msdk.oversea:mbbid:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||||
|
implementation 'com.mbridge.msdk.oversea:newinterstitial:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8
|
||||||
|
implementation 'com.mbridge.msdk.oversea:reward:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16
|
||||||
|
implementation 'com.pangle.global:ads-sdk:5.5.0.5' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||||
implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:4
|
implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:4
|
||||||
implementation 'com.tapjoy:tapjoy-android-sdk:12.11.1' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
implementation 'com.tapjoy:tapjoy-android-sdk:13.0.1' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||||
implementation 'com.unity3d.ads:unity-ads:4.6.1' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
implementation 'com.unity3d.ads:unity-ads:4.9.1' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||||
implementation 'io.liftoff:liftoffads:1.9.1' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8
|
implementation 'com.vungle:vungle-ads:7.0.0' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||||
// Android Resolver Dependencies End
|
// Android Resolver Dependencies End
|
||||||
**DEPS**}
|
**DEPS**}
|
||||||
|
|
||||||
|
|||||||
@ -111,8 +111,8 @@ public partial class AdManager
|
|||||||
string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
|
string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
|
||||||
string adFormat = adInfo.AdFormat;
|
string adFormat = adInfo.AdFormat;
|
||||||
|
|
||||||
var dict = new Dictionary<string, string>();
|
var dict = new Dictionary<string, System.Object>();
|
||||||
dict.Add("revenue", revenue.ToString());
|
dict.Add("revenue", revenue);
|
||||||
dict.Add("country_code", countryCode);
|
dict.Add("country_code", countryCode);
|
||||||
dict.Add("network_name", networkName);
|
dict.Add("network_name", networkName);
|
||||||
dict.Add("ad_unit_Id", adUnitId);
|
dict.Add("ad_unit_Id", adUnitId);
|
||||||
|
|||||||
@ -31,15 +31,16 @@ namespace BF
|
|||||||
|
|
||||||
// SDK init
|
// SDK init
|
||||||
BFLog.Log("unity-script: IronSource.Agent.init");
|
BFLog.Log("unity-script: IronSource.Agent.init");
|
||||||
|
// IronSource.Agent.setMetaData("is_test_suite", "enable");
|
||||||
IronSource.Agent.init(appKey);
|
IronSource.Agent.init(appKey);
|
||||||
IronSource.Agent.setManualLoadRewardedVideo(true);
|
IronSource.Agent.setManualLoadRewardedVideo(true);
|
||||||
|
|
||||||
// 初始化之前先设置一下用户id
|
// 初始化之前先设置一下用户id
|
||||||
ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
// ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
||||||
adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
// adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
||||||
// adQualityConfig.TestMode = true;
|
// // adQualityConfig.TestMode = true;
|
||||||
// adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
|
// // adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
|
||||||
IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
// IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
||||||
#elif UNITY_IPHONE
|
#elif UNITY_IPHONE
|
||||||
// string appKey = "8545d445";
|
// string appKey = "8545d445";
|
||||||
// 初始化之前先设置一下用户id
|
// 初始化之前先设置一下用户id
|
||||||
@ -155,6 +156,8 @@ namespace BF
|
|||||||
void SdkInitializationCompletedEvent()
|
void SdkInitializationCompletedEvent()
|
||||||
{
|
{
|
||||||
BFLog.Log("unity-script: I got SdkInitializationCompletedEvent");
|
BFLog.Log("unity-script: I got SdkInitializationCompletedEvent");
|
||||||
|
//Launch test suite
|
||||||
|
// IronSource.Agent.launchTestSuite();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -283,8 +286,8 @@ namespace BF
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var dict = new Dictionary<string, string>();
|
var dict = new Dictionary<string, System.Object>();
|
||||||
dict.Add("revenue", revenue.ToString());
|
dict.Add("revenue", revenue);
|
||||||
dict.Add("auction_id", impressionData.auctionId);
|
dict.Add("auction_id", impressionData.auctionId);
|
||||||
dict.Add("country_code", impressionData.country);
|
dict.Add("country_code", impressionData.country);
|
||||||
dict.Add("network_name", impressionData.adNetwork);
|
dict.Add("network_name", impressionData.adNetwork);
|
||||||
@ -298,7 +301,7 @@ namespace BF
|
|||||||
}
|
}
|
||||||
if (!ReferenceEquals(impressionData.lifetimeRevenue, null))
|
if (!ReferenceEquals(impressionData.lifetimeRevenue, null))
|
||||||
{
|
{
|
||||||
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue.ToString());
|
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue);
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(impressionData.encryptedCPM))
|
if (!string.IsNullOrEmpty(impressionData.encryptedCPM))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.19.0</unityversion>
|
<unityversion>4.3.20.1</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.adcolony:sdk:4.8.0">
|
<androidPackage spec="com.adcolony:sdk:4.8.0">
|
||||||
<repositories>
|
<repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.14">
|
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.15">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceAdColonyAdapter" version="4.3.16.0">
|
<iosPod name="IronSourceAdColonyAdapter" version="4.3.17.1">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.47.0</unityversion>
|
<unityversion>4.3.54.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.google.android.gms:play-services-ads:21.5.0">
|
<androidPackage spec="com.google.android.gms:play-services-ads:22.2.0">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://maven.google.com/</repository>
|
<repository>https://maven.google.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.35">
|
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.39">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceAdMobAdapter" version="4.3.41.0">
|
<iosPod name="IronSourceAdMobAdapter" version="4.3.47.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.42.0</unityversion>
|
<unityversion>4.3.44.3</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.37">
|
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.39">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.applovin:applovin-sdk:11.7.1">
|
<androidPackage spec="com.applovin:applovin-sdk:11.10.1">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://maven.google.com/</repository>
|
<repository>https://maven.google.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceAppLovinAdapter" version="4.3.38.0">
|
<iosPod name="IronSourceAppLovinAdapter" version="4.3.40.3">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.17.0</unityversion>
|
<unityversion>4.3.19.2</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.11">
|
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.12">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.chartboost:chartboost-sdk:9.2.0">
|
<androidPackage spec="com.chartboost:chartboost-sdk:9.3.1">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://maven.google.com/</repository>
|
<repository>https://cboost.jfrog.io/artifactory/chartboost-ads/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceChartboostAdapter" version="4.3.13.0">
|
<iosPod name="IronSourceChartboostAdapter" version="4.3.15.2">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.52.0</unityversion>
|
<unityversion>4.3.61.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.facebook.android:audience-network-sdk:6.12.0">
|
<androidPackage spec="com.facebook.android:audience-network-sdk:6.16.0">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://maven.google.com/</repository>
|
<repository>https://maven.google.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.39">
|
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.45">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceFacebookAdapter" version="4.3.39.0">
|
<iosPod name="IronSourceFacebookAdapter" version="4.3.43.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.34.0</unityversion>
|
<unityversion>4.3.38.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.fyber:marketplace-sdk:8.2.2">
|
<androidPackage spec="com.fyber:marketplace-sdk:8.2.4">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://repo.maven.apache.org/maven2/</repository>
|
<repository>https://repo.maven.apache.org/maven2/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.24">
|
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.28">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceFyberAdapter" version="4.3.28.0">
|
<iosPod name="IronSourceFyberAdapter" version="4.3.31.1">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.16.0</unityversion>
|
<unityversion>4.3.19.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.4.41">
|
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.5.21">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.4.41">
|
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.5.21">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.4.41">
|
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.5.21">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.4.41">
|
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.5.21">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.16">
|
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.19">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceMintegralAdapter" version="4.3.15.0">
|
<iosPod name="IronSourceMintegralAdapter" version="4.3.18.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.22.0</unityversion>
|
<unityversion>4.3.27.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.17">
|
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.22">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.pangle.global:ads-sdk:5.0.0.8">
|
<androidPackage spec="com.pangle.global:ads-sdk:5.5.0.5">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://artifact.bytedance.com/repository/pangle/</repository>
|
<repository>https://artifact.bytedance.com/repository/pangle/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourcePangleAdapter" version="4.3.19.0">
|
<iosPod name="IronSourcePangleAdapter" version="4.3.24.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.1.29.0</unityversion>
|
<unityversion>4.1.30.3</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.24">
|
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.25">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:12.11.1">
|
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:13.0.1">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://sdk.tapjoy.com/</repository>
|
<repository>https://sdk.tapjoy.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceTapjoyAdapter" version="4.1.24.0">
|
<iosPod name="IronSourceTapjoyAdapter" version="4.1.25.3">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.32.0</unityversion>
|
<unityversion>4.3.38.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.27">
|
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.33">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</androidPackage>
|
</androidPackage>
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.unity3d.ads:unity-ads:4.6.1">
|
<androidPackage spec="com.unity3d.ads:unity-ads:4.9.1">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://maven.google.com/</repository>
|
<repository>https://maven.google.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.28.0">
|
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.33.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>4.3.33.0</unityversion>
|
<unityversion>4.3.37.0</unityversion>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.vungle:publisher-sdk-android:6.12.1">
|
<androidPackage spec="com.vungle:vungle-ads:7.0.0">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://jitpack.io/</repository>
|
<repository>https://jitpack.io/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.20">
|
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.22">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceVungleAdapter" version="4.3.26.0">
|
<iosPod name="IronSourceVungleAdapter" version="4.3.29.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
@ -220,7 +220,7 @@ public class IronSourceDependenciesManager : EditorWindow
|
|||||||
ProviderInfo info = new ProviderInfo();
|
ProviderInfo info = new ProviderInfo();
|
||||||
|
|
||||||
object providerXML;
|
object providerXML;
|
||||||
var lowerCaseItem = item.Key.ToLower();
|
var lowerCaseItem = item.Key.ToLower(new System.Globalization.CultureInfo("en"));
|
||||||
|
|
||||||
linksDictionary.TryGetValue(lowerCaseItem, out providerXML);
|
linksDictionary.TryGetValue(lowerCaseItem, out providerXML);
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public class IronSourceManifestProcessor : IPreprocessBuild
|
|||||||
private const string AD_ID_PERMISSION_ATTR = "com.google.android.gms.permission.AD_ID";
|
private const string AD_ID_PERMISSION_ATTR = "com.google.android.gms.permission.AD_ID";
|
||||||
private const string MANIFEST_PERMISSION = "uses-permission";
|
private const string MANIFEST_PERMISSION = "uses-permission";
|
||||||
private const string MANIFEST_META_DATA = "meta-data";
|
private const string MANIFEST_META_DATA = "meta-data";
|
||||||
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.plugin/AndroidManifest.xml";
|
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.androidlib/AndroidManifest.xml";
|
||||||
private string manifestPath = "";
|
private string manifestPath = "";
|
||||||
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<unityversion>7.3.0.1</unityversion>
|
<unityversion>7.5.1</unityversion>
|
||||||
|
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.3.0.1">
|
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.5.1">
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
<repository>https://android-sdk.is.com/</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
</androidPackages>
|
</androidPackages>
|
||||||
|
|
||||||
<!-- <iosPods>
|
<!-- <iosPods>
|
||||||
<iosPod name="IronSourceSDK" version="7.3.0.0">
|
<iosPod name="IronSourceSDK" version="7.5.0.0">
|
||||||
<sources>
|
<sources>
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
<source>https://github.com/CocoaPods/Specs</source>
|
||||||
</sources>
|
</sources>
|
||||||
|
|||||||
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6ee27eb8be2558e4482bcaa12bbd4781
|
guid: 78bb03eee4d26fb4da4755f7e6529784
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
28
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib.meta
vendored
Normal file
28
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib.meta
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 718f851be2f4c4ee9b4c748b225a7ea2
|
||||||
|
folderAsset: yes
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
12
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/AndroidManifest.xml
vendored
Normal file
12
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/AndroidManifest.xml
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ironsource.unity">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<application>
|
||||||
|
<!-- AdMob -->
|
||||||
|
<!--As Requiered By Admob please add your App ID-->
|
||||||
|
<!--<meta-data-->
|
||||||
|
<!--android:name="com.google.android.gms.ads.APPLICATION_ID"-->
|
||||||
|
<!--android:value="YOUR_ADMOB_APP_ID"/>-->
|
||||||
|
</application>
|
||||||
|
</manifest>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 43f2c8ee7c4303948bbd5f896c515318
|
guid: e46e3d39a8bec48d9ae81d0008842ad4
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c104a6ee5617fb048acdd3b2f1cbc512
|
guid: a5936d92d17be4fde864e068dd13d202
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
BIN
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/libs/IronSource-bridge.jar
vendored
Normal file
BIN
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/libs/IronSource-bridge.jar
vendored
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cbe75846a2b4da1459371181319ce8e3
|
guid: f10a601320ff74e1e96ecfd77be278c5
|
||||||
PluginImporter:
|
PluginImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
2
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/project.properties
vendored
Normal file
2
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/project.properties
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
target=android-9
|
||||||
|
android.library=true
|
||||||
7
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/project.properties.meta
vendored
Normal file
7
Assets/ThirdParty/IronSource/Plugins/Android/IronSource.androidlib/project.properties.meta
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f6d91e910c9af49d7a1d0254340e9dca
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
Normal file
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the available formats for displaying advertisements.
|
||||||
|
/// </summary>
|
||||||
|
public enum AdFormat
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a rewarded video ad format.
|
||||||
|
/// </summary>
|
||||||
|
RewardedVideo,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents an interstitial ad format.
|
||||||
|
/// </summary>
|
||||||
|
Interstitial,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a banner ad format.
|
||||||
|
/// </summary>
|
||||||
|
Banner
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 08e1a7bef35354a1883fab85829a4273
|
guid: 8124546645b9349f7858c4510ea7de78
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@ -2,15 +2,20 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
public class AndroidAgent : IronSourceIAgent
|
public class AndroidAgent : IronSourceIAgent
|
||||||
{
|
{
|
||||||
private static AndroidJavaObject _androidBridge;
|
static AndroidJavaObject _androidBridge;
|
||||||
private readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||||
private const string REWARD_AMOUNT = "reward_amount";
|
const string REWARD_AMOUNT = "reward_amount";
|
||||||
private const string REWARD_NAME = "reward_name";
|
const string REWARD_NAME = "reward_name";
|
||||||
private const string PLACEMENT_NAME = "placement_name";
|
const string PLACEMENT_NAME = "placement_name";
|
||||||
|
|
||||||
|
const string WATERFALL_CONFIG_FLOOR = "floor";
|
||||||
|
const string WATERFALL_CONFIG_CEILING = "ceiling";
|
||||||
|
const string WATERFALL_CONFIG_API = "setWaterfallConfiguration";
|
||||||
|
|
||||||
public AndroidAgent ()
|
public AndroidAgent ()
|
||||||
{
|
{
|
||||||
@ -34,6 +39,48 @@ public class AndroidAgent : IronSourceIAgent
|
|||||||
|
|
||||||
//******************* Base API *******************//
|
//******************* Base API *******************//
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||||
|
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||||
|
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||||
|
{
|
||||||
|
var ceiling = waterfallConfiguration.Ceiling;
|
||||||
|
var floor = waterfallConfiguration.Floor;
|
||||||
|
var dict = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
if (ceiling.HasValue)
|
||||||
|
{
|
||||||
|
dict.Add(WATERFALL_CONFIG_CEILING, ceiling.Value.ToString(CultureInfo.InvariantCulture));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (floor.HasValue)
|
||||||
|
{
|
||||||
|
dict.Add(WATERFALL_CONFIG_FLOOR, floor.Value.ToString(CultureInfo.InvariantCulture));
|
||||||
|
}
|
||||||
|
|
||||||
|
var json = IronSourceJSON.Json.Serialize(dict);
|
||||||
|
string stringAdFormat;
|
||||||
|
|
||||||
|
switch (adFormat)
|
||||||
|
{
|
||||||
|
case AdFormat.RewardedVideo:
|
||||||
|
stringAdFormat = "REWARDED_VIDEO";
|
||||||
|
break;
|
||||||
|
case AdFormat.Interstitial:
|
||||||
|
stringAdFormat = "INTERSTITIAL";
|
||||||
|
break;
|
||||||
|
case AdFormat.Banner:
|
||||||
|
stringAdFormat = "BANNER";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBridge().Call(WATERFALL_CONFIG_API, json, stringAdFormat);
|
||||||
|
}
|
||||||
|
|
||||||
public void onApplicationPause (bool pause)
|
public void onApplicationPause (bool pause)
|
||||||
{
|
{
|
||||||
if (pause)
|
if (pause)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ public class IronSource : IronSourceIAgent
|
|||||||
{
|
{
|
||||||
private IronSourceIAgent _platformAgent;
|
private IronSourceIAgent _platformAgent;
|
||||||
private static IronSource _instance;
|
private static IronSource _instance;
|
||||||
public static string UNITY_PLUGIN_VERSION = "7.3.0.1-r";
|
public static string UNITY_PLUGIN_VERSION = "7.5.1-r";
|
||||||
private static bool isUnsupportedPlatform;
|
private static bool isUnsupportedPlatform;
|
||||||
|
|
||||||
private IronSource()
|
private IronSource()
|
||||||
@ -67,6 +67,16 @@ public class IronSource : IronSourceIAgent
|
|||||||
|
|
||||||
//******************* Base API *******************//
|
//******************* Base API *******************//
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||||
|
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||||
|
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||||
|
{
|
||||||
|
_platformAgent.SetWaterfallConfiguration(waterfallConfiguration, adFormat);
|
||||||
|
}
|
||||||
|
|
||||||
public void onApplicationPause(bool pause)
|
public void onApplicationPause(bool pause)
|
||||||
{
|
{
|
||||||
_platformAgent.onApplicationPause(pause);
|
_platformAgent.onApplicationPause(pause);
|
||||||
@ -256,22 +266,26 @@ public class IronSource : IronSourceIAgent
|
|||||||
|
|
||||||
//******************* Offerwall API *******************//
|
//******************* Offerwall API *******************//
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public void showOfferwall()
|
public void showOfferwall()
|
||||||
{
|
{
|
||||||
_platformAgent.showOfferwall();
|
_platformAgent.showOfferwall();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showOfferwall(string placementName)
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
|
public void showOfferwall(string placementName)
|
||||||
{
|
{
|
||||||
_platformAgent.showOfferwall(placementName);
|
_platformAgent.showOfferwall(placementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getOfferwallCredits()
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
|
public void getOfferwallCredits()
|
||||||
{
|
{
|
||||||
_platformAgent.getOfferwallCredits();
|
_platformAgent.getOfferwallCredits();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool isOfferwallAvailable()
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
|
public bool isOfferwallAvailable()
|
||||||
{
|
{
|
||||||
return _platformAgent.isOfferwallAvailable();
|
return _platformAgent.isOfferwallAvailable();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,11 +83,17 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
[Obsolete("This API has been deprecated as of SDK 7.3.0.1", false)]
|
[Obsolete("This API has been deprecated as of SDK 7.3.0.1", false)]
|
||||||
public static event Action<string, IronSourceError> onInterstitialAdShowFailedDemandOnlyEvent;
|
public static event Action<string, IronSourceError> onInterstitialAdShowFailedDemandOnlyEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<bool> onOfferwallAvailableEvent;
|
public static event Action<bool> onOfferwallAvailableEvent;
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action onOfferwallOpenedEvent;
|
public static event Action onOfferwallOpenedEvent;
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent;
|
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent;
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent;
|
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent;
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action onOfferwallClosedEvent;
|
public static event Action onOfferwallClosedEvent;
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent;
|
public static event Action<IronSourceError> onOfferwallShowFailedEvent;
|
||||||
|
|
||||||
[Obsolete("This API has been deprecated as of SDK 7.3.0. Please use the alternate API in IronSourceBannerEvents listener instead.", false)]
|
[Obsolete("This API has been deprecated as of SDK 7.3.0. Please use the alternate API in IronSourceBannerEvents listener instead.", false)]
|
||||||
@ -1643,6 +1649,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action _onOfferwallOpenedEvent;
|
private static event Action _onOfferwallOpenedEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action onOfferwallOpenedEvent
|
public static event Action onOfferwallOpenedEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -1672,6 +1679,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action<IronSourceError> _onOfferwallShowFailedEvent;
|
private static event Action<IronSourceError> _onOfferwallShowFailedEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent
|
public static event Action<IronSourceError> onOfferwallShowFailedEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -1702,6 +1710,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action _onOfferwallClosedEvent;
|
private static event Action _onOfferwallClosedEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action onOfferwallClosedEvent
|
public static event Action onOfferwallClosedEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -1731,6 +1740,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action<IronSourceError> _onGetOfferwallCreditsFailedEvent;
|
private static event Action<IronSourceError> _onGetOfferwallCreditsFailedEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent
|
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -1762,6 +1772,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action<Dictionary<string, object>> _onOfferwallAdCreditedEvent;
|
private static event Action<Dictionary<string, object>> _onOfferwallAdCreditedEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent
|
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -1789,6 +1800,7 @@ public class IronSourceEvents : MonoBehaviour
|
|||||||
|
|
||||||
private static event Action<bool> _onOfferwallAvailableEvent;
|
private static event Action<bool> _onOfferwallAvailableEvent;
|
||||||
|
|
||||||
|
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||||
public static event Action<bool> onOfferwallAvailableEvent
|
public static event Action<bool> onOfferwallAvailableEvent
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
|
|||||||
@ -4,6 +4,13 @@ public interface IronSourceIAgent
|
|||||||
{
|
{
|
||||||
//******************* Base API *******************//
|
//******************* Base API *******************//
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||||
|
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||||
|
void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat);
|
||||||
|
|
||||||
void onApplicationPause(bool pause);
|
void onApplicationPause(bool pause);
|
||||||
|
|
||||||
string getAdvertiserId();
|
string getAdvertiserId();
|
||||||
|
|||||||
@ -10,6 +10,15 @@ public class UnsupportedPlatformAgent : IronSourceIAgent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region IronSourceAgent implementation
|
#region IronSourceAgent implementation
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function is not supported on the current platform and does nothing.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||||
|
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||||
|
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void start()
|
public void start()
|
||||||
{
|
{
|
||||||
|
|||||||
92
Assets/ThirdParty/IronSource/Scripts/WaterfallConfiguration.cs
vendored
Normal file
92
Assets/ThirdParty/IronSource/Scripts/WaterfallConfiguration.cs
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Configuration class which allows users to customize or filter a Waterfall.
|
||||||
|
/// </summary>
|
||||||
|
public class WaterfallConfiguration
|
||||||
|
{
|
||||||
|
readonly double? ceiling;
|
||||||
|
readonly double? floor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the ceiling value.
|
||||||
|
/// </summary>
|
||||||
|
public double? Ceiling { get { return ceiling; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the floor value.
|
||||||
|
/// </summary>
|
||||||
|
public double? Floor { get { return floor; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the WaterfallConfiguration class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ceiling">The ceiling value.</param>
|
||||||
|
/// <param name="floor">The floor value.</param>
|
||||||
|
private WaterfallConfiguration(double? ceiling, double? floor)
|
||||||
|
{
|
||||||
|
this.ceiling = ceiling;
|
||||||
|
this.floor = floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a builder for creating instances of WaterfallConfiguration.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||||
|
public static WaterfallConfigurationBuilder Builder()
|
||||||
|
{
|
||||||
|
return new WaterfallConfigurationBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an empty instance of WaterfallConfiguration.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The empty WaterfallConfiguration.</returns>
|
||||||
|
public static WaterfallConfiguration Empty()
|
||||||
|
{
|
||||||
|
return new WaterfallConfiguration(double.NaN, double.NaN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builder class which to create a WaterfallConfiguration.
|
||||||
|
/// </summary>
|
||||||
|
public class WaterfallConfigurationBuilder
|
||||||
|
{
|
||||||
|
double? ceiling;
|
||||||
|
double? floor;
|
||||||
|
|
||||||
|
internal WaterfallConfigurationBuilder() {}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the ceiling value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ceiling">The ceiling value.</param>
|
||||||
|
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||||
|
public WaterfallConfigurationBuilder SetCeiling(double ceiling)
|
||||||
|
{
|
||||||
|
this.ceiling = ceiling;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the floor value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="floor">The floor value.</param>
|
||||||
|
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||||
|
public WaterfallConfigurationBuilder SetFloor(double floor)
|
||||||
|
{
|
||||||
|
this.floor = floor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds an instance of WaterfallConfiguration based on the configured values.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The created WaterfallConfiguration.</returns>
|
||||||
|
public WaterfallConfiguration Build()
|
||||||
|
{
|
||||||
|
return new WaterfallConfiguration(ceiling, floor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c70eb41427c4848d391fa9e66f60daf3
|
guid: 354652886a99945cba942b569effe7bb
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
881
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
881
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
@ -1,508 +1,533 @@
|
|||||||
#if UNITY_IPHONE || UNITY_IOS
|
#if UNITY_IPHONE || UNITY_IOS
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Linq;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
|
|
||||||
// public class iOSAgent : IronSourceIAgent
|
// public class iOSAgent : IronSourceIAgent
|
||||||
// {
|
// {
|
||||||
// [DllImport("__Internal")]
|
|
||||||
// private static extern void CFSetPluginData(string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
// struct IOSWaterfallConfiguration
|
||||||
|
// {
|
||||||
|
// public double Floor;
|
||||||
|
// public double Ceiling;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// [DllImport("__Internal")]
|
||||||
|
// private static extern void LPPSetWaterfallConfiguration(IOSWaterfallConfiguration configurationParams, AdFormat adFormat);
|
||||||
|
|
||||||
|
// [DllImport("__Internal")]
|
||||||
|
// private static extern void CFSetPluginData(string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern string CFGetAdvertiserId();
|
// private static extern string CFGetAdvertiserId();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFValidateIntegration();
|
// private static extern void CFValidateIntegration();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShouldTrackNetworkState(bool track);
|
// private static extern void CFShouldTrackNetworkState(bool track);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFSetDynamicUserId(string dynamicUserId);
|
// private static extern bool CFSetDynamicUserId(string dynamicUserId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetAdaptersDebug(bool enabled);
|
// private static extern void CFSetAdaptersDebug(bool enabled);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetMetaData(string key, string value);
|
// private static extern void CFSetMetaData(string key, string value);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetMetaDataWithValues(string key, params string[] values);
|
// private static extern void CFSetMetaDataWithValues(string key, params string[] values);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern string CFGetConversionValue();
|
// private static extern string CFGetConversionValue();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetManualLoadRewardedVideo(bool isOn);
|
// private static extern void CFSetManualLoadRewardedVideo(bool isOn);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetNetworkData(string networkKey, string networkData);
|
// private static extern void CFSetNetworkData(string networkKey, string networkData);
|
||||||
|
|
||||||
// delegate void ISUnityPauseGame(bool pause);
|
// delegate void ISUnityPauseGame(bool pause);
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void RegisterPauseGameFunction(bool pasue);
|
// private static extern void RegisterPauseGameFunction(bool pasue);
|
||||||
|
|
||||||
|
|
||||||
// //******************* SDK Init *******************//
|
// //******************* SDK Init *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetUserId(string userId);
|
// private static extern void CFSetUserId(string userId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFInit(string appKey);
|
// private static extern void CFInit(string appKey);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFInitWithAdUnits(string appKey, params string[] adUnits);
|
// private static extern void CFInitWithAdUnits(string appKey, params string[] adUnits);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFInitISDemandOnly(string appKey, params string[] adUnits);
|
// private static extern void CFInitISDemandOnly(string appKey, params string[] adUnits);
|
||||||
|
|
||||||
// //******************* RewardedVideo API *******************//
|
// //******************* RewardedVideo API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadRewardedVideo();
|
// private static extern void CFLoadRewardedVideo();
|
||||||
|
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowRewardedVideo();
|
// private static extern void CFShowRewardedVideo();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowRewardedVideoWithPlacementName(string placementName);
|
// private static extern void CFShowRewardedVideoWithPlacementName(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsRewardedVideoAvailable();
|
// private static extern bool CFIsRewardedVideoAvailable();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsRewardedVideoPlacementCapped(string placementName);
|
// private static extern bool CFIsRewardedVideoPlacementCapped(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern string CFGetPlacementInfo(string placementName);
|
// private static extern string CFGetPlacementInfo(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetRewardedVideoServerParameters(string jsonString);
|
// private static extern void CFSetRewardedVideoServerParameters(string jsonString);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFClearRewardedVideoServerParameters();
|
// private static extern void CFClearRewardedVideoServerParameters();
|
||||||
|
|
||||||
// //******************* RewardedVideo DemandOnly API *******************//
|
// //******************* RewardedVideo DemandOnly API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowISDemandOnlyRewardedVideo(string instanceId);
|
// private static extern void CFShowISDemandOnlyRewardedVideo(string instanceId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadISDemandOnlyRewardedVideo(string instanceId);
|
// private static extern void CFLoadISDemandOnlyRewardedVideo(string instanceId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsDemandOnlyRewardedVideoAvailable(string instanceId);
|
// private static extern bool CFIsDemandOnlyRewardedVideoAvailable(string instanceId);
|
||||||
|
|
||||||
// //******************* Interstitial API *******************//
|
// //******************* Interstitial API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadInterstitial();
|
// private static extern void CFLoadInterstitial();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowInterstitial();
|
// private static extern void CFShowInterstitial();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowInterstitialWithPlacementName(string placementName);
|
// private static extern void CFShowInterstitialWithPlacementName(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsInterstitialReady();
|
// private static extern bool CFIsInterstitialReady();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsInterstitialPlacementCapped(string placementName);
|
// private static extern bool CFIsInterstitialPlacementCapped(string placementName);
|
||||||
|
|
||||||
// //******************* Interstitial DemandOnly API *******************//
|
// //******************* Interstitial DemandOnly API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadISDemandOnlyInterstitial(string instanceId);
|
// private static extern void CFLoadISDemandOnlyInterstitial(string instanceId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowISDemandOnlyInterstitial(string instanceId);
|
// private static extern void CFShowISDemandOnlyInterstitial(string instanceId);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsDemandOnlyInterstitialReady(string instanceId);
|
// private static extern bool CFIsDemandOnlyInterstitialReady(string instanceId);
|
||||||
|
|
||||||
|
|
||||||
// //******************* Offerwall API *******************//
|
// //******************* Offerwall API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowOfferwall();
|
// private static extern void CFShowOfferwall();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowOfferwallWithPlacementName(string placementName);
|
// private static extern void CFShowOfferwallWithPlacementName(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFGetOfferwallCredits();
|
// private static extern void CFGetOfferwallCredits();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsOfferwallAvailable();
|
// private static extern bool CFIsOfferwallAvailable();
|
||||||
|
|
||||||
// //******************* Banner API *******************//
|
// //******************* Banner API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadBanner(string description, int width, int height, int position, string placementName, bool isAdaptive);
|
// private static extern void CFLoadBanner(string description, int width, int height, int position, string placementName, bool isAdaptive);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFDestroyBanner();
|
// private static extern void CFDestroyBanner();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFDisplayBanner();
|
// private static extern void CFDisplayBanner();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFHideBanner();
|
// private static extern void CFHideBanner();
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern bool CFIsBannerPlacementCapped(string placementName);
|
// private static extern bool CFIsBannerPlacementCapped(string placementName);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetSegment(string json);
|
// private static extern void CFSetSegment(string json);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetConsent(bool consent);
|
// private static extern void CFSetConsent(bool consent);
|
||||||
|
|
||||||
// //******************* ConsentView API *******************//
|
// //******************* ConsentView API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLoadConsentViewWithType(string consentViewType);
|
// private static extern void CFLoadConsentViewWithType(string consentViewType);
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFShowConsentViewWithType(string consentViewType);
|
// private static extern void CFShowConsentViewWithType(string consentViewType);
|
||||||
|
|
||||||
// //******************* ILRD API *******************//
|
// //******************* ILRD API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFSetAdRevenueData(string dataSource, string impressionData);
|
// private static extern void CFSetAdRevenueData(string dataSource, string impressionData);
|
||||||
|
|
||||||
// //******************* TestSuite API *******************//
|
// //******************* TestSuite API *******************//
|
||||||
|
|
||||||
// [DllImport("__Internal")]
|
// [DllImport("__Internal")]
|
||||||
// private static extern void CFLaunchTestSuite();
|
// private static extern void CFLaunchTestSuite();
|
||||||
|
|
||||||
// public iOSAgent()
|
// public iOSAgent()
|
||||||
// {
|
// {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// #region IronSourceIAgent implementation
|
// #region IronSourceIAgent implementation
|
||||||
|
|
||||||
// //******************* Base API *******************//
|
// //******************* Base API *******************//
|
||||||
|
|
||||||
// public void onApplicationPause(bool pause)
|
// /// <summary>
|
||||||
// {
|
// /// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||||
|
// /// </summary>
|
||||||
|
// /// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||||
|
// /// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||||
|
// public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||||
|
// {
|
||||||
|
// var config = new IOSWaterfallConfiguration
|
||||||
|
// {
|
||||||
|
// Floor = waterfallConfiguration.Floor ?? 0.0,
|
||||||
|
// Ceiling = waterfallConfiguration.Ceiling ?? 0.0
|
||||||
|
// };
|
||||||
|
|
||||||
|
// LPPSetWaterfallConfiguration(config, adFormat);
|
||||||
|
// }
|
||||||
|
|
||||||
// }
|
// public void onApplicationPause(bool pause)
|
||||||
|
// {
|
||||||
|
|
||||||
// public string getAdvertiserId()
|
// }
|
||||||
// {
|
|
||||||
// return CFGetAdvertiserId();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public void validateIntegration()
|
// public string getAdvertiserId()
|
||||||
// {
|
// {
|
||||||
// CFValidateIntegration();
|
// return CFGetAdvertiserId();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void shouldTrackNetworkState(bool track)
|
// public void validateIntegration()
|
||||||
// {
|
// {
|
||||||
// CFShouldTrackNetworkState(track);
|
// CFValidateIntegration();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool setDynamicUserId(string dynamicUserId)
|
// public void shouldTrackNetworkState(bool track)
|
||||||
// {
|
// {
|
||||||
// return CFSetDynamicUserId(dynamicUserId);
|
// CFShouldTrackNetworkState(track);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void setAdaptersDebug(bool enabled)
|
// public bool setDynamicUserId(string dynamicUserId)
|
||||||
// {
|
// {
|
||||||
// CFSetAdaptersDebug(enabled);
|
// return CFSetDynamicUserId(dynamicUserId);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void setMetaData(string key, params string[] values)
|
// public void setAdaptersDebug(bool enabled)
|
||||||
// {
|
// {
|
||||||
// CFSetMetaDataWithValues(key, values);
|
// CFSetAdaptersDebug(enabled);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void setMetaData(string key, string value)
|
// public void setMetaData(string key, params string[] values)
|
||||||
// {
|
// {
|
||||||
// CFSetMetaData(key, value);
|
// CFSetMetaDataWithValues(key, values);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public int? getConversionValue()
|
// public void setMetaData(string key, string value)
|
||||||
// {
|
// {
|
||||||
// CultureInfo invCulture = CultureInfo.InvariantCulture;
|
// CFSetMetaData(key, value);
|
||||||
// int parsedInt;
|
// }
|
||||||
// if (int.TryParse(string.Format(invCulture, "{0}", CFGetConversionValue()), NumberStyles.Any, invCulture, out parsedInt))
|
|
||||||
// {
|
// public int? getConversionValue()
|
||||||
// return parsedInt;
|
// {
|
||||||
// }
|
// CultureInfo invCulture = CultureInfo.InvariantCulture;
|
||||||
|
// int parsedInt;
|
||||||
// return null;
|
// if (int.TryParse(string.Format(invCulture, "{0}", CFGetConversionValue()), NumberStyles.Any, invCulture, out parsedInt))
|
||||||
// }
|
// {
|
||||||
|
// return parsedInt;
|
||||||
// public void setManualLoadRewardedVideo(bool isOn)
|
// }
|
||||||
// {
|
|
||||||
// CFSetManualLoadRewardedVideo(isOn);
|
// return null;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void setNetworkData(string networkKey, string networkData)
|
// public void setManualLoadRewardedVideo(bool isOn)
|
||||||
// {
|
// {
|
||||||
// CFSetNetworkData(networkKey, networkData);
|
// CFSetManualLoadRewardedVideo(isOn);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// [AOT.MonoPInvokeCallback(typeof(ISUnityPauseGame))]
|
// public void setNetworkData(string networkKey, string networkData)
|
||||||
// public void SetPauseGame(bool pause)
|
// {
|
||||||
// {
|
// CFSetNetworkData(networkKey, networkData);
|
||||||
// RegisterPauseGameFunction(pause);
|
// }
|
||||||
// if (pause)
|
|
||||||
// {
|
// [AOT.MonoPInvokeCallback(typeof(ISUnityPauseGame))]
|
||||||
// setMetaData("IS_PAUSE_GAME_FLAG", "true");
|
// public void SetPauseGame(bool pause)
|
||||||
// }
|
// {
|
||||||
// else
|
// RegisterPauseGameFunction(pause);
|
||||||
// {
|
// if (pause)
|
||||||
// setMetaData("IS_PAUSE_GAME_FLAG", "false");
|
// {
|
||||||
// }
|
// setMetaData("IS_PAUSE_GAME_FLAG", "true");
|
||||||
// }
|
// }
|
||||||
|
// else
|
||||||
// //******************* SDK Init *******************//
|
// {
|
||||||
|
// setMetaData("IS_PAUSE_GAME_FLAG", "false");
|
||||||
// public void setUserId(string userId)
|
// }
|
||||||
// {
|
// }
|
||||||
// CFSetUserId(userId);
|
|
||||||
// }
|
// //******************* SDK Init *******************//
|
||||||
|
|
||||||
// public void init(string appKey)
|
// public void setUserId(string userId)
|
||||||
// {
|
// {
|
||||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
// CFSetUserId(userId);
|
||||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
// }
|
||||||
// CFInit(appKey);
|
|
||||||
// }
|
// public void init(string appKey)
|
||||||
|
// {
|
||||||
// public void init(string appKey, params string[] adUnits)
|
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||||
// {
|
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
// CFInit(appKey);
|
||||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
// }
|
||||||
// CFInitWithAdUnits(appKey, adUnits);
|
|
||||||
// }
|
// public void init(string appKey, params string[] adUnits)
|
||||||
|
// {
|
||||||
// public void initISDemandOnly(string appKey, params string[] adUnits)
|
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||||
// {
|
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
// CFInitWithAdUnits(appKey, adUnits);
|
||||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
// }
|
||||||
// CFInitISDemandOnly(appKey, adUnits);
|
|
||||||
// }
|
// public void initISDemandOnly(string appKey, params string[] adUnits)
|
||||||
|
// {
|
||||||
// //******************* RewardedVideo API *******************//
|
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||||
|
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||||
// public void loadRewardedVideo()
|
// CFInitISDemandOnly(appKey, adUnits);
|
||||||
// {
|
// }
|
||||||
// CFLoadRewardedVideo();
|
|
||||||
// }
|
// //******************* RewardedVideo API *******************//
|
||||||
|
|
||||||
// public void showRewardedVideo()
|
// public void loadRewardedVideo()
|
||||||
// {
|
// {
|
||||||
// CFShowRewardedVideo();
|
// CFLoadRewardedVideo();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void showRewardedVideo(string placementName)
|
// public void showRewardedVideo()
|
||||||
// {
|
// {
|
||||||
// CFShowRewardedVideoWithPlacementName(placementName);
|
// CFShowRewardedVideo();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isRewardedVideoAvailable()
|
// public void showRewardedVideo(string placementName)
|
||||||
// {
|
// {
|
||||||
// return CFIsRewardedVideoAvailable();
|
// CFShowRewardedVideoWithPlacementName(placementName);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isRewardedVideoPlacementCapped(string placementName)
|
// public bool isRewardedVideoAvailable()
|
||||||
// {
|
// {
|
||||||
// return CFIsRewardedVideoPlacementCapped(placementName);
|
// return CFIsRewardedVideoAvailable();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public IronSourcePlacement getPlacementInfo(string placementName)
|
// public bool isRewardedVideoPlacementCapped(string placementName)
|
||||||
// {
|
// {
|
||||||
// IronSourcePlacement sp = null;
|
// return CFIsRewardedVideoPlacementCapped(placementName);
|
||||||
|
// }
|
||||||
// string spString = CFGetPlacementInfo(placementName);
|
|
||||||
// if (spString != null)
|
// public IronSourcePlacement getPlacementInfo(string placementName)
|
||||||
// {
|
// {
|
||||||
// Dictionary<string, object> spDic = IronSourceJSON.Json.Deserialize(spString) as Dictionary<string, object>;
|
// IronSourcePlacement sp = null;
|
||||||
// string pName = spDic["placement_name"].ToString();
|
|
||||||
// string rewardName = spDic["reward_name"].ToString();
|
// string spString = CFGetPlacementInfo(placementName);
|
||||||
// int rewardAmount = Convert.ToInt32(spDic["reward_amount"].ToString());
|
// if (spString != null)
|
||||||
// sp = new IronSourcePlacement(pName, rewardName, rewardAmount);
|
// {
|
||||||
// }
|
// Dictionary<string, object> spDic = IronSourceJSON.Json.Deserialize(spString) as Dictionary<string, object>;
|
||||||
|
// string pName = spDic["placement_name"].ToString();
|
||||||
// return sp;
|
// string rewardName = spDic["reward_name"].ToString();
|
||||||
// }
|
// int rewardAmount = Convert.ToInt32(spDic["reward_amount"].ToString());
|
||||||
|
// sp = new IronSourcePlacement(pName, rewardName, rewardAmount);
|
||||||
// public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
// }
|
||||||
// {
|
|
||||||
// string json = IronSourceJSON.Json.Serialize(parameters);
|
// return sp;
|
||||||
// CFSetRewardedVideoServerParameters(json);
|
// }
|
||||||
// }
|
|
||||||
|
// public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
||||||
// public void clearRewardedVideoServerParams()
|
// {
|
||||||
// {
|
// string json = IronSourceJSON.Json.Serialize(parameters);
|
||||||
// CFClearRewardedVideoServerParameters();
|
// CFSetRewardedVideoServerParameters(json);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* RewardedVideo DemandOnly API *******************//
|
// public void clearRewardedVideoServerParams()
|
||||||
|
// {
|
||||||
// public void showISDemandOnlyRewardedVideo(string instanceId)
|
// CFClearRewardedVideoServerParameters();
|
||||||
// {
|
// }
|
||||||
// CFShowISDemandOnlyRewardedVideo(instanceId);
|
|
||||||
// }
|
// //******************* RewardedVideo DemandOnly API *******************//
|
||||||
|
|
||||||
// public void loadISDemandOnlyRewardedVideo(string instanceId)
|
// public void showISDemandOnlyRewardedVideo(string instanceId)
|
||||||
// {
|
// {
|
||||||
// CFLoadISDemandOnlyRewardedVideo(instanceId);
|
// CFShowISDemandOnlyRewardedVideo(instanceId);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isISDemandOnlyRewardedVideoAvailable(string instanceId)
|
// public void loadISDemandOnlyRewardedVideo(string instanceId)
|
||||||
// {
|
// {
|
||||||
// return CFIsDemandOnlyRewardedVideoAvailable(instanceId);
|
// CFLoadISDemandOnlyRewardedVideo(instanceId);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* Interstitial API *******************//
|
// public bool isISDemandOnlyRewardedVideoAvailable(string instanceId)
|
||||||
|
// {
|
||||||
// public void loadInterstitial()
|
// return CFIsDemandOnlyRewardedVideoAvailable(instanceId);
|
||||||
// {
|
// }
|
||||||
// CFLoadInterstitial();
|
|
||||||
// }
|
// //******************* Interstitial API *******************//
|
||||||
|
|
||||||
// public void showInterstitial()
|
// public void loadInterstitial()
|
||||||
// {
|
// {
|
||||||
// CFShowInterstitial();
|
// CFLoadInterstitial();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void showInterstitial(string placementName)
|
// public void showInterstitial()
|
||||||
// {
|
// {
|
||||||
// CFShowInterstitialWithPlacementName(placementName);
|
// CFShowInterstitial();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isInterstitialReady()
|
// public void showInterstitial(string placementName)
|
||||||
// {
|
// {
|
||||||
// return CFIsInterstitialReady();
|
// CFShowInterstitialWithPlacementName(placementName);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isInterstitialPlacementCapped(string placementName)
|
// public bool isInterstitialReady()
|
||||||
// {
|
// {
|
||||||
// return CFIsInterstitialPlacementCapped(placementName);
|
// return CFIsInterstitialReady();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* Interstitial DemandOnly API *******************//
|
// public bool isInterstitialPlacementCapped(string placementName)
|
||||||
|
// {
|
||||||
// public void loadISDemandOnlyInterstitial(string instanceId)
|
// return CFIsInterstitialPlacementCapped(placementName);
|
||||||
// {
|
// }
|
||||||
// CFLoadISDemandOnlyInterstitial(instanceId);
|
|
||||||
// }
|
// //******************* Interstitial DemandOnly API *******************//
|
||||||
|
|
||||||
// public void showISDemandOnlyInterstitial(string instanceId)
|
// public void loadISDemandOnlyInterstitial(string instanceId)
|
||||||
// {
|
// {
|
||||||
// CFShowISDemandOnlyInterstitial(instanceId);
|
// CFLoadISDemandOnlyInterstitial(instanceId);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isISDemandOnlyInterstitialReady(string instanceId)
|
// public void showISDemandOnlyInterstitial(string instanceId)
|
||||||
// {
|
// {
|
||||||
// return CFIsDemandOnlyInterstitialReady(instanceId);
|
// CFShowISDemandOnlyInterstitial(instanceId);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* Offerwall API *******************//
|
// public bool isISDemandOnlyInterstitialReady(string instanceId)
|
||||||
|
// {
|
||||||
// public void showOfferwall()
|
// return CFIsDemandOnlyInterstitialReady(instanceId);
|
||||||
// {
|
// }
|
||||||
// CFShowOfferwall();
|
|
||||||
// }
|
// //******************* Offerwall API *******************//
|
||||||
|
|
||||||
// public void showOfferwall(string placementName)
|
// public void showOfferwall()
|
||||||
// {
|
// {
|
||||||
// CFShowOfferwallWithPlacementName(placementName);
|
// CFShowOfferwall();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void getOfferwallCredits()
|
// public void showOfferwall(string placementName)
|
||||||
// {
|
// {
|
||||||
// CFGetOfferwallCredits();
|
// CFShowOfferwallWithPlacementName(placementName);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isOfferwallAvailable()
|
// public void getOfferwallCredits()
|
||||||
// {
|
// {
|
||||||
// return CFIsOfferwallAvailable();
|
// CFGetOfferwallCredits();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* Banner API *******************//
|
// public bool isOfferwallAvailable()
|
||||||
|
// {
|
||||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position)
|
// return CFIsOfferwallAvailable();
|
||||||
// {
|
// }
|
||||||
// loadBanner(size, position, "");
|
|
||||||
// }
|
// //******************* Banner API *******************//
|
||||||
|
|
||||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||||
// {
|
// {
|
||||||
// CFLoadBanner(size.Description, (int)size.Width, (int)size.Height, (int)position, placementName, (bool)size.IsAdaptiveEnabled());
|
// loadBanner(size, position, "");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void destroyBanner()
|
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||||
// {
|
// {
|
||||||
// CFDestroyBanner();
|
// CFLoadBanner(size.Description, (int)size.Width, (int)size.Height, (int)position, placementName, (bool)size.IsAdaptiveEnabled());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void displayBanner()
|
// public void destroyBanner()
|
||||||
// {
|
// {
|
||||||
// CFDisplayBanner();
|
// CFDestroyBanner();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void hideBanner()
|
// public void displayBanner()
|
||||||
// {
|
// {
|
||||||
// CFHideBanner();
|
// CFDisplayBanner();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public bool isBannerPlacementCapped(string placementName)
|
// public void hideBanner()
|
||||||
// {
|
// {
|
||||||
// return CFIsBannerPlacementCapped(placementName);
|
// CFHideBanner();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void setSegment(IronSourceSegment segment)
|
// public bool isBannerPlacementCapped(string placementName)
|
||||||
// {
|
// {
|
||||||
// Dictionary<string, string> dict = segment.getSegmentAsDict();
|
// return CFIsBannerPlacementCapped(placementName);
|
||||||
// string json = IronSourceJSON.Json.Serialize(dict);
|
// }
|
||||||
// CFSetSegment(json);
|
|
||||||
// }
|
// public void setSegment(IronSourceSegment segment)
|
||||||
|
// {
|
||||||
// public void setConsent(bool consent)
|
// Dictionary<string, string> dict = segment.getSegmentAsDict();
|
||||||
// {
|
// string json = IronSourceJSON.Json.Serialize(dict);
|
||||||
// CFSetConsent(consent);
|
// CFSetSegment(json);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void loadConsentViewWithType(string consentViewType)
|
// public void setConsent(bool consent)
|
||||||
// {
|
// {
|
||||||
// CFLoadConsentViewWithType(consentViewType);
|
// CFSetConsent(consent);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public void showConsentViewWithType(string consentViewType)
|
// public void loadConsentViewWithType(string consentViewType)
|
||||||
// {
|
// {
|
||||||
// CFShowConsentViewWithType(consentViewType);
|
// CFLoadConsentViewWithType(consentViewType);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //******************* ILRD API *******************//
|
// public void showConsentViewWithType(string consentViewType)
|
||||||
|
// {
|
||||||
// public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
// CFShowConsentViewWithType(consentViewType);
|
||||||
// {
|
// }
|
||||||
// string json = IronSourceJSON.Json.Serialize(impressionData);
|
|
||||||
// CFSetAdRevenueData(dataSource, json);
|
// //******************* ILRD API *******************//
|
||||||
// }
|
|
||||||
|
// public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||||
// //******************* TestSuite API *******************//
|
// {
|
||||||
|
// string json = IronSourceJSON.Json.Serialize(impressionData);
|
||||||
// public void launchTestSuite()
|
// CFSetAdRevenueData(dataSource, json);
|
||||||
// {
|
// }
|
||||||
// Debug.Log("iOSAgent: launching TestSuite");
|
|
||||||
// CFLaunchTestSuite();
|
// //******************* TestSuite API *******************//
|
||||||
// }
|
|
||||||
|
// public void launchTestSuite()
|
||||||
// #endregion
|
// {
|
||||||
|
// Debug.Log("iOSAgent: launching TestSuite");
|
||||||
|
// CFLaunchTestSuite();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #endregion
|
||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
<dependencies>
|
|
||||||
<unityversion>7.13.0</unityversion>
|
|
||||||
|
|
||||||
<androidPackages>
|
|
||||||
<androidPackage spec="com.ironsource:adqualitysdk:7.13.0">
|
|
||||||
<repositories>
|
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
|
||||||
</repositories>
|
|
||||||
</androidPackage>
|
|
||||||
</androidPackages>
|
|
||||||
|
|
||||||
<androidPackages>
|
|
||||||
<androidPackage spec="com.ironsource.unity:adqualitysdk:7.13.0">
|
|
||||||
<repositories>
|
|
||||||
<repository>https://android-sdk.is.com/</repository>
|
|
||||||
</repositories>
|
|
||||||
</androidPackage>
|
|
||||||
</androidPackages>
|
|
||||||
|
|
||||||
<!-- <iosPods>
|
|
||||||
<iosPod name="IronSourceAdQualitySDK" version="7.13.0">
|
|
||||||
<sources>
|
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
|
||||||
</sources>
|
|
||||||
</iosPod>
|
|
||||||
</iosPods>
|
|
||||||
|
|
||||||
<iosPods>
|
|
||||||
<iosPod name="IronSourceAdQualityUnityBridge" version="7.13.0">
|
|
||||||
<sources>
|
|
||||||
<source>https://github.com/CocoaPods/Specs</source>
|
|
||||||
</sources>
|
|
||||||
</iosPod>
|
|
||||||
</iosPods> -->
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
using System;
|
|
||||||
public enum ISAdQualityDeviceIdType {
|
|
||||||
NONE = 0,
|
|
||||||
GAID = 1,
|
|
||||||
IDFA = 2
|
|
||||||
};
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
public enum ISAdQualityAdType {
|
|
||||||
UNKNOWN = -1,
|
|
||||||
RICH_MEDIA = 0,
|
|
||||||
INTERSTITIAL = 1,
|
|
||||||
APP_WALL = 2,
|
|
||||||
VIDEO = 3,
|
|
||||||
REWARDED_VIDEO = 4,
|
|
||||||
NATIVE = 5,
|
|
||||||
BANNER = 6,
|
|
||||||
OFFER_WALL = 7,
|
|
||||||
NATIVE_HTML = 8,
|
|
||||||
EXTERNAL = 9,
|
|
||||||
REWARDED = 10,
|
|
||||||
INTERACTIVE = 11
|
|
||||||
};
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
#if UNITY_ANDROID
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
[Preserve]
|
|
||||||
public class ISAdQualityAndroidInitHandler : AndroidJavaProxy
|
|
||||||
{
|
|
||||||
private const string IRON_SOURCE_AD_QUALITY_CLASS = "com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality";
|
|
||||||
private const string UNITY_IS_AD_QUALITY_INIT_LISTENER = "com.ironsource.adqualitysdk.sdk.unity.UnityISAdQualityInitListener";
|
|
||||||
|
|
||||||
public event Action OnAdQualitySdkInitSuccess = delegate { };
|
|
||||||
public event Action<ISAdQualityInitError, string> OnAdQualitySdkInitFailed = delegate { };
|
|
||||||
|
|
||||||
//implements UnityISAdQualityInitListener java interface
|
|
||||||
public ISAdQualityAndroidInitHandler(): base(UNITY_IS_AD_QUALITY_INIT_LISTENER)
|
|
||||||
{
|
|
||||||
#if !UNITY_EDITOR
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var jniAdQualityClass = new AndroidJavaClass(IRON_SOURCE_AD_QUALITY_CLASS))
|
|
||||||
{
|
|
||||||
jniAdQualityClass.CallStatic("setUnityISAdQualityInitListener", this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
Debug.LogError("setUnityISAdQualityInitListener method doesn't exist, error: " + e.Message);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
[Preserve]
|
|
||||||
public void adQualitySdkInitSuccess()
|
|
||||||
{
|
|
||||||
if (this.OnAdQualitySdkInitSuccess != null)
|
|
||||||
{
|
|
||||||
this.OnAdQualitySdkInitSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Preserve]
|
|
||||||
public void adQualitySdkInitFailed(int adQualitySdkInitError, string errorMessage)
|
|
||||||
{
|
|
||||||
if (this.OnAdQualitySdkInitFailed != null)
|
|
||||||
{
|
|
||||||
this.OnAdQualitySdkInitFailed((ISAdQualityInitError)adQualitySdkInitError, errorMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ISAdQualityConfig
|
|
||||||
{
|
|
||||||
private String userId;
|
|
||||||
private bool userIdSet;
|
|
||||||
private bool testMode;
|
|
||||||
private ISAdQualityInitCallback adQualityInitCallback;
|
|
||||||
private ISAdQualityLogLevel logLevel;
|
|
||||||
private String initializationSource;
|
|
||||||
private bool coppa;
|
|
||||||
private ISAdQualityDeviceIdType deviceIdType;
|
|
||||||
|
|
||||||
public ISAdQualityConfig()
|
|
||||||
{
|
|
||||||
userId = null;
|
|
||||||
testMode = false;
|
|
||||||
userIdSet = false;
|
|
||||||
logLevel = ISAdQualityLogLevel.INFO;
|
|
||||||
coppa = false;
|
|
||||||
deviceIdType = ISAdQualityDeviceIdType.NONE;
|
|
||||||
initializationSource = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String UserId
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
userIdSet = true;
|
|
||||||
userId = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal bool UserIdSet
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return userIdSet;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool TestMode
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return testMode;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
testMode = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISAdQualityLogLevel LogLevel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return logLevel;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
logLevel = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISAdQualityInitCallback AdQualityInitCallback
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return adQualityInitCallback;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
adQualityInitCallback = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String InitializationSource
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return initializationSource;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
initializationSource = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Coppa
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return coppa;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
coppa = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISAdQualityDeviceIdType DeviceIdType
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return deviceIdType;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
deviceIdType = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ISAdQualityCustomMediationRevenue
|
|
||||||
{
|
|
||||||
private ISAdQualityMediationNetwork mediationNetwork;
|
|
||||||
private ISAdQualityAdType adType;
|
|
||||||
private double revenue;
|
|
||||||
private String placement;
|
|
||||||
|
|
||||||
public ISAdQualityCustomMediationRevenue()
|
|
||||||
{
|
|
||||||
mediationNetwork = ISAdQualityMediationNetwork.UNKNOWN;
|
|
||||||
adType = ISAdQualityAdType.UNKNOWN;
|
|
||||||
revenue = 0;
|
|
||||||
placement = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISAdQualityMediationNetwork MediationNetwork
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return mediationNetwork;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
mediationNetwork = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISAdQualityAdType AdType
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return adType;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
adType = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double Revenue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return revenue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
revenue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String Placement
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return placement;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
placement = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8bb7937cdf9c640cf8ee92ed1fa34227
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public interface ISAdQualityInitCallback
|
|
||||||
{
|
|
||||||
void adQualitySdkInitSuccess();
|
|
||||||
void adQualitySdkInitFailed(ISAdQualityInitError adQualityInitError, string errorMessage);
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 894fc956cbe6c43e385333baa4651e56
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
public class ISAdQualityInitCallbackWrapper : MonoBehaviour
|
|
||||||
{
|
|
||||||
private ISAdQualityInitCallback mCallback;
|
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
|
||||||
private ISAdQualityAndroidInitHandler adQualityAndroidInitHandler;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UNITY_IPHONE || UNITY_IOS
|
|
||||||
// private ISAdQualityiOSInitHandler adQualityiOSInitHandler;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public ISAdQualityInitCallback AdQualityInitCallback
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
mCallback = value;
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return mCallback;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Awake ()
|
|
||||||
{
|
|
||||||
#if UNITY_ANDROID
|
|
||||||
adQualityAndroidInitHandler = new ISAdQualityAndroidInitHandler(); //sets this.adQualityAndroidInitHandler as listener for init events on the bridge
|
|
||||||
registerAdQualityAndroidInitEvents();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UNITY_IPHONE || UNITY_IOS
|
|
||||||
// registerAdQualityiOSInitEvents();
|
|
||||||
// adQualityiOSInitHandler = new ISAdQualityiOSInitHandler(); //sets this.adQualityiOSInit as listener for init events on the bridge
|
|
||||||
#endif
|
|
||||||
DontDestroyOnLoad(gameObject); //Makes the object not be destroyed automatically when loading a new scene.
|
|
||||||
}
|
|
||||||
|
|
||||||
private void adQualitySdkInitSuccess()
|
|
||||||
{
|
|
||||||
if (mCallback != null)
|
|
||||||
{
|
|
||||||
mCallback.adQualitySdkInitSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onAdQualitySdkInitFailed(ISAdQualityInitError sdkInitError, string errorMsg)
|
|
||||||
{
|
|
||||||
if (mCallback != null)
|
|
||||||
{
|
|
||||||
mCallback.adQualitySdkInitFailed(sdkInitError, errorMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
|
||||||
//subscribe to ISAdQualityAndroidInitHandler events
|
|
||||||
private void registerAdQualityAndroidInitEvents() {
|
|
||||||
adQualityAndroidInitHandler.OnAdQualitySdkInitSuccess += () =>
|
|
||||||
{
|
|
||||||
adQualitySdkInitSuccess();
|
|
||||||
};
|
|
||||||
|
|
||||||
adQualityAndroidInitHandler.OnAdQualitySdkInitFailed += (sdkInitError, errorMsg) =>
|
|
||||||
{
|
|
||||||
onAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UNITY_IPHONE || UNITY_IOS
|
|
||||||
//subscribe to ISAdQualityiOSInitHandler events
|
|
||||||
// private void registerAdQualityiOSInitEvents() {
|
|
||||||
// ISAdQualityiOSInitHandler.OnAdQualitySdkInitSuccess += () =>
|
|
||||||
// {
|
|
||||||
// adQualitySdkInitSuccess();
|
|
||||||
// };
|
|
||||||
|
|
||||||
// ISAdQualityiOSInitHandler.OnAdQualitySdkInitFailed += (sdkInitError, errorMsg) =>
|
|
||||||
// {
|
|
||||||
// onAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1f5c838c5a8ff40529569d29728deec4
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
public enum ISAdQualityInitError {
|
|
||||||
AD_QUALITY_SDK_WAS_SHUTDOWN = 0,
|
|
||||||
ILLEGAL_USER_ID = 1,
|
|
||||||
ILLEGAL_APP_KEY = 2,
|
|
||||||
EXCEPTION_ON_INIT = 3,
|
|
||||||
NO_NETWORK_CONNECTION = 4,
|
|
||||||
CONFIG_LOAD_TIMEOUT = 5,
|
|
||||||
CONNECTOR_LOAD_TIMEOUT = 6,
|
|
||||||
AD_NETWORK_VERSION_NOT_SUPPORTED_YET = 7,
|
|
||||||
AD_NETWORK_SDK_REQUIRES_NEWER_AD_QUALITY_SDK = 8,
|
|
||||||
AD_QUALITY_ALREADY_INITIALIZED = 9
|
|
||||||
};
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6da8d8e07e45042f197fc5f6304a9d62
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,495 +0,0 @@
|
|||||||
/*
|
|
||||||
* Based on the miniJSON by Calvin Rien
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace ISAdQualityJSON
|
|
||||||
{
|
|
||||||
public static class Json
|
|
||||||
{
|
|
||||||
public static object Deserialize (string json)
|
|
||||||
{
|
|
||||||
if (json == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return Parser.Parse (json);
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class Parser : IDisposable
|
|
||||||
{
|
|
||||||
const string WHITE_SPACE = " \t\n\r";
|
|
||||||
const string WORD_BREAK = " \t\n\r{}[],:\"";
|
|
||||||
|
|
||||||
enum TOKEN
|
|
||||||
{
|
|
||||||
NONE,
|
|
||||||
CURLY_OPEN,
|
|
||||||
CURLY_CLOSE,
|
|
||||||
SQUARED_OPEN,
|
|
||||||
SQUARED_CLOSE,
|
|
||||||
COLON,
|
|
||||||
COMMA,
|
|
||||||
STRING,
|
|
||||||
NUMBER,
|
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
NULL
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
StringReader json;
|
|
||||||
|
|
||||||
Parser (string jsonString)
|
|
||||||
{
|
|
||||||
json = new StringReader (jsonString);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static object Parse (string jsonString)
|
|
||||||
{
|
|
||||||
using (var instance = new Parser(jsonString)) {
|
|
||||||
return instance.ParseValue ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose ()
|
|
||||||
{
|
|
||||||
json.Dispose ();
|
|
||||||
json = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Dictionary<string, object> ParseObject ()
|
|
||||||
{
|
|
||||||
Dictionary<string, object> table = new Dictionary<string, object> ();
|
|
||||||
|
|
||||||
// ditch opening brace
|
|
||||||
json.Read ();
|
|
||||||
|
|
||||||
// {
|
|
||||||
while (true) {
|
|
||||||
switch (NextToken) {
|
|
||||||
case TOKEN.NONE:
|
|
||||||
return null;
|
|
||||||
case TOKEN.COMMA:
|
|
||||||
continue;
|
|
||||||
case TOKEN.CURLY_CLOSE:
|
|
||||||
return table;
|
|
||||||
default:
|
|
||||||
// name
|
|
||||||
string name = ParseString ();
|
|
||||||
if (name == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// :
|
|
||||||
if (NextToken != TOKEN.COLON) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// ditch the colon
|
|
||||||
json.Read ();
|
|
||||||
|
|
||||||
// value
|
|
||||||
table [name] = ParseValue ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<object> ParseArray ()
|
|
||||||
{
|
|
||||||
List<object> array = new List<object> ();
|
|
||||||
|
|
||||||
// ditch opening bracket
|
|
||||||
json.Read ();
|
|
||||||
|
|
||||||
// [
|
|
||||||
var parsing = true;
|
|
||||||
while (parsing) {
|
|
||||||
TOKEN nextToken = NextToken;
|
|
||||||
|
|
||||||
switch (nextToken) {
|
|
||||||
case TOKEN.NONE:
|
|
||||||
return null;
|
|
||||||
case TOKEN.COMMA:
|
|
||||||
continue;
|
|
||||||
case TOKEN.SQUARED_CLOSE:
|
|
||||||
parsing = false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
object value = ParseByToken (nextToken);
|
|
||||||
|
|
||||||
array.Add (value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
object ParseValue ()
|
|
||||||
{
|
|
||||||
TOKEN nextToken = NextToken;
|
|
||||||
return ParseByToken (nextToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
object ParseByToken (TOKEN token)
|
|
||||||
{
|
|
||||||
switch (token) {
|
|
||||||
case TOKEN.STRING:
|
|
||||||
return ParseString ();
|
|
||||||
case TOKEN.NUMBER:
|
|
||||||
return ParseNumber ();
|
|
||||||
case TOKEN.CURLY_OPEN:
|
|
||||||
return ParseObject ();
|
|
||||||
case TOKEN.SQUARED_OPEN:
|
|
||||||
return ParseArray ();
|
|
||||||
case TOKEN.TRUE:
|
|
||||||
return true;
|
|
||||||
case TOKEN.FALSE:
|
|
||||||
return false;
|
|
||||||
case TOKEN.NULL:
|
|
||||||
return null;
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string ParseString ()
|
|
||||||
{
|
|
||||||
StringBuilder s = new StringBuilder ();
|
|
||||||
char c;
|
|
||||||
|
|
||||||
// ditch opening quote
|
|
||||||
json.Read ();
|
|
||||||
|
|
||||||
bool parsing = true;
|
|
||||||
while (parsing) {
|
|
||||||
|
|
||||||
if (json.Peek () == -1) {
|
|
||||||
parsing = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = NextChar;
|
|
||||||
switch (c) {
|
|
||||||
case '"':
|
|
||||||
parsing = false;
|
|
||||||
break;
|
|
||||||
case '\\':
|
|
||||||
if (json.Peek () == -1) {
|
|
||||||
parsing = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = NextChar;
|
|
||||||
switch (c) {
|
|
||||||
case '"':
|
|
||||||
case '\\':
|
|
||||||
case '/':
|
|
||||||
s.Append (c);
|
|
||||||
break;
|
|
||||||
case 'b':
|
|
||||||
s.Append ('\b');
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
s.Append ('\f');
|
|
||||||
break;
|
|
||||||
case 'n':
|
|
||||||
s.Append ('\n');
|
|
||||||
break;
|
|
||||||
case 'r':
|
|
||||||
s.Append ('\r');
|
|
||||||
break;
|
|
||||||
case 't':
|
|
||||||
s.Append ('\t');
|
|
||||||
break;
|
|
||||||
case 'u':
|
|
||||||
var hex = new StringBuilder ();
|
|
||||||
|
|
||||||
for (int i=0; i< 4; i++) {
|
|
||||||
hex.Append (NextChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
s.Append ((char)Convert.ToInt32 (hex.ToString (), 16));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
s.Append (c);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return s.ToString ();
|
|
||||||
}
|
|
||||||
|
|
||||||
object ParseNumber ()
|
|
||||||
{
|
|
||||||
string number = NextWord;
|
|
||||||
|
|
||||||
if (number.IndexOf ('.') == -1) {
|
|
||||||
long parsedInt;
|
|
||||||
Int64.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedInt);
|
|
||||||
return parsedInt;
|
|
||||||
}
|
|
||||||
|
|
||||||
double parsedDouble;
|
|
||||||
Double.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedDouble);
|
|
||||||
return parsedDouble;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EatWhitespace ()
|
|
||||||
{
|
|
||||||
while (WHITE_SPACE.IndexOf(PeekChar) != -1) {
|
|
||||||
json.Read ();
|
|
||||||
|
|
||||||
if (json.Peek () == -1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char PeekChar {
|
|
||||||
get {
|
|
||||||
return Convert.ToChar (json.Peek ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char NextChar {
|
|
||||||
get {
|
|
||||||
return Convert.ToChar (json.Read ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string NextWord {
|
|
||||||
get {
|
|
||||||
StringBuilder word = new StringBuilder ();
|
|
||||||
|
|
||||||
while (WORD_BREAK.IndexOf(PeekChar) == -1) {
|
|
||||||
word.Append (NextChar);
|
|
||||||
|
|
||||||
if (json.Peek () == -1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return word.ToString ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TOKEN NextToken {
|
|
||||||
get {
|
|
||||||
EatWhitespace ();
|
|
||||||
|
|
||||||
if (json.Peek () == -1) {
|
|
||||||
return TOKEN.NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
char c = PeekChar;
|
|
||||||
switch (c) {
|
|
||||||
case '{':
|
|
||||||
return TOKEN.CURLY_OPEN;
|
|
||||||
case '}':
|
|
||||||
json.Read ();
|
|
||||||
return TOKEN.CURLY_CLOSE;
|
|
||||||
case '[':
|
|
||||||
return TOKEN.SQUARED_OPEN;
|
|
||||||
case ']':
|
|
||||||
json.Read ();
|
|
||||||
return TOKEN.SQUARED_CLOSE;
|
|
||||||
case ',':
|
|
||||||
json.Read ();
|
|
||||||
return TOKEN.COMMA;
|
|
||||||
case '"':
|
|
||||||
return TOKEN.STRING;
|
|
||||||
case ':':
|
|
||||||
return TOKEN.COLON;
|
|
||||||
case '0':
|
|
||||||
case '1':
|
|
||||||
case '2':
|
|
||||||
case '3':
|
|
||||||
case '4':
|
|
||||||
case '5':
|
|
||||||
case '6':
|
|
||||||
case '7':
|
|
||||||
case '8':
|
|
||||||
case '9':
|
|
||||||
case '-':
|
|
||||||
return TOKEN.NUMBER;
|
|
||||||
}
|
|
||||||
|
|
||||||
string word = NextWord;
|
|
||||||
|
|
||||||
switch (word) {
|
|
||||||
case "false":
|
|
||||||
return TOKEN.FALSE;
|
|
||||||
case "true":
|
|
||||||
return TOKEN.TRUE;
|
|
||||||
case "null":
|
|
||||||
return TOKEN.NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TOKEN.NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="json">A Dictionary<string, object> / List<object></param>
|
|
||||||
/// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
|
|
||||||
public static string Serialize (object obj)
|
|
||||||
{
|
|
||||||
return Serializer.Serialize (obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class Serializer
|
|
||||||
{
|
|
||||||
StringBuilder builder;
|
|
||||||
|
|
||||||
Serializer ()
|
|
||||||
{
|
|
||||||
builder = new StringBuilder ();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Serialize (object obj)
|
|
||||||
{
|
|
||||||
var instance = new Serializer ();
|
|
||||||
|
|
||||||
instance.SerializeValue (obj);
|
|
||||||
|
|
||||||
return instance.builder.ToString ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SerializeValue (object value)
|
|
||||||
{
|
|
||||||
IList asList;
|
|
||||||
IDictionary asDict;
|
|
||||||
string asStr;
|
|
||||||
|
|
||||||
if (value == null) {
|
|
||||||
builder.Append ("null");
|
|
||||||
} else if ((asStr = value as string) != null) {
|
|
||||||
SerializeString (asStr);
|
|
||||||
} else if (value is bool) {
|
|
||||||
builder.Append (value.ToString ().ToLower ());
|
|
||||||
} else if ((asList = value as IList) != null) {
|
|
||||||
SerializeArray (asList);
|
|
||||||
} else if ((asDict = value as IDictionary) != null) {
|
|
||||||
SerializeObject (asDict);
|
|
||||||
} else if (value is char) {
|
|
||||||
SerializeString (value.ToString ());
|
|
||||||
} else {
|
|
||||||
SerializeOther (value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SerializeObject (IDictionary obj)
|
|
||||||
{
|
|
||||||
bool first = true;
|
|
||||||
|
|
||||||
builder.Append ('{');
|
|
||||||
|
|
||||||
foreach (object e in obj.Keys) {
|
|
||||||
if (!first) {
|
|
||||||
builder.Append (',');
|
|
||||||
}
|
|
||||||
|
|
||||||
SerializeString (e.ToString ());
|
|
||||||
builder.Append (':');
|
|
||||||
|
|
||||||
SerializeValue (obj [e]);
|
|
||||||
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.Append ('}');
|
|
||||||
}
|
|
||||||
|
|
||||||
void SerializeArray (IList anArray)
|
|
||||||
{
|
|
||||||
builder.Append ('[');
|
|
||||||
|
|
||||||
bool first = true;
|
|
||||||
|
|
||||||
foreach (object obj in anArray) {
|
|
||||||
if (!first) {
|
|
||||||
builder.Append (',');
|
|
||||||
}
|
|
||||||
|
|
||||||
SerializeValue (obj);
|
|
||||||
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.Append (']');
|
|
||||||
}
|
|
||||||
|
|
||||||
void SerializeString (string str)
|
|
||||||
{
|
|
||||||
builder.Append ('\"');
|
|
||||||
|
|
||||||
char[] charArray = str.ToCharArray ();
|
|
||||||
foreach (var c in charArray) {
|
|
||||||
switch (c) {
|
|
||||||
case '"':
|
|
||||||
builder.Append ("\\\"");
|
|
||||||
break;
|
|
||||||
case '\\':
|
|
||||||
builder.Append ("\\\\");
|
|
||||||
break;
|
|
||||||
case '\b':
|
|
||||||
builder.Append ("\\b");
|
|
||||||
break;
|
|
||||||
case '\f':
|
|
||||||
builder.Append ("\\f");
|
|
||||||
break;
|
|
||||||
case '\n':
|
|
||||||
builder.Append ("\\n");
|
|
||||||
break;
|
|
||||||
case '\r':
|
|
||||||
builder.Append ("\\r");
|
|
||||||
break;
|
|
||||||
case '\t':
|
|
||||||
builder.Append ("\\t");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
int codepoint = Convert.ToInt32 (c);
|
|
||||||
if ((codepoint >= 32) && (codepoint <= 126)) {
|
|
||||||
builder.Append (c);
|
|
||||||
} else {
|
|
||||||
builder.Append ("\\u" + Convert.ToString (codepoint, 16).PadLeft (4, '0'));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.Append ('\"');
|
|
||||||
}
|
|
||||||
|
|
||||||
void SerializeOther (object value)
|
|
||||||
{
|
|
||||||
if (value is float
|
|
||||||
|| value is int
|
|
||||||
|| value is uint
|
|
||||||
|| value is long
|
|
||||||
|| value is double
|
|
||||||
|| value is sbyte
|
|
||||||
|| value is byte
|
|
||||||
|| value is short
|
|
||||||
|| value is ushort
|
|
||||||
|| value is ulong
|
|
||||||
|| value is decimal) {
|
|
||||||
builder.Append (value.ToString ());
|
|
||||||
} else {
|
|
||||||
SerializeString (value.ToString ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a80f212ad97ca4136b919689ba6ad522
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
using System;
|
|
||||||
public enum ISAdQualityLogLevel {
|
|
||||||
NONE = 0,
|
|
||||||
ERROR = 1,
|
|
||||||
WARNING = 2,
|
|
||||||
INFO = 3,
|
|
||||||
DEBUG = 4,
|
|
||||||
VERBOSE = 5
|
|
||||||
};
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c958a1a9721494cefb50a4fad4b6bb8b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
public enum ISAdQualityMediationNetwork {
|
|
||||||
UNKNOWN = -1,
|
|
||||||
ADMOB = 0,
|
|
||||||
DT_FAIR_BID = 1,
|
|
||||||
HELIUM = 2,
|
|
||||||
LEVEL_PLAY = 3,
|
|
||||||
MAX = 4,
|
|
||||||
UNITY = 5,
|
|
||||||
SELF_MEDIATED = 6,
|
|
||||||
OTHER = 7
|
|
||||||
};
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b1c44dbefc86f46d7a84660f64b9ba47
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
public class ISAdQualitySegment
|
|
||||||
{
|
|
||||||
public string name = null;
|
|
||||||
public int age;
|
|
||||||
public string gender = null;
|
|
||||||
public int level;
|
|
||||||
public int isPaying;
|
|
||||||
public double inAppPurchasesTotal;
|
|
||||||
public long userCreationDate;
|
|
||||||
public Dictionary<string,string> customs;
|
|
||||||
|
|
||||||
public ISAdQualitySegment ()
|
|
||||||
{
|
|
||||||
age = -1;
|
|
||||||
level = -1;
|
|
||||||
isPaying = -1;
|
|
||||||
inAppPurchasesTotal = -1;
|
|
||||||
userCreationDate = -1;
|
|
||||||
customs = new Dictionary<string,string> ();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustom(string key, string value){
|
|
||||||
customs.Add (key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string,string> getSegmentAsDict ()
|
|
||||||
{
|
|
||||||
Dictionary<string,string> dict = new Dictionary<string,string> ();
|
|
||||||
if (!string.IsNullOrEmpty(name))
|
|
||||||
{
|
|
||||||
dict.Add ("name", name);
|
|
||||||
}
|
|
||||||
if (age != -1)
|
|
||||||
{
|
|
||||||
dict.Add ("age", age + "");
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrEmpty(gender))
|
|
||||||
{
|
|
||||||
dict.Add ("gender", gender);
|
|
||||||
}
|
|
||||||
if (level != -1)
|
|
||||||
{
|
|
||||||
dict.Add ("level", level + "");
|
|
||||||
}
|
|
||||||
if (isPaying > -1 && isPaying < 2)
|
|
||||||
{
|
|
||||||
dict.Add ("isPaying", isPaying + "");
|
|
||||||
}
|
|
||||||
if (inAppPurchasesTotal > -1)
|
|
||||||
{
|
|
||||||
dict.Add ("iapt", inAppPurchasesTotal + "");
|
|
||||||
}
|
|
||||||
if (userCreationDate != -1)
|
|
||||||
{
|
|
||||||
dict.Add ("userCreationDate", userCreationDate + "");
|
|
||||||
}
|
|
||||||
Dictionary<string,string> result = dict.Concat(customs).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.First().Value);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: bbf07b143b428454a85a0dccbb3bd7b0
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
public static class ISAdQualityUtils {
|
|
||||||
|
|
||||||
private static bool isDebugBuild = false;
|
|
||||||
private static bool isDebugBuildSet = false;
|
|
||||||
/// <summary>
|
|
||||||
/// Creates Log Debug message according to given tag and message.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tag">The name of the class whose instance called this function.</param>
|
|
||||||
/// <param name="message">Debug message to output to log.</param>
|
|
||||||
public static void LogDebug(string tag, string message)
|
|
||||||
{
|
|
||||||
if (!isDebugBuildSet)
|
|
||||||
{
|
|
||||||
try //Debug.isDebugBuild can fail on WP8 if it is not called from the Main Thread
|
|
||||||
{
|
|
||||||
isDebugBuild = Debug.isDebugBuild;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
isDebugBuild = true;
|
|
||||||
Debug.Log(string.Format("{0} {1}", tag, e.Message));
|
|
||||||
}
|
|
||||||
isDebugBuildSet = true;
|
|
||||||
}
|
|
||||||
if (isDebugBuild)
|
|
||||||
{
|
|
||||||
Debug.Log(string.Format("{0} {1}", tag, message));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates Log Error message according to given tag and message.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tag">The name of the class whose instance called this function..</param>
|
|
||||||
/// <param name="message">Error message to output to log.</param>
|
|
||||||
public static void LogError(string tag, string message) {
|
|
||||||
Debug.LogError(string.Format("{0} {1}", tag, message));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LogWarning(string tag, string message) {
|
|
||||||
Debug.LogWarning(string.Format("{0} {1}", tag, message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the class name to be used in serialization/deserialization process
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="target">The target to get class name for</param>
|
|
||||||
/// <returns>The class name of the provided instance</returns>
|
|
||||||
public static string GetClassName(object target) {
|
|
||||||
return target.GetType().Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ae84ef4134f7e4290bd18d994cd71a5b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
// #if UNITY_IPHONE || UNITY_IOS
|
|
||||||
// using System;
|
|
||||||
// using System.Collections.Generic;
|
|
||||||
// using System.Runtime.InteropServices;
|
|
||||||
// using UnityEngine;
|
|
||||||
|
|
||||||
// public class ISAdQualityiOSInitHandler : MonoBehaviour
|
|
||||||
// {
|
|
||||||
// public static event Action OnAdQualitySdkInitSuccess = delegate { };
|
|
||||||
// public static event Action<ISAdQualityInitError, string> OnAdQualitySdkInitFailed = delegate { };
|
|
||||||
|
|
||||||
|
|
||||||
// #if UNITY_IOS && !UNITY_EDITOR
|
|
||||||
// delegate void ISAdQualityUnityInitSuccessCallback(string args);
|
|
||||||
// [DllImport("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_registerInitSuccessCallback(ISAdQualityUnityInitSuccessCallback func);
|
|
||||||
|
|
||||||
// delegate void ISAdQualityUnityInitFailedCallback(string args);
|
|
||||||
// [DllImport("__Internal")]
|
|
||||||
// private static extern void ironSourceAdQuality_registerInitFailedCallback(ISAdQualityUnityInitFailedCallback func);
|
|
||||||
|
|
||||||
// public ISAdQualityiOSInitHandler()
|
|
||||||
// {
|
|
||||||
// ironSourceAdQuality_registerInitSuccessCallback(fireInitSuccessCallback);
|
|
||||||
// ironSourceAdQuality_registerInitFailedCallback(fireInitFailedCallback);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// [AOT.MonoPInvokeCallback(typeof(ISAdQualityUnityInitSuccessCallback))]
|
|
||||||
// public static void fireInitSuccessCallback(string message)
|
|
||||||
// {
|
|
||||||
// if (OnAdQualitySdkInitSuccess != null)
|
|
||||||
// {
|
|
||||||
// OnAdQualitySdkInitSuccess();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// [AOT.MonoPInvokeCallback(typeof(ISAdQualityUnityInitFailedCallback))]
|
|
||||||
// public static void fireInitFailedCallback(string message)
|
|
||||||
// {
|
|
||||||
// if (OnAdQualitySdkInitFailed != null)
|
|
||||||
// {
|
|
||||||
// ISAdQualityInitError sdkInitError = ISAdQualityInitError.EXCEPTION_ON_INIT;
|
|
||||||
// string errorMsg = String.Empty;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// if (!String.IsNullOrEmpty(message))
|
|
||||||
// {
|
|
||||||
// string[] separators = { "Unity:" };
|
|
||||||
// string[] splitArray = message.Split(separators, System.StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
// if (splitArray.Length > 1)
|
|
||||||
// {
|
|
||||||
// sdkInitError = (ISAdQualityInitError)Enum.Parse(typeof(ISAdQualityInitError), splitArray[0]);
|
|
||||||
// errorMsg = splitArray[1];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (Exception e)
|
|
||||||
// {
|
|
||||||
// errorMsg = e.Message;
|
|
||||||
// }
|
|
||||||
// OnAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// #endif
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a21b72b3702244ccaa9227784e3fc6f3
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,157 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using UnityEngine;
|
|
||||||
using ISAdQualityJSON;
|
|
||||||
|
|
||||||
public class IronSourceAdQuality : CodeGeneratedSingleton
|
|
||||||
{
|
|
||||||
private static GameObject adQualityGameObject = new GameObject("IronSourceAdQuality");
|
|
||||||
|
|
||||||
#if UNITY_IOS && !UNITY_EDITOR
|
|
||||||
|
|
||||||
// [DllImport ("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_initialize(string appKey, string userId, bool userIdSet, bool testMode,
|
|
||||||
// bool debug, int logLevel, string initializationSource, bool coppa,
|
|
||||||
// int deviceIdType, bool isInitCallbackSet);
|
|
||||||
// [DllImport ("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_changeUserId(string userId);
|
|
||||||
// [DllImport ("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_setUserConsent(bool userConsent);
|
|
||||||
// [DllImport ("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_sendCustomMediationRevenue(int mediationNetwork, int adType, string placement, double revenue);
|
|
||||||
// [DllImport ("__Internal")]
|
|
||||||
// private static extern int ironSourceAdQuality_setSegment(string jsonString);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected override bool DontDestroySingleton { get { return true; } }
|
|
||||||
|
|
||||||
protected override void InitAfterRegisteringAsSingleInstance() {
|
|
||||||
base.InitAfterRegisteringAsSingleInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Initialize(string appKey) {
|
|
||||||
Initialize(appKey, new ISAdQualityConfig());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Initialize(string appKey, ISAdQualityConfig adQualityConfig) {
|
|
||||||
if (adQualityConfig == null) {
|
|
||||||
adQualityConfig = new ISAdQualityConfig();
|
|
||||||
}
|
|
||||||
Initialize(appKey,
|
|
||||||
adQualityConfig.UserId,
|
|
||||||
adQualityConfig.UserIdSet,
|
|
||||||
adQualityConfig.TestMode,
|
|
||||||
adQualityConfig.LogLevel,
|
|
||||||
adQualityConfig.InitializationSource,
|
|
||||||
adQualityConfig.Coppa,
|
|
||||||
adQualityConfig.DeviceIdType,
|
|
||||||
adQualityConfig.AdQualityInitCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Initialize(string appKey,
|
|
||||||
string userId,
|
|
||||||
bool userIdSet,
|
|
||||||
bool testMode,
|
|
||||||
ISAdQualityLogLevel logLevel,
|
|
||||||
string initializationSource,
|
|
||||||
bool coppa,
|
|
||||||
ISAdQualityDeviceIdType deviceIdType,
|
|
||||||
ISAdQualityInitCallback adQualityInitCallback) {
|
|
||||||
|
|
||||||
#if !UNITY_EDITOR
|
|
||||||
GetSynchronousCodeGeneratedInstance<IronSourceAdQuality>();
|
|
||||||
ISAdQualityInitCallbackWrapper initCallbackWrapper = adQualityGameObject.GetComponent<ISAdQualityInitCallbackWrapper>();
|
|
||||||
if (initCallbackWrapper == null) {
|
|
||||||
initCallbackWrapper = adQualityGameObject.AddComponent<ISAdQualityInitCallbackWrapper>();
|
|
||||||
}
|
|
||||||
initCallbackWrapper.AdQualityInitCallback = adQualityInitCallback;
|
|
||||||
bool isInitCallbackSet = (adQualityInitCallback != null);
|
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
|
||||||
AndroidJavaClass jLogLevelEnum = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.ISAdQualityLogLevel");
|
|
||||||
AndroidJavaObject jLogLevel = jLogLevelEnum.CallStatic<AndroidJavaObject>("fromInt", (int)logLevel);
|
|
||||||
AndroidJavaClass jDeviceIdTypeEnum = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.ISAdQualityDeviceIdType");
|
|
||||||
AndroidJavaObject jDeviceIdType = jDeviceIdTypeEnum.CallStatic<AndroidJavaObject>("fromInt", (int)deviceIdType);
|
|
||||||
jniAdQualityClass.CallStatic("initialize", appKey, userId, userIdSet, testMode, jLogLevel, initializationSource, coppa, jDeviceIdType, isInitCallbackSet);
|
|
||||||
}
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#elif UNITY_IOS
|
|
||||||
// ironSourceAdQuality_initialize(appKey, userId, userIdSet ,testMode, DEBUG, (int)logLevel, initializationSource, coppa, (int)deviceIdType, isInitCallbackSet);
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
ISAdQualityUtils.LogWarning(TAG, "Ad Quality SDK works only on Android or iOS devices.");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ChangeUserId(String userId) {
|
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
|
||||||
jniAdQualityClass.CallStatic("changeUserId", userId);
|
|
||||||
}
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
|
||||||
// ironSourceAdQuality_changeUserId(userId);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete("This method has been deprecated and will be removed soon")]
|
|
||||||
public static void SetUserConsent(bool userConsent) {
|
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
|
||||||
jniAdQualityClass.CallStatic("setUserConsent", userConsent);
|
|
||||||
}
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
|
||||||
// ironSourceAdQuality_setUserConsent(userConsent);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SendCustomMediationRevenue(ISAdQualityCustomMediationRevenue customMediationRevenue) {
|
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
|
||||||
jniAdQualityClass.CallStatic("sendCustomMediationRevenue",
|
|
||||||
(int) customMediationRevenue.MediationNetwork,
|
|
||||||
(int) customMediationRevenue.AdType,
|
|
||||||
customMediationRevenue.Placement,
|
|
||||||
customMediationRevenue.Revenue);
|
|
||||||
}
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
|
||||||
// ironSourceAdQuality_sendCustomMediationRevenue((int) customMediationRevenue.MediationNetwork,
|
|
||||||
// (int) customMediationRevenue.AdType,
|
|
||||||
// customMediationRevenue.Placement,
|
|
||||||
// customMediationRevenue.Revenue);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setSegment(ISAdQualitySegment segment) {
|
|
||||||
Dictionary <string,string> dict = segment.getSegmentAsDict();
|
|
||||||
string jsonString = ISAdQualityJSON.Json.Serialize(dict);
|
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
|
||||||
AndroidJNI.PushLocalFrame(100);
|
|
||||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
|
||||||
jniAdQualityClass.CallStatic("setSegment", jsonString);
|
|
||||||
}
|
|
||||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
|
||||||
// ironSourceAdQuality_setSegment(jsonString);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
private const string TAG = "IronSource AdQuality";
|
|
||||||
private const bool DEBUG = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9316531db81604347bb41857c8e7ea43
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 4338140da312a4c6fb1614cd4725933a
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
using UnityEditor;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This class holds the store's configurations.
|
|
||||||
/// </summary>
|
|
||||||
public class ISAdQualityEditorScript : ScriptableObject
|
|
||||||
{
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
|
|
||||||
static string currentModuleVersion = "7.13.0";
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5e0d3ac0c6a1f4767826e6a49833d7c3
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,208 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
using UnityEditor;
|
|
||||||
#endif
|
|
||||||
using System.IO;
|
|
||||||
using System.Xml;
|
|
||||||
using System.Text;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class IronSourceAdQualityManifestTools
|
|
||||||
{
|
|
||||||
static string outputFile = Path.Combine(Application.dataPath, "Plugins/Android/AndroidManifest.xml");
|
|
||||||
public static void GenerateManifest()
|
|
||||||
{
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
// only copy over a fresh copy of the AndroidManifest if one does not exist
|
|
||||||
if (!File.Exists(outputFile))
|
|
||||||
{
|
|
||||||
#if UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1
|
|
||||||
var inputFile = Path.Combine(EditorApplication.applicationContentsPath, "PlaybackEngines/androidplayer/AndroidManifest.xml");
|
|
||||||
#elif UNITY_5_2
|
|
||||||
var inputFile = Path.Combine(EditorApplication.applicationContentsPath, "PlaybackEngines/androidplayer/Apk/AndroidManifest.xml");
|
|
||||||
#else
|
|
||||||
var inputFile = Path.Combine(EditorApplication.applicationPath, "../PlaybackEngines/androidplayer/Apk/AndroidManifest.xml");
|
|
||||||
#endif
|
|
||||||
File.Copy(inputFile, outputFile);
|
|
||||||
}
|
|
||||||
UpdateManifest();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string _namespace = "";
|
|
||||||
private static XmlDocument _document = null;
|
|
||||||
private static XmlNode _manifestNode = null;
|
|
||||||
private static XmlNode _applicationNode = null;
|
|
||||||
|
|
||||||
private static void LoadManifest(){
|
|
||||||
_document = new XmlDocument();
|
|
||||||
_document.Load(outputFile);
|
|
||||||
|
|
||||||
if (_document == null)
|
|
||||||
{
|
|
||||||
Debug.LogError("Couldn't load " + outputFile);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_manifestNode = FindChildNode(_document, "manifest");
|
|
||||||
_namespace = _manifestNode.GetNamespaceOfPrefix("android");
|
|
||||||
_applicationNode = FindChildNode(_manifestNode, "application");
|
|
||||||
|
|
||||||
if (_applicationNode == null) {
|
|
||||||
Debug.LogError("Error parsing " + outputFile);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SaveManifest(){
|
|
||||||
_document.Save(outputFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void UpdateManifest() {
|
|
||||||
LoadManifest ();
|
|
||||||
|
|
||||||
SetPermission("android.permission.INTERNET");
|
|
||||||
SetPermission("android.permission.ACCESS_NETWORK_STATE");
|
|
||||||
|
|
||||||
SaveManifest ();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddActivity(string activityName, Dictionary<string, string> attributes) {
|
|
||||||
AppendApplicationElement("activity", activityName, attributes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveActivity(string activityName) {
|
|
||||||
RemoveApplicationElement("activity", activityName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetPermission(string permissionName) {
|
|
||||||
PrependManifestElement("uses-permission", permissionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemovePermission(string permissionName) {
|
|
||||||
RemoveManifestElement("uses-permission", permissionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement AppendApplicationElement(string tagName, string name, Dictionary<string, string> attributes) {
|
|
||||||
return AppendElementIfMissing(tagName, name, attributes, _applicationNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveApplicationElement(string tagName, string name) {
|
|
||||||
RemoveElement(tagName, name, _applicationNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement PrependManifestElement(string tagName, string name) {
|
|
||||||
return PrependElementIfMissing(tagName, name, null, _manifestNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveManifestElement(string tagName, string name) {
|
|
||||||
RemoveElement(tagName, name, _manifestNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement AddMetaDataTag(string mdName, string mdValue) {
|
|
||||||
return AppendApplicationElement("meta-data", mdName, new Dictionary<string, string>() {
|
|
||||||
{ "value", mdValue }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement AppendElementIfMissing(string tagName, string name, Dictionary<string, string> otherAttributes, XmlNode parent) {
|
|
||||||
XmlElement e = null;
|
|
||||||
if (!string.IsNullOrEmpty(name)) {
|
|
||||||
e = FindElementWithTagAndName(tagName, name, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e == null)
|
|
||||||
{
|
|
||||||
e = _document.CreateElement(tagName);
|
|
||||||
if (!string.IsNullOrEmpty(name)) {
|
|
||||||
e.SetAttribute("name", _namespace, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
parent.AppendChild(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (otherAttributes != null) {
|
|
||||||
foreach(string key in otherAttributes.Keys) {
|
|
||||||
e.SetAttribute(key, _namespace, otherAttributes[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement PrependElementIfMissing(string tagName, string name, Dictionary<string, string> otherAttributes, XmlNode parent) {
|
|
||||||
XmlElement e = null;
|
|
||||||
if (!string.IsNullOrEmpty(name)) {
|
|
||||||
e = FindElementWithTagAndName(tagName, name, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e == null)
|
|
||||||
{
|
|
||||||
e = _document.CreateElement(tagName);
|
|
||||||
if (!string.IsNullOrEmpty(name)) {
|
|
||||||
e.SetAttribute("name", _namespace, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
parent.PrependChild(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (otherAttributes != null) {
|
|
||||||
foreach(string key in otherAttributes.Keys) {
|
|
||||||
e.SetAttribute(key, _namespace, otherAttributes[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveElement(string tagName, string name, XmlNode parent) {
|
|
||||||
XmlElement e = FindElementWithTagAndName(tagName, name, parent);
|
|
||||||
if (e != null)
|
|
||||||
{
|
|
||||||
parent.RemoveChild(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlNode FindChildNode(XmlNode parent, string tagName)
|
|
||||||
{
|
|
||||||
XmlNode curr = parent.FirstChild;
|
|
||||||
while (curr != null)
|
|
||||||
{
|
|
||||||
if (curr.Name.Equals(tagName))
|
|
||||||
{
|
|
||||||
return curr;
|
|
||||||
}
|
|
||||||
curr = curr.NextSibling;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement FindChildElement(XmlNode parent, string tagName)
|
|
||||||
{
|
|
||||||
XmlNode curr = parent.FirstChild;
|
|
||||||
while (curr != null)
|
|
||||||
{
|
|
||||||
if (curr.Name.Equals(tagName))
|
|
||||||
{
|
|
||||||
return curr as XmlElement;
|
|
||||||
}
|
|
||||||
curr = curr.NextSibling;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static XmlElement FindElementWithTagAndName(string tagName, string name, XmlNode parent)
|
|
||||||
{
|
|
||||||
var curr = parent.FirstChild;
|
|
||||||
while (curr != null)
|
|
||||||
{
|
|
||||||
if (curr.Name.Equals(tagName) && curr is XmlElement && ((XmlElement)curr).GetAttribute("name", _namespace) == name)
|
|
||||||
{
|
|
||||||
return curr as XmlElement;
|
|
||||||
}
|
|
||||||
curr = curr.NextSibling;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 62494cb2550224675873046db8776006
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
// Copyright (c) 2012 Calvin Rien
|
|
||||||
// http://the.darktable.com
|
|
||||||
//
|
|
||||||
// This software is provided 'as-is', without any express or implied warranty. In
|
|
||||||
// no event will the authors be held liable for any damages arising from the use
|
|
||||||
// of this software.
|
|
||||||
//
|
|
||||||
// Permission is granted to anyone to use this software for any purpose,
|
|
||||||
// including commercial applications, and to alter it and redistribute it freely,
|
|
||||||
// subject to the following restrictions:
|
|
||||||
//
|
|
||||||
// 1. The origin of this software must not be misrepresented; you must not claim
|
|
||||||
// that you wrote the original software. If you use this software in a product,
|
|
||||||
// an acknowledgment in the product documentation would be appreciated but is not
|
|
||||||
// required.
|
|
||||||
//
|
|
||||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
// misrepresented as being the original software.
|
|
||||||
//
|
|
||||||
// 3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
using UnityEngine;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public sealed class ObjectKvp : UnityNameValuePair<string> {
|
|
||||||
public string value = null;
|
|
||||||
|
|
||||||
override public string Value {
|
|
||||||
get { return this.value; }
|
|
||||||
set { this.value = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public ObjectKvp(string key, string value) : base(key, value) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public class ObjectDictionary : UnityDictionary<string> {
|
|
||||||
public List<ObjectKvp> values;
|
|
||||||
|
|
||||||
override protected List<UnityKeyValuePair<string, string>> KeyValuePairs {
|
|
||||||
get {
|
|
||||||
if (values == null) {
|
|
||||||
values = new List<ObjectKvp>();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<UnityKeyValuePair<string, string>> valuesConverted = new List<UnityKeyValuePair<string, string>>();
|
|
||||||
foreach (ObjectKvp okvp in values)
|
|
||||||
{
|
|
||||||
valuesConverted.Add(ConvertOkvp(okvp));
|
|
||||||
}
|
|
||||||
|
|
||||||
return valuesConverted;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if (value == null) {
|
|
||||||
values = new List<ObjectKvp>();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach(UnityKeyValuePair<string,string> ukvp in value)
|
|
||||||
{
|
|
||||||
values.Add(ConvertUkvp(ukvp));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public new ObjectKvp ConvertUkvp(UnityKeyValuePair<string,string> ukvp)
|
|
||||||
{
|
|
||||||
return new ObjectKvp(ukvp.Key, ukvp.Value);
|
|
||||||
|
|
||||||
}
|
|
||||||
public UnityKeyValuePair<string, string> ConvertOkvp(ObjectKvp okvp)
|
|
||||||
{
|
|
||||||
return new UnityKeyValuePair<string, string>(okvp.Key,okvp.Value);
|
|
||||||
}
|
|
||||||
override protected void SetKeyValuePair(string k, string v) {
|
|
||||||
var index = values.FindIndex(x => {
|
|
||||||
return x.Key == k;});
|
|
||||||
|
|
||||||
if (index != -1) {
|
|
||||||
if (v == null) {
|
|
||||||
values.RemoveAt(index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
values[index] = new ObjectKvp(k, v);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
values.Add(new ObjectKvp(k, v));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3d242fa04ee9a4fc79ae19ff5a74303d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,317 +0,0 @@
|
|||||||
// Copyright (c) 2012 Calvin Rien
|
|
||||||
// http://the.darktable.com
|
|
||||||
//
|
|
||||||
// This software is provided 'as-is', without any express or implied warranty. In
|
|
||||||
// no event will the authors be held liable for any damages arising from the use
|
|
||||||
// of this software.
|
|
||||||
//
|
|
||||||
// Permission is granted to anyone to use this software for any purpose,
|
|
||||||
// including commercial applications, and to alter it and redistribute it freely,
|
|
||||||
// subject to the following restrictions:
|
|
||||||
//
|
|
||||||
// 1. The origin of this software must not be misrepresented; you must not claim
|
|
||||||
// that you wrote the original software. If you use this software in a product,
|
|
||||||
// an acknowledgment in the product documentation would be appreciated but is not
|
|
||||||
// required.
|
|
||||||
//
|
|
||||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
// misrepresented as being the original software.
|
|
||||||
//
|
|
||||||
// 3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class UnityNameValuePair<V> : UnityKeyValuePair<string, V> {
|
|
||||||
public string name = null;
|
|
||||||
|
|
||||||
override public string Key {
|
|
||||||
get { return name; }
|
|
||||||
set { name = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnityNameValuePair() : base() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnityNameValuePair(string key, V value) : base(key, value) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UnityKeyValuePair<K, V> {
|
|
||||||
virtual public K Key {
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual public V Value {
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnityKeyValuePair() {
|
|
||||||
Key = default(K);
|
|
||||||
Value = default(V);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnityKeyValuePair(K key, V value) {
|
|
||||||
Key = key;
|
|
||||||
Value = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class UnityDictionary<K,V> : IDictionary<K,V> {
|
|
||||||
abstract protected List<UnityKeyValuePair<K,V>> KeyValuePairs {
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void SetKeyValuePair(K k, V v); /* {
|
|
||||||
var index = Collection.FindIndex(x => {return x.Key == k;});
|
|
||||||
|
|
||||||
if (index != -1) {
|
|
||||||
if (v == null) {
|
|
||||||
Collection.RemoveAt(index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
values[index] = new UnityKeyValuePair(key, value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
values.Add(new UnityKeyValuePair(key, value));
|
|
||||||
} */
|
|
||||||
|
|
||||||
virtual public V this[K key] {
|
|
||||||
get {
|
|
||||||
var result = KeyValuePairs.Find(x => {
|
|
||||||
return x.Key.Equals(key);});
|
|
||||||
|
|
||||||
if (result == null) {
|
|
||||||
return default(V);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.Value;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if (key == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetKeyValuePair(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region IDictionary interface
|
|
||||||
|
|
||||||
public void Add(K key, V value) {
|
|
||||||
this[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(KeyValuePair<K, V> kvp) {
|
|
||||||
this[kvp.Key] = kvp.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool TryGetValue(K key, out V value) {
|
|
||||||
if (!this.ContainsKey(key)) {
|
|
||||||
value = default(V);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = this[key];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Remove(KeyValuePair<K, V> item) {
|
|
||||||
return Remove(item.Key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Remove(K key) {
|
|
||||||
var list = KeyValuePairs;
|
|
||||||
|
|
||||||
var index = list.FindIndex(x => {
|
|
||||||
return x.Key.Equals(key);});
|
|
||||||
|
|
||||||
if (index == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
list.RemoveAt(index);
|
|
||||||
|
|
||||||
KeyValuePairs = list;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clear() {
|
|
||||||
var list = KeyValuePairs;
|
|
||||||
|
|
||||||
list.Clear();
|
|
||||||
|
|
||||||
KeyValuePairs = list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ContainsKey(K key) {
|
|
||||||
return KeyValuePairs.FindIndex(x => {
|
|
||||||
return x.Key.Equals(key);}) != -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Contains(KeyValuePair<K, V> kvp) {
|
|
||||||
return this[kvp.Key].Equals(kvp.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Count {
|
|
||||||
get {
|
|
||||||
return KeyValuePairs.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CopyTo(KeyValuePair<K, V>[] array, int index) {
|
|
||||||
List<KeyValuePair<K, V>> copy = new List<KeyValuePair<K, V>>();
|
|
||||||
for (int i = 0; i < KeyValuePairs.Count;i++)
|
|
||||||
{
|
|
||||||
copy[i] = ConvertUkvp(KeyValuePairs[i]);
|
|
||||||
}
|
|
||||||
copy.CopyTo(array, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeyValuePair<K,V> ConvertUkvp(UnityKeyValuePair<K, V> ukvp)
|
|
||||||
{
|
|
||||||
return new KeyValuePair<K,V>(ukvp.Key,(V)ukvp.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator() {
|
|
||||||
return GetEnumerator() as IEnumerator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerator<KeyValuePair<K, V>> GetEnumerator() {
|
|
||||||
return new UnityDictionaryEnumerator(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICollection<K> Keys {
|
|
||||||
get {
|
|
||||||
ICollection<K> keys = new List<K>();
|
|
||||||
foreach(UnityKeyValuePair<K,V> ukvp in KeyValuePairs)
|
|
||||||
{
|
|
||||||
keys.Add(ukvp.Key);
|
|
||||||
}
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICollection<V> Values {
|
|
||||||
get {
|
|
||||||
ICollection<V> values = new List<V>();
|
|
||||||
foreach (UnityKeyValuePair<K, V> ukvp in KeyValuePairs)
|
|
||||||
{
|
|
||||||
values.Add(ukvp.Value);
|
|
||||||
}
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICollection<KeyValuePair<K, V>> Items {
|
|
||||||
get {
|
|
||||||
List<KeyValuePair<K,V>> items = new List<KeyValuePair<K,V>>();
|
|
||||||
foreach(UnityKeyValuePair<K,V> value in KeyValuePairs)
|
|
||||||
{
|
|
||||||
items.Add(new KeyValuePair<K, V>(value.Key, value.Value));
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public V SyncRoot {
|
|
||||||
get { return default(V); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsFixedSize {
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsReadOnly {
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsSynchronized {
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
internal sealed class UnityDictionaryEnumerator : IEnumerator<KeyValuePair<K, V>> {
|
|
||||||
// A copy of the SimpleDictionary T's key/value pairs.
|
|
||||||
KeyValuePair<K, V>[] items;
|
|
||||||
int index = -1;
|
|
||||||
|
|
||||||
internal UnityDictionaryEnumerator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
internal UnityDictionaryEnumerator(UnityDictionary<K,V> ud) {
|
|
||||||
// Make a copy of the dictionary entries currently in the SimpleDictionary T.
|
|
||||||
items = new KeyValuePair<K, V>[ud.Count];
|
|
||||||
|
|
||||||
ud.CopyTo(items, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
object IEnumerator.Current {
|
|
||||||
get { return Current; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeyValuePair<K, V> Current {
|
|
||||||
get {
|
|
||||||
ValidateIndex();
|
|
||||||
return items[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the current dictionary entry.
|
|
||||||
public KeyValuePair<K, V> Entry {
|
|
||||||
get { return (KeyValuePair<K, V>) Current; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose() {
|
|
||||||
index = -1;
|
|
||||||
items = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the key of the current item.
|
|
||||||
public K Key {
|
|
||||||
get {
|
|
||||||
ValidateIndex();
|
|
||||||
return items[index].Key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the value of the current item.
|
|
||||||
public V Value {
|
|
||||||
get {
|
|
||||||
ValidateIndex();
|
|
||||||
return items[index].Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Advance to the next item.
|
|
||||||
public bool MoveNext() {
|
|
||||||
if (index < items.Length - 1) {
|
|
||||||
index++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate the enumeration index and throw an exception if the index is out of range.
|
|
||||||
private void ValidateIndex() {
|
|
||||||
if (index < 0 || index >= items.Length) {
|
|
||||||
throw new System.InvalidOperationException("Enumerator is before or after the collection.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the index to restart the enumeration.
|
|
||||||
public void Reset() {
|
|
||||||
index = -1;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class UnityDictionary<V> : UnityDictionary<string, V> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2b3aeeb1755c04e6f80ffb1e982537f5
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 221bee1d14f6b4afaa10e6a0915411ba
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public abstract class BaseBehaviour : MonoBehaviour
|
|
||||||
{
|
|
||||||
private Transform cashedTransform;
|
|
||||||
public Transform CachedTransform
|
|
||||||
{
|
|
||||||
get { return cashedTransform ?? (cashedTransform = transform); }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void Awake() { }
|
|
||||||
|
|
||||||
protected virtual void Start() { }
|
|
||||||
|
|
||||||
protected virtual void OnDestroy() { }
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 80937c3c4170b4ff59501e589794ddca
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#pragma warning disable 618
|
|
||||||
/// <summary>
|
|
||||||
/// A Singleton for use when your component needs to be accessed at any given (run)time and can be automagically created on demand.
|
|
||||||
/// To use, override <see cref="UnitySingleton.InitAfterRegisteringAsSingleInstance"/> and write your initialization logic.
|
|
||||||
/// If your singleton shouldn't be destroyed when moving between scenes (<see cref="UnityEngine.Object.DontDestroyOnLoad"/>),
|
|
||||||
/// Override <see cref="UnitySingleton.DontDestroySingleton"/> and return true.
|
|
||||||
/// Like this:
|
|
||||||
///
|
|
||||||
/// protected override bool DontDestroySingleton
|
|
||||||
/// {
|
|
||||||
/// get { return true; }
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public abstract class CodeGeneratedSingleton : UnitySingleton
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1a0aa54a1a93447f6a59f4a1534ecbe7
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#pragma warning disable 618
|
|
||||||
/// <summary>
|
|
||||||
/// A Singleton for use when your component needs to be blaced in a scene on design time.
|
|
||||||
/// To use, override <see cref="UnitySingleton.InitAfterRegisteringAsSingleInstance"/> and write your initialization logic.
|
|
||||||
/// If your singleton shouldn't be destroyed when moving between scenes (<see cref="UnityEngine.Object.DontDestroyOnLoad"/>),
|
|
||||||
/// Override <see cref="UnitySingleton.DontDestroySingleton"/> and return true.
|
|
||||||
/// Like this:
|
|
||||||
///
|
|
||||||
/// protected override bool DontDestroySingleton
|
|
||||||
/// {
|
|
||||||
/// get { return true; }
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public abstract class SceneSingleton : UnitySingleton
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2b330e7d866904612b12283dfae41b84
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,271 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public abstract class UnitySingleton : BaseBehaviour
|
|
||||||
{
|
|
||||||
#region Private Variables
|
|
||||||
private static readonly Dictionary<Type, UnitySingleton> instances = new Dictionary<Type, UnitySingleton>();
|
|
||||||
private static readonly Dictionary<Type, Dictionary<MonoBehaviour, Action<UnitySingleton>>> instanceListeners =
|
|
||||||
new Dictionary<Type, Dictionary<MonoBehaviour, Action<UnitySingleton>>>();
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private Properties
|
|
||||||
protected bool IsInstanceReady { get; private set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private Functions
|
|
||||||
private void RegisterAsSingleInstanceAndInit()
|
|
||||||
{
|
|
||||||
instances.Add(GetType(), this);
|
|
||||||
InnerInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InnerInit()
|
|
||||||
{
|
|
||||||
InitAfterRegisteringAsSingleInstance();
|
|
||||||
|
|
||||||
if (DontDestroySingleton)
|
|
||||||
{
|
|
||||||
DontDestroyOnLoad(gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static S GetOrCreateInstanceOnGameObject<S>(Type type) where S : CodeGeneratedSingleton
|
|
||||||
{
|
|
||||||
S instance = null;
|
|
||||||
|
|
||||||
var prefab = Resources.Load<GameObject>(type.Name);
|
|
||||||
|
|
||||||
if (prefab)
|
|
||||||
{
|
|
||||||
var instantiatedObject = Instantiate(prefab)
|
|
||||||
#if !UNITY_5
|
|
||||||
as GameObject
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
if (!instantiatedObject)
|
|
||||||
{
|
|
||||||
throw new Exception("Failed to instantiate prefab: " + type.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
instance = instantiatedObject.GetComponent<S>();
|
|
||||||
|
|
||||||
if (!instance)
|
|
||||||
{
|
|
||||||
instance = instantiatedObject.AddComponent<S>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!instance)
|
|
||||||
{
|
|
||||||
instance = new GameObject(type.Name).AddComponent<S>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NotifyInstanceListeners()
|
|
||||||
{
|
|
||||||
var type = GetType();
|
|
||||||
|
|
||||||
// Checks if there are any registered listeners for this type of singleton
|
|
||||||
if (instanceListeners.ContainsKey(type))
|
|
||||||
{
|
|
||||||
foreach (var actionWithSender in instanceListeners[type].ToArray())
|
|
||||||
{
|
|
||||||
// If the sender is alive and has listeners - run its actions
|
|
||||||
if (actionWithSender.Key && actionWithSender.Value != null)
|
|
||||||
{
|
|
||||||
actionWithSender.Value(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Either way - remove the sender + action from the collection
|
|
||||||
instanceListeners[type].Remove(actionWithSender.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void DeclareAsReady()
|
|
||||||
{
|
|
||||||
IsInstanceReady = true;
|
|
||||||
|
|
||||||
NotifyInstanceListeners();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Public Functions
|
|
||||||
protected static S GetSynchronousCodeGeneratedInstance<S>() where S : CodeGeneratedSingleton
|
|
||||||
{
|
|
||||||
var type = typeof(S);
|
|
||||||
|
|
||||||
S instance;
|
|
||||||
|
|
||||||
// An instance of this type does not exist
|
|
||||||
if (!instances.ContainsKey(type))
|
|
||||||
{
|
|
||||||
// Try to find an existing one in the scene
|
|
||||||
instance = FindObjectOfType<S>();
|
|
||||||
|
|
||||||
if (!instance)
|
|
||||||
{
|
|
||||||
// Creating a new one
|
|
||||||
instance = GetOrCreateInstanceOnGameObject<S>(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
instance.RegisterAsSingleInstanceAndInit();
|
|
||||||
}
|
|
||||||
// An instance of this type already exists
|
|
||||||
else
|
|
||||||
{
|
|
||||||
instance = instances[type] as S;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!instance)
|
|
||||||
{
|
|
||||||
throw new Exception("No instance was created: " + type.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
instance.IsInstanceReady = true;
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DoWithCodeGeneratedInstance<C>(MonoBehaviour sender, Action<C> whatToDoWithInstanceWhenItsReady) where C : CodeGeneratedSingleton
|
|
||||||
{
|
|
||||||
// Make sure an instance exists (creating it if it doesn't)
|
|
||||||
GetSynchronousCodeGeneratedInstance<C>();
|
|
||||||
|
|
||||||
// Do the action with the existing instance or wait for it to be ready
|
|
||||||
DoWithExistingInstance(sender, whatToDoWithInstanceWhenItsReady);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DoWithSceneInstance<S>(MonoBehaviour sender, Action<S> whatToDoWithInstanceWhenItsReady) where S : SceneSingleton
|
|
||||||
{
|
|
||||||
DoWithExistingInstance(sender, whatToDoWithInstanceWhenItsReady);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs an action on an existing instance if and when it exists and ready
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="S"></typeparam>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="whatToDoWithInstanceWhenItsReady"></param>
|
|
||||||
private static void DoWithExistingInstance<S>(MonoBehaviour sender, Action<S> whatToDoWithInstanceWhenItsReady) where S : UnitySingleton
|
|
||||||
{
|
|
||||||
var type = typeof(S);
|
|
||||||
|
|
||||||
var isInstanceNotExistOrReady = true;
|
|
||||||
|
|
||||||
// An instance of this type exists
|
|
||||||
if (instances.ContainsKey(type))
|
|
||||||
{
|
|
||||||
var instance = instances[type] as S;
|
|
||||||
|
|
||||||
if (instance && instance.IsInstanceReady)
|
|
||||||
{
|
|
||||||
isInstanceNotExistOrReady = false;
|
|
||||||
|
|
||||||
// Call the action with the existing instance
|
|
||||||
whatToDoWithInstanceWhenItsReady(instance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// An instance of this type does not exist, we have to wait for it to initialize
|
|
||||||
if (isInstanceNotExistOrReady)
|
|
||||||
{
|
|
||||||
if (!instanceListeners.ContainsKey(type))
|
|
||||||
{
|
|
||||||
instanceListeners.Add(type, new Dictionary<MonoBehaviour, Action<UnitySingleton>>());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!instanceListeners[type].ContainsKey(sender))
|
|
||||||
{
|
|
||||||
instanceListeners[type].Add(sender, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
instanceListeners[type][sender] += singleton => whatToDoWithInstanceWhenItsReady(singleton as S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Unity Functions
|
|
||||||
protected sealed override void Start()
|
|
||||||
{
|
|
||||||
base.Start();
|
|
||||||
|
|
||||||
var type = GetType();
|
|
||||||
|
|
||||||
var needToDestroy = false;
|
|
||||||
|
|
||||||
// There's already an instance of my type
|
|
||||||
if (instances.ContainsKey(type))
|
|
||||||
{
|
|
||||||
// The existing instance is not this instance so we've got a conflict (There can only be one!)
|
|
||||||
if (instances[type] != this)
|
|
||||||
{
|
|
||||||
if (this is CodeGeneratedSingleton)
|
|
||||||
{
|
|
||||||
throw new Exception("There's already an instance for " + type.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this is SceneSingleton)
|
|
||||||
{
|
|
||||||
if (DontDestroySingleton)
|
|
||||||
{
|
|
||||||
// [this] is not the single instance (Singleton) so we actually DO need to destroy it
|
|
||||||
needToDestroy = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// There's no instance of my type and I'm a CodeGeneratedSingleton
|
|
||||||
// It should have been created via code so if I don't exist in the instance collection it means I was created on a scene
|
|
||||||
else if (this is CodeGeneratedSingleton)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException(string.Format("{0} is a {1} and needs to be created via code, and not placed on a scene!", type.Name, typeof(CodeGeneratedSingleton).Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needToDestroy)
|
|
||||||
{
|
|
||||||
Debug.LogWarning(string.Format("There's already a {0} instance on the current scene, there's no point in staying.. goodbye.. I'm gonna go now :(", type.Name));
|
|
||||||
|
|
||||||
Destroy(this);
|
|
||||||
}
|
|
||||||
else if (this is SceneSingleton)
|
|
||||||
{
|
|
||||||
RegisterAsSingleInstanceAndInit();
|
|
||||||
|
|
||||||
SetReadyAndNotifyAfterRegistering();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override this if the singleton won't be ready immediately after registering as single instance
|
|
||||||
/// </summary>
|
|
||||||
protected virtual void SetReadyAndNotifyAfterRegistering()
|
|
||||||
{
|
|
||||||
DeclareAsReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDestroy()
|
|
||||||
{
|
|
||||||
base.OnDestroy();
|
|
||||||
|
|
||||||
var type = GetType();
|
|
||||||
|
|
||||||
// There's already an instance of my type but it's me - remove me
|
|
||||||
if (instances.ContainsKey(type) && instances[type] == this)
|
|
||||||
{
|
|
||||||
instances.Remove(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Virtuals
|
|
||||||
protected virtual void InitAfterRegisteringAsSingleInstance() { }
|
|
||||||
protected virtual bool DontDestroySingleton { get { return false; } }
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ac12af7b0ebf6409c935fad7857982be
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<androidPackages>
|
<androidPackages>
|
||||||
<androidPackage spec="com.applovin:applovin-sdk:11.4.4" />
|
<androidPackage spec="com.applovin:applovin-sdk:11.10.1" />
|
||||||
</androidPackages>
|
</androidPackages>
|
||||||
<iosPods>
|
<iosPods>
|
||||||
<iosPod name="AppLovinSDK" version="11.4.3" />
|
<iosPod name="AppLovinSDK" version="11.10.1" />
|
||||||
</iosPods>
|
</iosPods>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -16,6 +16,7 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
|||||||
|
|
||||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)bannerPosition;
|
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)bannerPosition;
|
||||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||||
|
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode;
|
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode;
|
||||||
- (void)setBannerPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (void)setBannerPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)startBannerAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (void)startBannerAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
@ -34,6 +35,7 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
|||||||
|
|
||||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)mrecPosition;
|
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)mrecPosition;
|
||||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||||
|
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)startMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (void)startMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer;
|
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer;
|
||||||
@ -61,6 +63,12 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
|||||||
- (void)setInterstitialExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
- (void)setInterstitialExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||||
- (void)setInterstitialLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
- (void)setInterstitialLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||||
|
|
||||||
|
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
|
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
|
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||||
|
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||||
|
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||||
|
|
||||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (BOOL)isRewardedAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
- (BOOL)isRewardedAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||||
- (void)showRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
- (void)showRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||||
@ -85,8 +93,11 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
|||||||
// User Service
|
// User Service
|
||||||
- (void)didDismissUserConsentDialog;
|
- (void)didDismissUserConsentDialog;
|
||||||
|
|
||||||
|
// Consent Flow
|
||||||
|
- (void)startConsentFlow;
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
+ (NSString *)serializeParameters:(NSDictionary<NSString *, NSString *> *)dict;
|
+ (NSString *)serializeParameters:(NSDictionary<NSString *, id> *)dict;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of @c MAUnityAdManager if needed and returns the singleton instance.
|
* Creates an instance of @c MAUnityAdManager if needed and returns the singleton instance.
|
||||||
|
|||||||
@ -3,7 +3,6 @@ guid: 4209563f82b8a4f7dabf03705ab761c6
|
|||||||
labels:
|
labels:
|
||||||
- al_max
|
- al_max
|
||||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h
|
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h
|
||||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityAdManager.h
|
|
||||||
PluginImporter:
|
PluginImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@ -16,7 +15,7 @@ PluginImporter:
|
|||||||
validateReferences: 1
|
validateReferences: 1
|
||||||
platformData:
|
platformData:
|
||||||
- first:
|
- first:
|
||||||
: Any
|
'': Any
|
||||||
second:
|
second:
|
||||||
enabled: 0
|
enabled: 0
|
||||||
settings:
|
settings:
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#import "MAUnityAdManager.h"
|
#import "MAUnityAdManager.h"
|
||||||
|
|
||||||
#define VERSION @"5.4.5"
|
#define VERSION @"5.10.1"
|
||||||
|
|
||||||
#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
|
#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
|
||||||
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
|
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
|
||||||
@ -42,13 +42,14 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, ALVariableServiceDelegate>
|
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, MAAdReviewDelegate, ALVariableServiceDelegate>
|
||||||
|
|
||||||
// Parent Fields
|
// Parent Fields
|
||||||
@property (nonatomic, weak) ALSdk *sdk;
|
@property (nonatomic, weak) ALSdk *sdk;
|
||||||
|
|
||||||
// Fullscreen Ad Fields
|
// Fullscreen Ad Fields
|
||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAInterstitialAd *> *interstitials;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAInterstitialAd *> *interstitials;
|
||||||
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAAppOpenAd *> *appOpenAds;
|
||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedAd *> *rewardedAds;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedAd *> *rewardedAds;
|
||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedInterstitialAd *> *rewardedInterstitialAds;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedInterstitialAd *> *rewardedInterstitialAds;
|
||||||
|
|
||||||
@ -67,6 +68,7 @@ extern "C" {
|
|||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *adViewCustomDataToSetAfterCreate;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *adViewCustomDataToSetAfterCreate;
|
||||||
@property (nonatomic, strong) NSMutableArray<NSString *> *adUnitIdentifiersToShowAfterCreate;
|
@property (nonatomic, strong) NSMutableArray<NSString *> *adUnitIdentifiersToShowAfterCreate;
|
||||||
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAdaptiveBannerAdUnitIdentifiers;
|
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAdaptiveBannerAdUnitIdentifiers;
|
||||||
|
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAutoRefreshAdViewAdUnitIdentifiers;
|
||||||
@property (nonatomic, strong) UIView *safeAreaBackground;
|
@property (nonatomic, strong) UIView *safeAreaBackground;
|
||||||
@property (nonatomic, strong, nullable) UIColor *publisherBannerBackgroundColor;
|
@property (nonatomic, strong, nullable) UIColor *publisherBannerBackgroundColor;
|
||||||
|
|
||||||
@ -107,6 +109,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
if ( self )
|
if ( self )
|
||||||
{
|
{
|
||||||
self.interstitials = [NSMutableDictionary dictionaryWithCapacity: 2];
|
self.interstitials = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||||
|
self.appOpenAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||||
self.rewardedAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
self.rewardedAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||||
self.rewardedInterstitialAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
self.rewardedInterstitialAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||||
self.adViews = [NSMutableDictionary dictionaryWithCapacity: 2];
|
self.adViews = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||||
@ -123,6 +126,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
self.adViewCustomDataToSetAfterCreate = [NSMutableDictionary dictionaryWithCapacity: 1];
|
self.adViewCustomDataToSetAfterCreate = [NSMutableDictionary dictionaryWithCapacity: 1];
|
||||||
self.adUnitIdentifiersToShowAfterCreate = [NSMutableArray arrayWithCapacity: 2];
|
self.adUnitIdentifiersToShowAfterCreate = [NSMutableArray arrayWithCapacity: 2];
|
||||||
self.disabledAdaptiveBannerAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
self.disabledAdaptiveBannerAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||||
|
self.disabledAutoRefreshAdViewAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||||
self.adInfoDict = [NSMutableDictionary dictionary];
|
self.adInfoDict = [NSMutableDictionary dictionary];
|
||||||
self.adInfoDictLock = [[NSObject alloc] init];
|
self.adInfoDictLock = [[NSObject alloc] init];
|
||||||
|
|
||||||
@ -172,7 +176,15 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
backgroundCallback = unityBackgroundCallback;
|
backgroundCallback = unityBackgroundCallback;
|
||||||
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
||||||
NSString *sdkKey = infoDict[@"AppLovinSdkKey"];
|
NSString *sdkKey = infoDict[@"AppLovinSdkKey"];
|
||||||
self.sdk = [ALSdk sharedWithKey: sdkKey settings: [self generateSDKSettingsForAdUnitIdentifiers: serializedAdUnitIdentifiers metaData: serializedMetaData]];
|
if ( [sdkKey al_isValidString] )
|
||||||
|
{
|
||||||
|
self.sdk = [ALSdk sharedWithKey: sdkKey settings: [self generateSDKSettingsForAdUnitIdentifiers: serializedAdUnitIdentifiers metaData: serializedMetaData]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.sdk = [ALSdk sharedWithSettings:[self generateSDKSettingsForAdUnitIdentifiers:serializedAdUnitIdentifiers metaData:serializedMetaData]];
|
||||||
|
}
|
||||||
|
|
||||||
self.sdk.variableService.delegate = self;
|
self.sdk.variableService.delegate = self;
|
||||||
[self.sdk setPluginVersion: [@"Max-Unity-" stringByAppendingString: VERSION]];
|
[self.sdk setPluginVersion: [@"Max-Unity-" stringByAppendingString: VERSION]];
|
||||||
self.sdk.mediationProvider = @"max";
|
self.sdk.mediationProvider = @"max";
|
||||||
@ -187,7 +199,8 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
@"consentDialogState" : consentDialogStateStr,
|
@"consentDialogState" : consentDialogStateStr,
|
||||||
@"countryCode" : configuration.countryCode,
|
@"countryCode" : configuration.countryCode,
|
||||||
@"appTrackingStatus" : appTrackingStatus,
|
@"appTrackingStatus" : appTrackingStatus,
|
||||||
@"isSuccessfullyInitialized" : ([self.sdk isInitialized] ? @"true" : @"false")}];
|
@"isSuccessfullyInitialized" : @([self.sdk isInitialized]),
|
||||||
|
@"isTestModeEnabled" : @([configuration isTestModeEnabled])}];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
return self.sdk;
|
return self.sdk;
|
||||||
@ -205,6 +218,11 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
|
{
|
||||||
|
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier]];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode
|
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode
|
||||||
{
|
{
|
||||||
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] hexColorCode: hexColorCode];
|
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] hexColorCode: hexColorCode];
|
||||||
@ -292,6 +310,11 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
|
{
|
||||||
|
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
{
|
{
|
||||||
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||||
@ -302,9 +325,9 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[self startAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
[self startAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer
|
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
{
|
{
|
||||||
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifer adFormat: MAAdFormat.mrec];
|
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateMRecPosition:(NSString *)mrecPosition forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
- (void)updateMRecPosition:(NSString *)mrecPosition forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
@ -427,6 +450,38 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[interstitial setLocalExtraParameterForKey: key value: value];
|
[interstitial setLocalExtraParameterForKey: key value: value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - App Open Ads
|
||||||
|
|
||||||
|
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
|
{
|
||||||
|
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||||
|
[appOpenAd loadAd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
|
{
|
||||||
|
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||||
|
return [appOpenAd isReady];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData
|
||||||
|
{
|
||||||
|
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||||
|
[appOpenAd showAdForPlacement: placement customData: customData];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value
|
||||||
|
{
|
||||||
|
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||||
|
[appOpenAd setExtraParameterForKey: key value: value];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value
|
||||||
|
{
|
||||||
|
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||||
|
[appOpenAd setLocalExtraParameterForKey: key value: value];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Rewarded
|
#pragma mark - Rewarded
|
||||||
|
|
||||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
@ -568,6 +623,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
}
|
}
|
||||||
|
|
||||||
networkResponseDict[@"credentials"] = response.credentials;
|
networkResponseDict[@"credentials"] = response.credentials;
|
||||||
|
networkResponseDict[@"isBidding"] = @([response isBidding]);
|
||||||
|
|
||||||
MAError *error = response.error;
|
MAError *error = response.error;
|
||||||
if ( error )
|
if ( error )
|
||||||
@ -636,6 +692,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialLoadedEvent";
|
name = @"OnInterstitialLoadedEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdLoadedEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdLoadedEvent";
|
name = @"OnRewardedAdLoadedEvent";
|
||||||
@ -688,6 +748,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialLoadFailedEvent";
|
name = @"OnInterstitialLoadFailedEvent";
|
||||||
}
|
}
|
||||||
|
else if ( self.appOpenAds[adUnitIdentifier] )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdLoadFailedEvent";
|
||||||
|
}
|
||||||
else if ( self.rewardedAds[adUnitIdentifier] )
|
else if ( self.rewardedAds[adUnitIdentifier] )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdLoadFailedEvent";
|
name = @"OnRewardedAdLoadFailedEvent";
|
||||||
@ -735,6 +799,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialClickedEvent";
|
name = @"OnInterstitialClickedEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdClickedEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdClickedEvent";
|
name = @"OnRewardedAdClickedEvent";
|
||||||
@ -768,6 +836,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialDisplayedEvent";
|
name = @"OnInterstitialDisplayedEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdDisplayedEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdDisplayedEvent";
|
name = @"OnRewardedAdDisplayedEvent";
|
||||||
@ -792,6 +864,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialAdFailedToDisplayEvent";
|
name = @"OnInterstitialAdFailedToDisplayEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdFailedToDisplayEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdFailedToDisplayEvent";
|
name = @"OnRewardedAdFailedToDisplayEvent";
|
||||||
@ -825,6 +901,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialHiddenEvent";
|
name = @"OnInterstitialHiddenEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdHiddenEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdHiddenEvent";
|
name = @"OnRewardedAdHiddenEvent";
|
||||||
@ -952,6 +1032,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
{
|
{
|
||||||
name = @"OnInterstitialAdRevenuePaidEvent";
|
name = @"OnInterstitialAdRevenuePaidEvent";
|
||||||
}
|
}
|
||||||
|
else if ( MAAdFormat.appOpen == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnAppOpenAdRevenuePaidEvent";
|
||||||
|
}
|
||||||
else if ( MAAdFormat.rewarded == adFormat )
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
{
|
{
|
||||||
name = @"OnRewardedAdRevenuePaidEvent";
|
name = @"OnRewardedAdRevenuePaidEvent";
|
||||||
@ -970,6 +1054,41 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]];
|
[MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad
|
||||||
|
{
|
||||||
|
NSString *name;
|
||||||
|
MAAdFormat *adFormat = ad.format;
|
||||||
|
if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnBannerAdReviewCreativeIdGeneratedEvent";
|
||||||
|
}
|
||||||
|
else if ( MAAdFormat.mrec == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnMRecAdReviewCreativeIdGeneratedEvent";
|
||||||
|
}
|
||||||
|
else if ( MAAdFormat.interstitial == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||||
|
}
|
||||||
|
else if ( MAAdFormat.rewarded == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnRewardedAdReviewCreativeIdGeneratedEvent";
|
||||||
|
}
|
||||||
|
else if ( MAAdFormat.rewardedInterstitial == adFormat )
|
||||||
|
{
|
||||||
|
name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self logInvalidAdFormat: adFormat];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
|
||||||
|
args[@"adReviewCreativeId"] = creativeIdentifier;
|
||||||
|
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSMutableDictionary<NSString *, id> *)defaultAdEventParametersForName:(NSString *)name withAd:(MAAd *)ad
|
- (NSMutableDictionary<NSString *, id> *)defaultAdEventParametersForName:(NSString *)name withAd:(MAAd *)ad
|
||||||
{
|
{
|
||||||
NSMutableDictionary<NSString *, id> *args = [[self adInfoForAd: ad] mutableCopy];
|
NSMutableDictionary<NSString *, id> *args = [[self adInfoForAd: ad] mutableCopy];
|
||||||
@ -985,6 +1104,11 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
max_unity_dispatch_on_main_thread(^{
|
max_unity_dispatch_on_main_thread(^{
|
||||||
[self log: @"Creating %@ with ad unit identifier \"%@\" and position: \"%@\"", adFormat, adUnitIdentifier, adViewPosition];
|
[self log: @"Creating %@ with ad unit identifier \"%@\" and position: \"%@\"", adFormat, adUnitIdentifier, adViewPosition];
|
||||||
|
|
||||||
|
if ( self.adViews[adUnitIdentifier] )
|
||||||
|
{
|
||||||
|
[self log: @"Trying to create a %@ that was already created. This will cause the current ad to be hidden.", adFormat.label];
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve ad view from the map
|
// Retrieve ad view from the map
|
||||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
||||||
adView.hidden = YES;
|
adView.hidden = YES;
|
||||||
@ -1040,6 +1164,12 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
|
|
||||||
[adView loadAd];
|
[adView loadAd];
|
||||||
|
|
||||||
|
// Disable auto-refresh if publisher sets it before creating the ad view.
|
||||||
|
if ( [self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||||
|
{
|
||||||
|
[adView stopAutoRefresh];
|
||||||
|
}
|
||||||
|
|
||||||
// The publisher may have requested to show the banner before it was created. Now that the banner is created, show it.
|
// The publisher may have requested to show the banner before it was created. Now that the banner is created, show it.
|
||||||
if ( [self.adUnitIdentifiersToShowAfterCreate containsObject: adUnitIdentifier] )
|
if ( [self.adUnitIdentifiersToShowAfterCreate containsObject: adUnitIdentifier] )
|
||||||
{
|
{
|
||||||
@ -1049,6 +1179,32 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)loadAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
||||||
|
{
|
||||||
|
max_unity_dispatch_on_main_thread(^{
|
||||||
|
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||||
|
if ( !adView )
|
||||||
|
{
|
||||||
|
[self log: @"%@ does not exist for ad unit identifier %@.", adFormat.label, adUnitIdentifier];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||||
|
{
|
||||||
|
if ( [adView isHidden] )
|
||||||
|
{
|
||||||
|
[self log: @"Auto-refresh will resume when the %@ ad is shown. You should only call LoadBanner() or LoadMRec() if you explicitly pause auto-refresh and want to manually load an ad.", adFormat.label];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[self log: @"You must stop auto-refresh if you want to manually load %@ ads.", adFormat.label];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[adView loadAd];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setAdViewBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat hexColorCode:(NSString *)hexColorCode
|
- (void)setAdViewBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat hexColorCode:(NSString *)hexColorCode
|
||||||
{
|
{
|
||||||
max_unity_dispatch_on_main_thread(^{
|
max_unity_dispatch_on_main_thread(^{
|
||||||
@ -1082,6 +1238,8 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
max_unity_dispatch_on_main_thread(^{
|
max_unity_dispatch_on_main_thread(^{
|
||||||
[self log: @"Starting %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
[self log: @"Starting %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||||
|
|
||||||
|
[self.disabledAutoRefreshAdViewAdUnitIdentifiers removeObject: adUnitIdentifier];
|
||||||
|
|
||||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||||
if ( !adView )
|
if ( !adView )
|
||||||
{
|
{
|
||||||
@ -1098,6 +1256,8 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
max_unity_dispatch_on_main_thread(^{
|
max_unity_dispatch_on_main_thread(^{
|
||||||
[self log: @"Stopping %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
[self log: @"Stopping %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||||
|
|
||||||
|
[self.disabledAutoRefreshAdViewAdUnitIdentifiers addObject: adUnitIdentifier];
|
||||||
|
|
||||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||||
if ( !adView )
|
if ( !adView )
|
||||||
{
|
{
|
||||||
@ -1272,7 +1432,10 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
self.safeAreaBackground.hidden = NO;
|
self.safeAreaBackground.hidden = NO;
|
||||||
view.hidden = NO;
|
view.hidden = NO;
|
||||||
|
|
||||||
[view startAutoRefresh];
|
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||||
|
{
|
||||||
|
[view startAutoRefresh];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1317,6 +1480,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
MAAdView *view = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
MAAdView *view = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||||
view.delegate = nil;
|
view.delegate = nil;
|
||||||
view.revenueDelegate = nil;
|
view.revenueDelegate = nil;
|
||||||
|
view.adReviewDelegate = nil;
|
||||||
|
|
||||||
[view removeFromSuperview];
|
[view removeFromSuperview];
|
||||||
|
|
||||||
@ -1355,6 +1519,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
result = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
result = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||||
result.delegate = self;
|
result.delegate = self;
|
||||||
result.revenueDelegate = self;
|
result.revenueDelegate = self;
|
||||||
|
result.adReviewDelegate = self;
|
||||||
|
|
||||||
self.interstitials[adUnitIdentifier] = result;
|
self.interstitials[adUnitIdentifier] = result;
|
||||||
}
|
}
|
||||||
@ -1362,6 +1527,21 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (MAAppOpenAd *)retrieveAppOpenAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
|
{
|
||||||
|
MAAppOpenAd *result = self.appOpenAds[adUnitIdentifier];
|
||||||
|
if ( !result )
|
||||||
|
{
|
||||||
|
result = [[MAAppOpenAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||||
|
result.delegate = self;
|
||||||
|
result.revenueDelegate = self;
|
||||||
|
|
||||||
|
self.appOpenAds[adUnitIdentifier] = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
- (MARewardedAd *)retrieveRewardedAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
- (MARewardedAd *)retrieveRewardedAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||||
{
|
{
|
||||||
MARewardedAd *result = self.rewardedAds[adUnitIdentifier];
|
MARewardedAd *result = self.rewardedAds[adUnitIdentifier];
|
||||||
@ -1370,6 +1550,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
result = [MARewardedAd sharedWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
result = [MARewardedAd sharedWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||||
result.delegate = self;
|
result.delegate = self;
|
||||||
result.revenueDelegate = self;
|
result.revenueDelegate = self;
|
||||||
|
result.adReviewDelegate = self;
|
||||||
|
|
||||||
self.rewardedAds[adUnitIdentifier] = result;
|
self.rewardedAds[adUnitIdentifier] = result;
|
||||||
}
|
}
|
||||||
@ -1385,6 +1566,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
result = [[MARewardedInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
result = [[MARewardedInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||||
result.delegate = self;
|
result.delegate = self;
|
||||||
result.revenueDelegate = self;
|
result.revenueDelegate = self;
|
||||||
|
result.adReviewDelegate = self;
|
||||||
|
|
||||||
self.rewardedInterstitialAds[adUnitIdentifier] = result;
|
self.rewardedInterstitialAds[adUnitIdentifier] = result;
|
||||||
}
|
}
|
||||||
@ -1408,6 +1590,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
result.translatesAutoresizingMaskIntoConstraints = NO;
|
result.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
result.delegate = self;
|
result.delegate = self;
|
||||||
result.revenueDelegate = self;
|
result.revenueDelegate = self;
|
||||||
|
result.adReviewDelegate = self;
|
||||||
|
|
||||||
self.adViews[adUnitIdentifier] = result;
|
self.adViews[adUnitIdentifier] = result;
|
||||||
self.adViewPositions[adUnitIdentifier] = adViewPosition;
|
self.adViewPositions[adUnitIdentifier] = adViewPosition;
|
||||||
@ -1415,6 +1598,9 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
|
|
||||||
UIViewController *rootViewController = [self unityViewController];
|
UIViewController *rootViewController = [self unityViewController];
|
||||||
[rootViewController.view addSubview: result];
|
[rootViewController.view addSubview: result];
|
||||||
|
|
||||||
|
// Allow pubs to pause auto-refresh immediately, by default.
|
||||||
|
[result setExtraParameterForKey: @"allow_pause_auto_refresh_immediately" value: @"true"];
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1829,6 +2015,25 @@ static ALUnityBackgroundCallback backgroundCallback;
|
|||||||
[MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}];
|
[MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - Consent Flow
|
||||||
|
|
||||||
|
- (void)startConsentFlow
|
||||||
|
{
|
||||||
|
[self.sdk.cfService scfWithCompletionHander:^(ALCFError * _Nullable error) {
|
||||||
|
|
||||||
|
NSMutableDictionary<NSString *, id> *args = [NSMutableDictionary dictionaryWithCapacity: 3];
|
||||||
|
args[@"name"] = @"OnSdkConsentFlowCompletedEvent";
|
||||||
|
|
||||||
|
if ( error )
|
||||||
|
{
|
||||||
|
args[@"code"] = @(error.code);
|
||||||
|
args[@"message"] = error.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Variable Service (Deprecated)
|
#pragma mark - Variable Service (Deprecated)
|
||||||
|
|
||||||
- (void)loadVariables
|
- (void)loadVariables
|
||||||
|
|||||||
@ -3,7 +3,6 @@ guid: 2973e70bd2fa74984b35aea07ae9db52
|
|||||||
labels:
|
labels:
|
||||||
- al_max
|
- al_max
|
||||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m
|
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m
|
||||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityAdManager.m
|
|
||||||
PluginImporter:
|
PluginImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@ -16,7 +15,7 @@ PluginImporter:
|
|||||||
validateReferences: 1
|
validateReferences: 1
|
||||||
platformData:
|
platformData:
|
||||||
- first:
|
- first:
|
||||||
: Any
|
'': Any
|
||||||
second:
|
second:
|
||||||
enabled: 0
|
enabled: 0
|
||||||
settings:
|
settings:
|
||||||
|
|||||||
@ -37,11 +37,20 @@ extern "C"
|
|||||||
static NSNumber *_creativeDebuggerEnabledToSet;
|
static NSNumber *_creativeDebuggerEnabledToSet;
|
||||||
static NSNumber *_exceptionHandlerEnabledToSet;
|
static NSNumber *_exceptionHandlerEnabledToSet;
|
||||||
static NSNumber *_locationCollectionEnabledToSet;
|
static NSNumber *_locationCollectionEnabledToSet;
|
||||||
|
static NSNumber *_targetingYearOfBirth;
|
||||||
|
static NSString *_targetingGender;
|
||||||
|
static NSNumber *_targetingMaximumAdContentRating;
|
||||||
|
static NSString *_targetingEmail;
|
||||||
|
static NSString *_targetingPhoneNumber;
|
||||||
|
static NSArray<NSString *> *_targetingKeywords;
|
||||||
|
static NSArray<NSString *> *_targetingInterests;
|
||||||
static NSMutableDictionary<NSString *, NSString *> *_extraParametersToSet = [NSMutableDictionary dictionary];
|
static NSMutableDictionary<NSString *, NSString *> *_extraParametersToSet = [NSMutableDictionary dictionary];
|
||||||
static NSObject *_extraParametersToSetLock = [[NSObject alloc] init];
|
static NSObject *_extraParametersToSetLock = [[NSObject alloc] init];
|
||||||
|
|
||||||
// Helper method to create C string copy
|
// Helper method to create C string copy
|
||||||
static const char * cStringCopy(NSString *string);
|
static const char * cStringCopy(NSString *string);
|
||||||
|
// Helper method to log errors
|
||||||
|
void logUninitializedAccessError(char *callingMethod);
|
||||||
|
|
||||||
bool isPluginInitialized()
|
bool isPluginInitialized()
|
||||||
{
|
{
|
||||||
@ -66,6 +75,42 @@ extern "C"
|
|||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALGender getAppLovinGender(NSString *genderString)
|
||||||
|
{
|
||||||
|
if ( [@"F" al_isEqualToStringIgnoringCase: genderString] )
|
||||||
|
{
|
||||||
|
return ALGenderFemale;
|
||||||
|
}
|
||||||
|
else if ( [@"M" al_isEqualToStringIgnoringCase: genderString] )
|
||||||
|
{
|
||||||
|
return ALGenderMale;
|
||||||
|
}
|
||||||
|
else if ( [@"O" al_isEqualToStringIgnoringCase: genderString] )
|
||||||
|
{
|
||||||
|
return ALGenderOther;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ALGenderUnknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
ALAdContentRating getAppLovinAdContentRating(int maximumAdContentRating)
|
||||||
|
{
|
||||||
|
if ( maximumAdContentRating == 1 )
|
||||||
|
{
|
||||||
|
return ALAdContentRatingAllAudiences;
|
||||||
|
}
|
||||||
|
else if ( maximumAdContentRating == 2 )
|
||||||
|
{
|
||||||
|
return ALAdContentRatingEveryoneOverTwelve;
|
||||||
|
}
|
||||||
|
else if ( maximumAdContentRating == 3 )
|
||||||
|
{
|
||||||
|
return ALAdContentRatingMatureAudiences;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ALAdContentRatingNone;
|
||||||
|
}
|
||||||
|
|
||||||
void setPendingExtraParametersIfNeeded(ALSdkSettings *settings)
|
void setPendingExtraParametersIfNeeded(ALSdkSettings *settings)
|
||||||
{
|
{
|
||||||
@ -129,7 +174,7 @@ extern "C"
|
|||||||
|
|
||||||
if ( _verboseLoggingToSet )
|
if ( _verboseLoggingToSet )
|
||||||
{
|
{
|
||||||
_sdk.settings.isVerboseLogging = _verboseLoggingToSet.boolValue;
|
_sdk.settings.verboseLoggingEnabled = _verboseLoggingToSet.boolValue;
|
||||||
_verboseLoggingToSet = nil;
|
_verboseLoggingToSet = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +196,48 @@ extern "C"
|
|||||||
_locationCollectionEnabledToSet = nil;
|
_locationCollectionEnabledToSet = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( _targetingYearOfBirth )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.yearOfBirth = _targetingYearOfBirth.intValue <= 0 ? nil : _targetingYearOfBirth;
|
||||||
|
_targetingYearOfBirth = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingGender )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.gender = getAppLovinGender(_targetingGender);
|
||||||
|
_targetingGender = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingMaximumAdContentRating )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.maximumAdContentRating = getAppLovinAdContentRating(_targetingMaximumAdContentRating.intValue);
|
||||||
|
_targetingMaximumAdContentRating = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingEmail )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.email = _targetingEmail;
|
||||||
|
_targetingEmail = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingPhoneNumber )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.phoneNumber = _targetingPhoneNumber;
|
||||||
|
_targetingPhoneNumber = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingKeywords )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.keywords = _targetingKeywords;
|
||||||
|
_targetingKeywords = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _targetingInterests )
|
||||||
|
{
|
||||||
|
_sdk.targetingData.interests = _targetingInterests;
|
||||||
|
_targetingInterests = nil;
|
||||||
|
}
|
||||||
|
|
||||||
setPendingExtraParametersIfNeeded( _sdk.settings );
|
setPendingExtraParametersIfNeeded( _sdk.settings );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +282,17 @@ extern "C"
|
|||||||
[_sdk showMediationDebugger];
|
[_sdk showMediationDebugger];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _MaxShowCreativeDebugger()
|
||||||
|
{
|
||||||
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
NSLog(@"[%@] Failed to show creative debugger - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[_sdk showCreativeDebugger];
|
||||||
|
}
|
||||||
|
|
||||||
void _MaxShowConsentDialog()
|
void _MaxShowConsentDialog()
|
||||||
{
|
{
|
||||||
NSLog(@"[%@] Failed to show consent dialog - Unavailable on iOS, please use the consent flow: https://dash.applovin.com/documentation/mediation/unity/getting-started/consent-flow", TAG);
|
NSLog(@"[%@] Failed to show consent dialog - Unavailable on iOS, please use the consent flow: https://dash.applovin.com/documentation/mediation/unity/getting-started/consent-flow", TAG);
|
||||||
@ -236,82 +334,98 @@ extern "C"
|
|||||||
|
|
||||||
void _MaxSetTargetingDataYearOfBirth(const int yearOfBirth)
|
void _MaxSetTargetingDataYearOfBirth(const int yearOfBirth)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingYearOfBirth = @(yearOfBirth);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_sdk.targetingData.yearOfBirth = yearOfBirth <= 0 ? nil : @(yearOfBirth);
|
_sdk.targetingData.yearOfBirth = yearOfBirth <= 0 ? nil : @(yearOfBirth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataGender(const char *gender)
|
void _MaxSetTargetingDataGender(char *gender)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingGender = NSSTRING(gender);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NSString *genderString = NSSTRING(gender);
|
NSString *genderString = NSSTRING(gender);
|
||||||
ALGender alGender = ALGenderUnknown;
|
_sdk.targetingData.gender = getAppLovinGender(genderString);
|
||||||
|
|
||||||
if ( [genderString isEqualToString: @"F"] )
|
|
||||||
{
|
|
||||||
alGender = ALGenderFemale;
|
|
||||||
}
|
|
||||||
else if ( [genderString isEqualToString: @"M"] )
|
|
||||||
{
|
|
||||||
alGender = ALGenderMale;
|
|
||||||
}
|
|
||||||
else if ( [genderString isEqualToString: @"O"] )
|
|
||||||
{
|
|
||||||
alGender = ALGenderOther;
|
|
||||||
}
|
|
||||||
|
|
||||||
_sdk.targetingData.gender = alGender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataMaximumAdContentRating(const int maximumAdContentRating)
|
void _MaxSetTargetingDataMaximumAdContentRating(const int maximumAdContentRating)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
|
||||||
ALAdContentRating rating = ALAdContentRatingNone;
|
|
||||||
|
|
||||||
if ( maximumAdContentRating == 1 )
|
|
||||||
{
|
{
|
||||||
rating = ALAdContentRatingAllAudiences;
|
_targetingMaximumAdContentRating = @(maximumAdContentRating);
|
||||||
}
|
return;
|
||||||
else if ( maximumAdContentRating == 2 )
|
|
||||||
{
|
|
||||||
rating = ALAdContentRatingEveryoneOverTwelve;
|
|
||||||
}
|
|
||||||
else if ( maximumAdContentRating == 3 )
|
|
||||||
{
|
|
||||||
rating = ALAdContentRatingMatureAudiences;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sdk.targetingData.maximumAdContentRating = rating;
|
_sdk.targetingData.maximumAdContentRating = getAppLovinAdContentRating(maximumAdContentRating);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataEmail(const char *email)
|
void _MaxSetTargetingDataEmail(char *email)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingEmail = NSSTRING(email);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_sdk.targetingData.email = NSSTRING(email);
|
_sdk.targetingData.email = NSSTRING(email);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataPhoneNumber(const char *phoneNumber)
|
void _MaxSetTargetingDataPhoneNumber(char *phoneNumber)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingPhoneNumber = NSSTRING(phoneNumber);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_sdk.targetingData.phoneNumber = NSSTRING(phoneNumber);
|
_sdk.targetingData.phoneNumber = NSSTRING(phoneNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataKeywords(char **keywords, int size)
|
void _MaxSetTargetingDataKeywords(char **keywords, int size)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
NSArray<NSString *> *keywordsArray = keywords ? toStringArray(keywords, size) : nil;
|
||||||
_sdk.targetingData.keywords = toStringArray(keywords, size);
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingKeywords = keywordsArray;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sdk.targetingData.keywords = keywordsArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetTargetingDataInterests(char **interests, int size)
|
void _MaxSetTargetingDataInterests(char **interests, int size)
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
NSArray<NSString *> *interestsArray = interests ? toStringArray(interests, size) : nil;
|
||||||
_sdk.targetingData.interests = toStringArray(interests, size);
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingInterests = interestsArray;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sdk.targetingData.interests = interestsArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxClearAllTargetingData()
|
void _MaxClearAllTargetingData()
|
||||||
{
|
{
|
||||||
if ( !isPluginInitialized() ) return;
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
_targetingYearOfBirth = nil;
|
||||||
|
_targetingGender = nil;
|
||||||
|
_targetingMaximumAdContentRating = nil;
|
||||||
|
_targetingEmail = nil;
|
||||||
|
_targetingPhoneNumber = nil;
|
||||||
|
_targetingKeywords = nil;
|
||||||
|
_targetingInterests = nil;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[_sdk.targetingData clearAll];
|
[_sdk.targetingData clearAll];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +433,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
if ( !_sdk )
|
if ( !_sdk )
|
||||||
{
|
{
|
||||||
NSLog(@"[%@] Failed to get SDK configuration - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
logUninitializedAccessError("_MaxGetSdkConfiguration");
|
||||||
return cStringCopy(@"");
|
return cStringCopy(@"");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +443,8 @@ extern "C"
|
|||||||
return cStringCopy([MAUnityAdManager serializeParameters: @{@"consentDialogState" : consentDialogStateStr,
|
return cStringCopy([MAUnityAdManager serializeParameters: @{@"consentDialogState" : consentDialogStateStr,
|
||||||
@"countryCode" : _sdk.configuration.countryCode,
|
@"countryCode" : _sdk.configuration.countryCode,
|
||||||
@"appTrackingStatus" : appTrackingStatus,
|
@"appTrackingStatus" : appTrackingStatus,
|
||||||
@"isSuccessfullyInitialized" : ([_sdk isInitialized] ? @"true" : @"false")}]);
|
@"isSuccessfullyInitialized" : @([_sdk isInitialized]),
|
||||||
|
@"isTestModeEnabled" : @([_sdk.configuration isTestModeEnabled])}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _MaxSetHasUserConsent(bool hasUserConsent)
|
void _MaxSetHasUserConsent(bool hasUserConsent)
|
||||||
@ -391,6 +506,13 @@ extern "C"
|
|||||||
[_adManager createBannerWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
[_adManager createBannerWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _MaxLoadBanner(const char *adUnitIdentifier)
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized()) return;
|
||||||
|
|
||||||
|
[_adManager loadBannerWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||||
|
}
|
||||||
|
|
||||||
void _MaxSetBannerBackgroundColor(const char *adUnitIdentifier, const char *hexColorCode)
|
void _MaxSetBannerBackgroundColor(const char *adUnitIdentifier, const char *hexColorCode)
|
||||||
{
|
{
|
||||||
if (!isPluginInitialized()) return;
|
if (!isPluginInitialized()) return;
|
||||||
@ -493,6 +615,13 @@ extern "C"
|
|||||||
[_adManager createMRecWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
[_adManager createMRecWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _MaxLoadMRec(const char *adUnitIdentifier)
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized()) return;
|
||||||
|
|
||||||
|
[_adManager loadMRecWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||||
|
}
|
||||||
|
|
||||||
void _MaxSetMRecPlacement(const char *adUnitIdentifier, const char *placement)
|
void _MaxSetMRecPlacement(const char *adUnitIdentifier, const char *placement)
|
||||||
{
|
{
|
||||||
[_adManager setMRecPlacement: NSSTRING(placement) forAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
[_adManager setMRecPlacement: NSSTRING(placement) forAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||||
@ -649,6 +778,41 @@ extern "C"
|
|||||||
[_adManager showInterstitialWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) placement: NSSTRING(placement) customData: NSSTRING(customData)];
|
[_adManager showInterstitialWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) placement: NSSTRING(placement) customData: NSSTRING(customData)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _MaxLoadAppOpenAd(const char *adUnitIdentifier)
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized()) return;
|
||||||
|
|
||||||
|
[_adManager loadAppOpenAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||||
|
}
|
||||||
|
|
||||||
|
void _MaxSetAppOpenAdExtraParameter(const char *adUnitIdentifier, const char *key, const char *value)
|
||||||
|
{
|
||||||
|
[_adManager setAppOpenAdExtraParameterForAdUnitIdentifier: NSSTRING(adUnitIdentifier)
|
||||||
|
key: NSSTRING(key)
|
||||||
|
value: NSSTRING(value)];
|
||||||
|
}
|
||||||
|
|
||||||
|
void _MaxSetAppOpenAdLocalExtraParameter(const char *adUnitIdentifier, const char *key, MAUnityRef value)
|
||||||
|
{
|
||||||
|
[_adManager setAppOpenAdLocalExtraParameterForAdUnitIdentifier: NSSTRING(adUnitIdentifier)
|
||||||
|
key: NSSTRING(key)
|
||||||
|
value: (__bridge id)value];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _MaxIsAppOpenAdReady(const char *adUnitIdentifier)
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized()) return false;
|
||||||
|
|
||||||
|
return [_adManager isAppOpenAdReadyWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||||
|
}
|
||||||
|
|
||||||
|
void _MaxShowAppOpenAd(const char *adUnitIdentifier, const char *placement, const char *customData)
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized()) return;
|
||||||
|
|
||||||
|
[_adManager showAppOpenAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) placement: NSSTRING(placement) customData: NSSTRING(customData)];
|
||||||
|
}
|
||||||
|
|
||||||
void _MaxLoadRewardedAd(const char *adUnitIdentifier)
|
void _MaxLoadRewardedAd(const char *adUnitIdentifier)
|
||||||
{
|
{
|
||||||
if (!isPluginInitialized()) return;
|
if (!isPluginInitialized()) return;
|
||||||
@ -789,7 +953,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
if ( _sdk )
|
if ( _sdk )
|
||||||
{
|
{
|
||||||
_sdk.settings.isVerboseLogging = enabled;
|
_sdk.settings.verboseLoggingEnabled = enabled;
|
||||||
_verboseLoggingToSet = nil;
|
_verboseLoggingToSet = nil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -802,7 +966,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
if ( _sdk )
|
if ( _sdk )
|
||||||
{
|
{
|
||||||
return _sdk.settings.isVerboseLogging;
|
return [_sdk.settings isVerboseLoggingEnabled];
|
||||||
}
|
}
|
||||||
else if ( _verboseLoggingToSet )
|
else if ( _verboseLoggingToSet )
|
||||||
{
|
{
|
||||||
@ -890,11 +1054,38 @@ extern "C"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * _MaxGetCFType()
|
||||||
|
{
|
||||||
|
if ( !_sdk )
|
||||||
|
{
|
||||||
|
NSLog(@"[%@] Failed to get available mediated networks - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
||||||
|
return cStringCopy(@(ALCFTypeUnknown).stringValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cStringCopy(@(_sdk.cfService.cfType).stringValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _MaxStartConsentFlow()
|
||||||
|
{
|
||||||
|
if (!isPluginInitialized())
|
||||||
|
{
|
||||||
|
logUninitializedAccessError("_MaxStartConsentFlow");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[_adManager startConsentFlow];
|
||||||
|
}
|
||||||
|
|
||||||
float _MaxGetAdaptiveBannerHeight(const float width)
|
float _MaxGetAdaptiveBannerHeight(const float width)
|
||||||
{
|
{
|
||||||
return [MAUnityAdManager adaptiveBannerHeightForWidth: width];
|
return [MAUnityAdManager adaptiveBannerHeightForWidth: width];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void logUninitializedAccessError(char *callingMethod)
|
||||||
|
{
|
||||||
|
NSLog(@"[%@] Failed to execute: %s - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG, callingMethod);
|
||||||
|
}
|
||||||
|
|
||||||
[[deprecated("This API has been deprecated. Please use our SDK's initialization callback to retrieve variables instead.")]]
|
[[deprecated("This API has been deprecated. Please use our SDK's initialization callback to retrieve variables instead.")]]
|
||||||
void _MaxLoadVariables()
|
void _MaxLoadVariables()
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user