Esempio n. 1
0
    private IEnumerator SheduleProcessUI(UI.UISet TargetProcess)
    {
        UI.Instance.Load <UIShedule>(TargetProcess);

        yield return(new WaitForSeconds(1.0f));

        UI.Instance.DestroyUI(TargetProcess);
    }
Esempio n. 2
0
    void Update()
    {
        if (ScheduleStart)
        {
            /* 3차례 스케줄을 진행한 경우 */
            if (SheduleProcessBool[2] == true)
            {
                ScheduleWindowUI.gameObject.SetActive(false);

                /* 스케줄에 사용한 변수 초기화 */
                CardSelectedBool   = new bool[3];
                SheduleProcessBool = new bool[3];
                ScheduleStart      = false;
                SelectedCard.Clear();
                ProcessList = 0;
                SelectProprty.Clear();
                SelectName.Clear();
                SelectImage.Clear();
                SelectedProprty.Clear();
                SelectedName.Clear();
                SelectedImage.Clear();

                if (NowPoint >= StageList[SelectedStageNumber].Point)
                {
                    Debug.Log("점수 달성 성공 !");

                    StageList[SelectedStageNumber].Level++;
                    StageList[SelectedStageNumber].Point += 500;

                    /* 쥬얼, 플레이어 경험치 보상, 레벨업 확인 */
                    ResourceManager.Instance.PlusJewel(StageList[SelectedStageNumber].Jewel);
                    ResourceManager.Instance.SetExp(StageList[SelectedStageNumber].Exp);
                    ResourceManager.Instance.CanLevelUp();

                    /* 카드 경험치 보상, 레벨업 확인 */
                    for (int i = 0; i < Inventory.CompilationList.Count; i++)
                    {
                        Debug.Log("경험치 분배중");
                        Inventory.CompilationList[i].NowExp += StageList[SelectedStageNumber].Exp;
                        Inventory.CompilationList[i].LevelUpCheck();
                    }

                    Debug.Log("경험치 분배 완료");

                    ResultProcess(true);
                }
                else
                {
                    Debug.Log("점수 달성 실패 !");

                    ResultProcess(false);
                }

                StageDataSave();

                SetSchedule(SelectedStageNumber);
            }

            /* 카드가 세장 선택된 경우 */
            if (CardSelectedBool[2] == true)
            {
                /* 획득 점수 판단 */
                PointCalc();

                Debug.Log(NowPoint + " / " + StageList[SelectedStageNumber].Point);
                NowPointText.text = NowPoint.ToString() + " / " + StageList[SelectedStageNumber].Point.ToString();

                /* 상호작용이 불가능해진 버튼들을 초기화 */
                for (int i = 1; i < SelectScheduleImage.Length; i++)
                {
                    Button TargetButton = SelectScheduleImage[i].gameObject.GetComponent <Button>();
                    TargetButton.interactable = true;
                }

                SelectProprty.Clear();
                SelectName.Clear();
                SelectImage.Clear();

                SelectedProprty.Clear();
                SelectedName.Clear();
                SelectedImage.Clear();

                PointCalcBool[0] = false;
                PointCalcBool[1] = false;
                PointCalcBool[2] = false;

                for (int i = 0; i < SheduleProcessBool.Length; i++)
                {
                    if (SheduleProcessBool[i] == false)
                    {
                        SheduleProcessBool[i] = true;
                        CardSelectedBool      = new bool[3];

                        if (ProcessList <= UI.UISet.Last + 1)
                        {
                            if (ProcessList != UI.UISet.Last + 1)
                            {
                                StartCoroutine(SheduleProcessUI(ProcessList));
                                ProcessList++;
                            }
                        }

                        for (int j = 0; j < SelectedScheduleImage.Length; j++)
                        {
                            SelectedScheduleImage[j].sprite = PanelPrefab as Sprite;
                        }

                        SelectedCard.Clear();

                        /* 카드 중복 제거 하면서 생성될 카드 리스트 생성 */
                        while (SelectedCard.Count < 5)
                        {
                            SelectedCard.Add(Random.Range(0, Inventory.CompilationList.Count));

                            SelectedCard.Distinct();
                        }


                        for (int j = 0; j < 5; j++)
                        {
                            int RandomIndex = Random.Range(SelectedCard.Min(), SelectedCard.Max());

                            SelectScheduleImage[j + 1].sprite = Resources.Load(Inventory.CompilationList[RandomIndex].Image, typeof(Sprite)) as Sprite;

                            SelectProprty.Add(Inventory.CompilationList[RandomIndex].Property);
                            SelectName.Add(Inventory.CompilationList[RandomIndex].Name);
                            SelectImage.Add(Inventory.CompilationList[RandomIndex].Image);
                        }

                        break;
                    }
                }
            }
        }
    }