예제 #1
0
    void DoCloudSave()
    {
        string word = GenString();

        SetStandBy("Saving string to cloud: " + word);
        PlayGamesPlatform p = (PlayGamesPlatform)Social.Active;

        p.UpdateState(0, System.Text.ASCIIEncoding.Default.GetBytes(word), this);
        EndStandBy();
        mStatus = "Saved string to cloud: " + word;
        ShowEffect(true);
    }
예제 #2
0
        public void UpdateStateSucceedsWhenLoggedIn()
        {
            var mockClient = new CloudSaveClient();
            var platform   = new PlayGamesPlatform(mockClient);
            var listener   = new CapturingStateListener();
            var data       = new byte[] { 0, 1 };

            platform.UpdateState(2, data, listener);

            Assert.AreEqual(2, mockClient.Slot);
            Assert.AreEqual(data, mockClient.Data);
            Assert.AreSame(listener, mockClient.Listener);
        }
예제 #3
0
        public void UpdateStateFailsWhenNotLoggedIn()
        {
            var mockClient = new CloudSaveClient();
            var platform   = new PlayGamesPlatform(mockClient);
            var listener   = new CapturingStateListener();

            mockClient.Authenticated = false;

            platform.UpdateState(2, new byte[] { 0, 1 }, listener);

            Assert.AreEqual(2, listener.SlotForLastOperation);
            Assert.IsFalse(listener.LastOperationSucceeded.Value);
        }