Ejemplo n.º 1
0
    void ChangeSignal()
    {
        if (who.gameObject.activeInHierarchy)
        {
            //Debug.Log("人が領域に入ってる");
            if (Input.GetKey(KeyCode.K))
            {
                if (seconds >= 0.25)
                {
                    SignalBox.changeFlag();

                    if (SignalBox.getFlag())
                    {
                        havescript2.GetComponent <GreenAn>().AnotherColorChange2P(); //緑オン
                        havescript1.GetComponent <RedAn>().AnotherNoColorChange();   //赤オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }


                    else if (!SignalBox.getFlag())
                    {
                        havescript1.GetComponent <RedAn>().AnotherColorChange();       //赤オン
                        havescript2.GetComponent <GreenAn>().AnotherNoColorChange2P(); //緑オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (RollBox.getFlag())
     {
         transform.rotation = Quaternion.Euler(0, 0, Ti);
         //GetComponent<BoxCollider2D>().enabled = false;
         //Debug.Log("壁処理オン");
     }
     else if (!RollBox.getFlag())
     {
         transform.rotation = Quaternion.Euler(0, 0, Su);
         GetComponent <BoxCollider2D>().enabled = true;
         //Debug.Log("壁処理オフ");
     }
 }
Ejemplo n.º 3
0
    void ChangeSignal()
    {
        if (who.gameObject.activeInHierarchy)
        {
            Debug.Log("人が領域に入ってる");
            if (Input.GetKey(KeyCode.K))
            {
                if (seconds >= 0.25)
                {
                    SignalBox.changeFlag();
                    SignalBox2.changeFlag();
                    if (SignalBox.getFlag())
                    {
                        child.GetComponent <Green>().ColorChange2P(); //緑オン
                        child2.GetComponent <Red>().NoColorChange();  //赤オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }

                    else if (!SignalBox.getFlag())
                    {
                        child2.GetComponent <Red>().ColorChange();      //赤オン
                        child.GetComponent <Green>().NoColorChange2P(); //緑オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }

                    if (SignalBox2.getFlag())
                    {
                        child.GetComponent <Green>().ColorChange2P(); //緑オン
                        child2.GetComponent <Red>().NoColorChange();  //赤オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }

                    else if (!SignalBox2.getFlag())
                    {
                        child2.GetComponent <Red>().ColorChange();      //赤オン
                        child.GetComponent <Green>().NoColorChange2P(); //緑オフ
                        SE.instance.PlaySE(BGM_Gim);
                        seconds = 0;
                    }
                }
            }
        }
    }