Skip to content

Commit ccfb903

Browse files
authored
Update README.md
1 parent 87b1e6f commit ccfb903

File tree

1 file changed

+72
-2
lines changed

1 file changed

+72
-2
lines changed

README.md

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,75 @@
44

55
# Use
66
- After installation, open Adsetting to set up AdUnit Id
7-
(Ctrl + E or GameControl -> adSetting to open Adsetting)
8-
- You can choose Ad Network Applovin for Admob
7+
8+
(Ctrl + E or GameControl -> adSetting to open Adsetting)
9+
10+
![OpenAdsetting](https://github.com/wolf-package/advertising/assets/126542083/fc1d053d-56cc-4126-a6db-6cf03a2a6b46)
11+
- You can choose Ad Network Applovin for Admob and click `Create` button to create AdUnitiVariable
12+
![Adsetting](https://github.com/wolf-package/advertising/assets/126542083/d5026c44-61bd-4c29-a6de-e2d84003d24e)
13+
14+
- Set id for AdUnitVariable
15+
16+
![AdVariable](https://github.com/wolf-package/advertising/assets/126542083/f351e91d-9542-424b-89ff-25f6afa7ccec)
17+
18+
(For Admob, you can get the test Id by going to `Context Menu` and selecting `Get Id Test`)
19+
![idtest](https://github.com/wolf-package/advertising/assets/126542083/7ec8241b-5449-478d-be61-40eb38e53334)
20+
21+
- Attach `Advertising` to the object in the scene (loading scene) to load the ad
22+
![Adsvertising](https://github.com/wolf-package/advertising/assets/126542083/47b53d5a-a65f-41be-b2f9-8e06cd09cb77)
23+
24+
- Script demo show ads
25+
26+
```
27+
using System.Collections;
28+
using System.Collections.Generic;
29+
using TMPro;
30+
using UnityEngine;
31+
using VirtueSky.Ads;
32+
33+
public class ADs : MonoBehaviour
34+
{
35+
public TextMeshProUGUI textNoti;
36+
public AdUnitVariable banner;
37+
public AdUnitVariable inter;
38+
public AdUnitVariable reward;
39+
40+
public void ShowBanner()
41+
{
42+
Debug.Log(banner.IsReady());
43+
banner.Show();
44+
}
45+
46+
public void ShowInter()
47+
{
48+
if (inter.IsReady())
49+
{
50+
LogMessage("inter is ready");
51+
inter.Show().OnCompleted(() => { LogMessage("inter is completed"); });
52+
}
53+
else
54+
{
55+
LogMessage("Inter is not ready");
56+
}
57+
}
58+
59+
public void ShowReward()
60+
{
61+
if (reward.IsReady())
62+
{
63+
LogMessage("reward is ready");
64+
reward.Show().OnCompleted(() => { LogMessage("Reward is completed"); }).OnSkipped(() => { LogMessage("reward is skipped"); });
65+
}
66+
else
67+
{
68+
LogMessage("reward is not ready");
69+
}
70+
}
71+
72+
void LogMessage(string message)
73+
{
74+
textNoti.text = message;
75+
Debug.Log(message);
76+
}
77+
}
78+
```

0 commit comments

Comments
 (0)