v0.3.24 - Bug fixes
This commit is contained in:
parent
e56d95dee7
commit
2b7b5cbd6a
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dependencies>
|
||||
<!-- Internal library dependency generated at build time.
|
||||
<!-- Internal library dependency generated at build time.
|
||||
It also defines the transitive dependencies on play-services
|
||||
-->
|
||||
<androidPackages>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// </copyright>
|
||||
#if UNITY_ANDROID
|
||||
|
||||
namespace GooglePlayGames {
|
||||
#if UNITY_ANDROID
|
||||
namespace GooglePlayGames
|
||||
{
|
||||
///
|
||||
/// This file is automatically generated DO NOT EDIT!
|
||||
///
|
||||
|
|
@ -29,31 +30,30 @@ namespace GooglePlayGames {
|
|||
/// by checking whether it still retains its initial value - we prevent the constants from being
|
||||
/// replaced in the aforementioned search/replace by stripping off the leading and trailing "__".
|
||||
/// </summary>
|
||||
public static class GameInfo {
|
||||
|
||||
public static class GameInfo
|
||||
{
|
||||
private const string UnescapedApplicationId = "APP_ID";
|
||||
private const string UnescapedIosClientId = "IOS_CLIENTID";
|
||||
private const string UnescapedWebClientId = "WEB_CLIENTID";
|
||||
private const string UnescapedNearbyServiceId = "NEARBY_SERVICE_ID";
|
||||
|
||||
public const string ApplicationId = "542756239918"; // Filled in automatically
|
||||
public const string IosClientId = "__IOS_CLIENTID__"; // Filled in automatically
|
||||
public const string WebClientId = ""; // Filled in automatically
|
||||
public const string NearbyConnectionServiceId = "com.MoxiFoxi.PlaneRun";
|
||||
public const string ApplicationId = "__APP_ID__"; // Filled in automatically
|
||||
public const string WebClientId = "__WEB_CLIENTID__"; // Filled in automatically
|
||||
public const string NearbyConnectionServiceId = "__NEARBY_SERVICE_ID__";
|
||||
|
||||
public static bool ApplicationIdInitialized() {
|
||||
return !string.IsNullOrEmpty(ApplicationId) && !ApplicationId.Equals(ToEscapedToken(UnescapedApplicationId));
|
||||
|
||||
public static bool ApplicationIdInitialized()
|
||||
{
|
||||
return !string.IsNullOrEmpty(ApplicationId) &&
|
||||
!ApplicationId.Equals(ToEscapedToken(UnescapedApplicationId));
|
||||
}
|
||||
|
||||
public static bool IosClientIdInitialized() {
|
||||
return !string.IsNullOrEmpty(IosClientId) && !IosClientId.Equals(ToEscapedToken(UnescapedIosClientId));
|
||||
}
|
||||
|
||||
public static bool WebClientIdInitialized() {
|
||||
public static bool WebClientIdInitialized()
|
||||
{
|
||||
return !string.IsNullOrEmpty(WebClientId) && !WebClientId.Equals(ToEscapedToken(UnescapedWebClientId));
|
||||
}
|
||||
|
||||
public static bool NearbyConnectionsInitialized() {
|
||||
public static bool NearbyConnectionsInitialized()
|
||||
{
|
||||
return !string.IsNullOrEmpty(NearbyConnectionServiceId) &&
|
||||
!NearbyConnectionServiceId.Equals(ToEscapedToken(UnescapedNearbyServiceId));
|
||||
}
|
||||
|
|
@ -63,9 +63,10 @@ namespace GooglePlayGames {
|
|||
/// </summary>
|
||||
/// <returns>The escaped token.</returns>
|
||||
/// <param name="token">The Token</param>
|
||||
private static string ToEscapedToken(string token) {
|
||||
private static string ToEscapedToken(string token)
|
||||
{
|
||||
return string.Format("__{0}__", token);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif //UNITY_ANDROID
|
||||
|
|
@ -99,6 +99,7 @@ public class PickupManager : MonoBehaviour
|
|||
public void ActivateMissle()
|
||||
{
|
||||
misslePickup.EnableMissle();
|
||||
|
||||
}
|
||||
|
||||
public void ShootMissle(Transform target)
|
||||
|
|
@ -344,5 +345,6 @@ public class MisslePickup
|
|||
{
|
||||
missleButton.SetActive(false);
|
||||
pickupManager.EnableMissle();
|
||||
pickupManager.currentPickup = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
using UnityEngine;
|
||||
using GooglePlayGames;
|
||||
using GooglePlayGames.BasicApi;
|
||||
using GooglePlayGames.BasicApi.SavedGame;
|
||||
using System;
|
||||
using TMPro;
|
||||
|
||||
|
||||
public class PlayGamesManager_old : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
TMP_Text nicknameText;
|
||||
|
||||
private score score;
|
||||
|
||||
[SerializeField]
|
||||
private shopManager shopManager;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
this.score = GetComponent<score>();
|
||||
|
||||
SignIn();
|
||||
|
||||
}
|
||||
|
||||
public void SignIn()
|
||||
{
|
||||
PlayGamesPlatform.Activate();
|
||||
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
|
||||
|
||||
OpenSave(false);
|
||||
}
|
||||
|
||||
internal void ProcessAuthentication(SignInStatus status)
|
||||
{
|
||||
if (status == SignInStatus.Success)
|
||||
{
|
||||
// Continue with Play Games Services
|
||||
|
||||
string name = PlayGamesPlatform.Instance.GetUserDisplayName();
|
||||
|
||||
nicknameText.text = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable your integration with Play Games Services or show a login button
|
||||
// to ask users to sign-in. Clicking it should call
|
||||
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
|
||||
}
|
||||
}
|
||||
|
||||
#region SavedGames
|
||||
|
||||
private bool isSaving;
|
||||
|
||||
public void OpenSave(bool saving)
|
||||
{
|
||||
if(Social.localUser.authenticated)
|
||||
{
|
||||
isSaving = saving;
|
||||
((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution("Save", DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, SavedGameOpen);
|
||||
}
|
||||
}
|
||||
|
||||
private void SavedGameOpen(SavedGameRequestStatus status, ISavedGameMetadata metadata)
|
||||
{
|
||||
if(status == SavedGameRequestStatus.Success)
|
||||
{
|
||||
if(isSaving) // Saving
|
||||
{
|
||||
byte[] myData = System.Text.ASCIIEncoding.ASCII.GetBytes(GetSaveString());
|
||||
|
||||
SavedGameMetadataUpdate updateForMetadata = new SavedGameMetadataUpdate.Builder().WithUpdatedDescription("I have played my game at: " + DateTime.Now.ToString()).Build();
|
||||
|
||||
((PlayGamesPlatform)Social.Active).SavedGame.CommitUpdate(metadata, updateForMetadata, myData, SaveCallback);
|
||||
}
|
||||
else // Loading
|
||||
{
|
||||
((PlayGamesPlatform)Social.Active).SavedGame.ReadBinaryData(metadata, LoadCallBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadCallBack(SavedGameRequestStatus status, byte[] data)
|
||||
{
|
||||
if(status == SavedGameRequestStatus.Success)
|
||||
{
|
||||
string loadedData = System.Text.ASCIIEncoding.ASCII.GetString(data);
|
||||
|
||||
LoadSavedString(loadedData);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadSavedString(string loadedData)
|
||||
{
|
||||
string[] cloudStringArr = loadedData.Split('|');
|
||||
|
||||
int highscore = int.Parse(cloudStringArr[0]);
|
||||
|
||||
int coins = int.Parse(cloudStringArr[1]);
|
||||
|
||||
string ownedPlanes = cloudStringArr[2];
|
||||
|
||||
score.SetHighscore(highscore);
|
||||
|
||||
shopManager.coins = coins;
|
||||
|
||||
shopManager.ConvertOwnedPlanes(ownedPlanes);
|
||||
}
|
||||
|
||||
private string GetSaveString()
|
||||
{
|
||||
string dataToSave = "";
|
||||
|
||||
dataToSave += ((int)score.highscoreAmount).ToString() + "|" + shopManager.coins.ToString() + "|" + shopManager.GetOwnedPlanesString();
|
||||
|
||||
return dataToSave;
|
||||
}
|
||||
|
||||
private void SaveCallback(SavedGameRequestStatus status, ISavedGameMetadata metadata)
|
||||
{
|
||||
if(status == SavedGameRequestStatus.Success)
|
||||
{
|
||||
Debug.Log("Successfully saved to the cloud");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Failed to save to cloud");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dce2ad60d23539e44a8422890ae506cc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -171,9 +171,9 @@ PlayerSettings:
|
|||
iPhone: 0
|
||||
tvOS: 0
|
||||
overrideDefaultApplicationIdentifier: 0
|
||||
AndroidBundleVersionCode: 8
|
||||
AndroidBundleVersionCode: 28
|
||||
AndroidMinSdkVersion: 30
|
||||
AndroidTargetSdkVersion: 33
|
||||
AndroidTargetSdkVersion: 34
|
||||
AndroidPreferredInstallLocation: 1
|
||||
aotOptions:
|
||||
stripEngineCode: 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue