Skip to content

Commit f6d88e3

Browse files
committed
fix pack
1 parent 9041b30 commit f6d88e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+348
-344
lines changed

Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/AdSettingEditor.cs

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#if UNITY_EDITOR
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
namespace VirtueSky.Ads
6+
{
7+
[CustomEditor(typeof(AdSetting), true)]
8+
public class AdSettingEditor : Editor
9+
{
10+
private AdSetting _adSetting;
11+
private SerializedProperty _adNetwork;
12+
private SerializedProperty _adCheckingInterval;
13+
private SerializedProperty _adLoadingInterval;
14+
15+
private SerializedProperty _sdkKey;
16+
private SerializedProperty _applovinEnableAgeRestrictedUser;
17+
private SerializedProperty _maxAdClient;
18+
private SerializedProperty _maxBannerVariable;
19+
private SerializedProperty _maxInterVariable;
20+
private SerializedProperty _maxRewardVariable;
21+
private SerializedProperty _maxRewardInterVariable;
22+
private SerializedProperty _maxAppOpenVariable;
23+
24+
private SerializedProperty _admobAdClient;
25+
private SerializedProperty _admobBannerVariable;
26+
private SerializedProperty _admobInterVariable;
27+
private SerializedProperty _admobRewardVariable;
28+
private SerializedProperty _admobRewardInterVariable;
29+
private SerializedProperty _admobAppOpenVariable;
30+
private SerializedProperty _admobEnableTestMode;
31+
private SerializedProperty _admobDevicesTest;
32+
33+
private void OnEnable()
34+
{
35+
_adSetting = target as AdSetting;
36+
_adNetwork = serializedObject.FindProperty("adNetwork");
37+
_adCheckingInterval = serializedObject.FindProperty("adCheckingInterval");
38+
_adLoadingInterval = serializedObject.FindProperty("adLoadingInterval");
39+
40+
_sdkKey = serializedObject.FindProperty("sdkKey");
41+
_applovinEnableAgeRestrictedUser = serializedObject.FindProperty("applovinEnableAgeRestrictedUser");
42+
_maxAdClient = serializedObject.FindProperty("maxAdClient");
43+
_maxBannerVariable = serializedObject.FindProperty("maxBannerVariable");
44+
_maxInterVariable = serializedObject.FindProperty("maxInterVariable");
45+
_maxRewardVariable = serializedObject.FindProperty("maxRewardVariable");
46+
_maxRewardInterVariable = serializedObject.FindProperty("maxRewardInterVariable");
47+
_maxAppOpenVariable = serializedObject.FindProperty("maxAppOpenVariable");
48+
49+
_admobAdClient = serializedObject.FindProperty("admobAdClient");
50+
_admobBannerVariable = serializedObject.FindProperty("admobBannerVariable");
51+
_admobInterVariable = serializedObject.FindProperty("admobInterVariable");
52+
_admobRewardVariable = serializedObject.FindProperty("admobRewardVariable");
53+
_admobRewardInterVariable = serializedObject.FindProperty("admobRewardInterVariable");
54+
_admobAppOpenVariable = serializedObject.FindProperty("admobAppOpenVariable");
55+
_admobEnableTestMode = serializedObject.FindProperty("admobEnableTestMode");
56+
_admobDevicesTest = serializedObject.FindProperty("admobDevicesTest");
57+
}
58+
59+
public override void OnInspectorGUI()
60+
{
61+
// base.OnInspectorGUI();
62+
serializedObject.Update();
63+
EditorGUILayout.PropertyField(_adCheckingInterval);
64+
EditorGUILayout.PropertyField(_adLoadingInterval);
65+
EditorGUILayout.PropertyField(_adNetwork);
66+
67+
SetupMax();
68+
SetupAdmob();
69+
SetUpButton();
70+
71+
serializedObject.ApplyModifiedProperties();
72+
serializedObject.Update();
73+
}
74+
75+
void SetupMax()
76+
{
77+
if (_adNetwork.enumValueIndex == (int)AdNetwork.Applovin)
78+
{
79+
EditorGUILayout.PropertyField(_sdkKey);
80+
EditorGUILayout.PropertyField(_applovinEnableAgeRestrictedUser);
81+
EditorGUILayout.PropertyField(_maxAdClient);
82+
EditorGUILayout.PropertyField(_maxBannerVariable);
83+
EditorGUILayout.PropertyField(_maxInterVariable);
84+
EditorGUILayout.PropertyField(_maxRewardVariable);
85+
EditorGUILayout.PropertyField(_maxRewardInterVariable);
86+
EditorGUILayout.PropertyField(_maxAppOpenVariable);
87+
}
88+
}
89+
90+
void SetupAdmob()
91+
{
92+
if (_adNetwork.enumValueIndex == (int)AdNetwork.Admob)
93+
{
94+
EditorGUILayout.PropertyField(_admobAdClient);
95+
EditorGUILayout.PropertyField(_admobBannerVariable);
96+
EditorGUILayout.PropertyField(_admobInterVariable);
97+
EditorGUILayout.PropertyField(_admobRewardVariable);
98+
EditorGUILayout.PropertyField(_admobRewardInterVariable);
99+
EditorGUILayout.PropertyField(_admobAppOpenVariable);
100+
EditorGUILayout.PropertyField(_admobEnableTestMode);
101+
EditorGUILayout.PropertyField(_admobDevicesTest);
102+
}
103+
}
104+
105+
void SetUpButton()
106+
{
107+
if (_adNetwork.enumValueIndex == (int)AdNetwork.Applovin && GUILayout.Button("Create MaxClient And MaxVariable"))
108+
{
109+
_adSetting.CreateMax();
110+
}
111+
112+
if (_adNetwork.enumValueIndex == (int)AdNetwork.Admob && GUILayout.Button("Create AdmobClient And AdmobVariable"))
113+
{
114+
_adSetting.CreateAdmob();
115+
}
116+
}
117+
}
118+
}
119+
#endif

Editor/AdSettingEditor.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WindowEditor/AdsWindowEditor.cs renamed to Editor/AdsWindowEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if UNITY_EDITOR
1+
#if UNITY_EDITOR
22
using UnityEditor;
3-
using VirtueSky.Utils;
3+
using VirtueSky.UtilsEditor;
44

55
namespace VirtueSky.Ads
66
{

Editor/AdsWindowEditor.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Virtuesky.Sunflower.Advertising.Editor",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:abd57f653a468a04c8d4e281527ff293",
6+
"GUID:c904f6d969e991d459a0843b71c22ec5"
7+
],
8+
"includePlatforms": [
9+
"Editor"
10+
],
11+
"excludePlatforms": [],
12+
"allowUnsafeCode": false,
13+
"overrideReferences": false,
14+
"precompiledReferences": [],
15+
"autoReferenced": true,
16+
"defineConstraints": [],
17+
"versionDefines": [],
18+
"noEngineReferences": false
19+
}

Editor/Virtuesky.Sunflower.Advertising.Editor.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)