// Update is called once per frame void Update() { Color_Yellow yellow = Yellow.GetComponent <Color_Yellow>(); if (yellow.Color_yellow == 1) { kaminari.gameObject.SetActive(false); } }
// Update is called once per frame void Update() { Color_Yellow yellow = Yellow.GetComponent <Color_Yellow>(); Color_Red red = Red.GetComponent <Color_Red>(); if (yellow.Color_yellow == 1 && red.Color_red == 1) { sora.gameObject.SetActive(true); } }
// Update is called once per frame void Update() { Color_Yellow yellow = Yellow.GetComponent <Color_Yellow>(); Color_Blue blue = Blue.GetComponent <Color_Blue>(); Color_Red red = Red.GetComponent <Color_Red>(); if (yellow.Color_yellow == 1 && blue.Color_blue == 1 && red.Color_red == 1) { tobira.gameObject.SetActive(true); } }
// Update is called once per frame void Update() { Color_Red red = Red.GetComponent <Color_Red>(); Color_Blue blue = Blue.GetComponent <Color_Blue>(); Color_Yellow yellow = Yellow.GetComponent <Color_Yellow>(); if (red.Color_red == 1 && blue.Color_blue == 1 && yellow.Color_yellow == 1) { nizi.gameObject.SetActive(true); } else { nizi.gameObject.SetActive(false); } }
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 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 = "クリスタルの青色で何かできないかな?"; } }
public void Magic_ON() { //色変えプログラム if (hit != null) { Color_Brown brown = hit.GetComponent <Color_Brown>(); Color_Green green = hit.GetComponent <Color_Green>(); Color_Red red = hit.GetComponent <Color_Red>(); Color_Blue blue = hit.GetComponent <Color_Blue>(); Color_Yellow yellow = hit.GetComponent <Color_Yellow>(); ////Debug.Log(hit.name); //if (Input.GetKeyDown(KeyCode.X)) //{ if (hit.gameObject.CompareTag("Brown")) { //各条件式に&&Color_countを追加 if (brown.Color_brown == 0 && Color_Count_Brown >= 1 && Color_Count == 1) { brown.Color_brown++; Color_Count_Brown--; Color_Count--; //brown.Test(); } else if (brown.Color_brown == 1 && Color_Count == 0 && Color_Count == 0) { brown.Color_brown--; Color_Count_Brown++; Color_Count++; //brown.Test(); } } else if (hit.gameObject.CompareTag("Green")) { if (green.Color_green == 0 && Color_Count_Green >= 1 && Color_Count == 1) { green.Color_green++; Color_Count_Green--; Color_Count--; //green.Test(); } else if (green.Color_green == 1 && Color_Count == 0 && Color_Count == 0) { green.Color_green--; Color_Count_Green++; Color_Count++; //green.Test(); } } else if (hit.gameObject.CompareTag("Red")) { if (red.Color_red == 0 && Color_Count_Red >= 1 && Color_Count == 1) { red.Color_red++; Color_Count_Red--; Color_Count--; //red.Test(); } else if (red.Color_red == 1 && Color_Count == 0 && Color_Count == 0) { red.Color_red--; Color_Count_Red++; Color_Count++; //red.Test(); } } else if (hit.gameObject.CompareTag("Blue")) { if (blue.Color_blue == 0 && Color_Count_Blue >= 1 && Color_Count == 1) { blue.Color_blue++; Color_Count_Blue--; Color_Count--; //blue.Test(); } else if (blue.Color_blue == 1 && Color_Count == 0 && Color_Count == 0) { blue.Color_blue--; Color_Count_Blue++; Color_Count++; //blue.Test(); } } else if (hit.gameObject.CompareTag("Yellow")) { if (yellow.Color_yellow == 0 && Color_Count_Yellow >= 1 && Color_Count == 1) { yellow.Color_yellow++; Color_Count_Yellow--; Color_Count--; //yellow.Test(); } else if (yellow.Color_yellow == 1 && Color_Count == 0 && Color_Count == 0) { yellow.Color_yellow--; Color_Count_Yellow++; Color_Count++; //yellow.Test(); } } //} } }