v0.3.24 - Bug fixes

This commit is contained in:
Matic Ivešić 2025-03-01 15:54:24 +01:00
parent e56d95dee7
commit 2b7b5cbd6a
7 changed files with 40 additions and 171 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" ?>
<dependencies> <dependencies>
<!-- Internal library dependency generated at build time. <!-- Internal library dependency generated at build time.
It also defines the transitive dependencies on play-services It also defines the transitive dependencies on play-services
--> -->
<androidPackages> <androidPackages>
@ -10,4 +10,4 @@
</repositories> </repositories>
</androidPackage> </androidPackage>
</androidPackages> </androidPackages>
</dependencies> </dependencies>

View File

@ -13,9 +13,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// </copyright> // </copyright>
#if UNITY_ANDROID
namespace GooglePlayGames { #if UNITY_ANDROID
namespace GooglePlayGames
{
/// ///
/// This file is automatically generated DO NOT EDIT! /// This file is automatically generated DO NOT EDIT!
/// ///
@ -29,33 +30,32 @@ namespace GooglePlayGames {
/// by checking whether it still retains its initial value - we prevent the constants from being /// 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 "__". /// replaced in the aforementioned search/replace by stripping off the leading and trailing "__".
/// </summary> /// </summary>
public static class GameInfo { public static class GameInfo
{
private const string UnescapedApplicationId = "APP_ID"; private const string UnescapedApplicationId = "APP_ID";
private const string UnescapedIosClientId = "IOS_CLIENTID";
private const string UnescapedWebClientId = "WEB_CLIENTID"; private const string UnescapedWebClientId = "WEB_CLIENTID";
private const string UnescapedNearbyServiceId = "NEARBY_SERVICE_ID"; private const string UnescapedNearbyServiceId = "NEARBY_SERVICE_ID";
public const string ApplicationId = "542756239918"; // Filled in automatically public const string ApplicationId = "__APP_ID__"; // Filled in automatically
public const string IosClientId = "__IOS_CLIENTID__"; // Filled in automatically public const string WebClientId = "__WEB_CLIENTID__"; // Filled in automatically
public const string WebClientId = ""; // Filled in automatically public const string NearbyConnectionServiceId = "__NEARBY_SERVICE_ID__";
public const string NearbyConnectionServiceId = "com.MoxiFoxi.PlaneRun";
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() { public static bool WebClientIdInitialized()
return !string.IsNullOrEmpty(IosClientId) && !IosClientId.Equals(ToEscapedToken(UnescapedIosClientId)); {
}
public static bool WebClientIdInitialized() {
return !string.IsNullOrEmpty(WebClientId) && !WebClientId.Equals(ToEscapedToken(UnescapedWebClientId)); return !string.IsNullOrEmpty(WebClientId) && !WebClientId.Equals(ToEscapedToken(UnescapedWebClientId));
} }
public static bool NearbyConnectionsInitialized() { public static bool NearbyConnectionsInitialized()
{
return !string.IsNullOrEmpty(NearbyConnectionServiceId) && return !string.IsNullOrEmpty(NearbyConnectionServiceId) &&
!NearbyConnectionServiceId.Equals(ToEscapedToken(UnescapedNearbyServiceId)); !NearbyConnectionServiceId.Equals(ToEscapedToken(UnescapedNearbyServiceId));
} }
/// <summary> /// <summary>
@ -63,9 +63,10 @@ namespace GooglePlayGames {
/// </summary> /// </summary>
/// <returns>The escaped token.</returns> /// <returns>The escaped token.</returns>
/// <param name="token">The Token</param> /// <param name="token">The Token</param>
private static string ToEscapedToken(string token) { private static string ToEscapedToken(string token)
{
return string.Format("__{0}__", token); return string.Format("__{0}__", token);
} }
} }
} }
#endif #endif //UNITY_ANDROID

View File

@ -99,6 +99,7 @@ public class PickupManager : MonoBehaviour
public void ActivateMissle() public void ActivateMissle()
{ {
misslePickup.EnableMissle(); misslePickup.EnableMissle();
} }
public void ShootMissle(Transform target) public void ShootMissle(Transform target)
@ -344,5 +345,6 @@ public class MisslePickup
{ {
missleButton.SetActive(false); missleButton.SetActive(false);
pickupManager.EnableMissle(); pickupManager.EnableMissle();
pickupManager.currentPickup = 0;
} }
} }

View File

@ -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
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: dce2ad60d23539e44a8422890ae506cc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -171,9 +171,9 @@ PlayerSettings:
iPhone: 0 iPhone: 0
tvOS: 0 tvOS: 0
overrideDefaultApplicationIdentifier: 0 overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 8 AndroidBundleVersionCode: 28
AndroidMinSdkVersion: 30 AndroidMinSdkVersion: 30
AndroidTargetSdkVersion: 33 AndroidTargetSdkVersion: 34
AndroidPreferredInstallLocation: 1 AndroidPreferredInstallLocation: 1
aotOptions: aotOptions:
stripEngineCode: 1 stripEngineCode: 1

View File

@ -0,0 +1,12 @@
# Plane Run
## v0.1 - 0.3.23
A lot...
## v0.3.24
### Bug fixes
- All missles now should detect flares
- After activating missle pickup you can pickup other pickups