This commit is contained in:
corn
2026-06-07 22:59:32 +08:00
commit a62ff7379b
7171 changed files with 10015624 additions and 0 deletions

View File

@@ -0,0 +1,290 @@
using System;
using System.Text;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.UI;
using com.adjust.sdk;
public class ExampleGUI : MonoBehaviour
{
private int numberOfButtons = 8;
private bool isEnabled;
private bool showPopUp = false;
private string txtSetEnabled = "Disable SDK";
private string txtManualLaunch = "Manual Launch";
private string txtSetOfflineMode = "Turn Offline Mode ON";
void OnGUI()
{
if (showPopUp)
{
GUI.Window(0, new Rect((Screen.width / 2) - 150, (Screen.height / 2) - 65, 300, 130), ShowGUI, "Is SDK enabled?");
}
if (GUI.Button(new Rect(0, Screen.height * 0 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtManualLaunch))
{
if (!string.Equals(txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase))
{
AdjustConfig adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustEnvironment.Sandbox);
adjustConfig.setLogLevel(AdjustLogLevel.Verbose);
adjustConfig.setLogDelegate(msg => Debug.Log(msg));
adjustConfig.setEventSuccessDelegate(EventSuccessCallback);
adjustConfig.setEventFailureDelegate(EventFailureCallback);
adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback);
adjustConfig.setSessionFailureDelegate(SessionFailureCallback);
adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);
adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback);
Adjust.start(adjustConfig);
isEnabled = true;
txtManualLaunch = "SDK Launched";
}
}
if (GUI.Button(new Rect(0, Screen.height * 1 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Simple Event"))
{
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
Adjust.trackEvent(adjustEvent);
}
if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Revenue Event"))
{
AdjustEvent adjustEvent = new AdjustEvent("a4fd35");
adjustEvent.setRevenue(0.25, "EUR");
Adjust.trackEvent(adjustEvent);
}
if (GUI.Button(new Rect(0, Screen.height * 3 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Callback Event"))
{
AdjustEvent adjustEvent = new AdjustEvent("34vgg9");
adjustEvent.addCallbackParameter("key", "value");
adjustEvent.addCallbackParameter("foo", "bar");
Adjust.trackEvent(adjustEvent);
}
if (GUI.Button(new Rect(0, Screen.height * 4 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Partner Event"))
{
AdjustEvent adjustEvent = new AdjustEvent("w788qs");
adjustEvent.addPartnerParameter("key", "value");
adjustEvent.addPartnerParameter("foo", "bar");
Adjust.trackEvent(adjustEvent);
}
if (GUI.Button(new Rect(0, Screen.height * 5 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtSetOfflineMode))
{
if (string.Equals(txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase))
{
Adjust.setOfflineMode(true);
txtSetOfflineMode = "Turn Offline Mode OFF";
}
else
{
Adjust.setOfflineMode(false);
txtSetOfflineMode = "Turn Offline Mode ON";
}
}
if (GUI.Button(new Rect(0, Screen.height * 6 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtSetEnabled))
{
if (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase))
{
Adjust.setEnabled(false);
txtSetEnabled = "Enable SDK";
}
else
{
Adjust.setEnabled(true);
txtSetEnabled = "Disable SDK";
}
}
if (GUI.Button(new Rect(0, Screen.height * 7 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Is SDK Enabled?"))
{
isEnabled = Adjust.isEnabled();
showPopUp = true;
}
}
void ShowGUI(int windowID)
{
if (isEnabled)
{
GUI.Label(new Rect(65, 40, 200, 30), "Adjust SDK is ENABLED!");
}
else
{
GUI.Label(new Rect(65, 40, 200, 30), "Adjust SDK is DISABLED!");
}
if (GUI.Button(new Rect(90, 75, 120, 40), "OK"))
{
showPopUp = false;
}
}
public void HandleGooglePlayId(String adId)
{
Debug.Log("Google Play Ad ID = " + adId);
}
public void AttributionChangedCallback(AdjustAttribution attributionData)
{
Debug.Log("Attribution changed!");
if (attributionData.trackerName != null)
{
Debug.Log("Tracker name: " + attributionData.trackerName);
}
if (attributionData.trackerToken != null)
{
Debug.Log("Tracker token: " + attributionData.trackerToken);
}
if (attributionData.network != null)
{
Debug.Log("Network: " + attributionData.network);
}
if (attributionData.campaign != null)
{
Debug.Log("Campaign: " + attributionData.campaign);
}
if (attributionData.adgroup != null)
{
Debug.Log("Adgroup: " + attributionData.adgroup);
}
if (attributionData.creative != null)
{
Debug.Log("Creative: " + attributionData.creative);
}
if (attributionData.clickLabel != null)
{
Debug.Log("Click label: " + attributionData.clickLabel);
}
if (attributionData.adid != null)
{
Debug.Log("ADID: " + attributionData.adid);
}
}
public void EventSuccessCallback(AdjustEventSuccess eventSuccessData)
{
Debug.Log("Event tracked successfully!");
if (eventSuccessData.Message != null)
{
Debug.Log("Message: " + eventSuccessData.Message);
}
if (eventSuccessData.Timestamp != null)
{
Debug.Log("Timestamp: " + eventSuccessData.Timestamp);
}
if (eventSuccessData.Adid != null)
{
Debug.Log("Adid: " + eventSuccessData.Adid);
}
if (eventSuccessData.EventToken != null)
{
Debug.Log("EventToken: " + eventSuccessData.EventToken);
}
if (eventSuccessData.CallbackId != null)
{
Debug.Log("CallbackId: " + eventSuccessData.CallbackId);
}
if (eventSuccessData.JsonResponse != null)
{
Debug.Log("JsonResponse: " + eventSuccessData.GetJsonResponse());
}
}
public void EventFailureCallback(AdjustEventFailure eventFailureData)
{
Debug.Log("Event tracking failed!");
if (eventFailureData.Message != null)
{
Debug.Log("Message: " + eventFailureData.Message);
}
if (eventFailureData.Timestamp != null)
{
Debug.Log("Timestamp: " + eventFailureData.Timestamp);
}
if (eventFailureData.Adid != null)
{
Debug.Log("Adid: " + eventFailureData.Adid);
}
if (eventFailureData.EventToken != null)
{
Debug.Log("EventToken: " + eventFailureData.EventToken);
}
if (eventFailureData.CallbackId != null)
{
Debug.Log("CallbackId: " + eventFailureData.CallbackId);
}
if (eventFailureData.JsonResponse != null)
{
Debug.Log("JsonResponse: " + eventFailureData.GetJsonResponse());
}
Debug.Log("WillRetry: " + eventFailureData.WillRetry.ToString());
}
public void SessionSuccessCallback(AdjustSessionSuccess sessionSuccessData)
{
Debug.Log("Session tracked successfully!");
if (sessionSuccessData.Message != null)
{
Debug.Log("Message: " + sessionSuccessData.Message);
}
if (sessionSuccessData.Timestamp != null)
{
Debug.Log("Timestamp: " + sessionSuccessData.Timestamp);
}
if (sessionSuccessData.Adid != null)
{
Debug.Log("Adid: " + sessionSuccessData.Adid);
}
if (sessionSuccessData.JsonResponse != null)
{
Debug.Log("JsonResponse: " + sessionSuccessData.GetJsonResponse());
}
}
public void SessionFailureCallback(AdjustSessionFailure sessionFailureData)
{
Debug.Log("Session tracking failed!");
if (sessionFailureData.Message != null)
{
Debug.Log("Message: " + sessionFailureData.Message);
}
if (sessionFailureData.Timestamp != null)
{
Debug.Log("Timestamp: " + sessionFailureData.Timestamp);
}
if (sessionFailureData.Adid != null)
{
Debug.Log("Adid: " + sessionFailureData.Adid);
}
if (sessionFailureData.JsonResponse != null)
{
Debug.Log("JsonResponse: " + sessionFailureData.GetJsonResponse());
}
Debug.Log("WillRetry: " + sessionFailureData.WillRetry.ToString());
}
private void DeferredDeeplinkCallback(string deeplinkURL)
{
Debug.Log("Deferred deeplink reported!");
if (deeplinkURL != null)
{
Debug.Log("Deeplink URL: " + deeplinkURL);
}
else
{
Debug.Log("Deeplink URL is null!");
}
}
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 196c5c89d4b1e46dfbf423ae77d31a68
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 400000}
- component: {fileID: 11400000}
m_Layer: 0
m_Name: ExampleGUI
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
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: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 196c5c89d4b1e46dfbf423ae77d31a68, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1

View File

@@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 50b53da2a7a154d63a33a49ad08c24a8
NativeFormatImporter:
userData:

View File

@@ -0,0 +1,292 @@
%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: 8
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.2, g: 0.2, b: 0.2, a: 1}
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 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}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 1
m_BakeResolution: 50
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 0
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 0
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: 0
--- !u!196 &5
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.16666666
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &7284787
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11482148, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: startManually
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11482148, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: logLevel
value: 3
objectReference: {fileID: 0}
- target: {fileID: 11482148, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: appToken
value: '{YourAppToken}'
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
m_IsPrefabParent: 0
--- !u!1 &231489158
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 231489162}
- component: {fileID: 231489161}
- component: {fileID: 231489160}
- component: {fileID: 231489159}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &231489159
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 231489158}
m_Enabled: 1
--- !u!124 &231489160
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 231489158}
m_Enabled: 1
--- !u!20 &231489161
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 231489158}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
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 &231489162
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 231489158}
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: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1861285553
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
m_IsPrefabParent: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6aa8afcd558084586bce9f8efd3eb5d6
timeCreated: 1447689503
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant: