void OnFbInterstitialAdUnit(FbInterstitialUnit ad, List <FbInterstitialUnit> list) { EditorGUILayout.BeginVertical(GUI.skin.box); var newKey = AdGUIHelper.TextField(ad.key, AdString.key_label, AdString.key_infor); int countKey = 0; if (newKey != ad.key) { for (int k = 0; k < list.Count; k++) { if (newKey.Trim().Equals(list[k].key.Trim())) { countKey++; } } } if (countKey == 0) { ad.key = newKey.Trim(); } ad.androidAdId = EditorGUILayout.TextField("Android Placement Id", ad.androidAdId).Trim(); ad.iosAdId = EditorGUILayout.TextField("IOS Placement Id", ad.iosAdId).Trim(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (AdGUIHelper.Button(DeleteIcon) && ConfirmRemoveItem()) { list.Remove(ad); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.Space(5f); }
void OnGUIAdmobBannerAdUnit(AdmobBannerUnit ad, List <AdmobBannerUnit> list) { if (ad == null) { list.Remove(ad); return; } EditorGUILayout.BeginVertical(GUI.skin.box); var newKey = AdGUIHelper.TextField(ad.key, AdString.key_label, AdString.key_infor); // just change if there are no same key int countKey = 0; if (newKey != ad.key) { for (int k = 0; k < list.Count; k++) { if (newKey.Trim().Equals(list[k].key.Trim())) { countKey++; } } } if (countKey == 0) { ad.key = newKey.Trim(); } ad.androidAdId = EditorGUILayout.TextField("Android Ad Unit", ad.androidAdId).Trim(); ad.iosAdId = EditorGUILayout.TextField("IOS Ad Unit", ad.iosAdId).Trim(); ad.position = (BannerPosition)EditorGUILayout.EnumPopup("Position", ad.position); ad.size = (BannerSize)EditorGUILayout.EnumPopup("Size", ad.size); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (AdGUIHelper.Button(DeleteIcon) && ConfirmRemoveItem()) { list.Remove(ad); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.Space(5f); }
void OnFbNativeAdUnit(FBNativeAdUnit ad, List <FBNativeAdUnit> list) { EditorGUILayout.BeginVertical(GUI.skin.box); var newKey = AdGUIHelper.TextField(ad.key, AdString.key_label, AdString.key_infor); int countKey = 0; if (newKey != ad.key) { for (int k = 0; k < list.Count; k++) { if (newKey.Trim().Equals(list[k].key.Trim())) { countKey++; } } } if (countKey == 0) { ad.key = newKey.Trim(); } ad.androidPlacementId = EditorGUILayout.TextField("Android Placement Id", ad.androidPlacementId).Trim(); ad.iosPlacementId = EditorGUILayout.TextField("IOS Placement Id", ad.iosPlacementId).Trim(); ad.minSecondsToReload = EditorGUILayout.Slider("Min Seconds To Reload", ad.minSecondsToReload, 30f, 120f); ad.preload = EditorGUILayout.ToggleLeft("Preload", ad.preload); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (AdGUIHelper.Button(DeleteIcon) && ConfirmRemoveItem()) { list.Remove(ad); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.Space(5f); }