public void AddDepartmentIndicator(string name, List <string> departments, List <IIndicator> indicators)
    {
        GameObject             indObject    = _departmentsPool.GetInstance();
        StatIndicatorContainer indContainer = indObject.GetComponent <StatIndicatorContainer>();

        indContainer.InitContainer(name, departments, indicators);
    }
示例#2
0
    public void AddQuestionRecord(string question, string choice, QuestionChoiceCorrectness choiceCorrect)
    {
        Init();
        Color32    color          = _choicesColors[choiceCorrect];
        GameObject questionObject = _questionsPool.GetInstance();

        questionObject.transform.SetAsFirstSibling();
        QuestionReport qr = questionObject.GetComponent <QuestionReport>();

        qr.UpdateIndicatorColor(color);
        qr.UpdateQuestionChoice(question, choice);
        UpdateQuestionsStatistic(choiceCorrect);
    }
    public void AddCompanyIndicator(IIndicator indicator)
    {
        if (_companyPools.Count < _currentPoolIndex + 1)
        {
            return;
        }
        GameObjectsPool    pool      = _companyPools[_currentPoolIndex];
        GameObject         indObject = pool.GetInstance();
        IndicatorContainer ic        = indObject.GetComponent <IndicatorContainer>();

        if (ic != null)
        {
            ic.InitContainer(indicator);
            _currentPoolIndex++;
            _currentPoolIndex = _currentPoolIndex % _companyPools.Count;
        }
    }
示例#4
0
    public void AddTaskProcessingRecord(string name, int time, int reward, Dictionary <CardType, int> resources)
    {
        GameObject instance = _tasksProcessingPool.GetInstance();

        if (instance == null)
        {
            return;
        }
        instance.SetActive(false);
        var record = instance.GetComponent <TaskProcessingContainer>();

        if (record == null)
        {
            return;
        }
        record.UpdateData(name, time, reward, resources);
        instance.SetActive(true);
    }
示例#5
0
 protected override void Init()
 {
     base.Init();
     if (!_initProcessed)
     {
         _confirmButton.onClick.AddListener(() => OnConfirm());
         foreach (ConsumableData c in _allConsumablesData)
         {
             GameObject           instance = _consumablesPool.GetInstance();
             ConsumablesContainer cc       = instance.GetComponent <ConsumablesContainer>();
             if (cc != null)
             {
                 _containers.Add(cc);
                 cc.InitContainer(c.Name, c.Price);
                 cc.AddAmountChangedListener((int change, int costChange) => AmountChanged(cc, change, costChange));
             }
         }
         UpdateContainersButtonsActivity();
         _initProcessed = true;
     }
 }