Beispiel #1
0
 void Update()
 {
     if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
     {
         SceneManager.LoadScene(Scene);
     }
 }
Beispiel #2
0
    void OnGUI()
    {
        string label = "";

        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        {
            label = "Fall in hole!";
        }
        GUI.Label(new Rect(0, 0, 100, 30), label);
    }
Beispiel #3
0
    void OnGUI()
    {
        string label = " ";

        GUI.Label(new Rect(0, 0, 100, 30), " ");
        GUI.Label(new Rect(0, 30, 100, 30), " ");
        GUI.Label(new Rect(0, 60, 100, 30), " ");
        GUI.Label(new Rect(0, 90, 100, 30), " ");

        if (red.IsFallIn())
        {
            GUI.Label(new Rect(0, 30, 100, 30), "RED  :TRUE");
        }
        else
        {
            GUI.Label(new Rect(0, 30, 100, 30), "RED  :FALSE");
        }

        if (blue.IsFallIn())
        {
            GUI.Label(new Rect(0, 60, 100, 30), "BLUE :TRUE");
        }
        else
        {
            GUI.Label(new Rect(0, 60, 100, 30), "BLUE :FALSE");
        }

        if (green.IsFallIn())
        {
            GUI.Label(new Rect(0, 90, 100, 30), "GREEN:TRUE");
        }
        else
        {
            GUI.Label(new Rect(0, 90, 100, 30), "GREEN:FALSE");
        }

        //すべてのボールが入ったらラベルを表示
        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        {
            label = "Fall in hole!";
        }
        GUI.Label(new Rect(0, 0, 100, 30), label);
    }
    void onGUI()
    {
        string label = " ";

        // すべてのボールが入ったらラベルを表示
        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        {
            label = "Fall in hole!";
        }
        GUI.Label(new Rect(0, 0, 100, 30), label);
    }
Beispiel #5
0
    void OnGUI()
    {
        string strLabel = "";

        if (holeRed.IsFallIn() && holeBlue.IsFallIn() && holeGreen.IsFallIn())
        {
            strLabel = "Fall in hole!";
        }

        GUI.Label(new Rect(0.0f, 0.0f, 100.0f, 30.0f), strLabel);
    }
Beispiel #6
0
    void OnGUI()
    {
        string label = " ";

        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        {
            label = "Fall In hole!";
        }
        int width  = Screen.width;
        int height = Screen.height;

        GUI.Label(new Rect(0, 0, 500, 200), label);
    }
Beispiel #7
0
    //ボールが入ったどうか判定後に、メッセージ表示するメソッド
    private void OnGUI()
    {
        string label = " ";

        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        //IsFallIn は bool型のメソッドなので条件式内で呼び出すだけでtrueとして扱える
        //(red.IsFallIn()==true && blue.IsFallIn()==true && green.IsFallIn()==true)みたいな感じ
        {
            label = "Fall in hole!";
        }

        GUI.Label(new Rect(0, 0, 100, 30), label);
        //Labelはカッコ内でパラメータの設定と渡す文字または文字の入った変数を書く
        //Rect(x,y,width,height)
    }
Beispiel #8
0
    void OnGUI()
    {
        string label = " ";

        //全てのボールが入ったらラベルを表示
        if (red.IsFallIn() && blue.IsFallIn() && green.IsFallIn())
        {
            label = "Fall in hole!";
        }

        //おまけ 文字が小さい画面から見えない場合以下のように書き換えてください

        GUIStyle font = new GUIStyle();

        font.fontSize = 50;

        GUIStyleState state = new GUIStyleState();

        state.textColor = Color.white;

        font.normal = state;

        GUI.Label(new Rect(50, 100, 200, 200), label, font);
    }