Beispiel #1
0
    IEnumerator Start()
    {
        while (!SceneLobby.Instance)
        {
            yield return(null);
        }

        SceneLobby.Instance.OnChangedMenu += OnChangedMenu;

        while (!TerritoryManager.Instance.isInitialized)
        {
            yield return(null);
        }

        //productionSlotList = new List<UIProductionSlot>(productionSlotParent.GetComponentsInChildren<UIProductionSlot>());

        while (!ProductManager.Instance.isInitialized)
        {
            yield return(null);
        }

        for (int i = 0; i < ProductManager.Instance.productionLineDataList.Count; i++)
        {
            UIProductionSlot slot = CreateProductionSlot();
            slot.InitSlot(ProductManager.Instance.productionLineDataList[i]);
            //if(i == 0)
            //{
            //    slot.ApplyProduct(ProductManager.Instance.productList.Find(x => x.id == "food_001"));
            //}
            //else
            //    slot.ApplyProduct();
        }


        while (KingdomManagement.Storage.isInitialized == false)
        {
            yield return(null);
        }

        //productionSlotList[0]

        SizeControl(productionSlotList.Count);


        while (!User.Instance)
        {
            yield return(null);
        }

        User.Instance.onChangedUserData += OnChangedUserData;
        User.onChangedExp   += OnChangedUserExp;
        User.onChangedLevel += OnChangedUserLevel;

        //왕국 기본 정보(레벨, 만족도, 닉네임?) 표시
        UpdateUserInfo();

        //만족도 게이지 갱신
        UpdateExpGauge();
    }
Beispiel #2
0
    UIProductionSlot CreateProductionSlot()
    {
        UIProductionSlot slot = null;

        for (int i = 0; i < productionSlotList.Count; i++)
        {
            if (productionSlotList[i].gameObject.activeSelf == false)
            {
                slot = productionSlotList[i];
                break;
            }
        }

        if (slot == null)
        {
            GameObject go = Instantiate(productionSlotPrefab, productionSlotParent, false);
            slot = go.GetComponent <UIProductionSlot>();
            productionSlotList.Add(slot);
        }

        return(slot);
    }