Exemple #1
0
    private void InitOrUpdateView()
    {
        if (moneyBar == null)
        {
            moneyBar = Instantiate(LoadResourceController.GetMoneyBarView(), moneyBarAnchor);
            moneyBar.transform.localPosition = Vector3.zero;
        }

        moneyBar.SetData(requireCollection.GetCampaignRequireData(data.stage).require.GetResource());

        int i = 0;

        for (; i < data.rewards.Length; i++)
        {
            if (i < iconViews.Count)
            {
                iconViews[i].gameObject.SetActive(true);
                iconViews[i].SetData(data.rewards[i].GetResource());
            }
            else
            {
                var view = Instantiate(prefab, rewardAnchor);
                view.SetData(data.rewards[i].GetResource());
                iconViews.Add(view);
            }
        }

        for (; i < iconViews.Count; i++)
        {
            iconViews[i].gameObject.SetActive(false);
        }
    }
Exemple #2
0
 private void InitData()
 {
     levelCollection = LoadResourceController.GetCharacterLevelCollection();
     moneyBar        = LoadResourceController.GetMoneyBarView();
     prefab          = LoadResourceController.GetStatView();
 }