删除原sdk
This commit is contained in:
parent
cf1aeccd31
commit
690a5e81e3
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8de7dc06d234246b388388a6760b3342
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 50d65beef4907445493567daa5ba2ecf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,546 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &144620207
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 144620210}
|
||||
- component: {fileID: 144620209}
|
||||
- component: {fileID: 144620208}
|
||||
- component: {fileID: 144620211}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &144620208
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 144620207}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &144620209
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 144620207}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.9487362, g: 0.9613346, b: 0.9811321, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &144620210
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 144620207}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1974370200}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &144620211
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 144620207}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 191f5798a75bd42589f98898505e981f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &484534187
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 484534191}
|
||||
- component: {fileID: 484534190}
|
||||
- component: {fileID: 484534189}
|
||||
- component: {fileID: 484534188}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &484534188
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 484534187}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &484534189
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 484534187}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!223 &484534190
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 484534187}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!224 &484534191
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 484534187}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
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, y: 0}
|
||||
--- !u!1 &498045477
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 498045479}
|
||||
- component: {fileID: 498045478}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &498045478
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 498045477}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &498045479
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 498045477}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &910476656
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 910476659}
|
||||
- component: {fileID: 910476658}
|
||||
- component: {fileID: 910476657}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &910476657
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 910476656}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &910476658
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 910476656}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &910476659
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 910476656}
|
||||
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: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1488306033
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1488306034}
|
||||
- component: {fileID: 1488306036}
|
||||
- component: {fileID: 1488306035}
|
||||
m_Layer: 5
|
||||
m_Name: RawImage
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1488306034
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1488306033}
|
||||
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: 1974370200}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -117}
|
||||
m_SizeDelta: {x: 500, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1488306035
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1488306033}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 2800000, guid: 5e326581693fd4e0db4c590543c3edc4, type: 3}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
--- !u!222 &1488306036
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1488306033}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!1 &1974370199
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1974370200}
|
||||
- component: {fileID: 1974370203}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1974370200
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1974370199}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 1488306034}
|
||||
m_Father: {fileID: 144620210}
|
||||
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, y: 0}
|
||||
--- !u!223 &1974370203
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1974370199}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ccc0ac08126704384bdda74c26d99797
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,427 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
|
||||
// Example for IronSource Unity.
|
||||
public class IronSourceDemoScript : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
#if UNITY_ANDROID
|
||||
string appKey = "85460dcd";
|
||||
#elif UNITY_IPHONE
|
||||
string appKey = "8545d445";
|
||||
#else
|
||||
string appKey = "unexpected_platform";
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Debug.Log("unity-script: IronSource.Agent.validateIntegration");
|
||||
IronSource.Agent.validateIntegration();
|
||||
|
||||
Debug.Log("unity-script: unity version" + IronSource.unityVersion());
|
||||
|
||||
// SDK init
|
||||
Debug.Log("unity-script: IronSource.Agent.init");
|
||||
IronSource.Agent.init(appKey);
|
||||
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
//Add Rewarded Video Events
|
||||
IronSourceEvents.onRewardedVideoAdOpenedEvent += RewardedVideoAdOpenedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdClosedEvent += RewardedVideoAdClosedEvent;
|
||||
IronSourceEvents.onRewardedVideoAvailabilityChangedEvent += RewardedVideoAvailabilityChangedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdStartedEvent += RewardedVideoAdStartedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdEndedEvent += RewardedVideoAdEndedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdRewardedEvent += RewardedVideoAdRewardedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdShowFailedEvent += RewardedVideoAdShowFailedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdClickedEvent += RewardedVideoAdClickedEvent;
|
||||
|
||||
//Add Rewarded Video DemandOnly Events
|
||||
IronSourceEvents.onRewardedVideoAdOpenedDemandOnlyEvent += RewardedVideoAdOpenedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdClosedDemandOnlyEvent += RewardedVideoAdClosedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdLoadedDemandOnlyEvent += RewardedVideoAdLoadedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdRewardedDemandOnlyEvent += RewardedVideoAdRewardedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdShowFailedDemandOnlyEvent += RewardedVideoAdShowFailedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdClickedDemandOnlyEvent += RewardedVideoAdClickedDemandOnlyEvent;
|
||||
IronSourceEvents.onRewardedVideoAdLoadFailedDemandOnlyEvent += RewardedVideoAdLoadFailedDemandOnlyEvent;
|
||||
|
||||
|
||||
// Add Offerwall Events
|
||||
IronSourceEvents.onOfferwallClosedEvent += OfferwallClosedEvent;
|
||||
IronSourceEvents.onOfferwallOpenedEvent += OfferwallOpenedEvent;
|
||||
IronSourceEvents.onOfferwallShowFailedEvent += OfferwallShowFailedEvent;
|
||||
IronSourceEvents.onOfferwallAdCreditedEvent += OfferwallAdCreditedEvent;
|
||||
IronSourceEvents.onGetOfferwallCreditsFailedEvent += GetOfferwallCreditsFailedEvent;
|
||||
IronSourceEvents.onOfferwallAvailableEvent += OfferwallAvailableEvent;
|
||||
|
||||
|
||||
// Add Interstitial Events
|
||||
IronSourceEvents.onInterstitialAdReadyEvent += InterstitialAdReadyEvent;
|
||||
IronSourceEvents.onInterstitialAdLoadFailedEvent += InterstitialAdLoadFailedEvent;
|
||||
IronSourceEvents.onInterstitialAdShowSucceededEvent += InterstitialAdShowSucceededEvent;
|
||||
IronSourceEvents.onInterstitialAdShowFailedEvent += InterstitialAdShowFailedEvent;
|
||||
IronSourceEvents.onInterstitialAdClickedEvent += InterstitialAdClickedEvent;
|
||||
IronSourceEvents.onInterstitialAdOpenedEvent += InterstitialAdOpenedEvent;
|
||||
IronSourceEvents.onInterstitialAdClosedEvent += InterstitialAdClosedEvent;
|
||||
|
||||
// Add Interstitial DemandOnly Events
|
||||
IronSourceEvents.onInterstitialAdReadyDemandOnlyEvent += InterstitialAdReadyDemandOnlyEvent;
|
||||
IronSourceEvents.onInterstitialAdLoadFailedDemandOnlyEvent += InterstitialAdLoadFailedDemandOnlyEvent;
|
||||
IronSourceEvents.onInterstitialAdShowFailedDemandOnlyEvent += InterstitialAdShowFailedDemandOnlyEvent;
|
||||
IronSourceEvents.onInterstitialAdClickedDemandOnlyEvent += InterstitialAdClickedDemandOnlyEvent;
|
||||
IronSourceEvents.onInterstitialAdOpenedDemandOnlyEvent += InterstitialAdOpenedDemandOnlyEvent;
|
||||
IronSourceEvents.onInterstitialAdClosedDemandOnlyEvent += InterstitialAdClosedDemandOnlyEvent;
|
||||
|
||||
|
||||
// Add Banner Events
|
||||
IronSourceEvents.onBannerAdLoadedEvent += BannerAdLoadedEvent;
|
||||
IronSourceEvents.onBannerAdLoadFailedEvent += BannerAdLoadFailedEvent;
|
||||
IronSourceEvents.onBannerAdClickedEvent += BannerAdClickedEvent;
|
||||
IronSourceEvents.onBannerAdScreenPresentedEvent += BannerAdScreenPresentedEvent;
|
||||
IronSourceEvents.onBannerAdScreenDismissedEvent += BannerAdScreenDismissedEvent;
|
||||
IronSourceEvents.onBannerAdLeftApplicationEvent += BannerAdLeftApplicationEvent;
|
||||
|
||||
//Add ImpressionSuccess Event
|
||||
IronSourceEvents.onImpressionSuccessEvent += ImpressionSuccessEvent;
|
||||
}
|
||||
|
||||
void OnApplicationPause(bool isPaused)
|
||||
{
|
||||
Debug.Log("unity-script: OnApplicationPause = " + isPaused);
|
||||
IronSource.Agent.onApplicationPause(isPaused);
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
|
||||
GUI.backgroundColor = Color.blue;
|
||||
GUI.skin.button.fontSize = (int)(0.035f * Screen.width);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Rect showRewardedVideoButton = new Rect(0.10f * Screen.width, 0.15f * Screen.height, 0.80f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(showRewardedVideoButton, "Show Rewarded Video"))
|
||||
{
|
||||
Debug.Log("unity-script: ShowRewardedVideoButtonClicked");
|
||||
if (IronSource.Agent.isRewardedVideoAvailable())
|
||||
{
|
||||
IronSource.Agent.showRewardedVideo();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("unity-script: IronSource.Agent.isRewardedVideoAvailable - False");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Rect showOfferwallButton = new Rect(0.10f * Screen.width, 0.25f * Screen.height, 0.80f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(showOfferwallButton, "Show Offerwall"))
|
||||
{
|
||||
if (IronSource.Agent.isOfferwallAvailable())
|
||||
{
|
||||
IronSource.Agent.showOfferwall();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("IronSource.Agent.isOfferwallAvailable - False");
|
||||
}
|
||||
}
|
||||
|
||||
Rect loadInterstitialButton = new Rect(0.10f * Screen.width, 0.35f * Screen.height, 0.35f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(loadInterstitialButton, "Load Interstitial"))
|
||||
{
|
||||
Debug.Log("unity-script: LoadInterstitialButtonClicked");
|
||||
IronSource.Agent.loadInterstitial();
|
||||
}
|
||||
|
||||
Rect showInterstitialButton = new Rect(0.55f * Screen.width, 0.35f * Screen.height, 0.35f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(showInterstitialButton, "Show Interstitial"))
|
||||
{
|
||||
Debug.Log("unity-script: ShowInterstitialButtonClicked");
|
||||
if (IronSource.Agent.isInterstitialReady())
|
||||
{
|
||||
IronSource.Agent.showInterstitial();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("unity-script: IronSource.Agent.isInterstitialReady - False");
|
||||
}
|
||||
}
|
||||
|
||||
Rect loadBannerButton = new Rect(0.10f * Screen.width, 0.45f * Screen.height, 0.35f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(loadBannerButton, "Load Banner"))
|
||||
{
|
||||
Debug.Log("unity-script: loadBannerButtonClicked");
|
||||
IronSource.Agent.loadBanner(IronSourceBannerSize.BANNER, IronSourceBannerPosition.BOTTOM);
|
||||
}
|
||||
|
||||
Rect destroyBannerButton = new Rect(0.55f * Screen.width, 0.45f * Screen.height, 0.35f * Screen.width, 0.08f * Screen.height);
|
||||
if (GUI.Button(destroyBannerButton, "Destroy Banner"))
|
||||
{
|
||||
Debug.Log("unity-script: loadBannerButtonClicked");
|
||||
IronSource.Agent.destroyBanner();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region RewardedAd callback handlers
|
||||
|
||||
void RewardedVideoAvailabilityChangedEvent(bool canShowAd)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAvailabilityChangedEvent, value = " + canShowAd);
|
||||
}
|
||||
|
||||
void RewardedVideoAdOpenedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdOpenedEvent");
|
||||
}
|
||||
|
||||
void RewardedVideoAdRewardedEvent(IronSourcePlacement ssp)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdRewardedEvent, amount = " + ssp.getRewardAmount() + " name = " + ssp.getRewardName());
|
||||
|
||||
}
|
||||
|
||||
void RewardedVideoAdClosedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdClosedEvent");
|
||||
}
|
||||
|
||||
void RewardedVideoAdStartedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdStartedEvent");
|
||||
}
|
||||
|
||||
void RewardedVideoAdEndedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdEndedEvent");
|
||||
}
|
||||
|
||||
void RewardedVideoAdShowFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdShowFailedEvent, code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void RewardedVideoAdClickedEvent(IronSourcePlacement ssp)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdClickedEvent, name = " + ssp.getRewardName());
|
||||
}
|
||||
|
||||
/************* RewardedVideo DemandOnly Delegates *************/
|
||||
|
||||
void RewardedVideoAdLoadedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
|
||||
Debug.Log("unity-script: I got RewardedVideoAdLoadedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void RewardedVideoAdLoadFailedDemandOnlyEvent(string instanceId, IronSourceError error)
|
||||
{
|
||||
|
||||
Debug.Log("unity-script: I got RewardedVideoAdLoadFailedDemandOnlyEvent for instance: " + instanceId + ", code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void RewardedVideoAdOpenedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdOpenedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void RewardedVideoAdRewardedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdRewardedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void RewardedVideoAdClosedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdClosedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void RewardedVideoAdShowFailedDemandOnlyEvent(string instanceId, IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdShowFailedDemandOnlyEvent for instance: " + instanceId + ", code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void RewardedVideoAdClickedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got RewardedVideoAdClickedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Interstitial callback handlers
|
||||
|
||||
void InterstitialAdReadyEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdReadyEvent");
|
||||
}
|
||||
|
||||
void InterstitialAdLoadFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdLoadFailedEvent, code: " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void InterstitialAdShowSucceededEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdShowSucceededEvent");
|
||||
}
|
||||
|
||||
void InterstitialAdShowFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdShowFailedEvent, code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void InterstitialAdClickedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdClickedEvent");
|
||||
}
|
||||
|
||||
void InterstitialAdOpenedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdOpenedEvent");
|
||||
}
|
||||
|
||||
void InterstitialAdClosedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdClosedEvent");
|
||||
}
|
||||
|
||||
/************* Interstitial DemandOnly Delegates *************/
|
||||
|
||||
void InterstitialAdReadyDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdReadyDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void InterstitialAdLoadFailedDemandOnlyEvent(string instanceId, IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdLoadFailedDemandOnlyEvent for instance: " + instanceId + ", error code: " + error.getCode() + ",error description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void InterstitialAdShowFailedDemandOnlyEvent(string instanceId, IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdShowFailedDemandOnlyEvent for instance: " + instanceId + ", error code : " + error.getCode() + ",error description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void InterstitialAdClickedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdClickedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void InterstitialAdOpenedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdOpenedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
void InterstitialAdClosedDemandOnlyEvent(string instanceId)
|
||||
{
|
||||
Debug.Log("unity-script: I got InterstitialAdClosedDemandOnlyEvent for instance: " + instanceId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Banner callback handlers
|
||||
|
||||
void BannerAdLoadedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdLoadedEvent");
|
||||
}
|
||||
|
||||
void BannerAdLoadFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdLoadFailedEvent, code: " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void BannerAdClickedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdClickedEvent");
|
||||
}
|
||||
|
||||
void BannerAdScreenPresentedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdScreenPresentedEvent");
|
||||
}
|
||||
|
||||
void BannerAdScreenDismissedEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdScreenDismissedEvent");
|
||||
}
|
||||
|
||||
void BannerAdLeftApplicationEvent()
|
||||
{
|
||||
Debug.Log("unity-script: I got BannerAdLeftApplicationEvent");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Offerwall callback handlers
|
||||
|
||||
void OfferwallOpenedEvent()
|
||||
{
|
||||
Debug.Log("I got OfferwallOpenedEvent");
|
||||
}
|
||||
|
||||
void OfferwallClosedEvent()
|
||||
{
|
||||
Debug.Log("I got OfferwallClosedEvent");
|
||||
}
|
||||
|
||||
void OfferwallShowFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("I got OfferwallShowFailedEvent, code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void OfferwallAdCreditedEvent(Dictionary<string, object> dict)
|
||||
{
|
||||
Debug.Log("I got OfferwallAdCreditedEvent, current credits = " + dict["credits"] + " totalCredits = " + dict["totalCredits"]);
|
||||
|
||||
}
|
||||
|
||||
void GetOfferwallCreditsFailedEvent(IronSourceError error)
|
||||
{
|
||||
Debug.Log("I got GetOfferwallCreditsFailedEvent, code : " + error.getCode() + ", description : " + error.getDescription());
|
||||
}
|
||||
|
||||
void OfferwallAvailableEvent(bool canShowOfferwal)
|
||||
{
|
||||
Debug.Log("I got OfferwallAvailableEvent, value = " + canShowOfferwal);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ImpressionSuccess callback handler
|
||||
|
||||
void ImpressionSuccessEvent(IronSourceImpressionData impressionData)
|
||||
{
|
||||
Debug.Log("unity - script: I got ImpressionSuccessEvent ToString(): " + impressionData.ToString());
|
||||
Debug.Log("unity - script: I got ImpressionSuccessEvent allData: " + impressionData.allData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 191f5798a75bd42589f98898505e981f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
|
|
@ -1,88 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5e326581693fd4e0db4c590543c3edc4
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fc06ff225d2634d849a99e2c5f3eca8b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
using UnityEditor;
|
||||
|
||||
namespace IronSource.Editor
|
||||
{
|
||||
public interface IAdapterSettings
|
||||
{
|
||||
void updateProject(BuildTarget buildTarget, string projectPath);
|
||||
void updateProjectPlist(BuildTarget buildTarget, string plistPath);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 08c4ce248dc9b4ba2a62a14ef020cc17
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
#if UNITY_IOS
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IronSource.Editor
|
||||
{
|
||||
public class IronSourceBuildPostprocessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void OnPostprocessBuild (BuildTarget buildTarget, string buildPath)
|
||||
{
|
||||
if (buildTarget == BuildTarget.iOS) {
|
||||
string projectPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
|
||||
string dirpath = Application.dataPath + "/IronSource/Editor/";
|
||||
string currentNamespace = MethodBase.GetCurrentMethod().DeclaringType.Namespace;
|
||||
|
||||
updateProject (buildTarget, projectPath);
|
||||
|
||||
if (Directory.Exists (dirpath)) {
|
||||
//Match the classes that has "Settings" in their name, and don't start with "I"
|
||||
var files = Directory.GetFiles (dirpath, "*.cs", SearchOption.TopDirectoryOnly).Where (file => Regex.IsMatch (Path.GetFileName (file), "^(?!(IAdapter|IronSource)).+Settings.*$"));
|
||||
|
||||
//Go over all the adapter settings classes, and call their updateProject method
|
||||
foreach (string file in files) {
|
||||
string classname = Path.GetFileNameWithoutExtension (file);
|
||||
|
||||
if (!String.IsNullOrEmpty (classname)) {
|
||||
IAdapterSettings adapter = (IAdapterSettings)Activator.CreateInstance (Type.GetType (currentNamespace + "." + classname));
|
||||
adapter.updateProject (buildTarget, projectPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log ("IronSource build postprocessor finished");
|
||||
}
|
||||
|
||||
private static void updateProject (BuildTarget buildTarget, string projectPath)
|
||||
{
|
||||
Debug.Log ("IronSource - Update project for IronSource");
|
||||
|
||||
PBXProject project = new PBXProject ();
|
||||
project.ReadFromString (File.ReadAllText (projectPath));
|
||||
|
||||
string targetId;
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
targetId = project.GetUnityMainTargetGuid();
|
||||
#else
|
||||
targetId = project.TargetGuidByName(PBXProject.GetUnityTargetName());
|
||||
#endif
|
||||
|
||||
// Required System Frameworks
|
||||
project.AddFrameworkToProject (targetId, "AdSupport.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "AudioToolbox.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "AVFoundation.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "CoreGraphics.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "CoreMedia.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "CoreTelephony.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "CoreVideo.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "CFNetwork.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "Foundation.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "MobileCoreServices.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "QuartzCore.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "Security.framework", false);
|
||||
#if !DEVELOPMENT_BUILD
|
||||
#else
|
||||
project.AddFrameworkToProject (targetId, "StoreKit.framework", false);
|
||||
#endif
|
||||
project.AddFrameworkToProject (targetId, "SystemConfiguration.framework", false);
|
||||
project.AddFrameworkToProject (targetId, "WebKit.framework", false);
|
||||
|
||||
|
||||
project.AddFileToBuild (targetId, project.AddFile ("usr/lib/libz.tbd", "Frameworks/libz.tbd", PBXSourceTree.Sdk));
|
||||
|
||||
// Custom Link Flag
|
||||
project.AddBuildProperty (targetId, "OTHER_LDFLAGS", "-ObjC");
|
||||
|
||||
File.WriteAllText (projectPath, project.WriteToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 160c30613c17c4bc1a9dfcc2b2663ff4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,558 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using IronSourceJSON;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
public class IronSourceDependenciesManager : EditorWindow
|
||||
{
|
||||
private const string jsonURL = "http://ssa.public.s3.amazonaws.com/Ironsource-Integration-Manager/IronSourceSDKInfo.json";
|
||||
private const string ironSourceDownloadDir = "Assets/IronSource/Editor/";
|
||||
private const string sdk = "sdk";
|
||||
private const string errorMessage = "SDK and adapters data are not available right now. Try again soon.";
|
||||
private const int Width = 760;
|
||||
private const int Height = 760;
|
||||
private const string Android = "Android";
|
||||
private const string iOS = "iOS";
|
||||
private readonly SortedSet<providerInfo> providersSet = new SortedSet<providerInfo>(new ProviderInfoComparor());
|
||||
private providerInfo ironSourceProviderInfo;
|
||||
private UnityWebRequest downloadWebClient;
|
||||
private string messageData;
|
||||
private IronSourceEditorCoroutines mEditorCoroutines;
|
||||
|
||||
private GUIStyle headerStyle;
|
||||
private GUIStyle textStyle;
|
||||
private GUIStyle boldTextStyle;
|
||||
private readonly GUILayoutOption buttonWidth = GUILayout.Width(90);
|
||||
|
||||
public class providerInfo
|
||||
{
|
||||
public Status currentStatues;
|
||||
public string providerName;
|
||||
public string currentUnityVersion;
|
||||
public string latestUnityVersion;
|
||||
public string downloadURL;
|
||||
public string displayProviderName;
|
||||
public bool isNewProvider;
|
||||
public string fileName;
|
||||
public Dictionary<string, string> sdkVersionDic;
|
||||
|
||||
public providerInfo()
|
||||
{
|
||||
isNewProvider = false;
|
||||
fileName = string.Empty;
|
||||
downloadURL = string.Empty;
|
||||
currentUnityVersion = "none";
|
||||
sdkVersionDic = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
public enum Status
|
||||
{
|
||||
installed = 1,
|
||||
none = 2,
|
||||
updated = 3
|
||||
}
|
||||
|
||||
public bool GetFromJson(string name, Dictionary<string, object> dic)
|
||||
{
|
||||
providerName = name;
|
||||
object obj;
|
||||
|
||||
dic.TryGetValue("keyname", out obj);
|
||||
if (obj != null)
|
||||
{
|
||||
this.displayProviderName = obj as string;
|
||||
}
|
||||
else this.displayProviderName = providerName;
|
||||
|
||||
dic.TryGetValue("isNewProvider", out obj);
|
||||
if (obj != null)
|
||||
{
|
||||
this.isNewProvider = bool.Parse(obj as string);
|
||||
}
|
||||
|
||||
//Get Unity versions
|
||||
if (dic.TryGetValue("Unity", out obj))
|
||||
{
|
||||
Dictionary<string, object> remoteVersions = obj as Dictionary<string, object>;
|
||||
if (remoteVersions != null)
|
||||
{
|
||||
if (remoteVersions.TryGetValue("DownloadUrl", out obj))
|
||||
{
|
||||
this.downloadURL = obj as string;
|
||||
}
|
||||
if (remoteVersions.TryGetValue("FileName", out obj))
|
||||
{
|
||||
this.fileName = obj as string;
|
||||
}
|
||||
if (remoteVersions.TryGetValue("UnityAdapterVersion", out obj))
|
||||
{
|
||||
this.latestUnityVersion = obj as string;
|
||||
}
|
||||
}
|
||||
}
|
||||
////Get Android version
|
||||
if (dic.TryGetValue(Android, out obj))
|
||||
{
|
||||
Dictionary<string, object> androidVersion = obj as Dictionary<string, object>;
|
||||
if (androidVersion != null)
|
||||
{
|
||||
androidVersion.TryGetValue("version", out obj);
|
||||
androidVersion = obj as Dictionary<string, object>;
|
||||
if (androidVersion != null)
|
||||
{
|
||||
if (androidVersion.TryGetValue(sdk, out obj))
|
||||
{
|
||||
this.sdkVersionDic.Add(Android, obj as string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Get iOS version
|
||||
dic.TryGetValue(iOS, out obj);
|
||||
Dictionary<string, object> iosVersion = obj as Dictionary<string, object>;
|
||||
if (iosVersion != null)
|
||||
{
|
||||
iosVersion.TryGetValue("version", out obj);
|
||||
iosVersion = obj as Dictionary<string, object>;
|
||||
if (iosVersion != null)
|
||||
{
|
||||
if (iosVersion.TryGetValue(sdk, out obj))
|
||||
{
|
||||
this.sdkVersionDic.Add(iOS, obj as string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentUnityVersion = GetVersionFromXML(fileName);
|
||||
|
||||
if (currentUnityVersion.Equals("none"))
|
||||
{
|
||||
currentStatues = Status.none;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (isNewerVersion(currentUnityVersion, latestUnityVersion))
|
||||
{
|
||||
currentStatues = Status.installed;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentStatues = Status.updated;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetVersionFromXML(string fileName)
|
||||
{
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
string version = "none";
|
||||
try
|
||||
{
|
||||
xmlDoc.LoadXml(File.ReadAllText(ironSourceDownloadDir + fileName));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return version;
|
||||
}
|
||||
var unityVersion = xmlDoc.SelectSingleNode("dependencies/unityversion");
|
||||
if (unityVersion != null)
|
||||
{
|
||||
return (unityVersion.InnerText);
|
||||
}
|
||||
File.Delete(ironSourceDownloadDir + fileName);
|
||||
return version;
|
||||
}
|
||||
|
||||
private IEnumerator GetVersions()
|
||||
{
|
||||
UnityWebRequest unityWebRequest = UnityWebRequest.Get(jsonURL);
|
||||
var webRequest = unityWebRequest.SendWebRequest();
|
||||
|
||||
while (!webRequest.isDone)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
}
|
||||
if (!unityWebRequest.isHttpError && !unityWebRequest.isNetworkError)
|
||||
{
|
||||
string json = unityWebRequest.downloadHandler.text;
|
||||
providersSet.Clear();
|
||||
ironSourceProviderInfo = new providerInfo();
|
||||
Dictionary<string, object> dic = new Dictionary<string, object>();
|
||||
try
|
||||
{
|
||||
dic = Json.Deserialize(json) as Dictionary<string, object>;
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log("Error getting response " + e.ToString());
|
||||
}
|
||||
if (dic != null && dic.Count != 0)
|
||||
{
|
||||
object providersJson;
|
||||
if (dic.TryGetValue("SDKSInfo", out providersJson))
|
||||
{
|
||||
if (providersJson != null)
|
||||
{
|
||||
foreach (var item in providersJson as Dictionary<string, object>)
|
||||
{
|
||||
providerInfo info = new providerInfo();
|
||||
if (info.GetFromJson(item.Key, item.Value as Dictionary<string, object>))
|
||||
{
|
||||
if (item.Key.ToLower().Contains("ironsource"))
|
||||
{
|
||||
ironSourceProviderInfo = info;
|
||||
}
|
||||
else
|
||||
{
|
||||
providersSet.Add(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ironSourceProviderInfo.currentStatues == providerInfo.Status.installed || ironSourceProviderInfo.currentStatues == providerInfo.Status.none)
|
||||
{
|
||||
if (dic.TryGetValue("UpdateMessage", out providersJson))
|
||||
{
|
||||
messageData = providersJson.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dic.TryGetValue("LatestMessage", out providersJson))
|
||||
{
|
||||
messageData = providersJson.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void CancelDownload()
|
||||
{
|
||||
// if downloader object is still active
|
||||
if (downloadWebClient != null)
|
||||
{
|
||||
downloadWebClient.Abort();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mEditorCoroutines != null)
|
||||
{
|
||||
mEditorCoroutines.StopEditorCoroutine();
|
||||
mEditorCoroutines = null;
|
||||
}
|
||||
|
||||
downloadWebClient = null;
|
||||
}
|
||||
|
||||
public static void ShowISDependenciesManager()
|
||||
{
|
||||
var win = GetWindowWithRect<IronSourceDependenciesManager>(new Rect(0, 0, Width, Height), true);
|
||||
win.titleContent = new GUIContent("ironSource Integration Manager");
|
||||
win.Focus();
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
headerStyle = new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontStyle = FontStyle.Bold,
|
||||
fontSize = 14,
|
||||
fixedHeight = 20,
|
||||
stretchWidth = true,
|
||||
fixedWidth = Width / 4 + 5,
|
||||
clipping = TextClipping.Overflow,
|
||||
alignment = TextAnchor.MiddleLeft
|
||||
};
|
||||
textStyle = new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontStyle = FontStyle.Normal,
|
||||
alignment = TextAnchor.MiddleLeft
|
||||
|
||||
};
|
||||
boldTextStyle = new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontStyle = FontStyle.Bold
|
||||
};
|
||||
CancelDownload();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
mEditorCoroutines = IronSourceEditorCoroutines.StartEditorCoroutine(GetVersions());
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
CancelDownload();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
void DrawProviderItem(providerInfo providerData)
|
||||
{
|
||||
if (!providerData.Equals(default(providerInfo)))
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
GUI.enabled = true;
|
||||
bool isNew = providerData.isNewProvider;
|
||||
string isNewAddition = isNew ? " - New Network" : string.Empty;
|
||||
string androidVersion = "";
|
||||
string iosVersion = "";
|
||||
string tooltipText = "Latest Version: \n " + providerData.providerName + " Adapter Version " + providerData.latestUnityVersion;
|
||||
if (!providerData.sdkVersionDic.TryGetValue(Android, out androidVersion))
|
||||
{
|
||||
androidVersion = "";
|
||||
}
|
||||
else tooltipText = tooltipText + "\n Android SDK version " + androidVersion;
|
||||
if (!providerData.sdkVersionDic.TryGetValue(iOS, out iosVersion))
|
||||
{
|
||||
iosVersion = "";
|
||||
}
|
||||
else tooltipText = tooltipText + "\n iOS SDK version " + iosVersion;
|
||||
|
||||
EditorGUILayout.LabelField(providerData.displayProviderName + isNewAddition, isNew ? boldTextStyle : textStyle);
|
||||
EditorGUILayout.LabelField(providerData.currentUnityVersion, textStyle);
|
||||
EditorGUILayout.LabelField(providerData.latestUnityVersion, textStyle);
|
||||
|
||||
if (providerData.currentStatues == providerInfo.Status.none)
|
||||
{
|
||||
bool btn = GUILayout.Button(new GUIContent
|
||||
{
|
||||
text = "Install",
|
||||
tooltip = tooltipText
|
||||
}, buttonWidth);
|
||||
if (btn && downloadWebClient == null)
|
||||
{
|
||||
GUI.enabled = true;
|
||||
IronSourceEditorCoroutines.StartEditorCoroutine(DownloadFile(providerData.downloadURL));
|
||||
}
|
||||
|
||||
}
|
||||
else if (providerData.currentStatues == providerInfo.Status.installed)
|
||||
{
|
||||
var btn = GUILayout.Button(new GUIContent
|
||||
{
|
||||
text= "Update",
|
||||
tooltip = tooltipText
|
||||
}
|
||||
,buttonWidth);
|
||||
if (btn && downloadWebClient == null)
|
||||
{
|
||||
GUI.enabled = true;
|
||||
IronSourceEditorCoroutines.StartEditorCoroutine(DownloadFile(providerData.downloadURL));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.enabled = false;
|
||||
GUILayout.Button(new GUIContent
|
||||
{
|
||||
text = "Updated",
|
||||
tooltip = tooltipText
|
||||
}, buttonWidth);
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
if (ironSourceProviderInfo == null)
|
||||
{
|
||||
GUILayout.Label(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
GUILayout.Space(10);
|
||||
using (new EditorGUILayout.VerticalScope("box"))
|
||||
{
|
||||
DrawSDKHeader();
|
||||
GUILayout.Space(5);
|
||||
GUILayout.BeginHorizontal();
|
||||
DrawProviderItem(ironSourceProviderInfo);
|
||||
GUILayout.Space(5);
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
|
||||
GUILayout.Space(15);
|
||||
DrawAdaptersHeader();
|
||||
GUILayout.Space(15);
|
||||
|
||||
foreach (var provider in providersSet)
|
||||
{
|
||||
DrawProviderItem(provider);
|
||||
GUILayout.Space(2);
|
||||
}
|
||||
GUILayout.Space(30);
|
||||
if (!string.IsNullOrEmpty(messageData))
|
||||
{
|
||||
using (new EditorGUILayout.VerticalScope("box", GUILayout.ExpandHeight(true)))
|
||||
{
|
||||
GUILayout.Space(5);
|
||||
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
EditorGUILayout.SelectableLabel(messageData, EditorStyles.textField, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
using (new EditorGUILayout.VerticalScope(GUILayout.ExpandHeight(false)))
|
||||
{
|
||||
GUILayout.Space(15);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void DrawSDKHeader()
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
EditorGUILayout.LabelField("Current SDK Version", new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontStyle = FontStyle.Bold,
|
||||
fontSize = 13,
|
||||
fixedHeight = 20,
|
||||
stretchWidth = true,
|
||||
fixedWidth = Width / 4,
|
||||
clipping = TextClipping.Overflow,
|
||||
padding = new RectOffset(Width / 4 + 15, 0, 0, 0)
|
||||
});
|
||||
GUILayout.Space(85);
|
||||
EditorGUILayout.LabelField("Latest SDK Version", new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontStyle = FontStyle.Bold,
|
||||
fontSize = 13,
|
||||
fixedHeight = 20,
|
||||
stretchWidth = true,
|
||||
fixedWidth = Screen.width / 4,
|
||||
clipping = TextClipping.Overflow,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawAdaptersHeader()
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
EditorGUILayout.LabelField("Network", headerStyle);
|
||||
EditorGUILayout.LabelField("Current Adapter Version", headerStyle);
|
||||
EditorGUILayout.LabelField("Latest Adapter Version", headerStyle);
|
||||
GUILayout.Space(30);
|
||||
EditorGUILayout.LabelField("Action", headerStyle);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator DownloadFile(string downloadFileUrl)
|
||||
{
|
||||
int fileNameIndex = downloadFileUrl.LastIndexOf("/") + 1;
|
||||
string downloadFileName = downloadFileUrl.Substring(fileNameIndex);
|
||||
string fileDownloading = string.Format("Downloading {0}", downloadFileName);
|
||||
string genericFileName = Regex.Replace(downloadFileName, @"_v+(\d\.\d\.\d\.\d|\d\.\d\.\d)", "");
|
||||
string path = Path.Combine(ironSourceDownloadDir, genericFileName);
|
||||
bool isCancelled = false;
|
||||
downloadWebClient = new UnityWebRequest(downloadFileUrl);
|
||||
downloadWebClient.downloadHandler = new DownloadHandlerFile(path);
|
||||
downloadWebClient.SendWebRequest();
|
||||
if (!downloadWebClient.isHttpError && !downloadWebClient.isNetworkError)
|
||||
{
|
||||
while (!downloadWebClient.isDone)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Download Manager", fileDownloading, downloadWebClient.downloadProgress))
|
||||
{
|
||||
if (downloadWebClient.error != null)
|
||||
{
|
||||
Debug.LogError(downloadWebClient.error);
|
||||
}
|
||||
CancelDownload();
|
||||
isCancelled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Error Downloading " + genericFileName + " : " + downloadWebClient.error);
|
||||
}
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
|
||||
if (genericFileName.EndsWith(".unitypackage") && !isCancelled)
|
||||
{
|
||||
AssetDatabase.ImportPackage(Path.Combine(ironSourceDownloadDir, genericFileName), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// in case the download was cancelled, delete the file
|
||||
if(isCancelled && File.Exists(ironSourceDownloadDir + genericFileName))
|
||||
{
|
||||
File.Delete(ironSourceDownloadDir + genericFileName);
|
||||
}
|
||||
|
||||
IronSourceEditorCoroutines.StartEditorCoroutine(GetVersions());
|
||||
}
|
||||
|
||||
//clean the downloadWebClient object regardless of whether the request succeeded or failed
|
||||
downloadWebClient.Dispose();
|
||||
downloadWebClient = null;
|
||||
|
||||
IronSourceEditorCoroutines.StartEditorCoroutine(GetVersions());
|
||||
}
|
||||
|
||||
private static bool isNewerVersion(string current, string latest)
|
||||
{
|
||||
bool isNewer = false;
|
||||
try
|
||||
{
|
||||
int[] currentVersion = Array.ConvertAll(current.Split('.'), int.Parse);
|
||||
int[] remoteVersion = Array.ConvertAll(latest.Split('.'), int.Parse);
|
||||
int remoteBuild = 0;
|
||||
int curBuild = 0;
|
||||
if (currentVersion.Length > 3)
|
||||
{
|
||||
curBuild = currentVersion[3];
|
||||
}
|
||||
if (remoteVersion.Length > 3)
|
||||
{
|
||||
remoteBuild = remoteVersion[3];
|
||||
|
||||
}
|
||||
System.Version cur = new System.Version(currentVersion[0], currentVersion[1], currentVersion[2], curBuild);
|
||||
System.Version remote = new System.Version(remoteVersion[0], remoteVersion[1], remoteVersion[2], remoteBuild);
|
||||
isNewer = cur < remote;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
return isNewer;
|
||||
|
||||
}
|
||||
|
||||
internal class ProviderInfoComparor : IComparer<providerInfo>
|
||||
{
|
||||
public int Compare(providerInfo x, providerInfo y)
|
||||
{
|
||||
return x.providerName.CompareTo(y.providerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c6e4d9251bd484b8691739732905761c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
using UnityEditor;
|
||||
using System.Collections;
|
||||
|
||||
public class IronSourceEditorCoroutines
|
||||
{
|
||||
readonly IEnumerator mRoutine;
|
||||
|
||||
public static IronSourceEditorCoroutines StartEditorCoroutine( IEnumerator routine)
|
||||
{
|
||||
IronSourceEditorCoroutines coroutine = new IronSourceEditorCoroutines(routine);
|
||||
coroutine.start();
|
||||
return coroutine;
|
||||
}
|
||||
|
||||
IronSourceEditorCoroutines(IEnumerator routine)
|
||||
{
|
||||
mRoutine = routine;
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
EditorApplication.update += update;
|
||||
}
|
||||
|
||||
void update()
|
||||
{
|
||||
if(!mRoutine.MoveNext())
|
||||
{
|
||||
StopEditorCoroutine();
|
||||
}
|
||||
}
|
||||
|
||||
public void StopEditorCoroutine()
|
||||
{
|
||||
EditorApplication.update -= update;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 001447b23ecb34541b82b7d1874874d9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
#if UNITY_ANDROID
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using UnityEditor.Build.Reporting;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public class IronSourceManifestProcessor : IPreprocessBuildWithReport
|
||||
#else
|
||||
public class IronSourceManifestProcessor : IPreprocessBuild
|
||||
#endif
|
||||
{
|
||||
private const string META_APPLICATION_ID = "com.google.android.gms.ads.APPLICATION_ID";
|
||||
|
||||
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
||||
|
||||
public int callbackOrder { get { return 0; } }
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
#else
|
||||
public void OnPreprocessBuild(BuildTarget target, string path)
|
||||
#endif
|
||||
{
|
||||
if (File.Exists(IronSourceMediatedNetworkSettings.MEDIATION_SETTINGS_ASSET_PATH))
|
||||
{
|
||||
string appId = IronSourceMediatedNetworkSettingsInspector.IronSourceMediatedNetworkSettings.AdmobAndroidAppId;
|
||||
|
||||
if (IronSourceMediatedNetworkSettingsInspector.IronSourceMediatedNetworkSettings.EnableAdmob)
|
||||
{
|
||||
string manifestPath = Path.Combine(
|
||||
Application.dataPath, "IronSource/Plugins/Android/IronSource.plugin/AndroidManifest.xml");
|
||||
|
||||
XDocument manifest = null;
|
||||
try
|
||||
{
|
||||
manifest = XDocument.Load(manifestPath);
|
||||
}
|
||||
#pragma warning disable 0168
|
||||
catch (IOException e)
|
||||
#pragma warning restore 0168
|
||||
{
|
||||
StopBuildWithMessage("AndroidManifest.xml is missing. Try re-importing the plugin.");
|
||||
}
|
||||
|
||||
XElement elemManifest = manifest.Element("manifest");
|
||||
if (elemManifest == null)
|
||||
{
|
||||
StopBuildWithMessage("AndroidManifest.xml is not valid. Try re-importing the plugin.");
|
||||
}
|
||||
|
||||
XElement elemApplication = elemManifest.Element("application");
|
||||
if (elemApplication == null)
|
||||
{
|
||||
StopBuildWithMessage("AndroidManifest.xml is not valid. Try re-importing the plugin.");
|
||||
}
|
||||
|
||||
IEnumerable<XElement> metas = elemApplication.Descendants()
|
||||
.Where(elem => elem.Name.LocalName.Equals("meta-data"));
|
||||
|
||||
XElement elemAdMobEnabled = GetMetaElement(metas, META_APPLICATION_ID);
|
||||
|
||||
if (appId.Length == 0)
|
||||
{
|
||||
StopBuildWithMessage(
|
||||
"Android AdMob app ID is empty. Please enter your app ID to run ads properly");
|
||||
}
|
||||
else if (!Regex.IsMatch(appId, "^[a-zA-Z0-9-~]*$"))
|
||||
{
|
||||
StopBuildWithMessage(
|
||||
"Android AdMob app ID is not valid. Please enter a valid app ID to run ads properly");
|
||||
}
|
||||
|
||||
else if (elemAdMobEnabled == null)
|
||||
{
|
||||
elemApplication.Add(CreateMetaElement(META_APPLICATION_ID, appId));
|
||||
}
|
||||
else
|
||||
{
|
||||
elemAdMobEnabled.SetAttributeValue(ns + "value", appId);
|
||||
}
|
||||
|
||||
elemManifest.Save(manifestPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private XElement CreateMetaElement(string name, object value)
|
||||
{
|
||||
return new XElement("meta-data",
|
||||
new XAttribute(ns + "name", name), new XAttribute(ns + "value", value));
|
||||
}
|
||||
|
||||
private XElement GetMetaElement(IEnumerable<XElement> metas, string metaName)
|
||||
{
|
||||
foreach (XElement elem in metas)
|
||||
{
|
||||
IEnumerable<XAttribute> attrs = elem.Attributes();
|
||||
foreach (XAttribute attr in attrs)
|
||||
{
|
||||
if (attr.Name.Namespace.Equals(ns)
|
||||
&& attr.Name.LocalName.Equals("name") && attr.Value.Equals(metaName))
|
||||
{
|
||||
return elem;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void StopBuildWithMessage(string message)
|
||||
{
|
||||
string prefix = "[IronSourceApplicationSettings] ";
|
||||
|
||||
EditorUtility.DisplayDialog(
|
||||
"IronSource Developer Settings", "Error: " + message, "", "");
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
throw new BuildPlayerWindow.BuildMethodException(prefix + message);
|
||||
#else
|
||||
throw new OperationCanceledException(prefix + message);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b63a7ef12abd42eabd7c7b7c8250f83
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
public class IronSourceMediatedNetworkSettings : ScriptableObject
|
||||
{
|
||||
public static readonly string MEDIATION_SETTINGS_ASSET_PATH = Path.Combine(IronSourceConstants.IRONSOURCE_RESOURCES_PATH, IronSourceConstants.IRONSOURCE_MEDIATED_NETWORK_SETTING_NAME + ".asset");
|
||||
|
||||
[Header("")]
|
||||
[Header("AdMob Integration")]
|
||||
[SerializeField]
|
||||
[Tooltip("This will add AdMob Application ID to AndroidManifest.xml/info.plist")]
|
||||
public bool EnableAdmob = false;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("This Will be added to your AndroidManifest.xml")]
|
||||
public string AdmobAndroidAppId = string.Empty;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("This will be added to your info.plist")]
|
||||
public string AdmobIOSAppId = string.Empty;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6dcd730eacb2043e8a6f1c61c16243da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
using System.IO;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(IronSourceMediatedNetworkSettings))]
|
||||
public class IronSourceMediatedNetworkSettingsInspector : UnityEditor.Editor
|
||||
{
|
||||
private static IronSourceMediatedNetworkSettings ironSourceMediatedNetworkSettings;
|
||||
public static IronSourceMediatedNetworkSettings IronSourceMediatedNetworkSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ironSourceMediatedNetworkSettings == null)
|
||||
{
|
||||
ironSourceMediatedNetworkSettings = AssetDatabase.LoadAssetAtPath<IronSourceMediatedNetworkSettings>(IronSourceMediatedNetworkSettings.MEDIATION_SETTINGS_ASSET_PATH);
|
||||
if (ironSourceMediatedNetworkSettings == null)
|
||||
{
|
||||
IronSourceMediatedNetworkSettings asset = CreateInstance<IronSourceMediatedNetworkSettings>();
|
||||
Directory.CreateDirectory(IronSourceConstants.IRONSOURCE_RESOURCES_PATH);
|
||||
AssetDatabase.CreateAsset(asset, IronSourceMediatedNetworkSettings.MEDIATION_SETTINGS_ASSET_PATH);
|
||||
ironSourceMediatedNetworkSettings = asset;
|
||||
}
|
||||
}
|
||||
|
||||
return ironSourceMediatedNetworkSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ddcb1096c420410ead13befae195114
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
using System.IO;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(IronSourceMediationSettings))]
|
||||
public class IronSourceMediationSettingsInspector : UnityEditor.Editor
|
||||
{
|
||||
private static IronSourceMediationSettings ironSourceMediationSettings;
|
||||
public static IronSourceMediationSettings IronSourceMediationSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ironSourceMediationSettings == null)
|
||||
{
|
||||
ironSourceMediationSettings = AssetDatabase.LoadAssetAtPath<IronSourceMediationSettings>(IronSourceMediationSettings.IRONSOURCE_SETTINGS_ASSET_PATH);
|
||||
if (ironSourceMediationSettings == null)
|
||||
{
|
||||
IronSourceMediationSettings asset = CreateInstance<IronSourceMediationSettings>();
|
||||
Directory.CreateDirectory(IronSourceConstants.IRONSOURCE_RESOURCES_PATH);
|
||||
AssetDatabase.CreateAsset(asset, IronSourceMediationSettings.IRONSOURCE_SETTINGS_ASSET_PATH);
|
||||
ironSourceMediationSettings = asset;
|
||||
}
|
||||
}
|
||||
|
||||
return ironSourceMediationSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4a5cecbf374304044822daeaa54c686c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class IronSourceMenu : UnityEditor.Editor
|
||||
{
|
||||
|
||||
[MenuItem("IronSource/Documentation", false, 0)]
|
||||
public static void Documentation()
|
||||
{
|
||||
Application.OpenURL("https://developers.ironsrc.com/ironsource-mobile/unity/unity-plugin/");
|
||||
}
|
||||
|
||||
|
||||
[MenuItem("IronSource/SDK Change Log", false, 1)]
|
||||
public static void ChangeLog()
|
||||
{
|
||||
Application.OpenURL("https://developers.ironsrc.com/ironsource-mobile/unity/sdk-change-log/");
|
||||
}
|
||||
|
||||
|
||||
[MenuItem("IronSource/Integration Manager", false , 2)]
|
||||
public static void SdkManagerProd()
|
||||
{
|
||||
IronSourceDependenciesManager.ShowISDependenciesManager();
|
||||
}
|
||||
|
||||
[MenuItem("IronSource/Developer Settings/IronSource Mediation Settings", false, 3)]
|
||||
public static void mediationSettings()
|
||||
{
|
||||
string path = "Assets/IronSource/Resources";
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
|
||||
var ironSourceMediationSettings = Resources.Load<IronSourceMediationSettings>(IronSourceConstants.IRONSOURCE_MEDIATION_SETTING_NAME);
|
||||
if (ironSourceMediationSettings == null)
|
||||
{
|
||||
Debug.LogWarning(IronSourceConstants.IRONSOURCE_MEDIATION_SETTING_NAME + " can't be found, creating a new one...");
|
||||
ironSourceMediationSettings = CreateInstance<IronSourceMediationSettings>();
|
||||
AssetDatabase.CreateAsset(ironSourceMediationSettings, IronSourceMediationSettings.IRONSOURCE_SETTINGS_ASSET_PATH);
|
||||
ironSourceMediationSettings = Resources.Load<IronSourceMediationSettings>(IronSourceConstants.IRONSOURCE_MEDIATION_SETTING_NAME);
|
||||
}
|
||||
|
||||
Selection.activeObject = ironSourceMediationSettings;
|
||||
}
|
||||
|
||||
[MenuItem("IronSource/Developer Settings/Mediated Network Settings", false, 4)]
|
||||
public static void mediatedNetworkSettings()
|
||||
{
|
||||
string path = IronSourceConstants.IRONSOURCE_RESOURCES_PATH;
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
var ironSourceMediatedNetworkSettings = Resources.Load<IronSourceMediatedNetworkSettings>(IronSourceConstants.IRONSOURCE_MEDIATED_NETWORK_SETTING_NAME);
|
||||
if (ironSourceMediatedNetworkSettings == null)
|
||||
{
|
||||
Debug.LogWarning(IronSourceConstants.IRONSOURCE_MEDIATED_NETWORK_SETTING_NAME + " can't be found, creating a new one...");
|
||||
ironSourceMediatedNetworkSettings = CreateInstance<IronSourceMediatedNetworkSettings>();
|
||||
AssetDatabase.CreateAsset(ironSourceMediatedNetworkSettings, IronSourceMediatedNetworkSettings.MEDIATION_SETTINGS_ASSET_PATH);
|
||||
ironSourceMediatedNetworkSettings = Resources.Load<IronSourceMediatedNetworkSettings>(IronSourceConstants.IRONSOURCE_MEDIATED_NETWORK_SETTING_NAME);
|
||||
}
|
||||
|
||||
Selection.activeObject = ironSourceMediatedNetworkSettings;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 70dd99db2841b47fb8709e8e707d714a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
|
||||
#if UNITY_IOS || UNITY_IPHONE
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
/// <summary>
|
||||
/// PostProcessor script to automatically fill all required dependencies
|
||||
/// </summary>
|
||||
public class IronSourcePlistProcessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
|
||||
{
|
||||
if (File.Exists(IronSourceMediationSettings.IRONSOURCE_SETTINGS_ASSET_PATH))
|
||||
{
|
||||
if (buildTarget == BuildTarget.iOS)
|
||||
{
|
||||
/*
|
||||
* PBXProject
|
||||
*/
|
||||
string plistPath = Path.Combine(buildPath, "Info.plist");
|
||||
PBXProject project = new PBXProject();
|
||||
string projectPath = PBXProject.GetPBXProjectPath(buildPath);
|
||||
project.ReadFromFile(projectPath);
|
||||
PlistDocument plist = new PlistDocument();
|
||||
plist.ReadFromString(File.ReadAllText(plistPath));
|
||||
if (plist != null)
|
||||
{
|
||||
// Get root
|
||||
PlistElementDict rootDict = plist.root;
|
||||
|
||||
// Check if SKAdNetworkItems already exists
|
||||
PlistElementArray SKAdNetworkItems = null;
|
||||
if (rootDict.values.ContainsKey("SKAdNetworkItems"))
|
||||
{
|
||||
try
|
||||
{
|
||||
SKAdNetworkItems = rootDict.values["SKAdNetworkItems"] as PlistElementArray;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning(string.Format("Could not obtain SKAdNetworkItems PlistElementArray: {0}", e.Message));
|
||||
}
|
||||
}
|
||||
|
||||
//Add IronSource's SKAdNetwork ID
|
||||
if (IronSourceMediationSettingsInspector.IronSourceMediationSettings.AddIronsourceSkadnetworkID)
|
||||
{
|
||||
// If not exists, create it
|
||||
if (SKAdNetworkItems == null)
|
||||
{
|
||||
SKAdNetworkItems = rootDict.CreateArray("SKAdNetworkItems");
|
||||
}
|
||||
|
||||
string plistContent = File.ReadAllText(plistPath);
|
||||
if (!plistContent.Contains(IronSourceConstants.IRONSOURCE_SKAN_ID_KEY))
|
||||
{
|
||||
PlistElementDict SKAdNetworkIdentifierDict = SKAdNetworkItems.AddDict();
|
||||
SKAdNetworkIdentifierDict.SetString("SKAdNetworkIdentifier", IronSourceConstants.IRONSOURCE_SKAN_ID_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( File.Exists(IronSourceMediatedNetworkSettings.MEDIATION_SETTINGS_ASSET_PATH))
|
||||
{
|
||||
if (buildTarget == BuildTarget.iOS)
|
||||
{
|
||||
/*
|
||||
* PBXProject
|
||||
*/
|
||||
string plistPath = Path.Combine(buildPath, "Info.plist");
|
||||
PBXProject project = new PBXProject();
|
||||
string projectPath = PBXProject.GetPBXProjectPath(buildPath);
|
||||
project.ReadFromFile(projectPath);
|
||||
PlistDocument plist = new PlistDocument();
|
||||
plist.ReadFromString(File.ReadAllText(plistPath));
|
||||
if (plist != null)
|
||||
{
|
||||
// Get root
|
||||
PlistElementDict rootDict = plist.root;
|
||||
|
||||
|
||||
//Adding AdMob App ID to Plist
|
||||
if (IronSourceMediatedNetworkSettingsInspector.IronSourceMediatedNetworkSettings.EnableAdmob == true)
|
||||
{
|
||||
string appId = IronSourceMediatedNetworkSettingsInspector.IronSourceMediatedNetworkSettings.AdmobIOSAppId;
|
||||
if (appId.Length == 0)
|
||||
{
|
||||
StopBuildWithMessage(
|
||||
"iOS AdMob app ID is empty. Please enter your app ID to run ads properly");
|
||||
}
|
||||
else if (!Regex.IsMatch(appId, "^[a-zA-Z0-9-~]*$"))
|
||||
{
|
||||
StopBuildWithMessage(
|
||||
"iOS AdMob app ID is not valid. Please enter a valid app ID to run ads properly");
|
||||
}
|
||||
else
|
||||
{
|
||||
plist.root.SetString("GADApplicationIdentifier", appId);
|
||||
}
|
||||
}
|
||||
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void StopBuildWithMessage(string message)
|
||||
{
|
||||
string prefix = "[IronSourceApplicationSettings] ";
|
||||
|
||||
EditorUtility.DisplayDialog(
|
||||
"IronSource Developer Settings", "Error: " + message, "", "");
|
||||
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
throw new BuildPlayerWindow.BuildMethodException(prefix + message);
|
||||
#else
|
||||
throw new OperationCanceledException(prefix + message);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 920ec5e5fa67e48c2a6380c2c2be88fc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<dependencies>
|
||||
<unityversion>7.1.12</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.1.12">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-ads-identifier:17.0.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-basement:17.2.1">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<iosPods>
|
||||
<iosPod name="IronSourceSDK" version="7.1.12">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
</iosPod>
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d618a278f636e4718b9e6409b1f031eb
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 54543a6abf5c743eebffbdd3ab80a1e7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e68fc23b7584a4aeb9ad1faec8a8708c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f1bc66601864e445e88faef50fa5886c
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:installLocation="preferExternal"
|
||||
package="com.Company.ProductName"
|
||||
android:versionName="1.0"
|
||||
android:versionCode="1">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application>
|
||||
|
||||
<!-- AdMob -->
|
||||
|
||||
<!--As Requiered By Admob please add your App ID-->
|
||||
|
||||
<!--<meta-data-->
|
||||
<!--android:name="com.google.android.gms.ads.APPLICATION_ID"-->
|
||||
<!--android:value="YOUR_ADMOB_APP_ID"/>-->
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9632a9cae064644419de54f10c604559
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 52c96c6ebd65b44b3858b9ae1afdf87a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2dbf0193032a2473098de3a49a1e75f7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1 +0,0 @@
|
|||
android.library=true
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 21b205bdddcad4558ab4a0831cb093f2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d169a20af57cb4a47b056b3317f02f12
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
//
|
||||
// iOSBridge
|
||||
//
|
||||
// Created by Ori on 5/13/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <IronSource/ISSupersonicAdsConfiguration.h>
|
||||
#import <IronSource/ISConfigurations.h>
|
||||
|
||||
@interface IronSourceUnityConfig:NSObject
|
||||
//IronSource
|
||||
- (void) setClientSideCallbacks:(bool)useClientSideCallbacks;
|
||||
- (void) setLanguage:(NSString *)language;
|
||||
- (void) setRewardedVideoCustomParams:(NSString *)rvParams;
|
||||
- (void) setOfferwallCustomParams:(NSString *)owParams;
|
||||
|
||||
@end
|
||||
|
||||
@implementation IronSourceUnityConfig
|
||||
|
||||
//IronSource
|
||||
- (void) setClientSideCallbacks:(bool)useClientSideCallbacks {
|
||||
NSNumber *ucsc = @0;
|
||||
if (useClientSideCallbacks)
|
||||
ucsc = @1;
|
||||
|
||||
[ISSupersonicAdsConfiguration configurations].useClientSideCallbacks = ucsc;
|
||||
}
|
||||
|
||||
- (void) setLanguage:(NSString *)language {
|
||||
[ISSupersonicAdsConfiguration configurations].language = language;
|
||||
}
|
||||
|
||||
- (void) setRewardedVideoCustomParams:(NSString *)rvParams {
|
||||
NSError *jsonError;
|
||||
NSData *objectData = [rvParams dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:objectData options:NSJSONReadingMutableContainers error:&jsonError];
|
||||
if (!jsonError)
|
||||
[ISConfigurations configurations].rewardedVideoCustomParameters = json;
|
||||
}
|
||||
|
||||
- (void) setOfferwallCustomParams:(NSString *)owParams {
|
||||
NSError *jsonError;
|
||||
NSData *objectData = [owParams dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:objectData options:NSJSONReadingMutableContainers error:&jsonError];
|
||||
if (!jsonError)
|
||||
[ISConfigurations configurations].offerwallCustomParameters = json;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ParseNSStringParam( _x_ ) ( _x_ != NULL ) ? [NSString stringWithUTF8String:_x_] : [NSString stringWithUTF8String:""]
|
||||
|
||||
//IronSource
|
||||
void CFSetClientSideCallbacks(bool useClientSideCallbacks){
|
||||
[[IronSourceUnityConfig new] setClientSideCallbacks:useClientSideCallbacks];
|
||||
}
|
||||
void CFSetLanguage(const char *language){
|
||||
[[IronSourceUnityConfig new] setLanguage:ParseNSStringParam(language)];
|
||||
}
|
||||
void CFSetRewardedVideoCustomParams(const char *rvParams){
|
||||
[[IronSourceUnityConfig new] setRewardedVideoCustomParams:ParseNSStringParam(rvParams)];
|
||||
}
|
||||
void CFSetOfferwallCustomParams(const char *owParam){
|
||||
[[IronSourceUnityConfig new] setOfferwallCustomParams:ParseNSStringParam(owParam)];
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e0be82736da5a41d4af2ea3ac34d5ac4
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
//
|
||||
// iOSBridge.h
|
||||
// iOSBridge
|
||||
//
|
||||
// Created by Supersonic.
|
||||
// Copyright (c) 2015 Supersonic. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <IronSource/IronSource.h>
|
||||
static NSString * UnityGitHash = @"04bfbea";
|
||||
|
||||
@interface iOSBridge : NSObject<ISRewardedVideoDelegate,ISDemandOnlyRewardedVideoDelegate, ISInterstitialDelegate,ISDemandOnlyInterstitialDelegate, ISOfferwallDelegate, ISBannerDelegate, ISSegmentDelegate,ISImpressionDataDelegate, ISConsentViewDelegate>
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 33123db285ad544b59cf1c18d83f66b8
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,37 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 270589a8de1714a00bc20bfd059e4441
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1bbaa67142d994184844ed2864338043
|
||||
folderAsset: yes
|
||||
timeCreated: 1486985218
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,314 +0,0 @@
|
|||
#if UNITY_ANDROID
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
public class AndroidAgent : IronSourceIAgent
|
||||
{
|
||||
private static AndroidJavaObject _androidBridge;
|
||||
private readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
private const string REWARD_AMOUNT = "reward_amount";
|
||||
private const string REWARD_NAME = "reward_name";
|
||||
private const string PLACEMENT_NAME = "placement_name";
|
||||
|
||||
public AndroidAgent ()
|
||||
{
|
||||
Debug.Log ("AndroidAgent ctr");
|
||||
}
|
||||
|
||||
#region IronSourceIAgent implementation
|
||||
public AndroidJavaObject getBridge ()
|
||||
{
|
||||
if (_androidBridge == null)
|
||||
using (var pluginClass = new AndroidJavaClass( AndroidBridge ))
|
||||
_androidBridge = pluginClass.CallStatic<AndroidJavaObject> ("getInstance");
|
||||
|
||||
return _androidBridge;
|
||||
}
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
public void onApplicationPause (bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
getBridge ().Call ("onPause");
|
||||
}
|
||||
else
|
||||
{
|
||||
getBridge ().Call ("onResume");
|
||||
}
|
||||
}
|
||||
|
||||
public void setMediationSegment (string segment)
|
||||
{
|
||||
getBridge ().Call ("setMediationSegment", segment);
|
||||
}
|
||||
|
||||
public string getAdvertiserId ()
|
||||
{
|
||||
return getBridge ().Call<string> ("getAdvertiserId");
|
||||
}
|
||||
|
||||
public void validateIntegration ()
|
||||
{
|
||||
getBridge ().Call ("validateIntegration");
|
||||
}
|
||||
|
||||
public void shouldTrackNetworkState (bool track)
|
||||
{
|
||||
getBridge ().Call ("shouldTrackNetworkState", track);
|
||||
}
|
||||
|
||||
public bool setDynamicUserId (string dynamicUserId)
|
||||
{
|
||||
return getBridge ().Call<bool> ("setDynamicUserId", dynamicUserId);
|
||||
}
|
||||
|
||||
public void setAdaptersDebug(bool enabled)
|
||||
{
|
||||
getBridge ().Call ("setAdaptersDebug", enabled);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, string value)
|
||||
{
|
||||
getBridge().Call("setMetaData", key, value);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, params string[] values)
|
||||
{
|
||||
getBridge().Call("setMetaData", key, values);
|
||||
}
|
||||
|
||||
public int? getConversionValue()
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
return null;
|
||||
}
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
public void setUserId(string userId) {
|
||||
getBridge ().Call ("setUserId", userId);
|
||||
}
|
||||
|
||||
public void init(string appKey)
|
||||
{
|
||||
getBridge ().Call ("setPluginData", "Unity", IronSource.pluginVersion (), IronSource.unityVersion ());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
getBridge ().Call ("init", appKey);
|
||||
}
|
||||
|
||||
public void init (string appKey, params string[] adUnits)
|
||||
{
|
||||
getBridge ().Call ("setPluginData", "Unity", IronSource.pluginVersion (), IronSource.unityVersion ());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
getBridge ().Call ("init", appKey, adUnits);
|
||||
}
|
||||
|
||||
public void initISDemandOnly (string appKey, params string[] adUnits)
|
||||
{
|
||||
getBridge ().Call ("setPluginData", "Unity", IronSource.pluginVersion (), IronSource.unityVersion ());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
getBridge ().Call ("initISDemandOnly", appKey, adUnits);
|
||||
}
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
public void showRewardedVideo ()
|
||||
{
|
||||
getBridge ().Call ("showRewardedVideo");
|
||||
}
|
||||
|
||||
public void showRewardedVideo (string placementName)
|
||||
{
|
||||
getBridge ().Call ("showRewardedVideo", placementName);
|
||||
}
|
||||
|
||||
public bool isRewardedVideoAvailable ()
|
||||
{
|
||||
return getBridge ().Call<bool> ("isRewardedVideoAvailable");
|
||||
}
|
||||
|
||||
public bool isRewardedVideoPlacementCapped (string placementName)
|
||||
{
|
||||
return getBridge ().Call<bool> ("isRewardedVideoPlacementCapped", placementName);
|
||||
}
|
||||
|
||||
public IronSourcePlacement getPlacementInfo (string placementName)
|
||||
{
|
||||
string placementInfo = getBridge ().Call<string> ("getPlacementInfo", placementName);
|
||||
IronSourcePlacement pInfo = null;
|
||||
if (placementInfo != null) {
|
||||
Dictionary<string,object> pInfoDic = IronSourceJSON.Json.Deserialize (placementInfo) as Dictionary<string,object>;
|
||||
string pName = pInfoDic [PLACEMENT_NAME].ToString ();
|
||||
string rName = pInfoDic [REWARD_NAME].ToString ();
|
||||
int rAmount = Convert.ToInt32 (pInfoDic [REWARD_AMOUNT].ToString ());
|
||||
|
||||
pInfo = new IronSourcePlacement (pName, rName, rAmount);
|
||||
}
|
||||
return pInfo;
|
||||
}
|
||||
|
||||
public void setRewardedVideoServerParams(Dictionary<string, string> parameters) {
|
||||
string json = IronSourceJSON.Json.Serialize (parameters);
|
||||
getBridge ().Call ("setRewardedVideoServerParams", json);
|
||||
}
|
||||
|
||||
public void clearRewardedVideoServerParams() {
|
||||
getBridge ().Call ("clearRewardedVideoServerParams");
|
||||
}
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
public void showISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
getBridge ().Call ("showISDemandOnlyRewardedVideo",instanceId);
|
||||
}
|
||||
|
||||
public void loadISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
getBridge ().Call ("loadISDemandOnlyRewardedVideo", instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyRewardedVideoAvailable (string instanceId)
|
||||
{
|
||||
return getBridge ().Call<bool> ("isISDemandOnlyRewardedVideoAvailable", instanceId);
|
||||
}
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
public void loadInterstitial ()
|
||||
{
|
||||
getBridge ().Call ("loadInterstitial");
|
||||
}
|
||||
|
||||
public void showInterstitial ()
|
||||
{
|
||||
getBridge ().Call ("showInterstitial");
|
||||
}
|
||||
|
||||
public void showInterstitial (string placementName)
|
||||
{
|
||||
getBridge ().Call ("showInterstitial", placementName);
|
||||
}
|
||||
|
||||
public bool isInterstitialReady ()
|
||||
{
|
||||
return getBridge ().Call<bool> ("isInterstitialReady");
|
||||
}
|
||||
|
||||
public bool isInterstitialPlacementCapped (string placementName)
|
||||
{
|
||||
return getBridge ().Call<bool> ("isInterstitialPlacementCapped", placementName);
|
||||
}
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
public void loadISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
getBridge ().Call ("loadISDemandOnlyInterstitial",instanceId);
|
||||
}
|
||||
|
||||
public void showISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
getBridge ().Call ("showISDemandOnlyInterstitial",instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyInterstitialReady (string instanceId)
|
||||
{
|
||||
return getBridge ().Call<bool> ("isISDemandOnlyInterstitialReady",instanceId);
|
||||
}
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
public void showOfferwall ()
|
||||
{
|
||||
getBridge ().Call ("showOfferwall");
|
||||
}
|
||||
|
||||
public void showOfferwall (string placementName)
|
||||
{
|
||||
getBridge ().Call ("showOfferwall", placementName);
|
||||
}
|
||||
|
||||
public void getOfferwallCredits ()
|
||||
{
|
||||
getBridge ().Call ("getOfferwallCredits");
|
||||
}
|
||||
|
||||
public bool isOfferwallAvailable ()
|
||||
{
|
||||
return getBridge ().Call<bool> ("isOfferwallAvailable");
|
||||
}
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
{
|
||||
loadBanner(size, position, "");
|
||||
}
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
{
|
||||
getBridge().Call("loadBanner", size.Description, (int)size.Width, (int)size.Height, (int)position, placementName);
|
||||
}
|
||||
|
||||
public void destroyBanner()
|
||||
{
|
||||
getBridge ().Call ("destroyBanner");
|
||||
}
|
||||
|
||||
public void displayBanner()
|
||||
{
|
||||
getBridge ().Call ("displayBanner");
|
||||
}
|
||||
|
||||
public void hideBanner()
|
||||
{
|
||||
getBridge ().Call ("hideBanner");
|
||||
}
|
||||
|
||||
public bool isBannerPlacementCapped(string placementName)
|
||||
{
|
||||
return getBridge ().Call<bool> ("isBannerPlacementCapped", placementName);
|
||||
}
|
||||
|
||||
public void setSegment(IronSourceSegment segment)
|
||||
{
|
||||
Dictionary <string,string> dict = segment.getSegmentAsDict ();
|
||||
string json = IronSourceJSON.Json.Serialize (dict);
|
||||
getBridge ().Call ("setSegment", json);
|
||||
}
|
||||
|
||||
public void setConsent(bool consent)
|
||||
{
|
||||
getBridge().Call("setConsent",consent);
|
||||
}
|
||||
|
||||
//******************* ConsentView API *******************//
|
||||
|
||||
public void loadConsentViewWithType(string consentViewType)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showConsentViewWithType(string consentViewType)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize(impressionData);
|
||||
getBridge().Call("setAdRevenueData", dataSource, json);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 383e513a18bd7449994e83f8f434e950
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,317 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
public class IronSource : IronSourceIAgent
|
||||
{
|
||||
private IronSourceIAgent _platformAgent;
|
||||
private static IronSource _instance;
|
||||
private const string UNITY_PLUGIN_VERSION = "7.1.12-r";
|
||||
private static bool isUnsupportedPlatform;
|
||||
|
||||
private IronSource()
|
||||
{
|
||||
if (!isUnsupportedPlatform)
|
||||
{
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
_platformAgent = new UnsupportedPlatformAgent();
|
||||
#elif (UNITY_IPHONE || UNITY_IOS)
|
||||
_platformAgent = new iOSAgent();
|
||||
#elif UNITY_ANDROID
|
||||
_platformAgent = new AndroidAgent ();
|
||||
#endif
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
_platformAgent = new UnsupportedPlatformAgent();
|
||||
}
|
||||
var type = typeof(IronSourceEvents);
|
||||
var mgr = new GameObject("IronSourceEvents", type).GetComponent<IronSourceEvents>(); // Creates IronSourceEvents gameObject
|
||||
}
|
||||
|
||||
#region IronSourceIAgent implementation
|
||||
public static IronSource Agent {
|
||||
get {
|
||||
if (_instance == null) {
|
||||
_instance = new IronSource();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static string pluginVersion()
|
||||
{
|
||||
return UNITY_PLUGIN_VERSION;
|
||||
}
|
||||
|
||||
public static string unityVersion()
|
||||
{
|
||||
return Application.unityVersion;
|
||||
}
|
||||
|
||||
public static void setUnsupportedPlatform()
|
||||
{
|
||||
isUnsupportedPlatform = true;
|
||||
}
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
public void onApplicationPause(bool pause)
|
||||
{
|
||||
_platformAgent.onApplicationPause(pause);
|
||||
}
|
||||
|
||||
public void setMediationSegment(string segment)
|
||||
{
|
||||
_platformAgent.setMediationSegment(segment);
|
||||
}
|
||||
|
||||
public string getAdvertiserId()
|
||||
{
|
||||
return _platformAgent.getAdvertiserId();
|
||||
}
|
||||
|
||||
public void validateIntegration()
|
||||
{
|
||||
_platformAgent.validateIntegration();
|
||||
}
|
||||
|
||||
public void shouldTrackNetworkState(bool track)
|
||||
{
|
||||
_platformAgent.shouldTrackNetworkState(track);
|
||||
}
|
||||
|
||||
public bool setDynamicUserId(string dynamicUserId)
|
||||
{
|
||||
return _platformAgent.setDynamicUserId(dynamicUserId);
|
||||
}
|
||||
|
||||
public void setAdaptersDebug(bool enabled)
|
||||
{
|
||||
_platformAgent.setAdaptersDebug(enabled);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, string value)
|
||||
{
|
||||
_platformAgent.setMetaData(key, value);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, params string[] values)
|
||||
{
|
||||
_platformAgent.setMetaData(key, values);
|
||||
}
|
||||
|
||||
public int? getConversionValue()
|
||||
{
|
||||
return _platformAgent.getConversionValue();
|
||||
}
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
public void setUserId (string userId)
|
||||
{
|
||||
_platformAgent.setUserId (userId);
|
||||
}
|
||||
|
||||
public void init (string appKey)
|
||||
{
|
||||
_platformAgent.init (appKey);
|
||||
}
|
||||
|
||||
public void init (string appKey, params string[] adUnits)
|
||||
{
|
||||
_platformAgent.init (appKey, adUnits);
|
||||
}
|
||||
|
||||
public void initISDemandOnly (string appKey, params string[] adUnits)
|
||||
{
|
||||
_platformAgent.initISDemandOnly (appKey, adUnits);
|
||||
}
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
public void showRewardedVideo ()
|
||||
{
|
||||
_platformAgent.showRewardedVideo ();
|
||||
}
|
||||
|
||||
public void showRewardedVideo (string placementName)
|
||||
{
|
||||
_platformAgent.showRewardedVideo (placementName);
|
||||
}
|
||||
|
||||
public IronSourcePlacement getPlacementInfo (string placementName)
|
||||
{
|
||||
return _platformAgent.getPlacementInfo (placementName);
|
||||
}
|
||||
|
||||
public bool isRewardedVideoAvailable ()
|
||||
{
|
||||
return _platformAgent.isRewardedVideoAvailable ();
|
||||
}
|
||||
|
||||
public bool isRewardedVideoPlacementCapped (string placementName)
|
||||
{
|
||||
return _platformAgent.isRewardedVideoPlacementCapped (placementName);
|
||||
}
|
||||
|
||||
public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
||||
{
|
||||
_platformAgent.setRewardedVideoServerParams(parameters);
|
||||
}
|
||||
|
||||
public void clearRewardedVideoServerParams()
|
||||
{
|
||||
_platformAgent.clearRewardedVideoServerParams();
|
||||
}
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
public void showISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
_platformAgent.showISDemandOnlyRewardedVideo(instanceId);
|
||||
}
|
||||
|
||||
public void loadISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
_platformAgent.loadISDemandOnlyRewardedVideo(instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyRewardedVideoAvailable (string instanceId)
|
||||
{
|
||||
return _platformAgent.isISDemandOnlyRewardedVideoAvailable(instanceId);
|
||||
}
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
public void loadInterstitial ()
|
||||
{
|
||||
_platformAgent.loadInterstitial ();
|
||||
}
|
||||
|
||||
public void showInterstitial ()
|
||||
{
|
||||
_platformAgent.showInterstitial ();
|
||||
}
|
||||
|
||||
public void showInterstitial (string placementName)
|
||||
{
|
||||
_platformAgent.showInterstitial (placementName);
|
||||
}
|
||||
|
||||
public bool isInterstitialReady ()
|
||||
{
|
||||
return _platformAgent.isInterstitialReady ();
|
||||
}
|
||||
|
||||
public bool isInterstitialPlacementCapped (string placementName)
|
||||
{
|
||||
return _platformAgent.isInterstitialPlacementCapped (placementName);
|
||||
}
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
public void loadISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
_platformAgent.loadISDemandOnlyInterstitial(instanceId);
|
||||
}
|
||||
|
||||
public void showISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
_platformAgent.showISDemandOnlyInterstitial(instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyInterstitialReady (string instanceId)
|
||||
{
|
||||
return _platformAgent.isISDemandOnlyInterstitialReady(instanceId);
|
||||
}
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
public void showOfferwall ()
|
||||
{
|
||||
_platformAgent.showOfferwall ();
|
||||
}
|
||||
|
||||
public void showOfferwall (string placementName)
|
||||
{
|
||||
_platformAgent.showOfferwall (placementName);
|
||||
}
|
||||
|
||||
public void getOfferwallCredits ()
|
||||
{
|
||||
_platformAgent.getOfferwallCredits ();
|
||||
}
|
||||
|
||||
public bool isOfferwallAvailable ()
|
||||
{
|
||||
return _platformAgent.isOfferwallAvailable ();
|
||||
}
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
{
|
||||
_platformAgent.loadBanner (size, position);
|
||||
}
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
{
|
||||
_platformAgent.loadBanner (size, position, placementName);
|
||||
}
|
||||
|
||||
public void destroyBanner()
|
||||
{
|
||||
_platformAgent.destroyBanner ();
|
||||
}
|
||||
|
||||
public void displayBanner()
|
||||
{
|
||||
_platformAgent.displayBanner ();
|
||||
}
|
||||
|
||||
public void hideBanner()
|
||||
{
|
||||
_platformAgent.hideBanner ();
|
||||
}
|
||||
|
||||
|
||||
public bool isBannerPlacementCapped(string placementName)
|
||||
{
|
||||
return _platformAgent.isBannerPlacementCapped (placementName);
|
||||
|
||||
}
|
||||
|
||||
public void setSegment(IronSourceSegment segment)
|
||||
{
|
||||
_platformAgent.setSegment (segment);
|
||||
}
|
||||
|
||||
public void setConsent(bool consent)
|
||||
{
|
||||
_platformAgent.setConsent(consent);
|
||||
}
|
||||
|
||||
//******************* ConsentView API *******************//
|
||||
|
||||
public void loadConsentViewWithType(string consentViewType)
|
||||
{
|
||||
_platformAgent.loadConsentViewWithType(consentViewType);
|
||||
}
|
||||
|
||||
public void showConsentViewWithType(string consentViewType)
|
||||
{
|
||||
_platformAgent.showConsentViewWithType(consentViewType);
|
||||
}
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
{
|
||||
_platformAgent.setAdRevenueData( dataSource , impressionData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ec69520ef1aa4f74b7695ff3da85a8b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class IronSourceConfig
|
||||
{
|
||||
private const string unsupportedPlatformStr = "Unsupported Platform";
|
||||
private static IronSourceConfig _instance;
|
||||
|
||||
public static IronSourceConfig Instance {
|
||||
get {
|
||||
if (_instance == null) {
|
||||
_instance = new IronSourceConfig ();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
private static AndroidJavaObject _androidBridge;
|
||||
private readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
|
||||
public IronSourceConfig ()
|
||||
{
|
||||
using (var pluginClass = new AndroidJavaClass( AndroidBridge ))
|
||||
_androidBridge = pluginClass.CallStatic<AndroidJavaObject> ("getInstance");
|
||||
}
|
||||
|
||||
//Setters
|
||||
public void setLanguage (string language)
|
||||
{
|
||||
_androidBridge.Call ("setLanguage", language);
|
||||
}
|
||||
|
||||
public void setClientSideCallbacks (bool status)
|
||||
{
|
||||
_androidBridge.Call ("setClientSideCallbacks", status);
|
||||
}
|
||||
|
||||
public void setRewardedVideoCustomParams (Dictionary<string,string> rewardedVideoCustomParams)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize (rewardedVideoCustomParams);
|
||||
_androidBridge.Call ("setRewardedVideoCustomParams", json);
|
||||
}
|
||||
|
||||
public void setOfferwallCustomParams (Dictionary<string,string> offerwallCustomParams)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize (offerwallCustomParams);
|
||||
_androidBridge.Call ("setOfferwallCustomParams", json);
|
||||
}
|
||||
|
||||
|
||||
#elif (UNITY_IPHONE || UNITY_IOS) && !UNITY_EDITOR
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetLanguage (string language);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetClientSideCallbacks (bool useClientSideCallbacks);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetRewardedVideoCustomParams (string rewardedVideoCustomParams);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetOfferwallCustomParams (string offerwallCustomParams);
|
||||
|
||||
|
||||
public void setLanguage (string language)
|
||||
{
|
||||
CFSetLanguage (language);
|
||||
}
|
||||
|
||||
public void setClientSideCallbacks (bool status)
|
||||
{
|
||||
CFSetClientSideCallbacks (status);
|
||||
}
|
||||
|
||||
public void setRewardedVideoCustomParams (Dictionary<string,string> rewardedVideoCustomParams)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize (rewardedVideoCustomParams);
|
||||
CFSetRewardedVideoCustomParams (json);
|
||||
}
|
||||
|
||||
public void setOfferwallCustomParams (Dictionary<string,string> offerwallCustomParams)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize (offerwallCustomParams);
|
||||
CFSetOfferwallCustomParams (json);
|
||||
}
|
||||
|
||||
public IronSourceConfig ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
public void setLanguage (string language)
|
||||
{
|
||||
Debug.Log (unsupportedPlatformStr);
|
||||
}
|
||||
|
||||
public void setClientSideCallbacks (bool status)
|
||||
{
|
||||
Debug.Log (unsupportedPlatformStr);
|
||||
}
|
||||
|
||||
public void setRewardedVideoCustomParams (Dictionary<string,string> rewardedVideoCustomParams)
|
||||
{
|
||||
Debug.Log (unsupportedPlatformStr);
|
||||
}
|
||||
|
||||
public void setOfferwallCustomParams (Dictionary<string,string> offerwallCustomParams)
|
||||
{
|
||||
Debug.Log (unsupportedPlatformStr);
|
||||
}
|
||||
|
||||
public IronSourceConfig ()
|
||||
{
|
||||
Debug.Log (unsupportedPlatformStr);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e25760c5c158c41b4aa31bffb0209769
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
public static class IronSourceConstants
|
||||
{
|
||||
public const string interstitialBridgeListenerClass = "com.ironsource.unity.androidbridge.UnityInterstitialListener";
|
||||
public const string rewardedVideoBridgeListenerClass = "com.ironsource.unity.androidbridge.UnityRewardedVideoListener";
|
||||
public const string bridgeClass = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
public const string offerwallBridgeListenerClass = "com.ironsource.unity.androidbridge.UnityOfferwallListener";
|
||||
public const string bannerBridgeListenerClass = "com.ironsource.unity.androidbridge.UnityBannerListener";
|
||||
public const string segmentBridgeListenerClass = "com.ironsource.unity.androidbridge.UnitySegmentListener";
|
||||
public const string ERROR_CODE = "error_code";
|
||||
public const string ERROR_DESCRIPTION = "error_description";
|
||||
public const string INSTANCE_ID_KEY = "instanceId";
|
||||
public const string PLACEMENT_KEY = "placement";
|
||||
public const string IMPRESSION_DATA_KEY_AUCTION_ID = "auctionId";
|
||||
public const string IMPRESSION_DATA_KEY_AD_UNIT = "adUnit";
|
||||
public const string IMPRESSION_DATA_KEY_COUNTRY = "country";
|
||||
public const string IMPRESSION_DATA_KEY_ABTEST = "ab";
|
||||
public const string IMPRESSION_DATA_KEY_SEGMENT_NAME = "segmentName";
|
||||
public const string IMPRESSION_DATA_KEY_PLACEMENT = "placement";
|
||||
public const string IMPRESSION_DATA_KEY_AD_NETWORK = "adNetwork";
|
||||
public const string IMPRESSION_DATA_KEY_INSTANCE_NAME = "instanceName";
|
||||
public const string IMPRESSION_DATA_KEY_INSTANCE_ID = "instanceId";
|
||||
public const string IMPRESSION_DATA_KEY_REVENUE = "revenue";
|
||||
public const string IMPRESSION_DATA_KEY_PRECISION = "precision";
|
||||
public const string IMPRESSION_DATA_KEY_LIFETIME_REVENUE = "lifetimeRevenue";
|
||||
public const string IMPRESSION_DATA_KEY_ENCRYPTED_CPM = "encryptedCPM";
|
||||
public const string IMPRESSION_DATA_KEY_CONVERSION_VALUE= "conversionValue";
|
||||
public const string GENDER_MALE = "male";
|
||||
public const string GENDER_FEMALE = "female";
|
||||
public const string GENDER_UNKNOWN = "unknown";
|
||||
|
||||
public const string IRONSOURCE_MEDIATION_SETTING_NAME = "IronSourceMediationSettings";
|
||||
public const string IRONSOURCE_MEDIATED_NETWORK_SETTING_NAME = "IronSourceMediatedNetworkSettings";
|
||||
public const string IRONSOURCE_RESOURCES_PATH = "Assets/IronSource/Resources";
|
||||
public const string IRONSOURCE_SKAN_ID_KEY = "su67r6k2v3.skadnetwork";
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 86d04d1d517d942e79c31e208285c06a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
using System;
|
||||
|
||||
public class IronSourceError
|
||||
{
|
||||
private string description;
|
||||
private int code;
|
||||
|
||||
public int getErrorCode ()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public string getDescription ()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public int getCode ()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public IronSourceError (int errorCode, string errorDescription)
|
||||
{
|
||||
code = errorCode;
|
||||
description = errorDescription;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return code + " : " + description;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3eeee77c4aea4a979d85dcb1630fbe4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 06a7a5a9d456c4634864ec18b18f72dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
public interface IronSourceIAgent
|
||||
{
|
||||
//******************* Base API *******************//
|
||||
|
||||
void onApplicationPause (bool pause);
|
||||
|
||||
void setMediationSegment (string segment);
|
||||
|
||||
string getAdvertiserId ();
|
||||
|
||||
void validateIntegration ();
|
||||
|
||||
void shouldTrackNetworkState (bool track);
|
||||
|
||||
bool setDynamicUserId (string dynamicUserId);
|
||||
|
||||
void setAdaptersDebug(bool enabled);
|
||||
|
||||
void setMetaData(string key, string value);
|
||||
|
||||
void setMetaData(string key, params string[] values);
|
||||
|
||||
int? getConversionValue();
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
void setUserId (string userId);
|
||||
|
||||
void init (string appKey);
|
||||
|
||||
void init (string appKey, params string[] adUnits);
|
||||
|
||||
void initISDemandOnly (string appKey, params string[] adUnits);
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
void showRewardedVideo ();
|
||||
|
||||
void showRewardedVideo (string placementName);
|
||||
|
||||
bool isRewardedVideoAvailable ();
|
||||
|
||||
bool isRewardedVideoPlacementCapped (string placementName);
|
||||
|
||||
IronSourcePlacement getPlacementInfo (string name);
|
||||
|
||||
void setRewardedVideoServerParams(Dictionary<string, string> parameters);
|
||||
|
||||
void clearRewardedVideoServerParams();
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
void showISDemandOnlyRewardedVideo (string instanceId);
|
||||
|
||||
void loadISDemandOnlyRewardedVideo (string instanceId);
|
||||
|
||||
bool isISDemandOnlyRewardedVideoAvailable (string instanceId);
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
void loadInterstitial ();
|
||||
|
||||
void showInterstitial ();
|
||||
|
||||
void showInterstitial (string placementName);
|
||||
|
||||
bool isInterstitialReady ();
|
||||
|
||||
bool isInterstitialPlacementCapped (string placementName);
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
void loadISDemandOnlyInterstitial (string instanceId);
|
||||
|
||||
void showISDemandOnlyInterstitial (string instanceId);
|
||||
|
||||
bool isISDemandOnlyInterstitialReady (string instanceId);
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
void showOfferwall ();
|
||||
|
||||
void showOfferwall (string placementName);
|
||||
|
||||
bool isOfferwallAvailable ();
|
||||
|
||||
void getOfferwallCredits ();
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position);
|
||||
|
||||
void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position, string placementName);
|
||||
|
||||
void destroyBanner();
|
||||
|
||||
void displayBanner();
|
||||
|
||||
void hideBanner();
|
||||
|
||||
bool isBannerPlacementCapped(string placementName);
|
||||
|
||||
void setSegment(IronSourceSegment segment);
|
||||
|
||||
void setConsent(bool consent);
|
||||
|
||||
//******************* ConsentView API *******************//
|
||||
|
||||
void loadConsentViewWithType(string consentViewType);
|
||||
|
||||
void showConsentViewWithType(string consentViewType);
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData);
|
||||
}
|
||||
|
||||
public static class dataSource
|
||||
{
|
||||
public static string MOPUB { get { return "MoPub"; } }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class IronSourceAdUnits
|
||||
{
|
||||
public static string REWARDED_VIDEO { get { return "rewardedvideo"; } }
|
||||
|
||||
public static string INTERSTITIAL { get { return "interstitial"; } }
|
||||
|
||||
public static string OFFERWALL { get { return "offerwall"; } }
|
||||
|
||||
public static string BANNER { get { return "banner"; } }
|
||||
}
|
||||
|
||||
public class IronSourceBannerSize
|
||||
{
|
||||
private int width;
|
||||
private int height;
|
||||
private string description;
|
||||
|
||||
public static IronSourceBannerSize BANNER = new IronSourceBannerSize("BANNER");
|
||||
public static IronSourceBannerSize LARGE = new IronSourceBannerSize("LARGE");
|
||||
public static IronSourceBannerSize RECTANGLE = new IronSourceBannerSize("RECTANGLE");
|
||||
public static IronSourceBannerSize SMART = new IronSourceBannerSize("SMART");
|
||||
|
||||
private IronSourceBannerSize() {
|
||||
|
||||
}
|
||||
|
||||
public IronSourceBannerSize(int width, int height)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.description = "CUSTOM";
|
||||
}
|
||||
|
||||
public IronSourceBannerSize(string description)
|
||||
{
|
||||
this.description = description;
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
}
|
||||
|
||||
public string Description { get { return description; } }
|
||||
public int Width { get { return width; } }
|
||||
public int Height { get { return height; } }
|
||||
};
|
||||
|
||||
public enum IronSourceBannerPosition
|
||||
{
|
||||
TOP = 1,
|
||||
BOTTOM = 2
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a69a6174c46124e04b4b27ac7fbdd78d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
|
||||
public class IronSourceImpressionData
|
||||
{
|
||||
|
||||
public readonly string auctionId;
|
||||
public readonly string adUnit;
|
||||
public readonly string country;
|
||||
public readonly string ab;
|
||||
public readonly string segmentName;
|
||||
public readonly string placement;
|
||||
public readonly string adNetwork;
|
||||
public readonly string instanceName;
|
||||
public readonly string instanceId;
|
||||
public readonly double? revenue;
|
||||
public readonly string precision;
|
||||
public readonly double? lifetimeRevenue;
|
||||
public readonly string encryptedCPM;
|
||||
public readonly int? conversionValue;
|
||||
public readonly string allData;
|
||||
|
||||
|
||||
public IronSourceImpressionData(string json)
|
||||
{
|
||||
if (json != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
object obj;
|
||||
double parsedDouble;
|
||||
int parsedInt;
|
||||
allData = json;
|
||||
// Retrieve a CultureInfo object.
|
||||
CultureInfo invCulture = CultureInfo.InvariantCulture;
|
||||
Dictionary<string, object> jsonDic = IronSourceJSON.Json.Deserialize(json) as Dictionary<string, object>;
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_AUCTION_ID, out obj) && obj != null)
|
||||
{
|
||||
auctionId = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_AD_UNIT, out obj) && obj != null)
|
||||
{
|
||||
adUnit = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_COUNTRY, out obj) && obj != null)
|
||||
{
|
||||
country = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_ABTEST, out obj) && obj != null)
|
||||
{
|
||||
ab = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_SEGMENT_NAME, out obj) && obj != null)
|
||||
{
|
||||
segmentName = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_PLACEMENT, out obj) && obj != null)
|
||||
{
|
||||
placement = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_AD_NETWORK, out obj) && obj != null)
|
||||
{
|
||||
adNetwork = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_INSTANCE_NAME, out obj) && obj != null)
|
||||
{
|
||||
instanceName = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.INSTANCE_ID_KEY, out obj) && obj != null)
|
||||
{
|
||||
instanceId = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_PRECISION, out obj) && obj != null)
|
||||
{
|
||||
precision = obj.ToString();
|
||||
}
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_ENCRYPTED_CPM, out obj) && obj != null)
|
||||
{
|
||||
encryptedCPM = obj.ToString();
|
||||
}
|
||||
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_REVENUE, out obj) && obj != null && double.TryParse(string.Format(invCulture, "{0}", obj), NumberStyles.Any, invCulture, out parsedDouble))
|
||||
{
|
||||
revenue = parsedDouble;
|
||||
}
|
||||
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_LIFETIME_REVENUE, out obj) && obj != null && double.TryParse(string.Format(invCulture,"{0}",obj), NumberStyles.Any, invCulture, out parsedDouble))
|
||||
{
|
||||
lifetimeRevenue = parsedDouble;
|
||||
}
|
||||
|
||||
if (jsonDic.TryGetValue(IronSourceConstants.IMPRESSION_DATA_KEY_CONVERSION_VALUE, out obj) && obj != null && int.TryParse(string.Format(invCulture, "{0}", obj), NumberStyles.Any, invCulture, out parsedInt))
|
||||
{
|
||||
conversionValue = parsedInt;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Log("error parsing impression " + ex.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "IronSourceImpressionData{" +
|
||||
"auctionId='" + auctionId + '\'' +
|
||||
", adUnit='" + adUnit + '\'' +
|
||||
", country='" + country + '\'' +
|
||||
", ab='" + ab + '\'' +
|
||||
", segmentName='" + segmentName + '\'' +
|
||||
", placement='" + placement + '\'' +
|
||||
", adNetwork='" + adNetwork + '\'' +
|
||||
", instanceName='" + instanceName + '\'' +
|
||||
", instanceId='" + instanceId + '\'' +
|
||||
", revenue=" + revenue +
|
||||
", precision='" + precision + '\'' +
|
||||
", lifetimeRevenue=" + lifetimeRevenue +
|
||||
", encryptedCPM='" + encryptedCPM + '\'' +
|
||||
", conversionValue=" + conversionValue +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7ab0e9e995e4a4024abb4cee85c301ba
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class IronSourceInitilizer
|
||||
{
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
[RuntimeInitializeOnLoadMethod]
|
||||
static void Initilize()
|
||||
{
|
||||
var developerSettings = Resources.Load<IronSourceMediationSettings>(IronSourceConstants.IRONSOURCE_MEDIATION_SETTING_NAME);
|
||||
if (developerSettings != null)
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
string appKey = developerSettings.AndroidAppKey;
|
||||
#elif UNITY_IOS
|
||||
string appKey = developerSettings.IOSAppKey;
|
||||
#endif
|
||||
if (developerSettings.EnableIronsourceSDKInitAPI == true)
|
||||
{
|
||||
if (appKey.Equals(string.Empty))
|
||||
{
|
||||
Debug.LogWarning("IronSourceInitilizer Cannot init without AppKey");
|
||||
}
|
||||
else
|
||||
{
|
||||
IronSource.Agent.init(appKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (developerSettings.EnableAdapterDebug)
|
||||
{
|
||||
IronSource.Agent.setAdaptersDebug(true);
|
||||
}
|
||||
|
||||
if (developerSettings.EnableIntegrationHelper)
|
||||
{
|
||||
IronSource.Agent.validateIntegration();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f3e8e12247da34eafb182ebdfb06c10e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,495 +0,0 @@
|
|||
/*
|
||||
* Based on the miniJSON by Calvin Rien
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace IronSourceJSON
|
||||
{
|
||||
public static class Json
|
||||
{
|
||||
public static object Deserialize (string json)
|
||||
{
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
return Parser.Parse (json);
|
||||
}
|
||||
|
||||
sealed class Parser : IDisposable
|
||||
{
|
||||
const string WHITE_SPACE = " \t\n\r";
|
||||
const string WORD_BREAK = " \t\n\r{}[],:\"";
|
||||
|
||||
enum TOKEN
|
||||
{
|
||||
NONE,
|
||||
CURLY_OPEN,
|
||||
CURLY_CLOSE,
|
||||
SQUARED_OPEN,
|
||||
SQUARED_CLOSE,
|
||||
COLON,
|
||||
COMMA,
|
||||
STRING,
|
||||
NUMBER,
|
||||
TRUE,
|
||||
FALSE,
|
||||
NULL
|
||||
}
|
||||
;
|
||||
|
||||
StringReader json;
|
||||
|
||||
Parser (string jsonString)
|
||||
{
|
||||
json = new StringReader (jsonString);
|
||||
}
|
||||
|
||||
public static object Parse (string jsonString)
|
||||
{
|
||||
using (var instance = new Parser(jsonString)) {
|
||||
return instance.ParseValue ();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
json.Dispose ();
|
||||
json = null;
|
||||
}
|
||||
|
||||
Dictionary<string, object> ParseObject ()
|
||||
{
|
||||
Dictionary<string, object> table = new Dictionary<string, object> ();
|
||||
|
||||
// ditch opening brace
|
||||
json.Read ();
|
||||
|
||||
// {
|
||||
while (true) {
|
||||
switch (NextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.CURLY_CLOSE:
|
||||
return table;
|
||||
default:
|
||||
// name
|
||||
string name = ParseString ();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// :
|
||||
if (NextToken != TOKEN.COLON) {
|
||||
return null;
|
||||
}
|
||||
// ditch the colon
|
||||
json.Read ();
|
||||
|
||||
// value
|
||||
table [name] = ParseValue ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<object> ParseArray ()
|
||||
{
|
||||
List<object> array = new List<object> ();
|
||||
|
||||
// ditch opening bracket
|
||||
json.Read ();
|
||||
|
||||
// [
|
||||
var parsing = true;
|
||||
while (parsing) {
|
||||
TOKEN nextToken = NextToken;
|
||||
|
||||
switch (nextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.SQUARED_CLOSE:
|
||||
parsing = false;
|
||||
break;
|
||||
default:
|
||||
object value = ParseByToken (nextToken);
|
||||
|
||||
array.Add (value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
object ParseValue ()
|
||||
{
|
||||
TOKEN nextToken = NextToken;
|
||||
return ParseByToken (nextToken);
|
||||
}
|
||||
|
||||
object ParseByToken (TOKEN token)
|
||||
{
|
||||
switch (token) {
|
||||
case TOKEN.STRING:
|
||||
return ParseString ();
|
||||
case TOKEN.NUMBER:
|
||||
return ParseNumber ();
|
||||
case TOKEN.CURLY_OPEN:
|
||||
return ParseObject ();
|
||||
case TOKEN.SQUARED_OPEN:
|
||||
return ParseArray ();
|
||||
case TOKEN.TRUE:
|
||||
return true;
|
||||
case TOKEN.FALSE:
|
||||
return false;
|
||||
case TOKEN.NULL:
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
string ParseString ()
|
||||
{
|
||||
StringBuilder s = new StringBuilder ();
|
||||
char c;
|
||||
|
||||
// ditch opening quote
|
||||
json.Read ();
|
||||
|
||||
bool parsing = true;
|
||||
while (parsing) {
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
parsing = false;
|
||||
break;
|
||||
case '\\':
|
||||
if (json.Peek () == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
case '\\':
|
||||
case '/':
|
||||
s.Append (c);
|
||||
break;
|
||||
case 'b':
|
||||
s.Append ('\b');
|
||||
break;
|
||||
case 'f':
|
||||
s.Append ('\f');
|
||||
break;
|
||||
case 'n':
|
||||
s.Append ('\n');
|
||||
break;
|
||||
case 'r':
|
||||
s.Append ('\r');
|
||||
break;
|
||||
case 't':
|
||||
s.Append ('\t');
|
||||
break;
|
||||
case 'u':
|
||||
var hex = new StringBuilder ();
|
||||
|
||||
for (int i=0; i< 4; i++) {
|
||||
hex.Append (NextChar);
|
||||
}
|
||||
|
||||
s.Append ((char)Convert.ToInt32 (hex.ToString (), 16));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
s.Append (c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return s.ToString ();
|
||||
}
|
||||
|
||||
object ParseNumber ()
|
||||
{
|
||||
string number = NextWord;
|
||||
|
||||
if (number.IndexOf ('.') == -1) {
|
||||
long parsedInt;
|
||||
Int64.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedInt);
|
||||
return parsedInt;
|
||||
}
|
||||
|
||||
double parsedDouble;
|
||||
Double.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedDouble);
|
||||
return parsedDouble;
|
||||
}
|
||||
|
||||
void EatWhitespace ()
|
||||
{
|
||||
while (WHITE_SPACE.IndexOf(PeekChar) != -1) {
|
||||
json.Read ();
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char PeekChar {
|
||||
get {
|
||||
return Convert.ToChar (json.Peek ());
|
||||
}
|
||||
}
|
||||
|
||||
char NextChar {
|
||||
get {
|
||||
return Convert.ToChar (json.Read ());
|
||||
}
|
||||
}
|
||||
|
||||
string NextWord {
|
||||
get {
|
||||
StringBuilder word = new StringBuilder ();
|
||||
|
||||
while (WORD_BREAK.IndexOf(PeekChar) == -1) {
|
||||
word.Append (NextChar);
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return word.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
TOKEN NextToken {
|
||||
get {
|
||||
EatWhitespace ();
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
|
||||
char c = PeekChar;
|
||||
switch (c) {
|
||||
case '{':
|
||||
return TOKEN.CURLY_OPEN;
|
||||
case '}':
|
||||
json.Read ();
|
||||
return TOKEN.CURLY_CLOSE;
|
||||
case '[':
|
||||
return TOKEN.SQUARED_OPEN;
|
||||
case ']':
|
||||
json.Read ();
|
||||
return TOKEN.SQUARED_CLOSE;
|
||||
case ',':
|
||||
json.Read ();
|
||||
return TOKEN.COMMA;
|
||||
case '"':
|
||||
return TOKEN.STRING;
|
||||
case ':':
|
||||
return TOKEN.COLON;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '-':
|
||||
return TOKEN.NUMBER;
|
||||
}
|
||||
|
||||
string word = NextWord;
|
||||
|
||||
switch (word) {
|
||||
case "false":
|
||||
return TOKEN.FALSE;
|
||||
case "true":
|
||||
return TOKEN.TRUE;
|
||||
case "null":
|
||||
return TOKEN.NULL;
|
||||
}
|
||||
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
|
||||
/// </summary>
|
||||
/// <param name="json">A Dictionary<string, object> / List<object></param>
|
||||
/// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
|
||||
public static string Serialize (object obj)
|
||||
{
|
||||
return Serializer.Serialize (obj);
|
||||
}
|
||||
|
||||
sealed class Serializer
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
||||
Serializer ()
|
||||
{
|
||||
builder = new StringBuilder ();
|
||||
}
|
||||
|
||||
public static string Serialize (object obj)
|
||||
{
|
||||
var instance = new Serializer ();
|
||||
|
||||
instance.SerializeValue (obj);
|
||||
|
||||
return instance.builder.ToString ();
|
||||
}
|
||||
|
||||
void SerializeValue (object value)
|
||||
{
|
||||
IList asList;
|
||||
IDictionary asDict;
|
||||
string asStr;
|
||||
|
||||
if (value == null) {
|
||||
builder.Append ("null");
|
||||
} else if ((asStr = value as string) != null) {
|
||||
SerializeString (asStr);
|
||||
} else if (value is bool) {
|
||||
builder.Append (value.ToString ().ToLower ());
|
||||
} else if ((asList = value as IList) != null) {
|
||||
SerializeArray (asList);
|
||||
} else if ((asDict = value as IDictionary) != null) {
|
||||
SerializeObject (asDict);
|
||||
} else if (value is char) {
|
||||
SerializeString (value.ToString ());
|
||||
} else {
|
||||
SerializeOther (value);
|
||||
}
|
||||
}
|
||||
|
||||
void SerializeObject (IDictionary obj)
|
||||
{
|
||||
bool first = true;
|
||||
|
||||
builder.Append ('{');
|
||||
|
||||
foreach (object e in obj.Keys) {
|
||||
if (!first) {
|
||||
builder.Append (',');
|
||||
}
|
||||
|
||||
SerializeString (e.ToString ());
|
||||
builder.Append (':');
|
||||
|
||||
SerializeValue (obj [e]);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append ('}');
|
||||
}
|
||||
|
||||
void SerializeArray (IList anArray)
|
||||
{
|
||||
builder.Append ('[');
|
||||
|
||||
bool first = true;
|
||||
|
||||
foreach (object obj in anArray) {
|
||||
if (!first) {
|
||||
builder.Append (',');
|
||||
}
|
||||
|
||||
SerializeValue (obj);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append (']');
|
||||
}
|
||||
|
||||
void SerializeString (string str)
|
||||
{
|
||||
builder.Append ('\"');
|
||||
|
||||
char[] charArray = str.ToCharArray ();
|
||||
foreach (var c in charArray) {
|
||||
switch (c) {
|
||||
case '"':
|
||||
builder.Append ("\\\"");
|
||||
break;
|
||||
case '\\':
|
||||
builder.Append ("\\\\");
|
||||
break;
|
||||
case '\b':
|
||||
builder.Append ("\\b");
|
||||
break;
|
||||
case '\f':
|
||||
builder.Append ("\\f");
|
||||
break;
|
||||
case '\n':
|
||||
builder.Append ("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
builder.Append ("\\r");
|
||||
break;
|
||||
case '\t':
|
||||
builder.Append ("\\t");
|
||||
break;
|
||||
default:
|
||||
int codepoint = Convert.ToInt32 (c);
|
||||
if ((codepoint >= 32) && (codepoint <= 126)) {
|
||||
builder.Append (c);
|
||||
} else {
|
||||
builder.Append ("\\u" + Convert.ToString (codepoint, 16).PadLeft (4, '0'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
builder.Append ('\"');
|
||||
}
|
||||
|
||||
void SerializeOther (object value)
|
||||
{
|
||||
if (value is float
|
||||
|| value is int
|
||||
|| value is uint
|
||||
|| value is long
|
||||
|| value is double
|
||||
|| value is sbyte
|
||||
|| value is byte
|
||||
|| value is short
|
||||
|| value is ushort
|
||||
|| value is ulong
|
||||
|| value is decimal) {
|
||||
builder.Append (value.ToString ());
|
||||
} else {
|
||||
SerializeString (value.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6704b25b621ab47ebbfa013ced92bdb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
public class IronSourceMediationSettings : ScriptableObject
|
||||
{
|
||||
public static readonly string IRONSOURCE_SETTINGS_ASSET_PATH = Path.Combine(IronSourceConstants.IRONSOURCE_RESOURCES_PATH, IronSourceConstants.IRONSOURCE_MEDIATION_SETTING_NAME + ".asset");
|
||||
|
||||
[Header("Ironsource AppKey")]
|
||||
[Tooltip("Add your application AppKeys, as provided in Ironsource Platform")]
|
||||
public string AndroidAppKey = string.Empty;
|
||||
[Tooltip("Add your application AppKeys, as provided in Ironsource Platform")]
|
||||
public string IOSAppKey = string.Empty;
|
||||
|
||||
[Header("Automatic Initialization")]
|
||||
[Tooltip("Use this flag when you wish to initialize all ad units (recommended)")]
|
||||
public bool EnableIronsourceSDKInitAPI;
|
||||
|
||||
[Header("Ironsource SKAdNetwork ID")]
|
||||
[Tooltip("Add Ironsource SKAdNetworkIdentifier to your Info.plist for iOS 14+")]
|
||||
public bool AddIronsourceSkadnetworkID;
|
||||
|
||||
[Header("Project Features")]
|
||||
public bool EnableAdapterDebug;
|
||||
|
||||
public bool EnableIntegrationHelper;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d5a679b8640d04834b4f09b8c6adec7a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
using System;
|
||||
|
||||
public class IronSourcePlacement
|
||||
{
|
||||
private string rewardName;
|
||||
private int rewardAmount;
|
||||
private string placementName;
|
||||
|
||||
public IronSourcePlacement (string placementName, string rewardName, int rewardAmount)
|
||||
{
|
||||
this.placementName = placementName;
|
||||
this.rewardName = rewardName;
|
||||
this.rewardAmount = rewardAmount;
|
||||
}
|
||||
|
||||
public string getRewardName ()
|
||||
{
|
||||
return rewardName;
|
||||
}
|
||||
|
||||
public int getRewardAmount ()
|
||||
{
|
||||
return rewardAmount;
|
||||
}
|
||||
|
||||
public string getPlacementName ()
|
||||
{
|
||||
return placementName;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return placementName + " : " + rewardName + " : " + rewardAmount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 984e6a9b75cea4626baa9dcb08114ebf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
|
||||
|
||||
public class IronSourceSegment
|
||||
{
|
||||
|
||||
public int age;
|
||||
public string gender = null;
|
||||
public int level;
|
||||
public int isPaying;
|
||||
public long userCreationDate;
|
||||
public double iapt;
|
||||
public string segmentName = null;
|
||||
public Dictionary<string,string> customs;
|
||||
|
||||
public IronSourceSegment ()
|
||||
{
|
||||
customs = new Dictionary<string,string> ();
|
||||
age = -1;
|
||||
level = -1;
|
||||
isPaying = -1;
|
||||
userCreationDate = -1;
|
||||
iapt = 0;
|
||||
}
|
||||
|
||||
public void setCustom(string key, string value){
|
||||
customs.Add (key, value);
|
||||
}
|
||||
|
||||
public Dictionary<string,string> getSegmentAsDict ()
|
||||
{
|
||||
Dictionary<string,string> temp = new Dictionary<string,string> ();
|
||||
if (age != -1)
|
||||
temp.Add ("age", age + "");
|
||||
if (!string.IsNullOrEmpty(gender))
|
||||
temp.Add ("gender", gender);
|
||||
if (level != -1)
|
||||
temp.Add ("level", level + "");
|
||||
if (isPaying > -1 && isPaying < 2)
|
||||
temp.Add ("isPaying", isPaying + "");
|
||||
if (userCreationDate != -1)
|
||||
temp.Add ("userCreationDate", userCreationDate + "");
|
||||
if (!string.IsNullOrEmpty(segmentName))
|
||||
temp.Add ("segmentName", segmentName);
|
||||
if (iapt > 0)
|
||||
temp.Add ("iapt", iapt + "");
|
||||
|
||||
Dictionary<string,string> result = temp.Concat (customs).GroupBy (d => d.Key).ToDictionary (d => d.Key, d => d.First ().Value);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f060327917ac94f60857545bd54c308e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class IronSourceUtils
|
||||
{
|
||||
private const string ERROR_CODE = "error_code";
|
||||
private const string ERROR_DESCRIPTION = "error_description";
|
||||
private const string INSTANCE_ID_KEY = "instanceId";
|
||||
private const string PLACEMENT_KEY = "placement";
|
||||
|
||||
public static IronSourceError getErrorFromErrorObject(object descriptionObject)
|
||||
{
|
||||
Dictionary<string, object> error = null;
|
||||
if (descriptionObject is IDictionary)
|
||||
{
|
||||
error = descriptionObject as Dictionary<string, object>;
|
||||
}
|
||||
else if (descriptionObject is String && !String.IsNullOrEmpty(descriptionObject.ToString()))
|
||||
{
|
||||
error = IronSourceJSON.Json.Deserialize(descriptionObject.ToString()) as Dictionary<string, object>;
|
||||
}
|
||||
|
||||
IronSourceError sse = new IronSourceError(-1, "");
|
||||
if (error != null && error.Count > 0)
|
||||
{
|
||||
int eCode = Convert.ToInt32(error[ERROR_CODE].ToString());
|
||||
string eDescription = error[ERROR_DESCRIPTION].ToString();
|
||||
sse = new IronSourceError(eCode, eDescription);
|
||||
}
|
||||
|
||||
return sse;
|
||||
}
|
||||
|
||||
public static IronSourcePlacement getPlacementFromObject(object placementObject)
|
||||
{
|
||||
Dictionary<string, object> placementJSON = null;
|
||||
if (placementObject is IDictionary)
|
||||
{
|
||||
placementJSON = placementObject as Dictionary<string, object>;
|
||||
}
|
||||
else if (placementObject is String)
|
||||
{
|
||||
placementJSON = IronSourceJSON.Json.Deserialize(placementObject.ToString()) as Dictionary<string, object>;
|
||||
}
|
||||
|
||||
IronSourcePlacement ssp = null;
|
||||
if (placementJSON != null && placementJSON.Count > 0)
|
||||
{
|
||||
int rewardAmount = Convert.ToInt32(placementJSON["placement_reward_amount"].ToString());
|
||||
string rewardName = placementJSON["placement_reward_name"].ToString();
|
||||
string placementName = placementJSON["placement_name"].ToString();
|
||||
|
||||
ssp = new IronSourcePlacement(placementName, rewardName, rewardAmount);
|
||||
}
|
||||
|
||||
return ssp;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bba6a563b7b0746aea78a1ea9fea14fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,287 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class UnsupportedPlatformAgent : IronSourceIAgent
|
||||
{
|
||||
public UnsupportedPlatformAgent ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
#region IronSourceAgent implementation
|
||||
|
||||
public void start ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
public void onApplicationPause (bool pause)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void setMediationSegment (string segment)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public string getAdvertiserId ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return "";
|
||||
}
|
||||
|
||||
public void validateIntegration ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void shouldTrackNetworkState (bool track)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool setDynamicUserId (string dynamicUserId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setAdaptersDebug(bool enabled)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void setMetaData(string key, string value)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void setMetaData(string key, params string[] values)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
public int? getConversionValue()
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
return null;
|
||||
}
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
public void setUserId (string userId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void init (string appKey)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void init (string appKey, params string[] adUnits)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void initISDemandOnly (string appKey, params string[] adUnits)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
public void showRewardedVideo ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showRewardedVideo (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool isRewardedVideoAvailable ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool isRewardedVideoPlacementCapped (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return true;
|
||||
}
|
||||
|
||||
public IronSourcePlacement getPlacementInfo (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void clearRewardedVideoServerParams()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
public void showISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void loadISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyRewardedVideoAvailable (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
public void loadInterstitial ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showInterstitial ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showInterstitial (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool isInterstitialReady ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool isInterstitialPlacementCapped (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return true;
|
||||
}
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
public void loadISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyInterstitialReady (string instanceId)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
public void showOfferwall ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showOfferwall (string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void getOfferwallCredits ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool isOfferwallAvailable ()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void destroyBanner()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void displayBanner()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void hideBanner()
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public bool isBannerPlacementCapped(string placementName)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSegment(IronSourceSegment segment){
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void setConsent(bool consent)
|
||||
{
|
||||
Debug.Log ("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* ConsentView API *******************//
|
||||
|
||||
public void loadConsentViewWithType(string consentViewType)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
public void showConsentViewWithType(string consentViewType)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
{
|
||||
Debug.Log("Unsupported Platform");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fa7a1bdde72c745a48f5ab116d847d96
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,455 +0,0 @@
|
|||
#if UNITY_IPHONE || UNITY_IOS
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
public class iOSAgent : IronSourceIAgent
|
||||
{
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetPluginData (string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetMediationSegment (string segment);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern string CFGetAdvertiserId ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFValidateIntegration ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShouldTrackNetworkState (bool track);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFSetDynamicUserId (string dynamicUserId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetAdaptersDebug (bool enabled);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetMetaData (string key, string value);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetMetaDataWithValues (string key, params string[] values);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern string CFGetConversionValue();
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetUserId (string userId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFInit (string appKey);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFInitWithAdUnits (string appKey, params string[] adUnits);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFInitISDemandOnly (string appKey, params string[] adUnits);
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowRewardedVideo ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowRewardedVideoWithPlacementName (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsRewardedVideoAvailable ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsRewardedVideoPlacementCapped (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern string CFGetPlacementInfo (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetRewardedVideoServerParameters (string jsonString);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFClearRewardedVideoServerParameters ();
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowISDemandOnlyRewardedVideo (string instanceId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFLoadISDemandOnlyRewardedVideo (string instanceId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsDemandOnlyRewardedVideoAvailable (string instanceId);
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFLoadInterstitial ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowInterstitial ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowInterstitialWithPlacementName (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsInterstitialReady ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsInterstitialPlacementCapped (string placementName);
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFLoadISDemandOnlyInterstitial (string instanceId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowISDemandOnlyInterstitial(string instanceId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsDemandOnlyInterstitialReady (string instanceId);
|
||||
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowOfferwall ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowOfferwallWithPlacementName (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFGetOfferwallCredits ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsOfferwallAvailable ();
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFLoadBanner (string description, int width, int height, int position, string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFDestroyBanner ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFDisplayBanner ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFHideBanner ();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool CFIsBannerPlacementCapped (string placementName);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetSegment(string json);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetConsent(bool consent);
|
||||
|
||||
//******************* ConsentView API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFLoadConsentViewWithType(string consentViewType);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFShowConsentViewWithType(string consentViewType);
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void CFSetAdRevenueData(string dataSource, string impressionData);
|
||||
|
||||
public iOSAgent ()
|
||||
{
|
||||
}
|
||||
|
||||
#region IronSourceIAgent implementation
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
public void onApplicationPause (bool pause)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void setMediationSegment (string segment)
|
||||
{
|
||||
CFSetMediationSegment (segment);
|
||||
}
|
||||
|
||||
public string getAdvertiserId ()
|
||||
{
|
||||
return CFGetAdvertiserId ();
|
||||
}
|
||||
|
||||
public void validateIntegration ()
|
||||
{
|
||||
CFValidateIntegration ();
|
||||
}
|
||||
|
||||
public void shouldTrackNetworkState (bool track)
|
||||
{
|
||||
CFShouldTrackNetworkState (track);
|
||||
}
|
||||
|
||||
public bool setDynamicUserId (string dynamicUserId)
|
||||
{
|
||||
return CFSetDynamicUserId (dynamicUserId);
|
||||
}
|
||||
|
||||
public void setAdaptersDebug(bool enabled)
|
||||
{
|
||||
CFSetAdaptersDebug (enabled);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, params string[] values)
|
||||
{
|
||||
CFSetMetaDataWithValues(key, values);
|
||||
}
|
||||
|
||||
public void setMetaData(string key, string value)
|
||||
{
|
||||
CFSetMetaData(key, value);
|
||||
}
|
||||
|
||||
public int? getConversionValue()
|
||||
{
|
||||
CultureInfo invCulture = CultureInfo.InvariantCulture;
|
||||
int parsedInt;
|
||||
if(int.TryParse(string.Format(invCulture, "{0}", CFGetConversionValue()), NumberStyles.Any, invCulture, out parsedInt))
|
||||
{
|
||||
return parsedInt;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//******************* SDK Init *******************//
|
||||
|
||||
public void setUserId (string userId)
|
||||
{
|
||||
CFSetUserId (userId);
|
||||
}
|
||||
|
||||
public void init (string appKey)
|
||||
{
|
||||
CFSetPluginData ("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
CFInit (appKey);
|
||||
}
|
||||
|
||||
public void init (string appKey, params string[] adUnits)
|
||||
{
|
||||
CFSetPluginData ("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
CFInitWithAdUnits (appKey, adUnits);
|
||||
}
|
||||
|
||||
public void initISDemandOnly (string appKey, params string[] adUnits)
|
||||
{
|
||||
CFSetPluginData ("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
Debug.Log ("IntegrationHelper pluginVersion: " + IronSource.pluginVersion ());
|
||||
CFInitISDemandOnly (appKey, adUnits);
|
||||
}
|
||||
|
||||
//******************* RewardedVideo API *******************//
|
||||
|
||||
public void showRewardedVideo ()
|
||||
{
|
||||
CFShowRewardedVideo ();
|
||||
}
|
||||
|
||||
public void showRewardedVideo (string placementName)
|
||||
{
|
||||
CFShowRewardedVideoWithPlacementName (placementName);
|
||||
}
|
||||
|
||||
public bool isRewardedVideoAvailable ()
|
||||
{
|
||||
return CFIsRewardedVideoAvailable ();
|
||||
}
|
||||
|
||||
public bool isRewardedVideoPlacementCapped (string placementName)
|
||||
{
|
||||
return CFIsRewardedVideoPlacementCapped (placementName);
|
||||
}
|
||||
|
||||
public IronSourcePlacement getPlacementInfo (string placementName)
|
||||
{
|
||||
IronSourcePlacement sp = null;
|
||||
|
||||
string spString = CFGetPlacementInfo (placementName);
|
||||
if (spString != null) {
|
||||
Dictionary<string,object> spDic = IronSourceJSON.Json.Deserialize (spString) as Dictionary<string,object>;
|
||||
string pName = spDic ["placement_name"].ToString ();
|
||||
string rewardName = spDic ["reward_name"].ToString ();
|
||||
int rewardAmount = Convert.ToInt32 (spDic ["reward_amount"].ToString ());
|
||||
sp = new IronSourcePlacement (pName, rewardName, rewardAmount);
|
||||
}
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
public void setRewardedVideoServerParams(Dictionary<string, string> parameters){
|
||||
string json = IronSourceJSON.Json.Serialize (parameters);
|
||||
CFSetRewardedVideoServerParameters (json);
|
||||
}
|
||||
|
||||
public void clearRewardedVideoServerParams(){
|
||||
CFClearRewardedVideoServerParameters ();
|
||||
}
|
||||
|
||||
//******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
public void showISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
CFShowISDemandOnlyRewardedVideo(instanceId);
|
||||
}
|
||||
|
||||
public void loadISDemandOnlyRewardedVideo (string instanceId)
|
||||
{
|
||||
CFLoadISDemandOnlyRewardedVideo(instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyRewardedVideoAvailable (string instanceId)
|
||||
{
|
||||
return CFIsDemandOnlyRewardedVideoAvailable(instanceId);
|
||||
}
|
||||
|
||||
//******************* Interstitial API *******************//
|
||||
|
||||
public void loadInterstitial ()
|
||||
{
|
||||
CFLoadInterstitial ();
|
||||
}
|
||||
|
||||
public void showInterstitial ()
|
||||
{
|
||||
CFShowInterstitial ();
|
||||
}
|
||||
|
||||
public void showInterstitial (string placementName)
|
||||
{
|
||||
CFShowInterstitialWithPlacementName (placementName);
|
||||
}
|
||||
|
||||
public bool isInterstitialReady ()
|
||||
{
|
||||
return CFIsInterstitialReady ();
|
||||
}
|
||||
|
||||
public bool isInterstitialPlacementCapped (string placementName)
|
||||
{
|
||||
return CFIsInterstitialPlacementCapped (placementName);
|
||||
}
|
||||
|
||||
//******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
public void loadISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
CFLoadISDemandOnlyInterstitial (instanceId);
|
||||
}
|
||||
|
||||
public void showISDemandOnlyInterstitial (string instanceId)
|
||||
{
|
||||
CFShowISDemandOnlyInterstitial(instanceId);
|
||||
}
|
||||
|
||||
public bool isISDemandOnlyInterstitialReady (string instanceId)
|
||||
{
|
||||
return CFIsDemandOnlyInterstitialReady (instanceId);
|
||||
}
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
public void showOfferwall ()
|
||||
{
|
||||
CFShowOfferwall ();
|
||||
}
|
||||
|
||||
public void showOfferwall (string placementName)
|
||||
{
|
||||
CFShowOfferwallWithPlacementName (placementName);
|
||||
}
|
||||
|
||||
public void getOfferwallCredits ()
|
||||
{
|
||||
CFGetOfferwallCredits ();
|
||||
}
|
||||
|
||||
public bool isOfferwallAvailable ()
|
||||
{
|
||||
return CFIsOfferwallAvailable ();
|
||||
}
|
||||
|
||||
//******************* Banner API *******************//
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
{
|
||||
loadBanner(size, position, "");
|
||||
}
|
||||
|
||||
public void loadBanner (IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
{
|
||||
CFLoadBanner (size.Description, (int)size.Width, (int)size.Height, (int)position, placementName);
|
||||
}
|
||||
|
||||
public void destroyBanner ()
|
||||
{
|
||||
CFDestroyBanner ();
|
||||
}
|
||||
|
||||
public void displayBanner ()
|
||||
{
|
||||
CFDisplayBanner ();
|
||||
}
|
||||
|
||||
public void hideBanner ()
|
||||
{
|
||||
CFHideBanner ();
|
||||
}
|
||||
|
||||
public bool isBannerPlacementCapped (string placementName)
|
||||
{
|
||||
return CFIsBannerPlacementCapped (placementName);
|
||||
}
|
||||
|
||||
public void setSegment(IronSourceSegment segment){
|
||||
Dictionary <string,string> dict = segment.getSegmentAsDict ();
|
||||
string json = IronSourceJSON.Json.Serialize (dict);
|
||||
CFSetSegment (json);
|
||||
}
|
||||
|
||||
public void setConsent(bool consent)
|
||||
{
|
||||
CFSetConsent(consent);
|
||||
}
|
||||
|
||||
public void loadConsentViewWithType(string consentViewType)
|
||||
{
|
||||
CFLoadConsentViewWithType(consentViewType);
|
||||
}
|
||||
|
||||
public void showConsentViewWithType(string consentViewType)
|
||||
{
|
||||
CFShowConsentViewWithType(consentViewType);
|
||||
}
|
||||
|
||||
//******************* ILRD API *******************//
|
||||
|
||||
public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
{
|
||||
string json = IronSourceJSON.Json.Serialize (impressionData);
|
||||
CFSetAdRevenueData(dataSource, json);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 39133b84cde1b42d8b4970f62fd20faa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using GameAnalyticsSDK;
|
||||
|
||||
public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
|
||||
|
||||
public static readonly string AD_PLACEMENT_COIN = "coin";
|
||||
public static readonly string AD_PLACEMENT_CORNFIELD = "cornfield";
|
||||
public static readonly string AD_PLACEMENT_CUSTOMER = "increase_customer";
|
||||
public static readonly string AD_PLACEMENT_PERFECT = "perfect_popcorn";
|
||||
public static readonly string AD_PLACEMENT_VIP = "vip_customer";
|
||||
public static readonly string AD_PLACEMENT_AUTO = "auto_popcorn";
|
||||
|
||||
//-- ironSource --//
|
||||
#if UNITY_IOS
|
||||
private static readonly string IRONSOURCE_APP_KEY = "11bc8b5ad";
|
||||
#else
|
||||
private static readonly string IRONSOURCE_APP_KEY = "11bc928bd";
|
||||
#endif
|
||||
|
||||
private Action<bool> _rewardAdCallback = null;
|
||||
private readonly int ASYNC_FRAME_LIMIT = 60;
|
||||
private int _async_frame_count = 0;
|
||||
private bool _rewardAdOpen = false;
|
||||
private bool _rewardAdClose = false;
|
||||
private bool _rewardAdFinish = false;
|
||||
private float _timeScale = 0.0f;
|
||||
|
||||
private bool _marketPause;
|
||||
private bool _cacheSeEnabled;
|
||||
|
||||
void Awake(){
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
InitializeRewardedAds();
|
||||
|
||||
#if DEVELOPMENT_BUILD
|
||||
IronSource.Agent.validateIntegration ();
|
||||
IronSource.Agent.setAdaptersDebug(true);
|
||||
#endif
|
||||
IronSource.Agent.init (IRONSOURCE_APP_KEY);
|
||||
}
|
||||
|
||||
void Start(){
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
LoadBannerAds();
|
||||
ShowBannerAd();
|
||||
}
|
||||
|
||||
void Update (){
|
||||
if(_rewardAdOpen){
|
||||
_rewardAdOpen = false;
|
||||
pauseGame();
|
||||
}else if(_rewardAdClose){
|
||||
if(_rewardAdFinish){
|
||||
_rewardAdClose = false;
|
||||
this.RewardAdCallbackClose(_rewardAdFinish);
|
||||
}else if(ASYNC_FRAME_LIMIT > _async_frame_count){
|
||||
_async_frame_count++;
|
||||
}else{
|
||||
_rewardAdClose = false;
|
||||
this.RewardAdCallbackClose(_rewardAdFinish);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnApplicationPause(bool isPaused) {
|
||||
IronSource.Agent.onApplicationPause(isPaused);
|
||||
}
|
||||
|
||||
//-- Banners Ads --//
|
||||
|
||||
public void LoadBannerAds(){
|
||||
IronSource.Agent.loadBanner(IronSourceBannerSize.SMART, IronSourceBannerPosition.BOTTOM);
|
||||
|
||||
}
|
||||
public void ShowBannerAd(){
|
||||
IronSource.Agent.displayBanner();
|
||||
}
|
||||
public void HideBanner(){
|
||||
IronSource.Agent.hideBanner();
|
||||
}
|
||||
|
||||
public void InitializeRewardedAds(){
|
||||
IronSourceEvents.onRewardedVideoAdOpenedEvent += RewardedVideoAdOpenedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdClosedEvent += RewardedVideoAdClosedEvent;
|
||||
IronSourceEvents.onRewardedVideoAvailabilityChangedEvent += RewardedVideoAvailabilityChangedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdStartedEvent += RewardedVideoAdStartedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdRewardedEvent += RewardedVideoAdRewardedEvent;
|
||||
IronSourceEvents.onRewardedVideoAdShowFailedEvent += RewardedVideoAdShowFailedEvent;
|
||||
}
|
||||
private void RewardedVideoAdOpenedEvent(){
|
||||
_rewardAdOpen = true;
|
||||
}
|
||||
private void RewardedVideoAdClosedEvent(){
|
||||
_rewardAdClose = true;
|
||||
}
|
||||
private void RewardedVideoAvailabilityChangedEvent(bool available){
|
||||
}
|
||||
private void RewardedVideoAdStartedEvent(){
|
||||
}
|
||||
private void RewardedVideoAdRewardedEvent(IronSourcePlacement placement){
|
||||
_rewardAdFinish = true;
|
||||
}
|
||||
private void RewardedVideoAdShowFailedEvent (IronSourceError error){
|
||||
_rewardAdClose = true;
|
||||
}
|
||||
public bool IsLoadedRewardVideo(){
|
||||
#if UNITY_EDITOR
|
||||
return !UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, "DebugAlwaysVideoFailToLoad", false);
|
||||
#else
|
||||
return IronSource.Agent.isRewardedVideoAvailable();
|
||||
#endif
|
||||
}
|
||||
public void ShowRewardVideo(Action<bool> callback, string ad_placement = "none"){
|
||||
#if UNITY_EDITOR
|
||||
callback(true);
|
||||
#else
|
||||
_rewardAdCallback = callback;
|
||||
if(_rewardAdCallback == null){
|
||||
return;
|
||||
}else if(IsLoadedRewardVideo()){
|
||||
_rewardAdOpen = false;
|
||||
_rewardAdFinish = false;
|
||||
_rewardAdClose = false;
|
||||
_async_frame_count = 0;
|
||||
IronSource.Agent.showRewardedVideo();
|
||||
#if !DEVELOPMENT_BUILD && !UNITY_EDITOR
|
||||
GameAnalytics.NewAdEvent(GAAdAction.FailedShow, GAAdType.RewardedVideo, "ironsource", ad_placement);
|
||||
#endif
|
||||
}else{
|
||||
_rewardAdCallback(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
private void RewardAdCallbackClose(bool success){
|
||||
resumeGame();
|
||||
_rewardAdCallback(success);
|
||||
|
||||
// 広告カウント不具合確認用
|
||||
if (_rewardAdClose && !_rewardAdFinish)
|
||||
{
|
||||
Debug.Log($"_async_frame_count:{_async_frame_count}");
|
||||
throw new Exception("RewardAd closed but not finish.");
|
||||
}
|
||||
}
|
||||
|
||||
private void pauseGame(){
|
||||
SoundManager.Instance.PauseBGM();
|
||||
SoundManager.Instance.StopSE();
|
||||
_cacheSeEnabled = SoundManager.Instance.IsEnabled(SoundType.SE);
|
||||
SoundManager.Instance.SaveEnabledSE(false);
|
||||
_marketPause = Market.Instance.IsPause.Value;
|
||||
Market.Instance.IsPause.Value = true;
|
||||
if(Time.timeScale > 0.0f){
|
||||
_timeScale = Time.timeScale;
|
||||
// TimeManager.Instance.Stop();
|
||||
}
|
||||
}
|
||||
private void resumeGame(){
|
||||
SoundManager.Instance.ReplayBGM();
|
||||
SoundManager.Instance.SaveEnabledSE(_cacheSeEnabled);
|
||||
// キャッシュしていた元の状態に戻す
|
||||
if (Market.Instance.IsPause.Value)
|
||||
{
|
||||
Market.Instance.IsPause.Value = _marketPause;
|
||||
}
|
||||
if(_timeScale > 0.0f){
|
||||
Time.timeScale = _timeScale;
|
||||
// TimeManager.Instance.ChangeTimeScale(_timeScale);
|
||||
_timeScale = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e2021f1b8ce47f79191ab8732fba298
|
||||
timeCreated: 1634545756
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using GameAnalyticsSDK;
|
||||
|
||||
|
||||
public class AnalyticsInit : MonoBehaviour , IGameAnalyticsATTListener{
|
||||
|
||||
private bool _attDone = false;
|
||||
|
||||
public static readonly string TENJIN_API_KEY = "VCRGBQMHMGYPM2B5ITDHLSVIFTS8JQSW";
|
||||
|
||||
private void Awake() {
|
||||
|
||||
}
|
||||
|
||||
void Start () {
|
||||
if(Application.platform == RuntimePlatform.IPhonePlayer){
|
||||
GameAnalytics.RequestTrackingAuthorization(this);
|
||||
}else{
|
||||
InitAnalytics();
|
||||
}
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if(_attDone){
|
||||
_attDone = false;
|
||||
InitAnalytics();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OnApplicationPause (bool pauseStatus){
|
||||
if(pauseStatus){
|
||||
//do nothing
|
||||
}else{
|
||||
TenjinConnect();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitAnalytics(){
|
||||
GameAnalytics.Initialize();
|
||||
TenjinConnect();
|
||||
}
|
||||
|
||||
private void TenjinConnect(){
|
||||
#if !UNITY_EDITOR
|
||||
BaseTenjin instance = Tenjin.getInstance(TENJIN_API_KEY);
|
||||
instance.Connect();
|
||||
#endif
|
||||
}
|
||||
|
||||
//-- GameAnalytics --//
|
||||
public void GameAnalyticsATTListenerNotDetermined(){
|
||||
_attDone = true;
|
||||
}
|
||||
public void GameAnalyticsATTListenerRestricted(){
|
||||
_attDone = true;
|
||||
}
|
||||
public void GameAnalyticsATTListenerDenied(){
|
||||
_attDone = true;
|
||||
}
|
||||
public void GameAnalyticsATTListenerAuthorized(){
|
||||
_attDone = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 92f829d05e001457d8dc5a62a7162e6e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -55,33 +55,34 @@ namespace MyGame.Scripts
|
|||
movieObject.SetActive(true);
|
||||
coinObject.SetActive(true);
|
||||
messageText.text = ScriptLocalization.System.CoinMainMessage;
|
||||
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_COIN);
|
||||
SetButtonAction(closeButton, okButton, "");//AdManager.AD_PLACEMENT_COIN);
|
||||
|
||||
break;
|
||||
case RewardType.CornField:
|
||||
normalWindow.SetActive(true);
|
||||
movieObject.SetActive(true);
|
||||
fertilizerObject.SetActive(true);
|
||||
messageText.text = ScriptLocalization.System.CornFieldMessage;
|
||||
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_CORNFIELD);
|
||||
SetButtonAction(closeButton, okButton, ""); //AdManager.AD_PLACEMENT_CORNFIELD);
|
||||
break;
|
||||
case RewardType.IncreaseCustomer:
|
||||
normalWindow.SetActive(true);
|
||||
movieObject.SetActive(true);
|
||||
publicityObject.SetActive(true);
|
||||
messageText.text = ScriptLocalization.System.IncreaseCustomerMessage;
|
||||
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_CUSTOMER);
|
||||
SetButtonAction(closeButton, okButton, "");// AdManager.AD_PLACEMENT_CUSTOMER);
|
||||
break;
|
||||
case RewardType.PerfectPopcorn:
|
||||
normalWindow.SetActive(true);
|
||||
movieObject.SetActive(true);
|
||||
messageText.text = ScriptLocalization.System.PerfectPopcornMessage;
|
||||
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_PERFECT);
|
||||
SetButtonAction(closeButton, okButton, ""); //AdManager.AD_PLACEMENT_PERFECT);
|
||||
break;
|
||||
case RewardType.VipCustomer:
|
||||
normalWindow.SetActive(true);
|
||||
vipObject.SetActive(true);
|
||||
messageText.text = ScriptLocalization.System.VipCustomerMessage;
|
||||
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_VIP);
|
||||
SetButtonAction(closeButton, okButton, "");// AdManager.AD_PLACEMENT_VIP);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
|
@ -103,24 +104,24 @@ namespace MyGame.Scripts
|
|||
}).AddTo(this);
|
||||
okButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
||||
{
|
||||
if (AdManager.Instance.IsLoadedRewardVideo())
|
||||
{
|
||||
AdManager.Instance.ShowRewardVideo(result =>
|
||||
{
|
||||
if (result)
|
||||
{
|
||||
//if (AdManager.Instance.IsLoadedRewardVideo())
|
||||
//{
|
||||
// AdManager.Instance.ShowRewardVideo(result =>
|
||||
// {
|
||||
// if (result)
|
||||
// {
|
||||
GameDataManager.GameData.AddAdCount();
|
||||
LocalCacheManager.Load<Action>(OkCallbackTag, null)?.Invoke();
|
||||
LocalCacheManager.Remove(OkCallbackTag);
|
||||
}
|
||||
// }
|
||||
TransitionManager.Instance.UnloadScene(GameScenes.WatchMovieCoin);
|
||||
}, Placement);
|
||||
}
|
||||
else
|
||||
{
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.WatchMovieFailure);
|
||||
TransitionManager.Instance.UnloadScene(GameScenes.WatchMovieCoin);
|
||||
}
|
||||
// }, Placement);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// TransitionManager.Instance.LoadSceneAdditive(GameScenes.WatchMovieFailure);
|
||||
// TransitionManager.Instance.UnloadScene(GameScenes.WatchMovieCoin);
|
||||
// }
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0f4b98f5ed5946ee89907801938d429
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 44390b9de3c544f6b8c50e0abb26dd4a
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 290de8cd802b84212b25d541b2c9470c
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 11905b161e1a343de80f3fce285220c2
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a48d1a03d42a848439bad0f370ed4d66
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c8add85b994584dd6b2c3c93669d44c5
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1186ea1b3987e49ac96d90ceaf37db3d
|
||||
labels:
|
||||
- gpsr
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue