Ejemplo n.º 1
0
    public static void NextTurn()
    {
        int index = 0;

        // Find which index we are

        for (int i = 0; i < arrayOfUserUids.Length; i++)
        {
            if (arrayOfUserUids[i] == turnUid)
            {
                index = i;
                break;
            }
        }

        // Find new uid
        index++;
        if (index > 1)
        {
            index = 0;
        }

        string newTurnUid = arrayOfUserUids[index];

        Debug.Log("new uid before post: " + newTurnUid);
        ITurn newTurn = new ITurn();

        newTurn.uid = newTurnUid;
        // post new turn
        FirebaseDatabase.PostJSON("turn/uid", newTurnUid, "ServerManager", "ProccedNextTurn", "ErrorNextTurn");
    }
Ejemplo n.º 2
0
 public void PostJSON() => FirebaseDatabase.PostJSON(pathInputField.text, valueInputField.text, gameObject.name,
                                                     "DisplayInfo", "DisplayErrorObject");
Ejemplo n.º 3
0
 public void Ready()
 {
     // get ready
     FirebaseDatabase.PostJSON("rooms/" + roomKey + "/players/" + FirebaseManager.currentUser.uid + "/ready",
                               "true", gameObject.name, "OnReady", "OnError");
 }