Skip to content

Commit

Permalink
refac: update unity example scene, prefab and script
Browse files Browse the repository at this point in the history
  • Loading branch information
uerceg committed Jun 18, 2024
1 parent e727e78 commit cf39b15
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 124 deletions.
65 changes: 34 additions & 31 deletions Assets/Adjust/Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using UnityEngine.UI;
using AdjustSdk;

public class ExampleGUI : MonoBehaviour
public class Example : MonoBehaviour
{
private int numberOfButtons = 8;
private bool isEnabled;
Expand Down Expand Up @@ -50,52 +50,55 @@ void OnGUI()

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);
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);
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 (string.Equals(txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase))
{
Adjust.SwitchToOfflineMode();
txtSetOfflineMode = "Turn Offline Mode OFF";
}
else
{
Adjust.SwitchBackToOnlineMode();
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 (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase))
{
Adjust.Disable();
txtSetEnabled = "Enable SDK";
}
else
{
Adjust.Enable();
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;
Adjust.IsEnabled(enabled =>
{
isEnabled = enabled;
showPopUp = true;
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Adjust/Example/Example.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ MonoBehaviour:
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 196c5c89d4b1e46dfbf423ae77d31a68, type: 3}
m_Script: {fileID: 11500000, guid: 8e666decc46d44e7e98c2edc2493173b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Expand Down
103 changes: 11 additions & 92 deletions Assets/Adjust/Example/Example.unity
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: m_RootOrder
value: 2
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11482148, guid: a3267720e82aa41c1a05ab29824902b4, type: 2}
propertyPath: startManually
Expand All @@ -167,126 +167,45 @@ Prefab:
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
--- !u!1001 &1605594768
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
- target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2}
m_IsPrefabParent: 0

0 comments on commit cf39b15

Please sign in to comment.