Esempio n. 1
0
    public void ReadSystemData(Action callback)
    {
        ISharedDataSerializer.OnReadSystemData func = (errNo, metaData) =>
        {
            if (errNo == DataSerializerErrorCode.Success)
            {
                SystemAchievementStatuses = metaData.SystemAchievementStatuses;
                ScreenRotation            = metaData.ScreenRotation;
                if (ScreenRotation == 0)
                {
                    Debug.Log("serializer.ReadSystemData.callback 0.5 ReadSystemData : ScreenRotation == 0. Old save file.");
                    ScreenRotation = 3;
                }
                Debug.Log("serializer.ReadSystemData.callback 1 ReadSystemData : ScreenRotation = " + ScreenRotation);
                LatestSlot = metaData.LatestSlot;
                LatestSave = metaData.LatestSave;
                switch (metaData.SelectedLanguage)
                {
                case 0:
                    CurrentLanguage = "English(US)";
                    break;

                case 1:
                    CurrentLanguage = "English(UK)";
                    break;

                case 2:
                    CurrentLanguage = "English(US)";
                    break;

                case 3:
                    CurrentLanguage = "German";
                    break;

                case 4:
                    CurrentLanguage = "French";
                    break;

                case 5:
                    CurrentLanguage = "Italian";
                    break;

                case 6:
                    CurrentLanguage = "Spanish";
                    break;

                default:
                    CurrentLanguage = GetSystemLanguage();
                    break;
                }
            }
            else
            {
                SystemAchievementStatuses = null;
                ScreenRotation            = 3;
                CurrentLanguage           = GetSystemLanguage();
                Debug.Log("serializer.ReadSystemData.callback 2 ReadSystemData : fail");
            }
            PersistenSingleton <UIManager> .Instance.TitleScene.SetRotateScreen();

            Localization.localizationHasBeenSet = false;
            Localization.language = CurrentLanguage;
            UIManager.Field.InitializeATEText();
            StartCoroutine(PersistenSingleton <FF9TextTool> .Instance.UpdateTextLocalization(callback));
            EventInput.ChangeInputLayout(CurrentLanguage);
        };

        FF9StateSystem.Serializer.ReadSystemData(func);
    }