Skip to content

Commit

Permalink
Merge pull request #39 from VirtueSky/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
VirtueSky authored Dec 2, 2024
2 parents a50fb4f + 8314205 commit aabeaa6
Show file tree
Hide file tree
Showing 11 changed files with 355 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
### 1: Download the repo and drop it into folder `Assets`
### 2: Add the line below to `Packages/manifest.json`

for version `3.1.8`
for version `3.1.9`
```csharp
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#3.1.8",
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#3.1.9",
```

## Includes modules
Expand Down
15 changes: 15 additions & 0 deletions VirtueSky/Advertising/Editor/AdSettingEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class AdSettingEditor : Editor
private SerializedProperty _admobRewardVariable;
private SerializedProperty _admobRewardInterVariable;
private SerializedProperty _admobAppOpenVariable;
private SerializedProperty _admobNativeOverlayVariable;
private SerializedProperty _admobEnableTestMode;
private SerializedProperty _enableGDPR;
private SerializedProperty _enableGDPRTestMode;
Expand Down Expand Up @@ -63,6 +64,7 @@ void Initialize()
_admobRewardVariable = serializedObject.FindProperty("admobRewardVariable");
_admobRewardInterVariable = serializedObject.FindProperty("admobRewardInterVariable");
_admobAppOpenVariable = serializedObject.FindProperty("admobAppOpenVariable");
_admobNativeOverlayVariable = serializedObject.FindProperty("admobNativeOverlayVariable");
_admobEnableTestMode = serializedObject.FindProperty("admobEnableTestMode");
_admobDevicesTest = serializedObject.FindProperty("admobDevicesTest");
_enableGDPR = serializedObject.FindProperty("enableGDPR");
Expand Down Expand Up @@ -260,6 +262,19 @@ void SetupAdmob()
}
}

EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(_admobNativeOverlayVariable);
if (_admobNativeOverlayVariable.objectReferenceValue == null)
{
GUILayout.Space(2);
if (GUILayout.Button("Create", GUILayout.Width(55)))
{
_admobNativeOverlayVariable.objectReferenceValue =
CreateAsset.CreateAndGetScriptableAsset<AdmobNativeOverlayVariable>(pathAdmob);
}
}

EditorGUILayout.EndHorizontal();
EditorGUILayout.PropertyField(_admobEnableTestMode);
EditorGUILayout.PropertyField(_admobDevicesTest);
Expand Down
1 change: 1 addition & 0 deletions VirtueSky/Advertising/Runtime/Admob/AdmobAdClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public override void Initialize()
adSetting.AdmobRewardVariable.Init();
adSetting.AdmobRewardInterVariable.Init();
adSetting.AdmobAppOpenVariable.Init();
adSetting.AdmobNativeOverlayVariable.Init();

RegisterAppStateChange();
LoadInterstitial();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace VirtueSky.Ads
[EditorIcon("icon_scriptable")]
public class AdmobBannerVariable : AdmobAdUnitVariable
{
public BannerSize size = BannerSize.Adaptive;
public BannerPosition position = BannerPosition.Bottom;
public AdsSize size = AdsSize.Adaptive;
public AdsPosition position = AdsPosition.Bottom;
public bool useCollapsible;
public bool useTestId;
#if VIRTUESKY_ADS && VIRTUESKY_ADMOB
Expand Down Expand Up @@ -138,12 +138,12 @@ public AdSize ConvertSize()
{
switch (size)
{
case BannerSize.Adaptive:
case AdsSize.Adaptive:
return AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(
AdSize.FullWidth);
case BannerSize.MediumRectangle: return AdSize.MediumRectangle;
case BannerSize.Leaderboard: return AdSize.Leaderboard;
case BannerSize.IABBanner: return AdSize.IABBanner;
case AdsSize.MediumRectangle: return AdSize.MediumRectangle;
case AdsSize.Leaderboard: return AdSize.Leaderboard;
case AdsSize.IABBanner: return AdSize.IABBanner;
//case BannerSize.SmartBanner: return AdSize.SmartBanner;
default: return AdSize.Banner;
}
Expand All @@ -153,23 +153,23 @@ public AdPosition ConvertPosition()
{
switch (position)
{
case BannerPosition.Top: return AdPosition.Top;
case BannerPosition.Bottom: return AdPosition.Bottom;
case BannerPosition.TopLeft: return AdPosition.TopLeft;
case BannerPosition.TopRight: return AdPosition.TopRight;
case BannerPosition.BottomLeft: return AdPosition.BottomLeft;
case BannerPosition.BottomRight: return AdPosition.BottomRight;
case AdsPosition.Top: return AdPosition.Top;
case AdsPosition.Bottom: return AdPosition.Bottom;
case AdsPosition.TopLeft: return AdPosition.TopLeft;
case AdsPosition.TopRight: return AdPosition.TopRight;
case AdsPosition.BottomLeft: return AdPosition.BottomLeft;
case AdsPosition.BottomRight: return AdPosition.BottomRight;
default: return AdPosition.Bottom;
}
}

public string ConvertPlacementCollapsible()
{
if (position == BannerPosition.Top)
if (position == AdsPosition.Top)
{
return "top";
}
else if (position == BannerPosition.Bottom)
else if (position == AdsPosition.Bottom)
{
return "bottom";
}
Expand Down
Loading

0 comments on commit aabeaa6

Please sign in to comment.