Esempio n. 1
0
    private void InitiateProfileStatsView()
    {
        Vector3 playerNamePos   = _playerNameLabel.transform.position;
        Vector3 highscorePos    = _highscoreLabel.transform.position;
        Vector3 achievementsPos = _achievementsLabel.transform.position;

        SinglePlayerStatsView singlePlayerStatsViewInstance = Instantiate(_singlePlayerStatsView);

        _container.Inject(singlePlayerStatsViewInstance);
        singlePlayerStatsViewInstance.transform.SetParent(gameObject.transform);

        singlePlayerStatsViewInstance.CreateSinglePlayerStatsView(_projectData.EntireList[_projectData.CurrentID], playerNamePos, highscorePos, achievementsPos);
    }
Esempio n. 2
0
    public void CreateEmptyContainers(ProjectData projectData)                      // to, ile kontenerów ma byc w hierarchii wynika z ilości wpisów na liście playerów
    {
        _dataToDisplay = projectData;                                               // funkcja CreateEmptyContainers wywoływana jest z poziomu innej klasy i wymaga zestawu danych jako argumentu
        if (_dataToDisplay.EntireList.Count < 7)
        {
            _scope = _dataToDisplay.EntireList.Count;
        }
        else
        {
            _scope = 7;
        }

        for (int i = 0; i < _scope; i++)
        {
            SinglePlayerStatsView singlePlayerStatsViewInstance = Instantiate(_singlePlayerStatsView);                        // tworzy puste obiekty w hierarchii
            _container.Inject(singlePlayerStatsViewInstance);
            singlePlayerStatsViewInstance.transform.SetParent(gameObject.transform);
            singlePlayerStatsViewInstance.name = "SinglePlayerViewInstance" + i;
            _listOfContainers.Add(singlePlayerStatsViewInstance);
        }
    }