private void AddPatientCardInSelector(PatientData data, string _identifier)
    {
        if (patientSelectorContent == null)
        {
            return;
        }
        if (patientCardPref == null)
        {
            return;
        }

        var card = Instantiate(patientCardPref, patientSelectorContent.transform);

        card.GetComponent <PatientCard>().Initialize(data);
        card.GetComponent <Button>().onClick.AddListener(() =>
        {
            startGamePanelControl.Initialize(data, _identifier);
            startGamePanel.SetActive(true);
        });
        card.transform.SetAsFirstSibling();

        UIInstruments.GetSizeForHorizontalGroup(
            patientSelectorLayoutGroup,
            patientSelectorContent.transform.childCount - 2,
            card.GetComponent <RectTransform>().sizeDelta.x *card.GetComponent <RectTransform>().localScale.x,
            openCreatePatientPanelBtn.sizeDelta.x * openCreatePatientPanelBtn.localScale.x * 2);

        patientSelectorMover.CalculateMinPos();
    }
Example #2
0
 protected override void CalculateCategoryPanelRect()
 {
     UIInstruments.GetSizeForVerticalGroup(
         categoryParent.GetComponent <VerticalLayoutGroup>(),
         GetVisibleCategoriesCount(),
         categoryCardPref.GetComponent <RectTransform>().sizeDelta.y *categoryCardPref.GetComponent <RectTransform>().localScale.y);
     categoryContentMover.CalculateMinPos();
 }
Example #3
0
    private void CreateCardInstance(string key, CardData data)
    {
        var instance    = Instantiate(libraryCardPref, libraryPanel.transform);
        var initializer = instance.GetComponent <LibraryCardInitializer>();

        initializer.Initialize(key, data);
        libraryCards.Add(initializer);
        UIInstruments.GetSizeForVerticalGrid(grid, libraryCards.Count);
    }
Example #4
0
    private void CreateCard(CategoryData _data, string _categoryKey)
    {
        var instance    = Instantiate(libraryCategoryPref, libraryPanel.transform);
        var initializer = instance.GetComponent <LibraryCategoryInitializer>();

        initializer.Initialize(_categoryKey, _data);
        cards.Add(initializer);
        UIInstruments.GetSizeForVerticalGrid(grid, cards.Count);
    }
Example #5
0
    protected override void CalculateCardPanelRect(GameObject _panel)
    {
        var contentPanel = _panel.transform.Find("Mask/Content");

        var visibleCategoryCount = 0;

        foreach (Transform card in contentPanel.transform)
        {
            if (card.gameObject.activeSelf)
            {
                visibleCategoryCount++;
            }
        }

        UIInstruments.GetSizeForVerticalGrid(contentPanel.GetComponent <GridLayoutGroup>(), visibleCategoryCount);
    }
    public void AddPatientInDataPanel(PatientData _data, string _identifier)
    {
        if (patientsDataContent == null)
        {
            return;
        }
        if (patientDataCardPref == null)
        {
            return;
        }

        var card = Instantiate(patientDataCardPref, patientsDataContent.transform);

        card.GetComponent <PatientDataCard>().Initialize(_data, _identifier);

        card.transform.SetAsFirstSibling();

        UIInstruments.GetSizeForVerticalGroup(
            patientDatasLayoutGroup,
            patientsDataContent.transform.childCount,
            card.GetComponent <RectTransform>().sizeDelta.y *card.GetComponent <RectTransform>().localScale.y);
    }
Example #7
0
 protected override void CalculateCategoryPanelRect()
 {
     UIInstruments.GetSizeForHorizontalGrid(categoryParent.GetComponent <GridLayoutGroup>(), GetVisibleCategoriesCount());
     contentMover.CalculateMinPos();
 }
Example #8
0
 protected override void CalculateCategoryPanelRect()
 {
     UIInstruments.GetSizeForVerticalGrid(categoriesGrid, GetVisibleCategoriesCount());
 }