コード例 #1
0
    /*
     * Build Popup Elements
     * */
    public void Build(GameObject parent)
    {
        backGround = new GraphickObject();
        backGround.Build(parent, "Popup");
        backGround.setImage(parent.GetComponent <FieldBuilder>().GetSprite(11));
        backGround.setScale(new Vector3(0.5f, 0.5f, 0));
        backGround.SetLayer(5);

        button = new GraphickObject();
        button.Build(backGround.GetGameObject(), "PopupButton");
        button.setImage(parent.GetComponent <FieldBuilder>().GetSprite(12));
        button.setPosion(new Vector3(0, -1, 0));
        button.setScale(new Vector3(0.8f, 0.8f, 0));
        button.SetBoxCollider();
        button.SetLayer(5);
        button.SetActive(false);

        NoBut = new GraphickObject();
        NoBut.Build(backGround.GetGameObject(), "PopupNoButton");
        NoBut.setImage(parent.GetComponent <FieldBuilder>().GetSprite(13));
        NoBut.setPosion(new Vector3(-1.5f, -1, 0));
        NoBut.setScale(new Vector3(2f, 2f, 0));
        NoBut.SetBoxCollider();
        NoBut.SetLayer(5);
        NoBut.SetActive(false);

        YesBut = new GraphickObject();
        YesBut.Build(backGround.GetGameObject(), "PopupYesButton");
        YesBut.setImage(parent.GetComponent <FieldBuilder>().GetSprite(13));
        YesBut.setPosion(new Vector3(1.5f, -1, 0));
        YesBut.setScale(new Vector3(2f, 2f, 0));
        YesBut.SetBoxCollider();
        YesBut.SetLayer(5);
        YesBut.SetActive(false);

        text = new GraphickObject();
        text.BuildText(parent, "Message");
        text.SetText("Message", 0.2f, 6);
        text.SetTextColor(Color.black);
        text.SetTextAlgment(TextAlignment.Center);

        noButTxt = new GraphickObject();
        noButTxt.BuildText(NoBut.GetGameObject(), "NO");
        noButTxt.SetText("NO", 0.1f, 6);
        noButTxt.SetTextColor(Color.black);
        noButTxt.SetTextAlgment(TextAlignment.Center);
        noButTxt.setPosion(new Vector3(-1.7f, -0.85f, 0));
        noButTxt.setScale(new Vector3(2f, 2f, 0));

        yesButTxt = new GraphickObject();
        yesButTxt.BuildText(YesBut.GetGameObject(), "YES");
        yesButTxt.SetText("YES", 0.1f, 6);
        yesButTxt.SetTextColor(Color.black);
        yesButTxt.SetTextAlgment(TextAlignment.Center);
        yesButTxt.setPosion(new Vector3(1.25f, -0.85f, 0));
        yesButTxt.setScale(new Vector3(2f, 2f, 0));

        backGround.AddPopupViewComponent().ResetPArametr(this.backGround, this.button, this.text, this.YesBut, this.NoBut);
    }
コード例 #2
0
    IEnumerator ShowAnimation(Vector3 position, GraphickObject animateText)
    {
        OneStepAnimation(animateText.GetGameObject(), position + new Vector3(0, 0.5f, 0));
        yield return(new WaitForSeconds(.5f));

        animateText.SetActive(false);
        Destroy(animateText.GetGameObject());
    }
コード例 #3
0
    /*Show Text with pluss position
     * position - from what position we start animation
     * text - message of ANimation
     * */
    public void TextAnimation(Vector3 position, string text)
    {
        GraphickObject animateText = new GraphickObject();

        animateText.BuildText(this.gameObject, "AnimateText");

        animateText.setPosion(position);
        animateText.SetText(text, 0.2f, 10);
        animateText.SetActive(true);
        StartCoroutine(ShowAnimation(position, animateText));
    }
コード例 #4
0
 void Activate(bool active)
 {
     backGround.SetActive(active);
     //button.SetActive(active);
     text.SetActive(active);
 }
コード例 #5
0
    /*
     * Button View Componets
     * here you have to options
     * 1) With one button (false) --OK--
     * 2) With 2 buttons (true) --No-- --Yes--
     * */

    public void YesNoPopupActive(bool active)
    {
        button.SetActive(!active);
        NoBut.SetActive(active);
        YesBut.SetActive(active);
    }