LoadData() public method

public LoadData ( ) : void
return void
Beispiel #1
0
    public void LoadButton()
    {
        playerDataType p = (playerDataType)SL.LoadData(typeof(playerDataType));

        playerName.text = "Current Name:" + p.name;
        Debug.Log(p);
    }
Beispiel #2
0
        /// <summary>
        /// Json設定情報を<see cref="_settingModel"/>に読み込みます。その後通知状態を変化させます。
        /// </summary>
        public void Load()
        {
            Debug.WriteLine("Jsonロード(´・ω・`)");
            try
            {
                var data = SaveAndLoad.LoadData(SaveFileName);
                Debug.WriteLine("InputJsonData = " + data);
                _settingModel = JsonConvert.DeserializeObject <SettingModel>(data);
                this.StartUp  = _settingModel.StartUp;
                //this.FontSizeIndex = _intToSize.First(x => string.Equals(x.Value, _settingModel.Font, StringComparison.CurrentCultureIgnoreCase)).Key;
            }
            catch
            {
                Debug.WriteLine("Json作るよー(´・ω・`)");
                var data = JsonConvert.SerializeObject(new SettingModel(false, "Medium"));
                SaveAndLoad.SaveData(SaveFileName, data);
                Load();
            }

            // StartUpの値によって通知を変化
            if (StartUp)
            {
                SettingOn();
            }
            else
            {
                SettingOff();
            }
        }
Beispiel #3
0
 private void Start()
 {
     path = $"{Application.persistentDataPath}\\saveData.json";
     if (File.Exists(path))
     {
         Data data = sal.LoadData(path);
         timeList = data.Time;
         nameList = data.Name;
         NamesChanger();
     }
 }
Beispiel #4
0
    public object LoadDis()
    {
        maxDistance md = new maxDistance();

        md = (maxDistance)SL.LoadData();

        showMaxDistanceE.text = "Easy Max Distance : " + md.easyDis;
        showMaxDistanceH.text = "Hard Max Distance : " + md.hardDis;
        return(md);

        //Debug.Log(md);
    }
Beispiel #5
0
 private void Start()
 {
     path = $"{Application.persistentDataPath}\\saveData.json";
     if (File.Exists(path))
     {
         Data data = sal.LoadData(path);
         amountList = data.Amount;
         number     = 0;
         nameList   = data.Type.ToArray();
         NamesChanger();
     }
 }
Beispiel #6
0
    IEnumerator LoadCoroutine()
    {
        AsyncOperation operation = SceneManager.LoadSceneAsync(sceneName);

        while (!operation.isDone)
        {
            yield return(null);
        }
        theSaveAndLoad = FindObjectOfType <SaveAndLoad>();
        theSaveAndLoad.LoadData();

        Destroy(gameObject);
    }
Beispiel #7
0
    private ScoreData MyTimeRecord()
    {
        string path = $"{Application.persistentDataPath}\\saveData.json";

        Data data = null;

        if (File.Exists(path))
        {
            data = sal.LoadData(path);
        }
        if (!File.Exists(path) || data == null || data.Type == null || data.Amount == null)
        {
            data = new Data();
        }
        if (GameManager.GameClear)
        {
            score = new List <ScoreData>();
            score.Add(new ScoreData());
            score[0].time = GameManager.GetTime;
            score[0].name = "";
            for (int i = 0; i < data.Time.Count; ++i)
            {
                score.Add(new ScoreData());
                score[score.Count - 1].time = data.Time[i];
                score[score.Count - 1].name = data.Name[i];
            }

            score.Sort((a, b) => CompareByID(a.time, b.time));
            ScoreData myScore = score.Find(a => a.name == "");
            if (score.Count < saveListAmount && score[score.Count - 1] == myScore)
            {
                return(null);
            }
            return(myScore);
        }
        return(null);
    }
Beispiel #8
0
    private void IsDataLoad(string _startMode)
    {
        switch (_startMode)
        {
        case "NEWSTART":
            Debug.Log("게임 시작 성공");
            Invoke(nameof(SetActiveFalseGameLoadText), 3f);
            break;

        case "LOAD":
            //'GameScene' 내에 존재하는 SaveAndLoad 찾기
            theSaveAndLoad = FindObjectOfType <SaveAndLoad>();
            theSaveAndLoad.LoadData();
            Debug.Log("데이터 로드 성공");
            theGameLoadSuccessText.text = "데이터 로드를 성공하였습니다.\n 행운을 빕니다.";
            Invoke(nameof(SetActiveFalseGameLoadText), 3f);
            break;
        }
    }
Beispiel #9
0
    void Awake()
    {
        adCont         = GetComponent <AdController>();
        shopCont       = FindObjectOfType <ShopController>();
        adCounter      = 0;
        adLimit        = Random.Range(2, 4);
        challengeCont  = FindObjectOfType <ChallengeController>();
        abilityCont    = GetComponent <AbilityController>();
        audioCont      = FindObjectOfType <AudioController>();
        cameraCont     = FindObjectOfType <CameraController>();
        backGroundCont = FindObjectOfType <BackGroundController>();
        UICont         = FindObjectOfType <UIController>();
        spawnCont      = FindObjectOfType <SpawnController>();

        startTime                     = 0;
        currentEnemiesKilled          = new int[11];
        currentEnemiesKilledByEnemies = new int[11];
        currentDamageTaken            = new float[11];
        SetInitialValues();
        data   = new SerializableData();
        data   = SaveAndLoad.LoadData(isSerialized);
        maxExp = shopCont.GetMaxExp();
    }
Beispiel #10
0
 public void ClickLoad() // 로딩
 {
     Debug.Log("로드");
     theSaveAndLoad.LoadData();
 }
Beispiel #11
0
 public void ClickLoad()
 {
     theSaveAndLoad.LoadData();
     CloseMenu();
     Debug.Log("게임 내에서 로드");
 }
Beispiel #12
0
 public void ClickLoad()
 {
     Debug.Log("Load");
     theSaveAndLoad.LoadData();
     isHomeButton = true;
 }