コード例 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        // If we touch Yoshi
        if (collision.gameObject.GetComponent <Yoshi>() != null)
        {
            // Show message box
            MessageBoxScript mbs = FindObjectOfType <MessageBoxScript>();
            mbs.SetText(Text);
            mbs.SetTitle(Title);
            mbs.SetButton(Button);
            mbs.SetInfo();

            switch (Icon)
            {
            case InfoIcon.WARNING:
                mbs.SetWarning();
                break;

            case InfoIcon.INFO:
                mbs.SetInfo();
                break;

            case InfoIcon.ERROR:
                mbs.SetError();
                break;
            }

            if (BigBox)
            {
                mbs.SetBigBox();
            }
            else
            {
                mbs.SetSmallBox();
            }

            mbs.ShowMessageBox();

            // Destroy self
            Destroy(gameObject);
        }
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        // If it's Yoshi
        if (collision.GetComponent <Yoshi>() != null)
        {
            // Show message box
            MessageBoxScript mbs = FindObjectOfType <MessageBoxScript>();
            mbs.SetText("All files in the recycle bin will now be deleted.");
            mbs.SetTitle("Recycle Bin");
            mbs.SetButton("OK");
            mbs.SetInfo();
            mbs.SetSmallBox();

            mbs.ShowMessageBox();

            // Sets up close event
            mbs.OnMessageBoxClose = () =>
            {
                // Goes to next scene
                SceneManager.LoadScene("YoshiWorry2");
            };
        }
    }
コード例 #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        // If it's Yoshi
        if (collision.GetComponent <Yoshi>() != null)
        {
            // Show message box
            MessageBoxScript mbs = FindObjectOfType <MessageBoxScript>();
            mbs.SetText("Internet Explorer has caused an illegal operation for no reason.");
            mbs.SetTitle("Microsoft Internet Explorer");
            mbs.SetButton("OK");
            mbs.SetError();
            mbs.SetSmallBox();

            mbs.ShowMessageBox();

            // Sets up close event
            mbs.OnMessageBoxClose = () =>
            {
                // Goes to next scene
                SceneManager.LoadScene("YoshiError");
            };
        }
    }