Beispiel #1
0
    //스켸줄 등록
    public void AddSchedule(int schID)
    {
        ScheInfo tmpSchInfo = GetScheInfoByScheID(schID);

        if (tmpSchInfo == null)
        {
            Debug.Log(schID + " : schedule을 찾지 못했습니다...");
            return;
        }
        schedule.AddDautherSchedule(tmpSchInfo);

        //[dummy source] 아이콘을 임시로 바꾸기 위함
        iconArray = new Sprite[3];
        iconArray[(int)ICON_ARRAY.School]      = Resources.Load <Sprite>("Sche_School") as Sprite;
        iconArray[(int)ICON_ARRAY.Afer_School] = Resources.Load <Sprite>("Sche_AfterSchool") as Sprite;

        //임시로 이미지만 바꿈
        string imageName         = "scheBtn" + (int)(scheduleCount + 1);
        Image  currentScheBtnImg = GameObject.Find(imageName).GetComponent <Image>();

        if (scheduleCount < 4)
        {
            if (currentScheBtnImg != null)
            {
                currentScheBtnImg.sprite = iconArray[(int)ICON_ARRAY.School];
            }
        }
        else
        {
            if (currentScheBtnImg != null)
            {
                currentScheBtnImg.sprite = iconArray[(int)ICON_ARRAY.Afer_School];
            }
        }

        ++scheduleCount;


        if (scheduleCount == 4)
        {
            //리스트 내용을 방과후로 전환
            ViewScheduleInfos(schedule.scheInfo_AfterSchool);
        }
        else if (scheduleCount == MAX_SCHEDULE_COUNT)
        {
            //스켸줄 실행
            GameObject StartScheduleWindow = this.transform.Find("StartScheduleBG").gameObject;
            StartScheduleWindow.SetActive(true);

            Text schInfoTxt = GameObject.Find("sch_inform2").GetComponent <Text>();

            //생활비 구하기
            int totalBudget = schedule.GetTotalScheduleDebut();
            schInfoTxt.text = string.Format("총 {0}원이 따님 생활비로 사용 예상됩니다.", totalBudget);
        }
        Timer(0.5f);
    }