Ejemplo n.º 1
0
    void Show(DictionaryTapType tab = DictionaryTapType.Battle, DicionaryState state = DicionaryState.Default)
    {
        if (coroutineShow != null)
        {
            return;
        }

        // SortHeroList();

        if (tab == DictionaryTapType.Battle)
        {
            battleScrollViewContent.gameObject.SetActive(true);
            territoryScrollViewContent.gameObject.SetActive(false);
        }
        else
        {
            battleScrollViewContent.gameObject.SetActive(false);
            territoryScrollViewContent.gameObject.SetActive(true);
        }

        //for (int i = 0; i < heroSlotContainerList.Count; i++)
        //{
        //    if(heroSlotContainerList[i].heroInvenID == HeroManager.heroDataList[i].heroID)
        //    {
        //        heroSlotContainerList[i].GetComponentInChildren<UIHeroSlot>().heroImage.color = new Color(255, 255, 255);
        //    }
        //}

        coroutineShow = StartCoroutine(ShowA(tab, state));
    }
Ejemplo n.º 2
0
 public void OnValueChangedToggleListType()
 {
     if (battleToggle.isOn)
     {
         tabType = DictionaryTapType.Battle;
     }
     else if (territoryToggle.isOn)
     {
         tabType = DictionaryTapType.Territory;
     }
 }
Ejemplo n.º 3
0
    IEnumerator Start()
    {
        isInitialized = false;

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

        SceneLobby.Instance.OnChangedMenu += OnChangedMenu;

        //tabType = DictionaryTapType.Battle;

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

        yield return(StartCoroutine(DictionaryManager.Instance.InitDictionaryLevelData()));

        List <HeroBaseData> heroList = DictionaryManager.heroBaseDataDic.Values.ToList();

        for (int i = 0; i < heroList.Count; i++)
        {
            string    id     = heroList[i].id;
            Transform parent = id.EndsWith("_Hero") ? battleScrollViewContent.transform : territoryScrollViewContent.transform;

            GameObject go = Instantiate(heroSlotPrefab, parent) as GameObject;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;

            UIDictionarySlot heroSlot = go.GetComponent <UIDictionarySlot>();

            heroSlot.id = heroList[i].id;

            heroSlot.SlotDataInit(heroList[i].id, DicionaryState.Default);
            heroSlotDic.Add(heroSlot.id, heroSlot);
            heroSlotList.Add(heroSlot);

            continue;
        }

        yield return(StartCoroutine(SortHeroListA()));

        tabType = DictionaryTapType.Battle;
        SizeControl();


        isInitialized = true;
    }
Ejemplo n.º 4
0
    IEnumerator ShowA(DictionaryTapType tab, DicionaryState state)
    {
        //인벤토리 열릴시 NewCheck해제
        //onCheckNewHeroEarned();



        SizeControl();


        //canvas.enabled = false;
        canvas.gameObject.SetActive(true);



        for (int i = 0; i < heroSlotList.Count; i++)
        {
            heroSlotList[i].state = state;
        }

        battleScrollRect.gameObject.SetActive(tab == DictionaryTapType.Battle);
        territoryScrollRect.gameObject.SetActive(tab == DictionaryTapType.Territory);

        yield return(null);

        if (tab == DictionaryTapType.Battle)
        {
            battleScrollRect.normalizedPosition = new Vector2(battleScrollRect.normalizedPosition.x, 1f);
        }
        else if (tab == DictionaryTapType.Territory)
        {
            territoryScrollRect.normalizedPosition = new Vector2(territoryScrollRect.normalizedPosition.x, 1f);
        }



        battleScrollRect.GetComponent <CanvasRenderer>().SetAlpha(1f);
        territoryScrollRect.GetComponent <CanvasRenderer>().SetAlpha(1f);

        canvas.enabled = true;

        coroutineShow = null;

        yield break;
    }