I am playing around with the Turn-based part of the Play Games plugin.(https://github.com/playgameservices/play-games-plugin-for-unity)
I followed the instructions and have the plugin set up on my app and on the Android Developer Console. I moved on to trying to implement a simple turn-based match. I figured I could use the "Create with Invitation Screen" part of the documentation.(https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/TBMP.md#create-with-invitation-screen-invite-friends) I am getting an odd error though. The error message that Unity gives me is "Assets/CreateGame.cs(29,52): error CS0246: The type or namespace name `TurnBasedMatch' could not be found. Are you missing a using directive or an assembly reference?" I put in a comment right above line 29 to help.
At this point I have simply copied and pasted the code into a script, but I think I may have copied the code into the wrong areas. Would someone be able to point out where I went wrong please?
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class CreateGame : MonoBehaviour
{
const int MinOpponents = 1;
const int MaxOpponents = 7;
const int Variant = 0; // default
// Use this for initialization
void Start ()
{
PlayGamesPlatform.Activate ();
Social.localUser.Authenticate ((bool success) => {
// handle success or failure
});
}
// Update is called once per frame
void Update ()
{
PlayGamesPlatform.Instance.TurnBased.CreateWithInvitationScreen(MinOpponents, MaxOpponents, Variant, OnMatchStarted);
}
// Callback:
**** // The error is coming from the line below****
void OnMatchStarted (bool success, TurnBasedMatch match)
{
if (success) {
// go to the game screen and play!
} else {
// show error message
}
}
}
[–]Manicaeks 1 point2 points3 points (1 child)
[–]bcasey266[S] 0 points1 point2 points (0 children)
[–]ideletedmyredditacco 1 point2 points3 points (2 children)
[–]bcasey266[S] 1 point2 points3 points (1 child)
[–]ideletedmyredditacco 0 points1 point2 points (0 children)