public void Magical() { // //Debug.Log("Magic"); Player_Color magic = Magic.GetComponent <Player_Color>(); magic.Magic_ON(); }
void Update() { /* * * if (Input.GetKeyDown("space") && !Jump) * { * sound02.PlayOneShot(sound02.clip); * rigid2D.AddForce(Vector2.up * flap); * Jump = true; * //taiki->jump * anim.SetBool("Jump", true); * } * //*/ //左キー:-1、右キー:1 float x = Input.GetAxisRaw("Horizontal"); //左か右かを入力したら if (x != 0) { //入力方向へ移動 rigid2D.velocity = new Vector2(x * speed, rigid2D.velocity.y); //localScale.xを-1にすると画像が反転する Vector2 temp = transform.localScale; temp.x = -x; transform.localScale = temp; //taiki->walk anim.SetBool("Dash", true); //左も右も入力されていなかったら } else { //横移動の速度を0にしてピタっととまるようにする rigid2D.velocity = new Vector2(0, rigid2D.velocity.y); //walk->taiki anim.SetBool("Dash", false); } Player_Color player = GetComponent <Player_Color>(); if (player.hit != null) { Debug.Log("Stay"); //色を移す if (Input.GetKeyDown(KeyCode.Space) && !Jump) { Debug.Log("Color"); Stop_Rain(); anim.SetBool("Color", true); } else { anim.SetBool("Color", false); } } }
void OnTriggerStay2D(Collider2D other) { hit = other.gameObject; Color_Brown brown = GetComponent <Color_Brown>(); Player_Color player = hit.GetComponent <Player_Color>(); // //Debug.Log("Enter : " + other.gameObject.name); if (brown.Color_brown == 1 && player.Color_Count_Brown == 0 && player.Color_Count == 0) { Pa.SetActive(true); } else if (brown.Color_brown == 0 && player.Color_Count_Brown == 1 && player.Color_Count == 1) { Pa.SetActive(true); } }
void OnTriggerStay2D(Collider2D other) { hit = other.gameObject; Color_Yellow yellow = GetComponent <Color_Yellow>(); Player_Color player = hit.GetComponent <Player_Color>(); //Debug.Log("Enter : " + other.gameObject.name); if (hit.gameObject.CompareTag("Player")) { if (yellow.Color_yellow == 1 && player.Color_Count_Yellow == 0 && player.Color_Count == 0) { Pa.SetActive(true); } else if (yellow.Color_yellow == 0 && player.Color_Count_Yellow == 1 && player.Color_Count == 1) { Pa.SetActive(true); } } }
void OnTriggerStay2D(Collider2D other) { hit = other.gameObject; Color_Blue blue = GetComponent <Color_Blue>(); Player_Color player = hit.GetComponent <Player_Color>(); if (hit.gameObject.CompareTag("Player")) { // //Debug.Log("Stay : " + other.gameObject.name); if (blue.Color_blue == 1 && player.Color_Count_Blue == 0 && player.Color_Count == 0) { Pa.SetActive(true); } else if (blue.Color_blue == 0 && player.Color_Count_Blue == 1 && player.Color_Count == 1) { Pa.SetActive(true); } } }
void Update() { Color_Red daiza_red = Daiza_Red.GetComponent <Color_Red>(); Color_Red taimatu_red = Taimatu.GetComponent <Color_Red>(); Color_Blue daiza_blue = Daiza_Blue.GetComponent <Color_Blue>(); Color_Yellow daiza_yellow = Daiza_Yellow.GetComponent <Color_Yellow>(); Color_Blue kurisutal_blue = Kurisutal_Blue.GetComponent <Color_Blue>(); Player_Color rein = Rein.GetComponent <Player_Color>(); Color_Yellow kaminari = Kaminari.GetComponent <Color_Yellow>(); if (kurisutal_blue.Color_blue == 0 && rein.Color_Count == 1 && rein.Color_Count_Blue == 1) { text.text = "青色を移せるところを探しましょう!"; } else if (daiza_blue.Color_blue == 1 && rein.Color_Count == 0 && rein.Color_Count_Blue == 0 && kaminari.Color_yellow == 1 && taimatu_red.Color_red == 1) { text.text = "台座の力で天候が変わったわね!ほかの色を使って色を移してみて"; } else if (taimatu_red.Color_red == 0 && rein.Color_Count == 1 && rein.Color_Count_Red == 1) { text.text = "赤色を台座に使ってみましょう!"; } else if (kaminari.Color_yellow == 0 && rein.Color_Count == 1 && rein.Color_Count_Yellow == 1) { text.text = "黄色を台座に使ってみましょう!"; } else if (daiza_blue.Color_blue == 1 && daiza_red.Color_red == 1 && daiza_yellow.Color_yellow == 1) { text.text = "虹の力で地下への道が出たみたいね!"; } else if (daiza_blue.Color_blue == 1 && daiza_red.Color_red == 1 && daiza_yellow.Color_yellow == 0) { text.text = "カミナリが使えそうよ"; } else if (daiza_blue.Color_blue == 1 && daiza_red.Color_red == 0 && daiza_yellow.Color_yellow == 1) { text.text = "松明の赤をどこかに移せないかしら?"; } else { text.text = "クリスタルの青色で何かできないかな?"; } }
void Update() { Color_Green ha = Ha.GetComponent <Color_Green>(); Color_Green otiruha = Otiruha.GetComponent <Color_Green>(); Color_Brown ki = Ki.GetComponent <Color_Brown>(); Color_Brown ie = Ie.GetComponent <Color_Brown>(); Color_Green me = Me.GetComponent <Color_Green>(); Player_Color rein = Rein.GetComponent <Player_Color>(); if (ha.Color_green == 0 && rein.Color_Count == 1 && me.Color_green == 0) { text.text = "光っているのが色が移せる合図よ!先にある芽に移してみて!"; } else if (me.Color_green == 1 && rein.Color_Count == 0 && ki.Color_brown == 1 && otiruha.Color_green == 1) { text.text = "リンゴを取りに行くために他のものを色移ししてみましょ?"; } else if (rein.Color_Count == 1 && otiruha.Color_green == 0 && ki.Color_brown == 1) { text.text = "最初に取った葉っぱに移してみましょ!"; } else if (ki.Color_brown == 0 && rein.Color_Count == 1) { text.text = "家に茶色を移してみましょ!"; } else if (ha.Color_green == 1 && rein.Color_Count == 0 && otiruha.Color_green == 0 && ie.Color_brown == 0) { text.text = "木の茶色をどこかに移してみましょ!"; } else if (ki.Color_brown == 0 && ie.Color_brown == 1 && rein.Color_Count == 0 && ha.Color_green == 0) { text.text = "最初の葉っぱにまた色を移せば屋根に上れそうね"; } else if (ie.Color_brown == 1 && ha.Color_green == 1) { text.text = "屋根に上ってリンゴを取りに行きましょ!"; } else { text.text = "葉っぱに近づいてスペースを押してみて!"; } }
void Update() { Color_Red kaeru_red = Kaeru.GetComponent <Color_Red>(); Color_Red taimatu_red = Taimatu.GetComponent <Color_Red>(); Color_Blue Ice_blue = Ice.GetComponent <Color_Blue>(); Color_Red kurisutal_red = Kurisutal.GetComponent <Color_Red>(); Color_Blue mizu_blue = Mizu.GetComponent <Color_Blue>(); Player_Color rein = Rein.GetComponent <Player_Color>(); Stage2_Iwa iwa = Iwa.GetComponent <Stage2_Iwa>(); if (kurisutal_red.Color_red == 0 && rein.Color_Count == 1 && rein.Color_Count_Red == 1) { text.text = "赤色を移せるところを探しましょう!"; } else if (Ice_blue.Color_blue == 0 && rein.Color_Count == 1 && rein.Color_Count_Blue == 1) { text.text = "湖と岩の穴は繋がってるみたいね岩が当たらないように移しましょ"; } else if (rein.Color_Count == 0 && taimatu_red.Color_red == 1 && Ice_blue.Color_blue == 1) { text.text = "氷の柱を少し溶けたみたいね!出てきた青で何かできないかな?"; } else if (kaeru_red.Color_red == 1 && rein.Color_Count == 0 && mizu_blue.Color_blue == 0) { text.text = "何かで岩を押し出せるかもしれないわ!探してみましょう!"; } else if (iwa.kaeru == 0 && rein.Color_Count == 0 && mizu_blue.Color_blue == 1) { //else if内の条件文Kaeru_red.Color_red ==0をiwa.kaeru ==0に変更 text.text = "ツタが引っかかってるみたい…どうにかしてツタをどかせないかしら?"; } else if (iwa.kaeru == 1 && mizu_blue.Color_blue == 1) { text.text = "氷の柱がどかせたわね!右奥に向かえばもうすぐ遺跡よ"; } else { text.text = "クリスタルの赤色で何かできないかな?"; } }
// Update is called once per frame void Update() { Player_Color Tue = Player.GetComponent <Player_Color>(); ParticleSystem.MainModule main = GetComponent <ParticleSystem>().main; if (Tue.Color_Count == 1 && Tue.Color_Count_Red == 1) { //パーティクルを赤にする main.startColor = Color.red; } else if (Tue.Color_Count == 1 && Tue.Color_Count_Blue == 1) { //パーティクルを青にする main.startColor = Color.blue; } else if (Tue.Color_Count == 1 && Tue.Color_Count_Yellow == 1) { //パーティクを黄色にする main.startColor = Color.yellow; } else if (Tue.Color_Count == 1 && Tue.Color_Count_Green == 1) { //パーティクルを緑にする main.startColor = Color.green; } else if (Tue.Color_Count == 1 && Tue.Color_Count_Brown == 1) { //パーティクルを茶色にする main.startColor = new Color(0.8396226f, 0.4573543f, 0.1465379f); } else { //それ以外の場合のパーティクルの色 //main.startColor = Color.HSVToRGB(27, 76, 82); main.startColor = Color.grey; } // //Debug.Log(main.startColor.color); }