diff --git a/com.chartboost.mediation.demo/Assets/Demo/Demo.cs b/com.chartboost.mediation.demo/Assets/Demo/Demo.cs index aa5423ad..51d11c86 100644 --- a/com.chartboost.mediation.demo/Assets/Demo/Demo.cs +++ b/com.chartboost.mediation.demo/Assets/Demo/Demo.cs @@ -35,6 +35,7 @@ public class Demo : MonoBehaviour public Dropdown bannerLocationDropdown; public Dropdown horizontalAlignmentDropdown; public Dropdown verticalAlignmentDropdown; + public Dropdown resizeDropdown; public ScrollRect outputTextScrollRect; public Text outputText; @@ -249,14 +250,19 @@ public async void OnCreateBannerClick() _bannerAd.DidRecordImpression += DidRecordImpressionBanner; _bannerAd.DidDrag += DidDragBanner; + // keywords var keywords = _bannerAd.Keywords ??= new Dictionary(); keywords.Add("bnr_keyword1", "bnr_value1"); keywords.Add("bnr_keyword2", "bnr_value2"); _bannerAd.Keywords = keywords; + // Alignment _bannerAd.VerticalAlignment = (ChartboostMediationBannerVerticalAlignment)verticalAlignmentDropdown.value; _bannerAd.HorizontalAlignment = (ChartboostMediationBannerHorizontalAlignment)horizontalAlignmentDropdown.value; - + + // Resize + _bannerAd.ResizeOption = (ResizeOption)resizeDropdown.value; + var result = await _bannerAd.Load(); Log(result.Error == null ? "Successfully loaded banner" : result.Error?.Message); } @@ -277,6 +283,14 @@ public void OnVerticalAlignmentChange() } } + public void OnResizeOptionChange() + { + if (_bannerAd != null) + { + _bannerAd.ResizeOption = (ResizeOption)resizeDropdown.value; + } + } + public void OnToggleBannerVisibilityClick() { if (_bannerAd != null) diff --git a/com.chartboost.mediation.demo/Assets/Demo/Demo.unity b/com.chartboost.mediation.demo/Assets/Demo/Demo.unity index de0f2946..c234d49e 100644 --- a/com.chartboost.mediation.demo/Assets/Demo/Demo.unity +++ b/com.chartboost.mediation.demo/Assets/Demo/Demo.unity @@ -123,95 +123,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &11953515 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 11953516} - - component: {fileID: 11953519} - - component: {fileID: 11953518} - - component: {fileID: 11953517} - m_Layer: 0 - m_Name: CM_UnityBannerAd (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &11953516 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 11953515} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 607549595} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 336.88016, y: -75} - m_SizeDelta: {x: 609.7603, y: 150} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &11953517 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 11953515} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 85a07fd1d4def42a9a13af997042d807, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &11953518 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 11953515} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: 150 - m_PreferredWidth: -1 - m_PreferredHeight: -1 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 ---- !u!114 &11953519 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 11953515} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a52761cf26c416e8ea222d79516c918, type: 3} - m_Name: - m_EditorClassIdentifier: - autoLoadOnInit: 1 - placementName: - draggable: 1 - size: 0 - resizeToFit: 0 - horizontalAlignment: 1 - verticalAlignment: 1 --- !u!1 &26122568 GameObject: m_ObjectHideFlags: 0 @@ -402,6 +313,42 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -10.000253, y: 5000} m_Pivot: {x: 0, y: 1} +--- !u!1 &38392631 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 38392632} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &38392632 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 38392631} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1928239278} + m_Father: {fileID: 1171972858} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &127934768 GameObject: m_ObjectHideFlags: 0 @@ -436,7 +383,7 @@ RectTransform: - {fileID: 766850856} - {fileID: 1982251927} m_Father: {fileID: 607549595} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -606,6 +553,154 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 130902004} m_CullTransparentMesh: 0 +--- !u!1 &135282890 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 135282891} + - component: {fileID: 135282893} + - component: {fileID: 135282892} + m_Layer: 5 + m_Name: Item Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &135282891 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 135282890} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1288041181} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 10, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &135282892 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 135282890} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &135282893 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 135282890} + m_CullTransparentMesh: 1 +--- !u!1 &156870216 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 156870217} + - component: {fileID: 156870218} + - component: {fileID: 156870219} + m_Layer: 5 + m_Name: Resize + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &156870217 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156870216} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1260450205} + - {fileID: 2123259610} + m_Father: {fileID: 642107532} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &156870218 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156870216} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 10 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 32 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &156870219 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156870216} + m_CullTransparentMesh: 1 --- !u!1 &158094230 GameObject: m_ObjectHideFlags: 0 @@ -1029,12 +1124,12 @@ RectTransform: m_Children: - {fileID: 755499979} m_Father: {fileID: 642107532} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.50000006, y: 0.5} --- !u!114 &262299029 MonoBehaviour: @@ -1528,7 +1623,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 295701533} m_CullTransparentMesh: 0 ---- !u!1 &354986014 +--- !u!1 &312137971 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1536,55 +1631,130 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 354986015} - - component: {fileID: 354986018} - - component: {fileID: 354986017} - - component: {fileID: 354986016} + - component: {fileID: 312137972} + - component: {fileID: 312137974} + - component: {fileID: 312137973} m_Layer: 5 - m_Name: Viewport + m_Name: Arrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &354986015 +--- !u!224 &312137972 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 354986014} + m_GameObject: {fileID: 312137971} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1448602121} - m_Father: {fileID: 817336130} - m_RootOrder: 0 + m_Children: [] + m_Father: {fileID: 2123259610} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -18, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!114 &354986016 + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -15, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &312137973 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 354986014} + m_GameObject: {fileID: 312137971} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!114 &354986017 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10915, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &312137974 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 312137971} + m_CullTransparentMesh: 1 +--- !u!1 &354986014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 354986015} + - component: {fileID: 354986018} + - component: {fileID: 354986017} + - component: {fileID: 354986016} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &354986015 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 354986014} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1448602121} + m_Father: {fileID: 817336130} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -18, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &354986016 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 354986014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &354986017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 354986014} m_Enabled: 1 @@ -1618,6 +1788,85 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 354986014} m_CullTransparentMesh: 1 +--- !u!1 &369046088 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 369046089} + - component: {fileID: 369046091} + - component: {fileID: 369046090} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &369046089 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369046088} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2123259610} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -7.5, y: -0.5} + m_SizeDelta: {x: -35, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &369046090 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369046088} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 24 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Fit Both +--- !u!222 &369046091 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369046088} + m_CullTransparentMesh: 1 --- !u!1 &389232253 GameObject: m_ObjectHideFlags: 0 @@ -1726,7 +1975,7 @@ RectTransform: - {fileID: 295701534} - {fileID: 707926652} m_Father: {fileID: 607549595} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2103,7 +2352,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 470271378} m_CullTransparentMesh: 0 ---- !u!1 &520640961 +--- !u!1 &512167098 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2111,93 +2360,34 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 520640962} - - component: {fileID: 520640965} - - component: {fileID: 520640964} - - component: {fileID: 520640963} - m_Layer: 0 - m_Name: CM_UnityBannerAd + - component: {fileID: 512167099} + m_Layer: 5 + m_Name: Content m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &520640962 +--- !u!224 &512167099 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 520640961} + m_GameObject: {fileID: 512167098} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1938273986} - m_RootOrder: 2 + m_Children: + - {fileID: 1288041181} + m_Father: {fileID: 1954674460} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -327.79532, y: 73.57004} - m_SizeDelta: {x: 614.4609, y: 504.3136} - m_Pivot: {x: 0, y: 1} ---- !u!114 &520640963 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 520640961} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.34117648, g: 0.6509804, b: 0.09411766, a: 0.19607843} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &520640964 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 520640961} - m_CullTransparentMesh: 1 ---- !u!114 &520640965 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 520640961} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a52761cf26c416e8ea222d79516c918, type: 3} - m_Name: - m_EditorClassIdentifier: - autoLoadOnInit: 1 - placementName: ACAdaptiveBanner - draggable: 1 - size: 0 - resizeToFit: 1 - horizontalAlignment: 1 - verticalAlignment: 1 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} + m_Pivot: {x: 0.5, y: 1} --- !u!1 &554163490 GameObject: m_ObjectHideFlags: 0 @@ -2277,6 +2467,81 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 554163490} m_CullTransparentMesh: 1 +--- !u!1 &567521555 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 567521556} + - component: {fileID: 567521558} + - component: {fileID: 567521557} + m_Layer: 5 + m_Name: Item Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &567521556 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 567521555} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1288041181} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &567521557 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 567521555} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &567521558 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 567521555} + m_CullTransparentMesh: 1 --- !u!1 &607549594 GameObject: m_ObjectHideFlags: 0 @@ -2308,7 +2573,6 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 11953516} - {fileID: 884844376} - {fileID: 700397475} - {fileID: 642107532} @@ -2317,7 +2581,7 @@ RectTransform: - {fileID: 1924329662} - {fileID: 127934769} m_Father: {fileID: 1938273986} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2382,6 +2646,7 @@ MonoBehaviour: bannerLocationDropdown: {fileID: 858297263} horizontalAlignmentDropdown: {fileID: 283749090} verticalAlignmentDropdown: {fileID: 911517598} + resizeDropdown: {fileID: 2123259612} outputTextScrollRect: {fileID: 1924329665} outputText: {fileID: 1230585348} objectToDestroyForTest: {fileID: 1938273982} @@ -2509,12 +2774,12 @@ RectTransform: - {fileID: 1285523671} - {fileID: 739097909} - {fileID: 714185034} + - {fileID: 156870217} - {fileID: 262299028} - - {fileID: 1803998856} - {fileID: 1014545486} - {fileID: 1868187209} m_Father: {fileID: 607549595} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2543,7 +2808,7 @@ MonoBehaviour: m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 m_ChildControlWidth: 1 - m_ChildControlHeight: 1 + m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 @@ -2834,7 +3099,7 @@ RectTransform: - {fileID: 1352250943} - {fileID: 631313736} m_Father: {fileID: 607549595} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -3094,7 +3359,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &714185035 MonoBehaviour: @@ -3158,7 +3423,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &739097910 MonoBehaviour: @@ -4449,7 +4714,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 607549595} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4640,7 +4905,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 607549595} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -5189,7 +5454,7 @@ GameObject: - component: {fileID: 1014545486} - component: {fileID: 1014545487} m_Layer: 5 - m_Name: Buttons + m_Name: Toggle Buttons m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -5214,7 +5479,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1014545487 MonoBehaviour: @@ -5242,63 +5507,6 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 ---- !u!1 &1019134531 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1019134532} - - component: {fileID: 1019134533} - m_Layer: 5 - m_Name: Adaptive Banner Ad (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &1019134532 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1019134531} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1560581145} - m_Father: {fileID: 1938273986} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 368.88, y: -951} - m_SizeDelta: {x: 609.7603, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1019134533 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1019134531} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: 100 - m_PreferredWidth: -1 - m_PreferredHeight: -1 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 --- !u!1 &1020468672 GameObject: m_ObjectHideFlags: 0 @@ -6442,40 +6650,166 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1168740380} m_OnClick: m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 607549598} - m_TargetAssemblyTypeName: - m_MethodName: OnToggleBannerVisibilityClick - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: OnCacheBannerClick - m_BoolArgument: 0 - m_CallState: 2 ---- !u!114 &1168740380 + m_Calls: + - m_Target: {fileID: 607549598} + m_TargetAssemblyTypeName: + m_MethodName: OnToggleBannerVisibilityClick + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: OnCacheBannerClick + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1168740380 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1168740377} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.0627451, g: 0.427451, b: 0.8705883, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 0.5 +--- !u!222 &1168740381 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1168740377} + m_CullTransparentMesh: 0 +--- !u!1 &1171972857 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1171972858} + - component: {fileID: 1171972861} + - component: {fileID: 1171972860} + - component: {fileID: 1171972859} + m_Layer: 5 + m_Name: Scrollbar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1171972858 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1171972857} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 38392632} + m_Father: {fileID: 1934778650} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1171972859 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1171972857} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1928239279} + m_HandleRect: {fileID: 1928239278} + m_Direction: 2 + m_Value: 0 + m_Size: 0.2 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &1171972860 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1168740377} + m_GameObject: {fileID: 1171972857} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.0627451, g: 0.427451, b: 0.8705883, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -6484,15 +6818,15 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 0.5 ---- !u!222 &1168740381 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1171972861 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1168740377} - m_CullTransparentMesh: 0 + m_GameObject: {fileID: 1171972857} + m_CullTransparentMesh: 1 --- !u!1 &1183794684 GameObject: m_ObjectHideFlags: 0 @@ -6741,7 +7075,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1132835359} m_Direction: 2 m_Value: 1 - m_Size: 0.10117103 + m_Size: 0.1173932 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -7001,6 +7335,85 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1256536328} m_CullTransparentMesh: 1 +--- !u!1 &1260450204 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1260450205} + - component: {fileID: 1260450207} + - component: {fileID: 1260450206} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1260450205 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1260450204} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 156870217} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1260450206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1260450204} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.01886791, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 28 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Resize +--- !u!222 &1260450207 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1260450204} + m_CullTransparentMesh: 1 --- !u!1 &1285523670 GameObject: m_ObjectHideFlags: 0 @@ -7039,7 +7452,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1285523672 MonoBehaviour: @@ -7144,6 +7557,93 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1285523670} m_CullTransparentMesh: 0 +--- !u!1 &1288041180 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1288041181} + - component: {fileID: 1288041182} + m_Layer: 5 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1288041181 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1288041180} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 567521556} + - {fileID: 135282891} + - {fileID: 1615634531} + m_Father: {fileID: 512167099} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1288041182 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1288041180} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 567521557} + toggleTransition: 1 + graphic: {fileID: 135282892} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 --- !u!1 &1308001630 GameObject: m_ObjectHideFlags: 0 @@ -8024,61 +8524,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1502427943} m_CullTransparentMesh: 1 ---- !u!1 &1560581144 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1560581145} - - component: {fileID: 1560581146} - m_Layer: 0 - m_Name: CM_UnityBannerAd - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1560581145 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1560581144} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1019134532} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -305, y: 0} - m_SizeDelta: {x: 610, y: 100} - m_Pivot: {x: 0, y: 0.5} ---- !u!114 &1560581146 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1560581144} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a52761cf26c416e8ea222d79516c918, type: 3} - m_Name: - m_EditorClassIdentifier: - autoLoadOnInit: 1 - placementName: - draggable: 1 - size: 0 - resizeToFit: 0 - horizontalAlignment: 1 - verticalAlignment: 1 --- !u!1 &1580685155 GameObject: m_ObjectHideFlags: 0 @@ -8165,8 +8610,87 @@ MonoBehaviour: onValueChanged: m_PersistentCalls: m_Calls: [] - m_IsOn: 1 ---- !u!1 &1613066124 + m_IsOn: 1 +--- !u!1 &1613066124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1613066125} + - component: {fileID: 1613066127} + - component: {fileID: 1613066126} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1613066125 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613066124} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1982251927} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1613066126 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613066124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 28 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Clear Log +--- !u!222 &1613066127 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613066124} + m_CullTransparentMesh: 0 +--- !u!1 &1615634530 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8174,42 +8698,42 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1613066125} - - component: {fileID: 1613066127} - - component: {fileID: 1613066126} + - component: {fileID: 1615634531} + - component: {fileID: 1615634533} + - component: {fileID: 1615634532} m_Layer: 5 - m_Name: Text + m_Name: Item Label m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1613066125 +--- !u!224 &1615634531 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1613066124} + m_GameObject: {fileID: 1615634530} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 1982251927} - m_RootOrder: 0 + m_Father: {fileID: 1288041181} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchoredPosition: {x: 5, y: -0.5} + m_SizeDelta: {x: -30, y: -3} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1613066126 +--- !u!114 &1615634532 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1613066124} + m_GameObject: {fileID: 1615634530} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} @@ -8225,26 +8749,26 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 28 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 40 - m_Alignment: 4 + m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Clear Log ---- !u!222 &1613066127 + m_Text: Option A +--- !u!222 &1615634533 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1613066124} - m_CullTransparentMesh: 0 + m_GameObject: {fileID: 1615634530} + m_CullTransparentMesh: 1 --- !u!1 &1655463610 GameObject: m_ObjectHideFlags: 0 @@ -8593,95 +9117,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1793262923} m_CullTransparentMesh: 1 ---- !u!1 &1803998855 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1803998856} - - component: {fileID: 1803998858} - - component: {fileID: 1803998857} - - component: {fileID: 1803998859} - m_Layer: 0 - m_Name: CM_UnityBannerAd - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &1803998856 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1803998855} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 642107532} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 304.88016, y: -331.08374} - m_SizeDelta: {x: 609.7603, y: 46.86265} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1803998857 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1803998855} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: 0 - m_PreferredWidth: -1 - m_PreferredHeight: -1 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 ---- !u!114 &1803998858 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1803998855} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a52761cf26c416e8ea222d79516c918, type: 3} - m_Name: - m_EditorClassIdentifier: - autoLoadOnInit: 1 - placementName: - draggable: 1 - size: 0 - resizeToFit: 0 - horizontalAlignment: 1 - verticalAlignment: 1 ---- !u!114 &1803998859 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1803998855} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 85a07fd1d4def42a9a13af997042d807, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1868187208 GameObject: m_ObjectHideFlags: 0 @@ -8693,7 +9128,7 @@ GameObject: - component: {fileID: 1868187209} - component: {fileID: 1868187210} m_Layer: 5 - m_Name: Buttons + m_Name: Other options m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -8718,7 +9153,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1868187210 MonoBehaviour: @@ -9078,7 +9513,7 @@ RectTransform: - {fileID: 1183794685} - {fileID: 1203335227} m_Father: {fileID: 607549595} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0.16700001} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -9153,26 +9588,209 @@ MonoBehaviour: m_OnValueChanged: m_PersistentCalls: m_Calls: [] ---- !u!114 &1924329666 +--- !u!114 &1924329666 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924329661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 600 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1928239277 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1928239278} + - component: {fileID: 1928239280} + - component: {fileID: 1928239279} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1928239278 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1928239277} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 38392632} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.2} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1928239279 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1928239277} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1928239280 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1928239277} + m_CullTransparentMesh: 1 +--- !u!1 &1934778649 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1934778650} + - component: {fileID: 1934778653} + - component: {fileID: 1934778652} + - component: {fileID: 1934778651} + m_Layer: 5 + m_Name: Template + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1934778650 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934778649} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1954674460} + - {fileID: 1171972858} + m_Father: {fileID: 2123259610} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 2} + m_SizeDelta: {x: 0, y: 550} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1934778651 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934778649} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 512167099} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 1954674460} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 1171972859} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &1934778652 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1924329661} + m_GameObject: {fileID: 1934778649} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: -1 - m_PreferredWidth: -1 - m_PreferredHeight: 600 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1934778653 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934778649} + m_CullTransparentMesh: 1 --- !u!1 &1938273982 GameObject: m_ObjectHideFlags: 0 @@ -9249,7 +9867,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -9264,9 +9882,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 1019134532} - {fileID: 607549595} - - {fileID: 520640962} m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -9350,6 +9966,96 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1952044067} m_CullTransparentMesh: 1 +--- !u!1 &1954674459 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1954674460} + - component: {fileID: 1954674463} + - component: {fileID: 1954674462} + - component: {fileID: 1954674461} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1954674460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954674459} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 512167099} + m_Father: {fileID: 1934778650} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -18, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &1954674461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954674459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &1954674462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954674459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1954674463 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954674459} + m_CullTransparentMesh: 1 --- !u!1 &1982251926 GameObject: m_ObjectHideFlags: 0 @@ -9953,3 +10659,176 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2055753071} m_CullTransparentMesh: 1 +--- !u!1 &2123259609 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2123259610} + - component: {fileID: 2123259614} + - component: {fileID: 2123259613} + - component: {fileID: 2123259612} + - component: {fileID: 2123259611} + m_Layer: 5 + m_Name: Dropdown + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2123259610 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2123259609} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 369046089} + - {fileID: 312137972} + - {fileID: 1934778650} + m_Father: {fileID: 156870217} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2123259611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2123259609} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: 100 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &2123259612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2123259609} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d0b652f32a2cc243917e4028fa0f046, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2123259613} + m_Template: {fileID: 1934778650} + m_CaptionText: {fileID: 369046090} + m_CaptionImage: {fileID: 0} + m_ItemText: {fileID: 1615634532} + m_ItemImage: {fileID: 0} + m_Value: 2 + m_Options: + m_Options: + - m_Text: Fit Horizontal + m_Image: {fileID: 0} + - m_Text: Fit Vertical + m_Image: {fileID: 0} + - m_Text: Fit Both + m_Image: {fileID: 0} + - m_Text: Disabled + m_Image: {fileID: 0} + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 607549598} + m_TargetAssemblyTypeName: Demo, Assembly-CSharp + m_MethodName: OnResizeOptionChange + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_AlphaFadeSpeed: 0.15 +--- !u!114 &2123259613 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2123259609} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 0.5 +--- !u!222 &2123259614 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2123259609} + m_CullTransparentMesh: 1 diff --git a/com.chartboost.mediation.demo/ProjectSettings/ProjectSettings.asset b/com.chartboost.mediation.demo/ProjectSettings/ProjectSettings.asset index 42350dee..fc92059d 100644 --- a/com.chartboost.mediation.demo/ProjectSettings/ProjectSettings.asset +++ b/com.chartboost.mediation.demo/ProjectSettings/ProjectSettings.asset @@ -688,7 +688,7 @@ PlayerSettings: webGLThreadsSupport: 0 webGLDecompressionFallback: 0 scriptingDefineSymbols: - 4: UNITY_ANDROID + 4: 7: additionalCompilerArguments: {} platformArchitecture: {} diff --git a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerAdWrapper.kt b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerAdWrapper.kt index 06bdbecc..2e320f8f 100644 --- a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerAdWrapper.kt +++ b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerAdWrapper.kt @@ -24,7 +24,6 @@ class BannerAdWrapper(private val ad: HeliumBannerAd) { var winningBidInfo: Map? = null var loadId: String = "" - var horizontalGravity = Gravity.CENTER_HORIZONTAL var verticalGravity = Gravity.CENTER_VERTICAL @@ -197,9 +196,7 @@ class BannerAdWrapper(private val ad: HeliumBannerAd) { fun getAdSize(): String { val size = ad.getSize() val creativeSize = partnerAd?.let { - Size( - (it.width / displayDensity).toInt(), (it.height / displayDensity).toInt() - ) + Size((it.width / displayDensity).toInt(), (it.height / displayDensity).toInt()) } val json = JSONObject() @@ -211,8 +208,8 @@ class BannerAdWrapper(private val ad: HeliumBannerAd) { else -> 0 }) json.put("aspectRatio", size?.aspectRatio) - json.put("width", creativeSize?.width ?: { size?.width }) - json.put("height", creativeSize?.height ?: { size?.height }) + json.put("width", creativeSize?.width ?: 0) + json.put("height", creativeSize?.height ?: 0) json.put("type", size?.isAdaptive) return json.toString() @@ -394,6 +391,7 @@ class BannerAdWrapper(private val ad: HeliumBannerAd) { bannerViewListener?.onAdDrag(this@BannerAdWrapper, x, y) } }) + layout.setBackgroundColor(Color.TRANSPARENT) usesGravity = false // Attach the banner layout to the activity. diff --git a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerLayout.kt b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerLayout.kt index 0a035f26..6aad028e 100644 --- a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerLayout.kt +++ b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/BannerLayout.kt @@ -4,15 +4,26 @@ import android.content.Context import android.view.MotionEvent import android.widget.RelativeLayout import com.chartboost.heliumsdk.ad.HeliumBannerAd -import kotlin.math.sqrt import kotlin.math.pow +import kotlin.math.sqrt -class BannerLayout( - context: Context, - private var bannerView: HeliumBannerAd, +class BannerLayout : RelativeLayout { + private var bannerView: HeliumBannerAd private var dragListener: IBannerDragListener -) : RelativeLayout(context) { - var canDrag: Boolean = true + + constructor( + context: Context, + bannerView: HeliumBannerAd, + dragListener: IBannerDragListener + ) : super(context) { + this.bannerView = bannerView + this.dragListener = dragListener + + // making it clickable here allows onInterceptTouchEvent to intercept touch events on bannerView + bannerView.isClickable = true; + } + + var canDrag: Boolean = false private val dragThresholdDistance = 10 // in pixels private var startX: Int = 0 diff --git a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/UnityBridge.kt b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/UnityBridge.kt index d8730c2c..a3e9570f 100644 --- a/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/UnityBridge.kt +++ b/com.chartboost.mediation/Android~/chartboost-mediation-android-bridge/src/main/java/com/chartboost/mediation/unity/UnityBridge.kt @@ -173,8 +173,7 @@ class UnityBridge { @JvmStatic fun getBannerAd(placementName: String, size: Int): AdWrapper { // default to standard - val wantedSize = - when (size) { + val wantedSize = when (size) { 0 -> HeliumBannerAd.HeliumBannerSize.STANDARD 1 -> HeliumBannerAd.HeliumBannerSize.MEDIUM 2 -> HeliumBannerAd.HeliumBannerSize.LEADERBOARD diff --git a/com.chartboost.mediation/Editor/ChartboostMediationUnityBannerAdEditor.cs b/com.chartboost.mediation/Editor/ChartboostMediationUnityBannerAdEditor.cs index 9af738b3..ffb7c335 100644 --- a/com.chartboost.mediation/Editor/ChartboostMediationUnityBannerAdEditor.cs +++ b/com.chartboost.mediation/Editor/ChartboostMediationUnityBannerAdEditor.cs @@ -1,14 +1,8 @@ #if UNITY_EDITOR - - -using System; using Chartboost.AdFormats.Banner; using Chartboost.AdFormats.Banner.Unity; using Chartboost.Banner; -using Chartboost.Utilities; using UnityEditor; -using UnityEngine; -using static Chartboost.Utilities.Constants; namespace Chartboost.Editor { @@ -16,24 +10,24 @@ namespace Chartboost.Editor internal class ChartboostMediationUnityBannerAdEditor : UnityEditor.Editor { private SerializedProperty _sizeTypeSP; + private SerializedProperty _resizeOptionSP; private SerializedProperty _horizontalAlignmentSP; private SerializedProperty _verticalAlignmentSP; - private SerializedProperty _resizeToFitSP; - - private bool _resizeToFit; + private ChartboostMediationBannerSizeType _sizeType = ChartboostMediationBannerSizeType.Standard; + private ResizeOption _resizeOption = ResizeOption.Disabled; private ChartboostMediationBannerHorizontalAlignment _horizontalAlignment = ChartboostMediationBannerHorizontalAlignment.Center; private ChartboostMediationBannerVerticalAlignment _verticalAlignment = ChartboostMediationBannerVerticalAlignment.Center; private void OnEnable() { _sizeTypeSP = serializedObject.FindProperty("sizeType"); + _resizeOptionSP = serializedObject.FindProperty("resizeOption"); _horizontalAlignmentSP = serializedObject.FindProperty("horizontalAlignment"); _verticalAlignmentSP = serializedObject.FindProperty("verticalAlignment"); - _resizeToFitSP = serializedObject.FindProperty("resizeToFit"); _sizeType = (ChartboostMediationBannerSizeType)_sizeTypeSP.intValue; - _resizeToFit = _resizeToFitSP.boolValue; + _resizeOption = (ResizeOption)_resizeOptionSP.intValue; _horizontalAlignment = (ChartboostMediationBannerHorizontalAlignment)_horizontalAlignmentSP.intValue; _verticalAlignment = (ChartboostMediationBannerVerticalAlignment)_verticalAlignmentSP.intValue; } @@ -41,27 +35,24 @@ private void OnEnable() public override void OnInspectorGUI() { DrawDefaultInspector(); - + _sizeType = (ChartboostMediationBannerSizeType)EditorGUILayout.EnumPopup("Size", _sizeType); - if (_sizeType == (int)ChartboostMediationBannerSizeType.Adaptive) + if (_sizeType == ChartboostMediationBannerSizeType.Adaptive) { - _resizeToFit = EditorGUILayout.Toggle("Resize To Fit", _resizeToFit); - - if (!_resizeToFitSP.boolValue) - { - _horizontalAlignment = (ChartboostMediationBannerHorizontalAlignment)EditorGUILayout.EnumPopup("Horizontal Alignment", _horizontalAlignment); - _verticalAlignment = (ChartboostMediationBannerVerticalAlignment)EditorGUILayout.EnumPopup("Vertical Alignment", _verticalAlignment); - } + _resizeOption = (ResizeOption) EditorGUILayout.EnumPopup("Resize", _resizeOption); + _horizontalAlignment = (ChartboostMediationBannerHorizontalAlignment)EditorGUILayout.EnumPopup("Horizontal Alignment", _horizontalAlignment); + _verticalAlignment = (ChartboostMediationBannerVerticalAlignment)EditorGUILayout.EnumPopup("Vertical Alignment", _verticalAlignment); } else { var unityBannerAd = target as ChartboostMediationUnityBannerAd; + // ReSharper disable once PossibleNullReferenceException unityBannerAd.LockToFixedSize(_sizeType); } _sizeTypeSP.intValue = (int)_sizeType; - _resizeToFitSP.boolValue = _resizeToFit; + _resizeOptionSP.intValue = (int)_resizeOption; _horizontalAlignmentSP.intValue = (int)_horizontalAlignment; _verticalAlignmentSP.intValue = (int)_verticalAlignment; diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs new file mode 100644 index 00000000..37f377eb --- /dev/null +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs @@ -0,0 +1,9 @@ +namespace Chartboost.AdFormats.Banner +{ + public enum ChartboostMediationBannerResizeAxis + { + Horizontal, + Vertical, + Both + } +} diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs.meta b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs.meta new file mode 100644 index 00000000..2a765e14 --- /dev/null +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerResizeAxis.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 58fd8e29c32449e5a0f7efbbddeafd5a +timeCreated: 1694472284 \ No newline at end of file diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewAndroid.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewAndroid.cs index 00dee687..1dc90ed1 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewAndroid.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewAndroid.cs @@ -50,7 +50,11 @@ public override Dictionary Keywords public override BidInfo WinningBidInfo { - get => _bannerAd.Get("winningBidInfo").MapToWinningBidInfo(); + get + { + var winningBidInfo = _bannerAd.Get("winningBidInfo"); + return winningBidInfo?.MapToWinningBidInfo() ?? new BidInfo(); + } protected set { } } @@ -68,11 +72,13 @@ public override Metrics? LoadMetrics protected set { } } - public override ChartboostMediationBannerAdSize AdSize + public override ChartboostMediationBannerAdSize? AdSize { get { var sizeJson = _bannerAd.Call("getAdSize"); + if (string.IsNullOrEmpty(sizeJson)) + return null; return JsonConvert.DeserializeObject(sizeJson); } protected set { } @@ -93,6 +99,7 @@ public override ChartboostMediationBannerVerticalAlignment VerticalAlignment public override async Task Load(ChartboostMediationBannerAdLoadRequest request, ChartboostMediationBannerAdScreenLocation screenLocation) { await base.Load(request, screenLocation); + Request = request; if (LoadRequest != null) { @@ -112,6 +119,7 @@ public override async Task Load(Chartboos public override async Task Load(ChartboostMediationBannerAdLoadRequest request, float x, float y) { await base.Load(request, x, y); + Request = request; if (LoadRequest != null) { @@ -129,6 +137,13 @@ public override async Task Load(Chartboos return result; } + public override void ResizeToFit(ChartboostMediationBannerResizeAxis axis = ChartboostMediationBannerResizeAxis.Both, + Vector2 pivot = default) + { + base.ResizeToFit(axis, pivot); + _bannerAd.Call("resizeToFit", (int)axis, pivot.x, 1 - pivot.y); + } + public override void SetDraggability(bool canDrag) { base.SetDraggability(canDrag); diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewBase.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewBase.cs index 24330dfa..2313f7a5 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewBase.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewBase.cs @@ -6,6 +6,7 @@ using Chartboost.Requests; using Chartboost.Results; using Chartboost.Utilities; +using UnityEngine; using Logger = Chartboost.Utilities.Logger; namespace Chartboost.AdFormats.Banner @@ -32,9 +33,10 @@ protected ChartboostMediationBannerViewBase(IntPtr uniqueId) public abstract BidInfo WinningBidInfo { get; protected set; } public abstract string LoadId { get; protected set; } public abstract Metrics? LoadMetrics { get; protected set; } - public abstract ChartboostMediationBannerAdSize AdSize { get; protected set; } + public abstract ChartboostMediationBannerAdSize? AdSize { get; protected set; } public abstract ChartboostMediationBannerHorizontalAlignment HorizontalAlignment { get; set; } public abstract ChartboostMediationBannerVerticalAlignment VerticalAlignment { get; set; } + public virtual Task Load(ChartboostMediationBannerAdLoadRequest request, ChartboostMediationBannerAdScreenLocation screenLocation) { Request = request; @@ -50,6 +52,7 @@ public virtual Task Load(ChartboostMediat public virtual Task Load(ChartboostMediationBannerAdLoadRequest request, float x, float y) { + Request = request; if (!CanFetchAd(request.PlacementName)) { var error = new ChartboostMediationError("Chartboost Mediation is not ready or placement is invalid."); @@ -59,10 +62,19 @@ public virtual Task Load(ChartboostMediat Logger.Log(LogTag, $"Loading banner ad for placement {request.PlacementName} and size {request.Size.SizeType} at ({x}, {y})"); return Task.FromResult(null); } - - public virtual void SetDraggability(bool canDrag) => Logger.Log(LogTag, $"Setting Draggability to {canDrag}"); - public virtual void SetVisibility(bool visibility) => Logger.Log(LogTag, $"Setting Visibility to {visibility}"); - public virtual void Reset() => Logger.Log(LogTag, $"Resetting banner ad"); + + public virtual void ResizeToFit(ChartboostMediationBannerResizeAxis axis = ChartboostMediationBannerResizeAxis.Both, Vector2 pivot = default) + => Logger.Log(LogTag, $"Resizing at axis {axis} with pivot {pivot}"); + + public virtual void SetDraggability(bool canDrag) + => Logger.Log(LogTag, $"Setting Draggability to {canDrag}"); + + public virtual void SetVisibility(bool visibility) + => Logger.Log(LogTag, $"Setting Visibility to {visibility}"); + + public virtual void Reset() + => Logger.Log(LogTag, $"Resetting banner ad"); + public virtual void Destroy() { Logger.Log(LogTag, $"Removing/Destroying banner ad"); diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewIOS.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewIOS.cs index 8fa7cc1d..c23aeb93 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewIOS.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewIOS.cs @@ -1,14 +1,10 @@ #if UNITY_IPHONE using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; using System.Linq; using System.Runtime.InteropServices; using System.Threading.Tasks; using Chartboost.Banner; -using Chartboost.Platforms; using Chartboost.Requests; using Chartboost.Results; using Chartboost.Utilities; @@ -57,8 +53,8 @@ protected set { } public override string LoadId { // TODO: why metrics is a list ? - get => LoadMetrics?.metrics.FirstOrDefault().loadId; - protected set {} + get => LoadMetrics?.metrics != null ? LoadMetrics?.metrics.FirstOrDefault().loadId : ""; + protected set {} } public override Metrics? LoadMetrics @@ -72,7 +68,7 @@ public override Metrics? LoadMetrics protected set { } } - public override ChartboostMediationBannerAdSize AdSize + public override ChartboostMediationBannerAdSize? AdSize { get { @@ -97,6 +93,7 @@ public override ChartboostMediationBannerVerticalAlignment VerticalAlignment public override async Task Load(ChartboostMediationBannerAdLoadRequest request, ChartboostMediationBannerAdScreenLocation screenLocation) { + Request = request; await base.Load(request, screenLocation); var (proxy, hashCode) = _setupProxy(); @@ -115,7 +112,9 @@ public override async Task Load(Chartboos public override async Task Load(ChartboostMediationBannerAdLoadRequest request, float x, float y) { + Request = request; await base.Load(request, x, y); + var (proxy, hashCode) = _setupProxy(); CacheManager.TrackBannerAdLoadRequest(hashCode, request); @@ -131,6 +130,13 @@ public override async Task Load(Chartboos return result; } + public override void ResizeToFit(ChartboostMediationBannerResizeAxis axis = ChartboostMediationBannerResizeAxis.Both, + Vector2 pivot = default) + { + base.ResizeToFit(axis, pivot); + _chartboostMediationBannerViewResizeToFit(UniqueId, (int)axis, pivot.x, 1-pivot.y); + } + public override void SetDraggability(bool canDrag) { base.SetDraggability(canDrag); @@ -187,6 +193,9 @@ public override void Destroy() [DllImport("__Internal")] private static extern int _chartboostMediationBannerViewGetVerticalAlignment(IntPtr uniqueId); + [DllImport("__Internal")] + private static extern void _chartboostMediationBannerViewResizeToFit(IntPtr uniqueId, int axis, float pivotX, float pivotY ); + [DllImport("__Internal")] private static extern void _chartboostMediationBannerViewSetDraggability(IntPtr uniqueId, bool canDrag ); diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewUnsupported.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewUnsupported.cs index 4a58f058..7702cd49 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewUnsupported.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/ChartboostMediationBannerViewUnsupported.cs @@ -19,7 +19,7 @@ public ChartboostMediationBannerViewUnsupported() public override BidInfo WinningBidInfo { get; protected set; } public override string LoadId { get; protected set; } public override Metrics? LoadMetrics { get; protected set; } - public override ChartboostMediationBannerAdSize AdSize { get; protected set; } + public override ChartboostMediationBannerAdSize? AdSize { get; protected set; } public override ChartboostMediationBannerHorizontalAlignment HorizontalAlignment { get; set; } public override ChartboostMediationBannerVerticalAlignment VerticalAlignment { get; set; } public override Task Load(ChartboostMediationBannerAdLoadRequest request, ChartboostMediationBannerAdScreenLocation screenLocation) diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/IChartboostMediationBannerView.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/IChartboostMediationBannerView.cs index 22b7895d..e765763b 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/IChartboostMediationBannerView.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/IChartboostMediationBannerView.cs @@ -5,6 +5,7 @@ using Chartboost.Events; using Chartboost.Requests; using Chartboost.Results; +using UnityEngine; namespace Chartboost.AdFormats.Banner { @@ -31,11 +32,12 @@ public interface IChartboostMediationBannerView abstract ChartboostMediationBannerAdLoadRequest Request { get; } abstract BidInfo WinningBidInfo { get; } abstract string LoadId { get; } - abstract ChartboostMediationBannerAdSize AdSize { get; } + abstract ChartboostMediationBannerAdSize? AdSize { get; } abstract ChartboostMediationBannerHorizontalAlignment HorizontalAlignment { get; set; } abstract ChartboostMediationBannerVerticalAlignment VerticalAlignment { get; set; } abstract Task Load(ChartboostMediationBannerAdLoadRequest request, ChartboostMediationBannerAdScreenLocation screenLocation); abstract Task Load(ChartboostMediationBannerAdLoadRequest request, float x, float y); + abstract void ResizeToFit(ChartboostMediationBannerResizeAxis axis = ChartboostMediationBannerResizeAxis.Both, Vector2 pivot = default); abstract void SetDraggability(bool canDrag); abstract void SetVisibility(bool visibility); abstract void Reset(); diff --git a/com.chartboost.mediation/Runtime/AdFormats/Banner/Unity/ChartboostMediationUnityBannerAd.cs b/com.chartboost.mediation/Runtime/AdFormats/Banner/Unity/ChartboostMediationUnityBannerAd.cs index a1b0113e..20eb6639 100644 --- a/com.chartboost.mediation/Runtime/AdFormats/Banner/Unity/ChartboostMediationUnityBannerAd.cs +++ b/com.chartboost.mediation/Runtime/AdFormats/Banner/Unity/ChartboostMediationUnityBannerAd.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Chartboost.Banner; +using Chartboost.Platforms; using Chartboost.Requests; using Chartboost.Results; using Chartboost.Utilities; @@ -16,6 +17,14 @@ namespace Chartboost.AdFormats.Banner.Unity public delegate void ChartboostMediationUnityBannerAdEvent(); public delegate void ChartboostMediationUnityBannerAdDragEvent(float x, float y); + + public enum ResizeOption + { + FitHorizontal, + FitVertical, + FitBoth, + Disabled + } [RequireComponent(typeof(RectTransform))] public partial class ChartboostMediationUnityBannerAd : MonoBehaviour @@ -25,17 +34,15 @@ public partial class ChartboostMediationUnityBannerAd : MonoBehaviour public ChartboostMediationUnityBannerAdEvent DidRecordImpression; public ChartboostMediationUnityBannerAdDragEvent DidDrag; - [SerializeField] - private bool autoLoadOnInit = true; [SerializeField] private string placementName; [SerializeField] - private bool draggable = true; + private bool draggable; - [SerializeField][HideInInspector][InspectorName("Size")] + [SerializeField][HideInInspector] private ChartboostMediationBannerSizeType sizeType; - [SerializeField][HideInInspector] - private bool resizeToFit; + [SerializeField][HideInInspector] + private ResizeOption resizeOption = ResizeOption.FitBoth; [SerializeField][HideInInspector] private ChartboostMediationBannerHorizontalAlignment horizontalAlignment = ChartboostMediationBannerHorizontalAlignment.Center; [SerializeField][HideInInspector] @@ -50,8 +57,6 @@ private void Start() { LockToFixedSize(sizeType); } - - ChartboostMediation.DidStart += ChartboostMediationOnDidStart; } private void OnEnable() => BannerView?.SetVisibility(true); @@ -77,9 +82,17 @@ public bool Draggable draggable = value; } } - - public bool ResizeToFit { get => resizeToFit; set => resizeToFit = value; } - + + public ResizeOption ResizeOption + { + get => resizeOption; + set + { + resizeOption = value; + Resize(); + } + } + public async Task Load() { if (string.IsNullOrEmpty(placementName)) @@ -118,14 +131,15 @@ public Dictionary Keywords public string LoadId => BannerView?.LoadId; - public ChartboostMediationBannerAdSize AdSize => BannerView?.AdSize ?? ChartboostMediationBannerAdSize.Adaptive(0,0); + public ChartboostMediationBannerAdSize? AdSize => BannerView?.AdSize; public ChartboostMediationBannerHorizontalAlignment HorizontalAlignment { get => horizontalAlignment; set { - BannerView.HorizontalAlignment = value; + if(BannerView != null) + BannerView.HorizontalAlignment = value; horizontalAlignment = value; } } @@ -135,12 +149,13 @@ public ChartboostMediationBannerVerticalAlignment VerticalAlignment get => verticalAlignment; set { - BannerView.VerticalAlignment = value; + if(BannerView != null) + BannerView.VerticalAlignment = value; verticalAlignment = value; } } - public void ResetAd() => BannerView.Reset(); + public void ResetAd() => BannerView?.Reset(); #endregion @@ -185,32 +200,11 @@ public override string ToString() } #region Events - - private async void ChartboostMediationOnDidStart(string error) - { - if (string.IsNullOrEmpty(error)) - { - if (autoLoadOnInit) - { - await Load(); - } - } - } private void OnLoad(IChartboostMediationBannerView bannerView) { DidLoad?.Invoke(); - - if (ResizeToFit) - { - var canvas = GetComponentInParent(); - var canvasScale = canvas.transform.localScale.x; - var width = ChartboostMediationConverters.NativeToPixels(AdSize.Width) / canvasScale; - var height = ChartboostMediationConverters.NativeToPixels(AdSize.Height) / canvasScale; - var rect = GetComponent(); - rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width); - rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); - } + Resize(); } private void OnRecordImpression(IChartboostMediationBannerView bannerView) => DidRecordImpression?.Invoke(); @@ -221,11 +215,12 @@ private void OnDrag(IChartboostMediationBannerView bannerView, float x, float y) { // x,y obtained from native is for top left corner (x = 0,y = 1) // RectTransform pivot may or may not be top-left (it's usually at center) - var pivot = GetComponent().pivot; - var widthInPixels = ChartboostMediationConverters.NativeToPixels(AdSize.Width); - var heightInPixels = ChartboostMediationConverters.NativeToPixels(AdSize.Height); - x += widthInPixels * pivot.x; // top-left x is 0 - y += heightInPixels * (pivot.y - 1); // top-left y is 1 + var rect = GetComponent(); + var pivot = rect.pivot; + var widthInPixels = rect.LayoutParams().width; + var heightInPixels = rect.LayoutParams().height; + x += widthInPixels * pivot.x; + y -= heightInPixels - heightInPixels * pivot.y; transform.position = new Vector3(x, y, 0); DidDrag?.Invoke(x, y); @@ -237,6 +232,38 @@ private void SetSizeType(ChartboostMediationBannerSizeType sizeType) { this.sizeType = sizeType; } + + private void Resize() + { + // Cannot resize until BannerView is loaded with Ad + var adSize = AdSize ?? ChartboostMediationBannerAdSize.Adaptive(0, 0); + if (Request?.Size.BannerType == ChartboostMediationBannerType.Fixed || adSize.SizeType == ChartboostMediationBannerSizeType.Unknown || + adSize is { Width: 0, Height: 0 }) + return; + + var rect = GetComponent(); + var canvasScale = GetComponentInParent().transform.localScale.x; + var width = ChartboostMediationConverters.NativeToPixels(adSize.Width)/canvasScale; + var height = ChartboostMediationConverters.NativeToPixels(adSize.Height)/canvasScale; + switch (resizeOption) + { + case ResizeOption.FitHorizontal: + rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width); + break; + case ResizeOption.FitVertical: + rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); + break; + case ResizeOption.FitBoth: + rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width); + rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); + break; + case ResizeOption.Disabled: + default: + return; + } + + BannerView?.ResizeToFit((ChartboostMediationBannerResizeAxis)resizeOption, rect.pivot); + } private IChartboostMediationBannerView BannerView { @@ -250,7 +277,6 @@ private IChartboostMediationBannerView BannerView _bannerView.DidRecordImpression += OnRecordImpression; _bannerView.DidDrag += OnDrag; - _bannerView.SetVisibility(gameObject.activeSelf); _bannerView.SetDraggability(Draggable); } diff --git a/com.chartboost.mediation/Runtime/Banner/ChartboostMediationBannerAdSize.cs b/com.chartboost.mediation/Runtime/Banner/ChartboostMediationBannerAdSize.cs index 27695697..8ee2abc1 100644 --- a/com.chartboost.mediation/Runtime/Banner/ChartboostMediationBannerAdSize.cs +++ b/com.chartboost.mediation/Runtime/Banner/ChartboostMediationBannerAdSize.cs @@ -1,8 +1,6 @@ using System; using Chartboost.Utilities; using Newtonsoft.Json; -using UnityEngine; -using static Chartboost.Utilities.Constants; namespace Chartboost.Banner { @@ -14,10 +12,11 @@ public enum ChartboostMediationBannerType public enum ChartboostMediationBannerSizeType { - Adaptive, - Standard, - Medium, - Leaderboard + Unknown = -1, + Standard = 0, + Medium = 1, + Leaderboard = 2, + Adaptive = 3, } /// diff --git a/com.chartboost.mediation/Runtime/ChartboostMediation.cs b/com.chartboost.mediation/Runtime/ChartboostMediation.cs index dc76b821..76d02dc5 100644 --- a/com.chartboost.mediation/Runtime/ChartboostMediation.cs +++ b/com.chartboost.mediation/Runtime/ChartboostMediation.cs @@ -237,8 +237,7 @@ public static ChartboostMediationUnityBannerAd GetUnityBannerAd(string placement unityBannerAd.PlacementName = placementName; return unityBannerAd; } - - + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] private static void Init() { @@ -267,5 +266,6 @@ public static void StartWithOptions(string appId, string appSignature, string[] public static void SetUserIdentifier(string userIdentifier) => _chartboostMediationExternal.SetUserIdentifier(userIdentifier); public static string GetUserIdentifier() => _chartboostMediationExternal.GetUserIdentifier(); public static void SetTestMode(bool testModeEnabled) => _chartboostMediationExternal.SetTestMode(testModeEnabled); + public static void DiscardOversizedAds(bool shouldDiscard) => _chartboostMediationExternal.DiscardOversizedAds(shouldDiscard); } } diff --git a/com.chartboost.mediation/Runtime/Platforms/Android/ChartboostMediationAndroid.cs b/com.chartboost.mediation/Runtime/Platforms/Android/ChartboostMediationAndroid.cs index 3e34d50a..3543b223 100644 --- a/com.chartboost.mediation/Runtime/Platforms/Android/ChartboostMediationAndroid.cs +++ b/com.chartboost.mediation/Runtime/Platforms/Android/ChartboostMediationAndroid.cs @@ -128,6 +128,13 @@ public override void SetTestMode(bool testModeEnabled) nativeSDK.CallStatic("setTestMode", testModeEnabled); } + public override void DiscardOversizedAds(bool shouldDiscard) + { + base.DiscardOversizedAds(shouldDiscard); + using var nativeSDK = GetNativeSDK(); + nativeSDK.CallStatic("setShouldDiscardOversizedAds", shouldDiscard); + } + public override void Destroy() { if (!CheckInitialized()) diff --git a/com.chartboost.mediation/Runtime/Platforms/ChartboostMediationExternal.cs b/com.chartboost.mediation/Runtime/Platforms/ChartboostMediationExternal.cs index 7730bd43..05ff1fc1 100644 --- a/com.chartboost.mediation/Runtime/Platforms/ChartboostMediationExternal.cs +++ b/com.chartboost.mediation/Runtime/Platforms/ChartboostMediationExternal.cs @@ -81,8 +81,10 @@ public virtual string GetUserIdentifier() public virtual void SetTestMode(bool testModeEnabled) => Logger.Log(LogTag, $"SetTestMode {testModeEnabled}"); - + public virtual void DiscardOversizedAds(bool shouldDiscard) + => Logger.Log(LogTag, $"DiscardOversizedAds : {shouldDiscard}"); + public virtual void Destroy() => Logger.Log(LogTag, "Destroy"); diff --git a/com.chartboost.mediation/Runtime/Platforms/IOS/ChartboostMediationIOS.cs b/com.chartboost.mediation/Runtime/Platforms/IOS/ChartboostMediationIOS.cs index 7e7cdb96..2b3e9c1a 100644 --- a/com.chartboost.mediation/Runtime/Platforms/IOS/ChartboostMediationIOS.cs +++ b/com.chartboost.mediation/Runtime/Platforms/IOS/ChartboostMediationIOS.cs @@ -40,6 +40,9 @@ internal sealed partial class ChartboostMediationIOS : ChartboostMediationExtern [DllImport("__Internal")] private static extern void _chartboostMediationSetTestMode(bool isTestMode); + + [DllImport("__Internal")] + private static extern void _chartboostMediationDiscardOversizedAds(bool shouldDiscard); [DllImport("__Internal")] private static extern float _chartboostMediationGetUIScaleFactor(); @@ -147,6 +150,12 @@ public override void SetTestMode(bool testModeEnabled) _chartboostMediationSetTestMode(testModeEnabled); } + public override void DiscardOversizedAds(bool shouldDiscard) + { + base.DiscardOversizedAds(shouldDiscard); + _chartboostMediationDiscardOversizedAds(shouldDiscard); + } + public static float GetUIScaleFactor() { return _chartboostMediationGetUIScaleFactor(); diff --git a/com.chartboost.mediation/Runtime/Plugins/Android/chartboost-mediation-android-bridge.jar b/com.chartboost.mediation/Runtime/Plugins/Android/chartboost-mediation-android-bridge.jar index 64345ab8..f44ff698 100644 Binary files a/com.chartboost.mediation/Runtime/Plugins/Android/chartboost-mediation-android-bridge.jar and b/com.chartboost.mediation/Runtime/Plugins/Android/chartboost-mediation-android-bridge.jar differ diff --git a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.h b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.h index 0b611bd6..25eb65e9 100644 --- a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.h +++ b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.h @@ -17,16 +17,17 @@ typedef void (*ChartboostMediationBannerAdDragEvent)(void* uniqueId, float x, float y); - @interface ChartboostMediationBannerAdWrapper : NSObject @property ChartboostMediationBannerView* bannerView; @property ChartboostMediationBannerAdDragEvent dragListener; @property UIPanGestureRecognizer *panGesture; @property BOOL canDrag; +@property BOOL usesConstraints; - (instancetype)initWithBannerView: (ChartboostMediationBannerView*) bannerView andDragListener:(ChartboostMediationBannerAdDragEvent) dragListener; - (void)setDraggable:(BOOL)canDrag; +- (void) resize:(int)axis pivotX:(float) pivotX pivotY:(float)pivotY; @end #endif /* ChartboostMediationBannerAdWrapper_h */ diff --git a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.m b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.m index 352956fa..91c295e4 100644 --- a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.m +++ b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationBannerAdWrapper.m @@ -10,33 +10,82 @@ @implementation ChartboostMediationBannerAdWrapper -- (instancetype)initWithBannerView:(ChartboostMediationBannerView *)bannerView andDragListener:(ChartboostMediationBannerAdDragEvent)dragListener -{ +- (instancetype)initWithBannerView:(ChartboostMediationBannerView *)bannerView andDragListener:(ChartboostMediationBannerAdDragEvent)dragListener{ self.bannerView = bannerView; self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; [self.bannerView addGestureRecognizer:self.panGesture]; self.dragListener = dragListener; - self.canDrag = true; // default is true + self.canDrag = false; - NSLog(@"Wrapper created"); return self; } - -- (void)setDraggable: (BOOL) canDrag { +- (void)setDraggable: (BOOL) canDrag{ self.canDrag = canDrag; - [self.bannerView removeGestureRecognizer:self.panGesture]; if(self.canDrag) [self.bannerView addGestureRecognizer:self.panGesture]; } +- (void) resize:(int)axis pivotX:(float) pivotX pivotY:(float)pivotY { + CGRect frame = _bannerView.frame; + CGSize newSize = _bannerView.size.size; + NSLog(@"Initial Frame => origin : (%f, %f), size : (%f, %f)", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); + + // if container is positioned using constraints then pivot and constraints are pretty much the same + // so we don't make any adjustments in container's position + if(self.usesConstraints){ + switch (axis) { + case 0: // Horizontal + frame.size.width = newSize.width; + break; + case 1: // Vertical + frame.size.height = newSize.height; + break; + default: // both + frame.size = newSize; + break; + } + } + // if no constraints are in use then we manually position it by moving it around its pivot + else + { + CGSize size = frame.size; + CGPoint origin = frame.origin; + CGPoint pivot = CGPointMake(origin.x + (pivotX * size.width) , origin.y + (pivotY * size.height)); + NSLog(@"pivot : (%f, %f)", pivot.x, pivot.y); + + // Find top-left corner of newSize w.r.t pivot + float left = pivotX * newSize.width; + float top = pivotY * newSize.height; + NSLog(@"Left : %f, Top : %f newSize : (%f, %f)", left, top, newSize.width, newSize.height); + + // Resize and move container to top-left of new size + CGPoint topLeft = CGPointMake(pivot.x - left, pivot.y - top); + NSLog(@"Topleft : (%f, %f)", topLeft.x, topLeft.y); + + switch(axis){ + case 0: // Horizontal + frame.size.width = newSize.width; + frame.origin.x = topLeft.x; + break; + case 1: // Vertical + frame.size.height = newSize.height; + frame.origin.y = topLeft.y; + break; + default: // both + frame = CGRectMake(topLeft.x, topLeft.y, newSize.width, newSize.height); + break; + } + } + NSLog(@"Final Frame => origin : (%f, %f), size : (%f, %f)", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); + _bannerView.frame = frame; +} -- (void)handlePan:(UIPanGestureRecognizer *)gr -{ +- (void)handlePan:(UIPanGestureRecognizer *)gr{ if(!self.canDrag) return; @@ -53,5 +102,4 @@ - (void)handlePan:(UIPanGestureRecognizer *)gr self.dragListener((__bridge void*)self, x, y); } - @end diff --git a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationUnityBridge.mm b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationUnityBridge.mm index 8fa72862..659e2f21 100644 --- a/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationUnityBridge.mm +++ b/com.chartboost.mediation/Runtime/Plugins/iOS/ChartboostMediationUnityBridge.mm @@ -598,6 +598,11 @@ void _chartboostMediationSetTestMode(BOOL isTestModeEnabled) function([ChartboostMediationObserver sharedObserver], implementation.selector, isTestModeEnabled); } +void _chartboostMediationDiscardOversizedAds(BOOL shouldDiscard) +{ + [[Helium sharedHelium] setDiscardOversizedAds:shouldDiscard]; +} + void * _chartboostMediationGetInterstitialAd(const char *placementName) { id ad = [[Helium sharedHelium] interstitialAdProviderWithDelegate: [ChartboostMediationObserver sharedObserver] andPlacementName: GetStringParam(placementName)]; @@ -936,16 +941,16 @@ void _chartboostMediationFreeAdObject(const void * uniqueId, const char * placem return (__bridge void*)wrapper; } -void _chartboostMediationBannerViewLoadAdWithScreenPos(const void *uniqueId, const char *placementName, long sizeType, float width, float height, long screenLocation, int hashCode, ChartboostMediationBannerAdLoadResultEvent callback) { +void _chartboostMediationBannerViewLoadAdWithScreenPos(const void *uniqueId, const char *placementName, int sizeType, float width, float height, long screenLocation, int hashCode, ChartboostMediationBannerAdLoadResultEvent callback) { ChartboostMediationBannerView *bannerView = _getBannerView(uniqueId); - - ChartboostMediationBannerSize *size; + + ChartboostMediationBannerSize *size; switch(sizeType){ - case -1 : size = [ChartboostMediationBannerSize adaptiveWithWidth:width maxHeight:height]; break; case 0 : size = [ChartboostMediationBannerSize standard]; break; case 1 : size = [ChartboostMediationBannerSize medium]; break; case 2 : size = [ChartboostMediationBannerSize leaderboard]; break; - default: size = [ChartboostMediationBannerSize standard]; break; + case 3 : size = [ChartboostMediationBannerSize adaptiveWithWidth:width maxHeight:height]; break; + default: size = [ChartboostMediationBannerSize adaptiveWithWidth:0 maxHeight:0]; break; } ChartboostMediationBannerLoadRequest *loadRequest = [[ChartboostMediationBannerLoadRequest alloc] initWithPlacement:GetStringParam(placementName) size:size]; @@ -966,20 +971,20 @@ void _chartboostMediationBannerViewLoadAdWithScreenPos(const void *uniqueId, con const char *loadId = [[adLoadResult loadID] UTF8String]; const char *metricsJson = dictionaryToJSON([adLoadResult metrics]); callback(hashCode, uniqueId, loadId, metricsJson, "", ""); - }]; + }]; } -void _chartboostMediationBannerViewLoadAdWithXY(const void *uniqueId, const char *placementName, long sizeType, float width, float height, float x, float y, int hashCode, ChartboostMediationBannerAdLoadResultEvent callback) { +void _chartboostMediationBannerViewLoadAdWithXY(const void *uniqueId, const char *placementName, int sizeType, float width, float height, float x, float y, int hashCode, ChartboostMediationBannerAdLoadResultEvent callback) { ChartboostMediationBannerView *bannerView = _getBannerView(uniqueId); ChartboostMediationBannerSize *size; - switch(sizeType){ - case -1 : size = [ChartboostMediationBannerSize adaptiveWithWidth:width maxHeight:height]; break; - case 0 : size = [ChartboostMediationBannerSize standard]; break; - case 1 : size = [ChartboostMediationBannerSize medium]; break; - case 2 : size = [ChartboostMediationBannerSize leaderboard]; break; - default: size = [ChartboostMediationBannerSize standard]; break; - } + switch(sizeType){ + case 0 : size = [ChartboostMediationBannerSize standard]; break; + case 1 : size = [ChartboostMediationBannerSize medium]; break; + case 2 : size = [ChartboostMediationBannerSize leaderboard]; break; + case 3 : size = [ChartboostMediationBannerSize adaptiveWithWidth:width maxHeight:height]; break; + default: size = [ChartboostMediationBannerSize adaptiveWithWidth:0 maxHeight:0]; break; + } ChartboostMediationBannerLoadRequest *loadRequest = [[ChartboostMediationBannerLoadRequest alloc] initWithPlacement:GetStringParam(placementName) size:size]; UIViewController* viewController = [[ChartboostMediationObserver sharedObserver] getBannerViewController:bannerView size:size.size x:x y:y]; @@ -1021,14 +1026,14 @@ void _chartboostMediationBannerViewSetKeywords(const void* uniqueId, const char if(bannerView.size.type == 0) { // Fixed int width = bannerView.size.size.width; switch (width) { - case 320: sizeTypeValue = [NSString stringWithFormat:@"%d", 0]; break; - case 300: sizeTypeValue = [NSString stringWithFormat:@"%d", 1]; break; - case 728: sizeTypeValue = [NSString stringWithFormat:@"%d", 2]; break; - default:break; + case 320: sizeTypeValue = [NSString stringWithFormat:@"%d", 0]; break; // Standard + case 300: sizeTypeValue = [NSString stringWithFormat:@"%d", 1]; break; // Medium + case 728: sizeTypeValue = [NSString stringWithFormat:@"%d", 2]; break; // Leaderboard + default: sizeTypeValue = [NSString stringWithFormat:@"%d", -1];break; // Unknown } } else{ - sizeTypeValue = [NSString stringWithFormat:@"%d", -1]; + sizeTypeValue = [NSString stringWithFormat:@"%d", 3]; // Adaptive } NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:sizeTypeValue,sizeTypeKey,aspectRatioValue,aspectRatioKey,widthValue,widthKey,heightValue,heightKey,typeValue, typeKey, nil]; @@ -1037,12 +1042,16 @@ void _chartboostMediationBannerViewSetKeywords(const void* uniqueId, const char const char * _chartboostMediationBannerViewGetWinningBidInfo(const void* uniqueId){ ChartboostMediationBannerView *bannerView = _getBannerView(uniqueId); - return dictionaryToJSON(bannerView.winningBidInfo); + if(bannerView.winningBidInfo != nil) + return dictionaryToJSON(bannerView.winningBidInfo); + return NULL; } const char * _chartboostMediationBannerViewGetLoadMetrics(const void* uniqueId){ ChartboostMediationBannerView *bannerView = _getBannerView(uniqueId); - return dictionaryToJSON(bannerView.loadMetrics); + if(bannerView.loadMetrics != nil) + return dictionaryToJSON(bannerView.loadMetrics); + return NULL; } void _chartboostMediationBannerViewSetHorizontalAlignment(const void* uniqueId, int horizontalAlignment){ @@ -1067,6 +1076,11 @@ int _chartboostMediationBannerViewGetVerticalAlignment(const void* uniqueId){ return (int)bannerView.verticalAlignment; } +void _chartboostMediationBannerViewResizeToFit(const void* uniqueId, int axis, float pivotX, float pivotY) { + ChartboostMediationBannerAdWrapper *bannerWrapper = (__bridge ChartboostMediationBannerAdWrapper *)uniqueId; + [bannerWrapper resize:axis pivotX:pivotX pivotY:pivotY]; +} + void _chartboostMediationBannerViewSetDraggability(const void* uniqueId, BOOL canDrag){ ChartboostMediationBannerAdWrapper *bannerWrapper = (__bridge ChartboostMediationBannerAdWrapper *)uniqueId; [bannerWrapper setDraggable:canDrag];