Ejemplo n.º 1
0
    private GameObject createLoadButton()
    {
        GameObject button = Instantiate(Resources.Load("Submission_Cell", typeof(GameObject))) as GameObject;

        button.transform.SetParent(commitsPanel.transform);
        button.transform.localScale = Vector3.one;
        button.transform.position   = new Vector3(-500f, -500f, -500f);

        button.name = "Load_Button";
        var text = button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>();

        text.text      = "Reload";
        text.fontStyle = TMPro.FontStyles.Bold;
        text.alignment = TMPro.TextAlignmentOptions.Center;
        text.fontSize  = 1.8f;

        //var icon = button.transform.Find("Icon");
        //var notAvailable = button.transform.Find("PreviewNotAvailable");
        //icon.gameObject.SetActive(false);
        //notAvailable.gameObject.SetActive(false);

        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        // Add this action to the panel
        commitsPanel.AddAction(button.GetComponent <FlexButtonComponent>());

        return(button);
    }
Ejemplo n.º 2
0
    private GameObject createLoadButton()
    {
        GameObject button = Instantiate(Resources.Load("Tournament_Cell", typeof(GameObject))) as GameObject;

        button.transform.SetParent(tournamentsPanel.transform);
        button.transform.localScale = Vector3.one;
        button.transform.position   = new Vector3(-500f, -500f, -500f);

        button.name = "Load_Button";
        var text = button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>();

        text.text      = "Reload Tournaments";
        text.fontStyle = TMPro.FontStyles.Bold;
        text.alignment = TMPro.TextAlignmentOptions.Center;

        TMPro.TextMeshPro matryxBountyTMP = button.transform.Find("MTX_Amount").GetComponent <TMPro.TextMeshPro>();
        matryxBountyTMP.text = "";

        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        // Add this action to the panel
        tournamentsPanel.AddAction(button.GetComponent <FlexButtonComponent>());

        return(button);
    }
Ejemplo n.º 3
0
    private GameObject createButton(string account)
    {
        GameObject button = Instantiate(Resources.Load("Account_Cell", typeof(GameObject))) as GameObject;

        button.transform.SetParent(accountsPanel.transform);
        button.transform.localScale = Vector3.one;
        button.transform.position   = new Vector3(-500f, -500f, -500f);

        button.name = account;

        MeshRenderer meshRenderer    = button.transform.Find("Icon").GetComponent <MeshRenderer>();
        Texture2D    blockieTex      = Utils.Accounts.getBlockieTexture(account);
        Material     blockieMaterial = new Material(meshRenderer.material);

        blockieMaterial.mainTexture = blockieTex;

        meshRenderer.material = blockieMaterial;

        button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>().text = Utils.Accounts.ellipseAddress(button.name);

        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        return(button);
    }
Ejemplo n.º 4
0
    private GameObject createButton(Matryx_Submission submission)
    {
        GameObject button = Instantiate(Resources.Load("Submission_Cell", typeof(GameObject))) as GameObject;

        button.transform.SetParent(submissionsPanel.transform);
        button.transform.localScale = Vector3.one;

        button.name = submission.getTitle();
        button.GetComponent <SubmissionContainer>().SetSubmission(submission);

        button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>().text = submission.getTitle();

        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        return(button);
    }
Ejemplo n.º 5
0
    private GameObject createButton(SavePackage save)
    {
        GameObject button = Instantiate(Resources.Load("Screenshot", typeof(GameObject))) as GameObject;

        button.name = save.date;
        initializeButton(save, button);
        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        return(button);
    }
Ejemplo n.º 6
0
    private GameObject createLoadButton()
    {
        GameObject button = Instantiate(Resources.Load("Tournament_Cell", typeof(GameObject))) as GameObject;

        button.transform.SetParent(tournamentsPanel.transform);
        button.transform.localScale = Vector3.one;

        button.name = "Load_Button";
        button.transform.Find("Text").GetComponent <TMPro.TextMeshPro>().text = "Load More...";

        TMPro.TextMeshPro matryxBountyTMP = button.transform.Find("MTX_Amount").GetComponent <TMPro.TextMeshPro>();
        matryxBountyTMP.text = "";

        scroll.addObject(button.transform);
        joyStickAggregator.AddForwarder(button.GetComponentInChildren <JoyStickForwarder>());

        // Add this action to the panel
        tournamentsPanel.AddAction(button.GetComponent <FlexButtonComponent>());

        return(button);
    }
