Ejemplo n.º 1
0
    // Use this for initialization
    public void Start()
    {
        installNowButton    = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallNowButton", install_now);
        installOnExitButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallOnExitButton", install_on_exit);
        installLaterButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallLaterButton", install_later);

        downloadPanel = this.gameObject.FindChildByName("DownloadPanel", true);
        downloadText  = UnityUIUtil.FindText(this.gameObject, "DownloadingText");
        cancelButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "CancelButton", cancel_download);
        downloadPanel.SetVisible(false);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    public void Start()
    {
        try {
            statusBG      = this.gameObject.FindChildByName("StatusBG", true);
            statusBGImage = statusBG.GetComponent <Image>();
            statusText    = UnityUIUtil.FindText(statusBG, "StatusText");

            statusBG.SetVisible(false);
        } catch (Exception e) {
            DebugUtil.Log("StatusPanelSetup Start(): " + e.Message);
        }
    }
Ejemplo n.º 3
0
    private PanelRow add_new_row(PrintMeshSO so)
    {
        PanelRow row = new PanelRow();

        row.SO = so;

        row.panel = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("SceneBrowserPrintSOPanel"));
        this.gameObject.AddChild(row.panel, false);

        row.label      = UnityUIUtil.FindText(row.panel, "SONameLabel");
        row.label.text = so.Name;

        row.rowButton             = UnityUIUtil.FindButtonAndAddClickHandler(row.panel, "RowButton", () => { on_row_clicked(row); });
        row.rowButton.image.color = defaultRowColor;

        row.visibleButton = UnityUIUtil.FindButtonAndAddClickHandler(row.panel, "VisibleButton", () => { on_visible_clicked(row); });

        return(row);
    }
Ejemplo n.º 4
0
    // Use this for initialization
    public void Start()
    {
        try {
            statusBG        = this.gameObject.FindChildByName("InfoBG", true);
            layerText       = UnityUIUtil.FindText(statusBG, "LayerText");
            layerUpButton   = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "LayerUpButton", on_up_button);
            layerDownButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "LayerDownButton", on_down_button);

            ButtonLongPress layerUpHold = layerUpButton.gameObject.AddComponent <ButtonLongPress>();
            layerUpHold.HoldTime = 0.5f; layerUpHold.RepeatTime = 0.1f;
            layerUpHold.onLongPress.AddListener(on_up_button_longpress);

            ButtonLongPress layerDownHold = layerDownButton.gameObject.AddComponent <ButtonLongPress>();
            layerDownHold.HoldTime = 0.5f; layerDownHold.RepeatTime = 0.1f;
            layerDownHold.onLongPress.AddListener(on_down_button_longpress);

            statusBG.SetVisible(false);
            visible   = false;
            cur_layer = -1;
        } catch (Exception e) {
            DebugUtil.Log("StatusPanelSetup Start(): " + e.Message);
        }
    }
Ejemplo n.º 5
0
    // Use this for initialization
    public void Start()
    {
        dimensionPanel      = this.gameObject.FindChildByName("DimensionPanel", true);
        dimensionText       = UnityUIUtil.FindText(this.gameObject, "DimensionText");
        dimensionInput      = UnityUIUtil.FindInput(this.gameObject, "DimensionInput");
        dimensionInput.text = InitialDimension.ToString("F4");
        if (message_mode == 0)
        {
            dimensionText.text = "The imported mesh is very small. Maybe the units are not mm? You can select other units or enter a new height in the field below.";
        }
        else if (message_mode == 1)
        {
            dimensionText.text = "The imported mesh is taller than the print volume. You can enter a new height in the field below, or select the original units or a new height.";
        }
        else if (message_mode == 2)
        {
            dimensionText.text = "The imported mesh is much larger than the print bed. You can enter a new height in the field below, or select the original units or a new height.";
        }

        inchButton   = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InchButton", on_dimension_inch);
        meterButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "MeterButton", on_dimension_meter);
        FiveCMButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "FiveButton", on_dimension_fivecm);
        TenCMButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "TenButton", on_dimension_tencm);

        polycountPanel      = this.gameObject.FindChildByName("PolycountPanel", true);
        polycountText       = UnityUIUtil.FindText(this.gameObject, "PolycountText");
        polycountInput      = UnityUIUtil.FindInput(this.gameObject, "PolycountInput");
        polycountInput.text = InitialPolycount.ToString();

        tenKButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "TenKButton", () => { polycountInput.text = "25000"; });
        if (InitialPolycount < 10000)
        {
            tenKButton.interactable = false;
        }
        hundredKButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "HundredKButton", () => { polycountInput.text = "100000"; });
        if (InitialPolycount < 100000)
        {
            hundredKButton.interactable = false;
        }
        twofiftyKButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "TwoFiftyKButton", () => { polycountInput.text = "250000"; });
        if (InitialPolycount < 250000)
        {
            twofiftyKButton.interactable = false;
        }
        millionButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "MillionButton", () => { polycountInput.text = "1000000"; });
        if (InitialPolycount < 1000000)
        {
            millionButton.interactable = false;
        }

        skipButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "SkipButton", on_skip);
        applyButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "ApplyButton", on_apply);


        if (SetDimension == false)
        {
            dimensionPanel.SetVisible(false);
            dimensionText.gameObject.SetVisible(false);
        }
        if (SetPolycount == false)
        {
            polycountPanel.SetVisible(false);
            polycountText.gameObject.SetVisible(false);
        }
    }