-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from dsarfati/1.2.0
Updated iOS and Android SDKs
- Loading branch information
Showing
44 changed files
with
276 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
Assets/Zapic/Editor/Xcode.Custom/Unity.iOS.Extensions.XCode.csproj.meta
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
<dependencies> | ||
<androidPackages> | ||
<androidPackage spec="com.android.support:cardview-v7:27.1.0" /> | ||
<androidPackage spec="com.android.support:support-fragment:27.1.0" /> | ||
<androidPackage spec="com.google.android.gms:play-services-auth:11.8.0"> | ||
<androidSdkPackageIds> | ||
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId> | ||
</androidSdkPackageIds> | ||
</androidPackage> | ||
<androidPackage spec="com.google.android.gms:play-services-games:11.8.0"> | ||
<androidSdkPackageIds> | ||
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId> | ||
</androidSdkPackageIds> | ||
</androidPackage> | ||
<androidPackage spec="com.android.support:support-core-utils:[26.0.0, 27.2.0)" /> | ||
</androidPackages> | ||
</dependencies> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class ZapicExample : MonoBehaviour | ||
{ | ||
void Start() | ||
{ | ||
Zapic.OnLogin = ((player) => | ||
{ | ||
Debug.LogFormat("Player logged in. Id:{0}, Notification:{1}", player.PlayerId, player.NotificationToken); | ||
}); | ||
|
||
Zapic.OnLogout = ((player) => | ||
{ | ||
Debug.LogFormat("Player logged out. Id:{0}, Notification:{1}", player.PlayerId, player.NotificationToken); | ||
}); | ||
|
||
Zapic.Start(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
//Simulate a Zapic event on left click | ||
if (Input.GetMouseButtonDown(0)) | ||
{ | ||
SendEvent(); | ||
} | ||
//Simulate HandleInteraction on right click | ||
else if(Input.GetMouseButtonDown(1)) | ||
{ | ||
HandleInteraction(); | ||
} | ||
//Simulate getting current player on space bar | ||
else if(Input.GetKeyDown(KeyCode.Space)) | ||
{ | ||
GetPlayer(); | ||
} | ||
} | ||
|
||
private void SendEvent() | ||
{ | ||
var eventParams = new Dictionary<string, object>(); | ||
|
||
//Add parameter information to the event | ||
eventParams.Add("Score",22); | ||
eventParams.Add("PARAM2","abc"); | ||
eventParams.Add("PARAM3",true); | ||
eventParams.Add("PARAM4","\"blab"); | ||
eventParams.Add("PAR\"AM5", "\"blab" ); | ||
|
||
//Sumbit the event to the Zapic server | ||
Zapic.SubmitEvent(eventParams); | ||
} | ||
|
||
private void GetPlayer() | ||
{ | ||
//Gets the current player | ||
var player = Zapic.Player(); | ||
|
||
if (player == null) | ||
{ | ||
Debug.Log("Player is null"); | ||
} | ||
else | ||
{ | ||
Debug.LogFormat("Current Player, Id:{0}, NotificationToken:{1}", player.PlayerId, player.NotificationToken); | ||
} | ||
} | ||
|
||
private void HandleInteraction() | ||
{ | ||
var data = new Dictionary<string, object>() | ||
{ { "zapic", "/challenge/00000000-0000-0000-0000-000000000000" } | ||
}; | ||
|
||
Zapic.HandleInteraction(data); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.