public void Save_vector_3() { save.list_save.Clear(); save.list_rot.Clear(); save.list_anima.Clear(); for (int i = 0; i < list.Count; i++) { save.list_save.Add(list[i].transform.position); Move_vector script = list[i].GetComponent <Move_vector>(); save.list_rot.Add(script.rot); save.list_anima.Add(script.anima); } save.move_s = resp_Text.move_tog.isOn; save.speed_s = resp_Text.speed.value; save.v_1_x = resp_Text.move_circl_tog.isOn; save.video_2_on = resp_Text.video_tog.isOn; save.color_1_s = int.Parse(resp_Text.input_color_1.text); save.color_2_s = int.Parse(resp_Text.input_color_2.text); save.color_3_s = int.Parse(resp_Text.input_color_3.text); save.font_size_s = int.Parse(resp_Text.input_size.text); save.text_limit_s = int.Parse(resp_Text.limit_input.text); save.font_s = resp_Text.font.value; save.video_2 = video_2.transform.position; File.WriteAllText(path_3, JsonUtility.ToJson(save)); Debug.Log("Save"); save_ok.SetActive(true); Invoke("Save_ok_false", 1); }
public void Load_vector_1() { load_ok_1.SetActive(true); load_ok_2.SetActive(false); load_ok_3.SetActive(false); Debug.Log("Load"); if (list.Count != 0) { for (int i = 0; i < list.Count; i++) { Destroy(vector_mass.transform.GetChild(i).gameObject); } list.Clear(); } if (File.Exists(path_1)) { save = JsonUtility.FromJson <Save>(File.ReadAllText(path_1)); for (int i = 0; i < save.list_save.Count; i++) { GameObject newV = Instantiate(v, save.list_save[i], v.transform.rotation) as GameObject; newV.transform.parent = vector_mass.transform; newV.transform.localScale = new Vector3(1, 1, 1); list.Add(newV); Move_vector script = newV.GetComponent <Move_vector>(); script.n = list.Count; script.rot = save.list_rot[i]; script.anima = save.list_anima[i]; move_Vector = script; vector = script.gameObject; Vector_load(); } resp_Text.move_tog.isOn = save.move_s; resp_Text.speed.value = save.speed_s; resp_Text.move_circl_tog.isOn = save.v_1_x; resp_Text.input_size.text = save.font_size_s.ToString(); resp_Text.input_color_1.text = save.color_1_s.ToString(); resp_Text.input_color_2.text = save.color_2_s.ToString(); resp_Text.input_color_3.text = save.color_3_s.ToString(); resp_Text.font.value = save.font_s; resp_Text.video_tog.isOn = save.video_2_on; resp_Text.limit_input.text = save.text_limit_s.ToString(); video_2.transform.position = save.video_2; resp_Text.Ok(); } }
void Start() { vector = GameObject.Find("Canvas").GetComponent <Vector>(); script = gameObject.GetComponent <Move_vector>(); n_t = transform.GetChild(0).GetComponent <Text>(); anima_t = transform.GetChild(1).GetComponent <Text>(); n_t.text = "" + n; vector.vector = gameObject; vector.move_Vector = script; }
void Start() { speed_save = speed; resp = GameObject.Find("Canvas").GetComponent <Resp_text>(); photonView = GetComponent <PhotonView>(); canvas = GameObject.Find("Canvas"); text_t = GetComponent <Text>(); vector = GameObject.Find("Canvas").GetComponent <Vector>(); transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); m_Vector = vector.list[move_vector].GetComponent <Move_vector>(); animator = GetComponent <Animator>(); count_text = resp.text_count; if (resp.move == false) { if (m_Vector.anima == 1) { move = vector.list[move_vector].transform.position; Add(); transform.position = move; } if (m_Vector.anima == 2) { Invoke("Up", 1); move = vector.list[move_vector].transform.position; Add(); transform.position = move; } if (m_Vector.anima == 3) { Invoke("Go_2_1", 10 - add / 7); Invoke("Up", 10 - add / 7); move = vector.list[move_vector].transform.position; Add(); transform.position = move; } if (m_Vector.anima == 4) { speed = 20; move = vector.list[move_vector].transform.position; } if (m_Vector.anima == 5) { move_vector = count_text - 1; move = vector.list[move_vector].transform.position; transform.position = move; } if (m_Vector.anima == 6) { speed = speed * 2; move = vector.list[move_vector].transform.position; transform.position = new Vector2(-10, 0); text_t.enabled = false; if (add == 0) { animator.enabled = false; image.enabled = true; } } } else { if (m_Vector.anima == 1) { move = vector.list[0].transform.position; transform.position = move; } if (m_Vector.anima == 2) { move = vector.list[0].transform.position; transform.position = move; } if (m_Vector.anima == 3) { move_vector = count_text - 1; move = vector.list[move_vector].transform.position; transform.position = vector.list[0].transform.position; } } }