/// <summary> /// クリック処理 /// </summary> public void onClick() { // オブジェクトを探す GameObject scene = GameObject.Find("FadePanel"); // nullチェック if (scene == null) { // 関数を抜ける return; } // コンポーネントを取得 SceneChanger sceneChanger = scene.GetComponent <SceneChanger>(); // nullチェック if (sceneChanger == null) { // 関数を抜ける return; } // フェード中ならば if (sceneChanger.IsFading == true) { // 関数を抜ける return; } // コルーチンを作動 sceneChanger.ExecuteCoroutine("stage1"); }
public void OnButton() { sceneChanger.ExecuteCoroutine("Title"); Stage.SetStageNum(1); CharacterManager.SetBattery(1.0f); Stage.SetStageNum(1); }
void Update() { _hp = CharacterManager.GetBattery(); // _hp = chara.Charge; ActiveBar(); // HP if (Input.GetKeyDown(KeyCode.Space)) { _hp -= 0.3f; } if (_hp < 0.05) { if (color1 != frame.GetComponent <Image>().color) { frame.color = color1; } else { frame.color = color2; } } if (_hp < 0) { Debug.Log("hp0"); // 最大を超えたら1に戻す CharacterManager.SetBattery(1.0f); nowRate = 1; Stage.SetStageNum(1); sceneChanger.ExecuteCoroutine("Result"); } // HPゲージに値を設定 Bar.fillAmount = _hp; }
/// <summary> /// ステージの遷移 /// </summary> public static void ChangeStage() { // オブジェクトを探す GameObject scene = GameObject.Find("FadePanel"); // nullチェック if (scene == null) { // 関数を抜ける return; } // コンポーネントを取得 SceneChanger sceneChanger = scene.GetComponent <SceneChanger>(); // nullチェック if (sceneChanger == null) { // 関数を抜ける return; } // フェード中ならば if (sceneChanger.IsFading == true) { // 関数を抜ける return; } // ステージの数値を加算 stageNum += 1; if (stageNum < 21) { // コルーチンを作動 sceneChanger.ExecuteCoroutine(Utility.GetStageName(stageNum)); } else { // コルーチンを作動 sceneChanger.ExecuteCoroutine("Title"); stageNum = 1; } }
// Use this for initialization void Start() { // オブジェクトを探す GameObject scene = GameObject.Find("FadePanel"); // nullチェック if (scene == null) { // 関数を抜ける return; } // コンポーネントを取得 SceneChanger sceneChanger = scene.GetComponent <SceneChanger>(); // nullチェック if (sceneChanger == null) { // 関数を抜ける return; } // コルーチンを作動 sceneChanger.ExecuteCoroutine("Title"); }