Ejemplo n.º 7
0
    //NOTE: make sure actions aren't getting double registered.
    private void initializePresetButtons()
    {
        #region add to presets
        //R1 -> R1
        presets.Add("Cinquefoil Knot", cinquefoilKnot);
        presets.Add("Circle", circle);
        presets.Add("Sphere Outline", sphereOutline);
        presets.Add("Hypocloid", hypocloid);
        presets.Add("Hypocloid Surface", hypocloidSurface);
        presets.Add("Trefoil Knot", trefoilKnot);
        presets.Add("Turnip", turnip);
        presets.Add("Wavy Surface", wavySurface);
        presets.Add("High-res Sphere", highResSphere);

        //R2 -> R3
        presets.Add("Astroidal Ellipse", astroidalEllipse);
        presets.Add("Bumpy Sphere", bumpySphere);
        presets.Add("Dini's Surface", dinisSurface);
        presets.Add("Figure-8", figure8);
        presets.Add("Gray's Surface", graysSurface);
        presets.Add("Knot", knot);
        presets.Add("Mobius", mobius);
        presets.Add("Radial Wave", radialWave);
        presets.Add("Torus", torus);

        //R3 -> R3
        presets.Add("Cone", cone);
        presets.Add("Cube", cube);
        presets.Add("Cylinder", cylinder);
        presets.Add("Sphere", sphere);
        presets.Add("Tetrahedron", tetrahedron);
        #endregion

        foreach (KeyValuePair <string, bool> pair in presets)
        {
            if (pair.Value == true)
            {
                GameObject presetButton = Instantiate(Resources.Load("Preset", typeof(GameObject))) as GameObject;
                presetButton.GetComponentInChildren <TMPro.TextMeshPro>().text = pair.Key;
                presetButton.name = pair.Key;
                presetButton.SetActive(false);
                scroll.addObject(presetButton.transform);
                scroll.objectParent.GetComponent <FlexPanelComponent>().AddAction(presetButton.GetComponent <FlexActionableComponent>());
                joyStickAggregator.AddForwarder(presetButton.GetComponentInChildren <JoyStickForwarder>());
            }
        }
    }
Ejemplo n.º 8
0
    //NOTE: make sure actions aren't getting double registered.
    private void initializePresetButtons()
    {
        #region add to presets

        //Oribals
        presets.Add("1S", s1);
        presets.Add("2S", s2);
        presets.Add("2Pz", p2);
        presets.Add("3S", s3);
        presets.Add("3Pz", p3);
        presets.Add("3Dz\x00B2", d3z2);
        presets.Add("3Dxy", d3xy);
        presets.Add("4S", s4);
        presets.Add("4Pz", p4);
        presets.Add("4Dz\x00B2", d4z2);
        presets.Add("4Dxy", d4xy);
        presets.Add("4Fz\x00B3", f4z3);
        presets.Add("4Fxz\x00B2", f4xz2);
        presets.Add("4Fxyz", f4xyz);
        #endregion

        foreach (KeyValuePair <string, bool> pair in presets)
        {
            if (pair.Value == true)
            {
                GameObject presetButton = Instantiate(Resources.Load("DensityPreset", typeof(GameObject))) as GameObject;
                presetButton.GetComponentInChildren <TMPro.TextMeshPro>().text = pair.Key;
                presetButton.name = pair.Key;
                presetButton.SetActive(false);
                scroll.addObject(presetButton.transform);
                scroll.objectParent.GetComponent <SelectorFlexPanel>().AddAction(presetButton.GetComponent <FlexActionableComponent>());
                joyStickAggregator.AddForwarder(presetButton.GetComponentInChildren <JoyStickForwarder>());

                if (pair.Key == defaultFunction)
                {
                    presetButton.GetComponent <FlexActionableComponent>().SetState(2);
                }
            }
        }
    }