Beispiel #1
0
    private void AddToScrollView(string name, string Id, SimpleScrollSnap sss, GameObject toggle)
    {
        //Pagination
        Instantiate(toggle, sss.pagination.transform.position + new Vector3(toggleWidth * (sss.NumberOfPanels + 1), 0, 0), Quaternion.identity, sss.pagination.transform);
        sss.pagination.transform.position -= new Vector3(toggleWidth / 2f, 0, 0);

        //Panel
        var textObject = panel.GetComponentInChildren <TextMeshProUGUI>();

        textObject.text = name;

        panel.GetComponent <Panel>().id = Id;
        sss.Add(panel, 0);
    }
Beispiel #2
0
    private void Add(Note note)
    {
        //Pagination
        Instantiate(toggle, sss.pagination.transform.position + new Vector3(toggleWidth * (sss.NumberOfPanels + 1), 0, 0), Quaternion.identity, sss.pagination.transform);
        sss.pagination.transform.position -= new Vector3(toggleWidth / 2f, 0, 0);

        //Panel
        var textObjects = panel.GetComponentsInChildren <TextMeshProUGUI>();

        foreach (var textObject in textObjects)
        {
            if (textObject.tag.ToUpper() == "Title".ToUpper())
            {
                textObject.text = note.Title;
            }
            else
            {
                textObject.text = note.FormattedText;
            }
        }

        panel.GetComponent <Panel>().id = note.Id;
        sss.Add(panel, 0);
    }
        private void CreateNewPhaseDescription(PhaseDescriptionVM vm)
        {
            PhaseDescriptionView newDescription = m_Scroll.Add(m_DescriptionPrefab, vm.Number);

            newDescription.Bind(vm);
        }