FiE-Game/Assets/Scripts/Fie/Manager/FieCurrentGameManager.cs

34 lines
867 B
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
using Fie.User;
namespace Fie.Manager
{
[FieManagerExists(FieManagerExistSceneFlag.INGAME)]
public class FieCurrentGameManager : FieManagerBehaviour<FieCurrentGameManager>
{
private bool _isBooted;
public bool isBooted => _isBooted;
protected override void StartUpEntity()
{
InitializeCurrentGameInfo();
_isBooted = true;
}
public void InitializeCurrentGameInfo()
{
FieManagerBehaviour<FieSaveManager>.I.ResetCurrentGameData();
FieUser[] allUserData = FieManagerBehaviour<FieUserManager>.I.getAllUserData();
foreach (FieUser fieUser in allUserData)
{
if (fieUser != null && !(fieUser.usersCharacter == null))
{
fieUser.usersCharacter.score = 0;
int totalExp = fieUser.usersCharacter.totalExp;
FieManagerBehaviour<FieSaveManager>.I.SnapshotCurrentExp(fieUser.usersCharacter, totalExp);
}
}
}
}
}