Fixed bugs

Bug 1:
After clearing the data, the game wouldn't save afterwards.

Bug 2:
Animation was too short, which led to some animation errors
This commit is contained in:
MarcUs7i 2024-10-11 08:34:50 +02:00
parent 5844e9118b
commit 31f428881f
6 changed files with 15 additions and 27 deletions

View file

@ -43,7 +43,7 @@ public class SC_2DCoin : MonoBehaviour
void Update()
{
if (totalCoins != PlayerSaving.coins && !PlayerSaving.Deleting)
if (totalCoins != PlayerSaving.coins)
{
PlayerSaving.coins = totalCoins;
PlayerSaving.SavePlayer();

View file

@ -4618,10 +4618,6 @@ PrefabInstance:
propertyPath: m_Name
value: Aleksei
objectReference: {fileID: 0}
- target: {fileID: 6297549000983085029, guid: 7dcd7bf6b73974b41a58ae3191280b93, type: 3}
propertyPath: target
value:
objectReference: {fileID: 820667352}
- target: {fileID: 6297549000983085029, guid: 7dcd7bf6b73974b41a58ae3191280b93, type: 3}
propertyPath: BackgroundMusic
value:

View file

@ -27,7 +27,7 @@ public class Endlevel : MonoBehaviour
void Update()
{
if (level != PlayerSaving.level && !PlayerSaving.Deleting)
if (level != PlayerSaving.level)
{
if (PlayerSaving.level < level)
{

View file

@ -8,7 +8,6 @@ public class PlayerSaving : MonoBehaviour
public static int coins = 0;
public static bool hasCompletedTutorial = false;
public static bool movingClouds = true;
public static bool Deleting = false;
void Awake()
{
@ -37,7 +36,6 @@ public class PlayerSaving : MonoBehaviour
public static void DeletePlayer()
{
Deleting = true;
level = 0;
coins = 0;
hasCompletedTutorial = false;

View file

@ -143,24 +143,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6ae1ab0fdd9e16a439d838ef09c03c06, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 0}
firePoint: {fileID: 7831235675031236576}
SlowSpeed: 300
NormalSpeed: 500
FastSpeed: 700
speed: 500
encourageSpeed: 900
nextWaypointDistance: 3
BackgroundMusic: {fileID: 0}
audioSource: {fileID: 5670231526534885764}
health: 200
deathEffect: {fileID: 1755349173569476, guid: 3c45864be6a059a4a82a25e285298338, type: 3}
range: 10
attackRange: 8
enemyGFX: {fileID: 733867154372970512}
stage2Speed: 900
stage2AnimSec: 3
nextWaypointDistance: 3
BackgroundMusic: {fileID: 0}
health: 200
deathEffect: {fileID: 1755349173569476, guid: 3c45864be6a059a4a82a25e285298338, type: 3}
EnemyWeapon: {fileID: 1539632861300792, guid: 6cc48262badcab34baa3ce3a2cc8203d, type: 3}
animator: {fileID: 733867154372970513}
encourageSec: 2
--- !u!61 &1183544670447260753
BoxCollider2D:
m_ObjectHideFlags: 0
@ -371,7 +365,7 @@ SpriteRenderer:
m_SpriteSortPoint: 0
--- !u!95 &733867154372970513
Animator:
serializedVersion: 4
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -388,7 +382,8 @@ Animator:
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1 &4406158393300619773
GameObject:
m_ObjectHideFlags: 0
@ -477,7 +472,7 @@ SpriteRenderer:
m_SpriteSortPoint: 0
--- !u!95 &1005185907
Animator:
serializedVersion: 4
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -494,7 +489,8 @@ Animator:
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!114 &4016137151956235320
MonoBehaviour:
m_ObjectHideFlags: 0
@ -507,5 +503,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88a2fc0dc3cce174ea887f9123530715, type: 3}
m_Name:
m_EditorClassIdentifier:
aleksei: {fileID: 6297549000983085029}
animator: {fileID: 1005185907}

View file

@ -18,7 +18,7 @@ public class Aleksei : MonoBehaviour
[Header("Stage2")]
public float stage2Speed = 900f;
public float stage2AnimSec = 2.0f;
public float stage2AnimSec = 3.0f;
[Header("Pathfinding")]
public float nextWaypointDistance = 3f;