-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vungle Support for Unity #56
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
728b8b1
Added Vungle properties to unity editor and to post build processors.…
jonathansligh-nimbus 28b545d
Added more Vungle fields.
jonathansligh-nimbus 6e81ffa
Added some more code for iOS. Still experiencing weird build issues …
jonathansligh-nimbus 3789901
Android Interceptor creation
jonathansligh-nimbus 1b788be
Added initialization and interceptors for Android
jonathansligh-nimbus 3769cd2
Fixed JAVA Config
jonathansligh-nimbus ea830c7
Finally got Vungle iOS support working.
jonathansligh-nimbus 83de831
Fixed up the iOS side.
jonathansligh-nimbus eeabc57
Got Android working!
jonathansligh-nimbus 2cefebe
Fixed iOS extra screen issue!
jonathansligh-nimbus 3467946
Cleaning up some typos
jonathansligh-nimbus 4f63031
Cleanups and updates!
jonathansligh-nimbus cd0115a
Revert "Cleanups and updates!"
jonathansligh-nimbus d7818e5
Fixing null issues.
jonathansligh-nimbus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,12 @@ public class NimbusManagerCreator : EditorWindow { | |
private SerializedProperty _iosAppId; | ||
private ReorderableList _iosApsSlotIdList = null; | ||
private SerializedProperty _iosApsSlots = null; | ||
|
||
|
||
|
||
// Vungle | ||
private SerializedProperty _androidVungleAppId; | ||
|
||
private SerializedProperty _iosVungleAppId; | ||
|
||
[MenuItem("Nimbus/Create New NimbusAdsManager")] | ||
public static void CreateNewNimbusGameManager() { | ||
GetWindow<NimbusManagerCreator>("NimbusAdsManager Creator"); | ||
|
@@ -73,6 +77,13 @@ private void OnEnable() { | |
_iosApsSlotIdList.elementHeight = 10 * EditorGUIUtility.singleLineHeight; | ||
_iosApsSlotIdList.headerHeight = 0f; | ||
_iosApsSlotIdList.drawElementCallback += OnDrawElementIosApsSlotData; | ||
|
||
// Vungle | ||
// Android Vungle UI | ||
_androidVungleAppId = serializedObject.FindProperty("androidVungleAppID"); | ||
|
||
// IOS Vungle UI | ||
_iosVungleAppId = serializedObject.FindProperty("iosVungleAppID"); | ||
} | ||
|
||
|
||
|
@@ -132,9 +143,12 @@ private void OnGUI() { | |
|
||
var headerStyle = EditorStyles.largeLabel; | ||
headerStyle.fontStyle = FontStyle.Bold; | ||
|
||
#if NIMBUS_ENABLE_APS || NIMBUS_ENABLE_VUNGLE | ||
EditorGUILayout.LabelField("Third Party SDK Support", headerStyle); | ||
#endif | ||
|
||
#if NIMBUS_ENABLE_APS | ||
EditorGUILayout.LabelField("Third Party SDK Support", headerStyle); | ||
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2); | ||
GUILayout.Space(10); | ||
EditorGUILayout.LabelField("APS Configuration", headerStyle); | ||
|
@@ -154,6 +168,25 @@ private void OnGUI() { | |
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter APS data", MessageType.Warning); | ||
#endif | ||
#endif | ||
|
||
#if NIMBUS_ENABLE_VUNGLE | ||
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2); | ||
GUILayout.Space(10); | ||
EditorGUILayout.LabelField("Vungle Configuration", headerStyle); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The display name for Vungle if referencing it in a UI is Liftoff Monetize |
||
#if UNITY_ANDROID | ||
EditorGUILayout.PropertyField((_androidVungleAppId)); | ||
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray); | ||
#endif | ||
|
||
#if UNITY_IOS | ||
EditorGUILayout.PropertyField((_iosVungleAppId)); | ||
EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray); | ||
#endif | ||
|
||
#if !UNITY_ANDROID && !UNITY_IOS | ||
EditorGUILayout.HelpBox("In build settings select Android or IOS to enter Vungle data", MessageType.Warning); | ||
#endif | ||
#endif | ||
|
||
// ReSharper disable InvertIf | ||
if (GUILayout.Button("Create")) { | ||
|
@@ -184,6 +217,12 @@ private void OnGUI() { | |
return; | ||
} | ||
#endif | ||
|
||
#if NIMBUS_ENABLE_VUNGLE | ||
if (!ValidateVungleData()) { | ||
return; | ||
} | ||
#endif | ||
|
||
AssetDatabase.CreateAsset(_asset, | ||
"Packages/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.ScriptableObjects/NimbusSDKConfiguration.asset"); | ||
|
@@ -289,6 +328,23 @@ private bool ValidateApsData() { | |
} | ||
return true; | ||
} | ||
|
||
private bool ValidateVungleData() { | ||
string appId = null; | ||
#if UNITY_ANDROID | ||
appId = _androidVungleAppId.stringValue; | ||
#elif UNITY_IOS | ||
appId = _iosVungleAppId.stringValue; | ||
#endif | ||
|
||
if (appId.IsNullOrEmpty()) { | ||
Debug.unityLogger.LogError("Nimbus", | ||
"Vungle SDK has been included, the Vungle App ID cannot be empty, object NimbusAdsManager not created"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here about Liftoff Monetize |
||
return false; | ||
} | ||
ApsSlotData[] slotData = null; | ||
return true; | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is minor and can be done at a later time but ideally all of the extensions would be contained within a single dependencies block which would require changing the functionality of this class to take in a list of required extensions instead of writing a new dependencies block for each extension. The output would look like the following