public void Change_Chara(bool b) { if (main.Flg(1) || b) { Party tmp = Chara[0]; for (int i = 0; i < Life_point; i++) { Chara[i] = Chara[i + 1]; } Chara[Life_point] = tmp; Chara[Life_point].Index = 3; Player.SetInteger("Chara_Int", Top_ID()); Skill_text.text = Chara[0].skill_Description; skill_time = 20; skill_Icon.GetComponent <RectTransform>().sizeDelta = new Vector2(0.055f * height, 0.055f * height); skill_Icon.GetComponent <Animator>().SetInteger("Chara_Int", Top_ID()); Skill_Flame.GetComponent <Image>().color = Color.clear; if (Chara[0].skills[6] > 30) { main.Set_Speed(55f); } else { main.Set_Speed(90f); } } }
public bool Damage() { Chara[0].Anime().SetBool("Out_Bool", true); Life_point--; skill_time = 20; if (Chara[1].skills[6] > 30) { main.Set_Speed(55); } else { main.Set_Speed(90f); } skill_Icon.GetComponent <Animator>().SetInteger("Chara_Int", Top_ID()); Skill_Flame.GetComponent <Image>().color = Color.clear; if (Life_point < 0)//GameOver { Skill_text.text = ""; return(true); } else { Party tmp = Chara[0]; Chara[0] = Chara[1]; Chara[1] = Chara[2]; Chara[2] = tmp; Skill_text.text = Chara[0].skill_Description; skill_Icon.GetComponent <RectTransform>().sizeDelta = new Vector2(0.055f * height, 0.055f * height); skill_Icon.GetComponent <Animator>().SetInteger("Chara_Int", Top_ID()); return(false); } }
public void Skill_On() //スキルボタンを押したとき { if (Road_count >= Chara[0].Max_gage) //●押しちゃいけないとき { skill_time = -2; //秒 Road_count = 0; //Chara[0].walk_count = 0; gage.color = new Color(0, 1, 1, 1); //main.Pause_button_down(true); pause_bool = false; bg_bool = false; timer_bool = false; Anime(0, Common.Action.Happy); Anime(1, Common.Action.Stop); Anime(2, Common.Action.Stop); skill_Icon.GetComponent <RectTransform>().sizeDelta = new Vector2(0.055f * height, 0.055f * height); GetComponent <AudioSource>().PlayOneShot(Chara[0].skill_SE); if (Chara[0].skills[6] > 0) { main.Set_Speed(55f); } if (Chara[0].skills[8] > 0) { main.Back(); } /* ここを消しても */ Skill_Flame.GetComponent <Image>().sprite = Chara[0].skill_img; /* Skill_Flame 止められません...。*/ } }
// Update is called once per frame void Update() { #region 背景の動画 if (!pause_bool && bg_bool) { Back_anime.GetComponent <RectTransform>().Translate(new Vector3(-height * 0.001f, 0, 0)); Front_anime.GetComponent <RectTransform>().Translate(new Vector3(-height * 0.001f, 0, 0)); if (Back_anime.GetComponent <RectTransform>().localPosition.x < -0.7f * height) { Back_anime.GetComponent <RectTransform>().position += new Vector3(1.4f * height, 0, 0); Front_anime.GetComponent <RectTransform>().position += new Vector3(1.4f * height, 0, 0); } } #endregion #region キャラクター移動 for (int i = 0; i <= Life_point; i++) { Vector3 vec = Chara[i].Pos; if ((vec - new Vector3(-width * 0.2f * (i - 0.2f), height * 0.277f)).magnitude < 0.01f) { Chara[i].Pos = new Vector3(-width * 0.2f * (i - 0.2f), height * 0.277f); } else { Chara[i].Pos = (39f * vec + new Vector3(-width * 0.2f * (i - 0.2f), height * 0.277f)) / 40f; } } #endregion #region 時間表示 if (!pause_bool && timer_bool) { if (is_Skill(5)) { time += Time.deltaTime / 3f; } time -= Time.deltaTime; int m = Mathf.FloorToInt(time / 60f); int s = Mathf.FloorToInt(time % 60f); Degital_Time.text = (m.ToString().PadLeft(2, '0') + " : " + s.ToString().PadLeft(2, '0')); Needle.localRotation = new Quaternion(0, 0, 1, 1 - needle / Max_Time); Flame.color -= new Color(0, 0, 0, 0.01f); } if (time < 0) //GameOver { time = 0; main.Goal(1); } if (time < needle) { time_gage.GetComponent <RectTransform>().localRotation = new Quaternion(0, 0, 1, 1 - needle / Max_Time); time_gage.GetComponent <Image>().fillAmount = (needle - time) / Max_Time / 4f; if (!pause_bool && timer_bool) { if (time_delta < 0) { time_delta += Time.deltaTime; } else { needle -= 0.7f; } } } else { time_gage.GetComponent <RectTransform>().localRotation = new Quaternion(0, 0, 1, 1 - time / Max_Time); time_gage.GetComponent <Image>().fillAmount = (time - needle) / Max_Time / 4f; if (!pause_bool && timer_bool) { if (time_delta < 0) { time_delta += Time.deltaTime; } else { needle += 0.7f; } } } if (needle < 80 && !is_red) { Back_anime.GetComponent <Image>().sprite = Resources.Load <Sprite>("Images/Background/BG_red" + (int)Common.Thema.Sky); Front_anime.GetComponent <Image>().sprite = Resources.Load <Sprite>("Images/Background/Bg_front_red" + (int)Common.Thema.Sky); Background.sprite = Resources.Load <Sprite>("Images/Background/Back_red" + (int)Common.Thema.Sky); is_red = true; main.To_Red(true); } #endregion #region スキル Gage(); if (skill_time < 20 && !pause_bool && timer_bool) { skill_time += Time.deltaTime; } else if (skill_time < 0) { skill_time += Time.deltaTime; if (skill_time < -0.2f) { var pos = _camera.ScreenToWorldPoint(new Vector3(Random.Range(0.12f, 0.88f) * width, Random.Range(0.13f, 0.6f) * height, 10)); skillEffect.transform.position = pos; skillEffect.Emit(1); skill_effect_anim.GetComponent <Animator>().SetInteger("Skill_int", Top_ID()); // スキルエフェクト 追加 max_bool = false; skill_icon_effect.GetComponent <Animator>().SetBool("Icon_effect", false); Debug.Log("Skill ok"); } else { Anime(0, Common.Action.Walk); Anime(1, Common.Action.Walk); Anime(2, Common.Action.Walk); main.Pause_button_down(false); bg_bool = true; timer_bool = true; skill_effect_anim.GetComponent <Animator>().SetInteger("Skill_int", 10); // スキルエフェクト 消去 } } if (skill_time < Chara[0].Max_second) { var pos = _camera.ScreenToWorldPoint(new Vector3(Random.Range(0.12f, (1 - skill_time / Chara[0].Max_second) * 0.66f) * width, 0.04f * height, 10)); skillEffect.transform.position = pos; skillEffect.Emit(1); /*float ran = Random.value; * pos = _camera.ScreenToWorldPoint(new Vector3(0, 0, 10)) + new Vector3(1.4f * Mathf.Cos(ran * 2 * Mathf.PI) + 1.7f, 1.4f * Mathf.Sin(ran * 2 * Mathf.PI) + 2f); * //pos = _camera.ScreenToWorldPoint(new Vector3(0,0,10)) + new Vector3(1.4f*skill_time * Mathf.Cos(skill_time*16) + 1.7f, 1.4f*skill_time * Mathf.Sin(skill_time*16) +2f); * skillEffect.transform.position = pos; * skillEffect.Emit(1);*/ /* ここを消しても */ Skill_Flame.GetComponent <Image>().color = new Color(1, 1, 1, (Chara[0].Max_second - skill_time) * 3f); Skill_Flame.GetComponent <RectTransform>().Translate(new Vector3(0, height / 180f, 0)); if (Skill_Flame.GetComponent <RectTransform>().localPosition.y > height * 1.5f) { Skill_Flame.GetComponent <RectTransform>().localPosition = new Vector3(0, -height * 1.5f, 0); } /* Skill_Flame 止められません...。*/ } else if (skill_time < Chara[0].Max_second + 0.1f) { if (Chara[0].skills[6] < 30) { main.Set_Speed(90f); } } //if (Chara[0].walk_count >= Chara[0].Max_gage) if (Road_count >= Chara[0].Max_gage) { if (!max_bool) { SE_on(Common.SE.Decision); // 追加SE skill_icon_effect.GetComponent <Animator>().SetBool("Icon_effect", true); max_bool = true; } var pos = _camera.ScreenToWorldPoint(new Vector3(Random.Range(0.18f, 0.66f) * width, 0.04f * height, 10)); skillEffect.transform.position = pos; skillEffect.Emit(1); if (skill_time >= 20 && !pause_bool && timer_bool) { skill_time += Time.deltaTime; } if (skill_time > 30) { skill_time -= 10; } skill_Icon.GetComponent <RectTransform>().sizeDelta = new Vector2((0.055f + 0.01f * Mathf.Sin(Mathf.PI * skill_time / 1f)) * height, (0.055f + 0.01f * Mathf.Sin(Mathf.PI * skill_time / 1f)) * height); } #endregion #region ポーズメニュー Vector3 v = Pause_Menu.localPosition; if (pause_bool && v.z < 0) { float x = v.z * 11f; x++; Pause_Menu.localPosition = new Vector3(0, x * (x + 20) * 0.0005f * height, x / 11f); if (Mathf.Abs(v.z) < 0.1f) { Pause_Menu.localPosition = Vector3.zero; } } else if (!pause_bool && v.z > -5) { float x = v.z * 11f; x--; Pause_Menu.localPosition = new Vector3(0, x * (x + 20) * 0.0005f * height, x / 11f); if (Mathf.Abs(v.z + 5) < 0.1f) { Pause_Menu.localPosition = new Vector3(0, height, -5.1f); main.Pause_button_down(false); } } #endregion }