// Start is called before the first frame update void Start() { DataManager = GameObject.Find("SaveLoadWindow").GetComponent <SaveLoadDataManager>(); Button1 = DataPanel1.GetComponentInChildren <Button>(); Button2 = DataPanel2.GetComponentInChildren <Button>(); Button3 = DataPanel3.GetComponentInChildren <Button>(); Button4 = DataPanel4.GetComponentInChildren <Button>(); Button5 = DataPanel5.GetComponentInChildren <Button>(); Button6 = DataPanel6.GetComponentInChildren <Button>(); Button7 = DataPanel7.GetComponentInChildren <Button>(); Button8 = DataPanel8.GetComponentInChildren <Button>(); Button9 = DataPanel9.GetComponentInChildren <Button>(); Button10 = DataPanel10.GetComponentInChildren <Button>(); Button11 = DataPanel11.GetComponentInChildren <Button>(); Button12 = DataPanel12.GetComponentInChildren <Button>(); Field1 = DataPanel1.GetComponentInChildren <InputField>(); Field2 = DataPanel2.GetComponentInChildren <InputField>(); Field3 = DataPanel3.GetComponentInChildren <InputField>(); Field4 = DataPanel4.GetComponentInChildren <InputField>(); Field5 = DataPanel5.GetComponentInChildren <InputField>(); Field6 = DataPanel6.GetComponentInChildren <InputField>(); Field7 = DataPanel7.GetComponentInChildren <InputField>(); Field8 = DataPanel8.GetComponentInChildren <InputField>(); Field9 = DataPanel9.GetComponentInChildren <InputField>(); Field10 = DataPanel10.GetComponentInChildren <InputField>(); Field11 = DataPanel11.GetComponentInChildren <InputField>(); Field12 = DataPanel12.GetComponentInChildren <InputField>(); }
void Start() { _gc = GameObject.Find("GameController").GetComponent <GameController>(); _sldm = GameObject.Find("SaveLoadWindow").GetComponent <SaveLoadDataManager>(); bank = DataBank.Open(); //Debug.Log($"save path of bank is { bank.SavePath }"); //セーブデータが存在しないならば作成せよのIF文 bank.Load <SaveData>(gameObject.name); saveData = bank.Get <SaveData>(gameObject.name); if (saveData == null) { saveData = new SaveData() { icon_name = "silhouette", chara_name = "del_chara", time = "YYYY/MM/DD\nah:mm", text = "セーブデータがありません", sceneLoadName = "", loadnum = 0, id = "" }; bank.Store(gameObject.name, saveData); bank.SaveAll(); saveData = bank.Get <SaveData>(gameObject.name); //bank.Clear(); } foreach (Transform child in this.transform) { if (child.name == "Image") { _charaIcoImage = child.gameObject.GetComponent <Image>(); } else if (child.name == "Time") { _time = child.gameObject.GetComponent <Text>(); } else if (child.name == "Comment") { foreach (Transform child2 in child.transform) { if (child2.name == "Placeholder") { _comment = child2.gameObject.GetComponent <Text>(); } } } } _charaIcoImage.sprite = Resources.Load <Sprite>("Image/CharaIcons/" + saveData.icon_name); _time.text = saveData.time; _comment.text = saveData.text; }
// Start is called before the first frame update void Start() { CurrentIndex = 1; DataManager = GameObject.Find("SaveLoadWindow").GetComponent <SaveLoadDataManager>(); }