예제 #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);
    }
예제 #2
0
파일: Lobby.cs 프로젝트: earlgrey94/Karen
    void FileOpen(string file_name)
    {
        FileStream   fs = new FileStream(file_name, FileMode.Open);
        StreamReader sr = new StreamReader(fs, Encoding.UTF8, false);

        string lineStr = null;

        string[] keys = null;
        int      cnt  = 0;

        while ((lineStr = sr.ReadLine()) != null)
        {
            //첫 2줄은 읽지 않고 skip
            if (cnt < 2)
            {
                ++cnt;
                continue;
            }

            //빈 줄이 들어오면 return
            if (string.IsNullOrEmpty(lineStr))
            {
                return;
            }

            keys = lineStr.Split(',');
            ScheInfo tmpScheInfo = new ScheInfo(keys);

            //Debug.Log("ID : " + tmpScheInfo.ScheGroupID);

            //Schedule Type에 따라 다른 list에 넣어줌
            if (tmpScheInfo.ScheType == SCHE_TYPE.School)
            {
                schedule.scheInfo_School.Add(tmpScheInfo);
            }
            else if (tmpScheInfo.ScheType == SCHE_TYPE.AfterSchool)
            {
                schedule.scheInfo_AfterSchool.Add(tmpScheInfo);
            }
            else if (tmpScheInfo.ScheType == SCHE_TYPE.Rest)
            {
                schedule.scheInfo_Rest.Add(tmpScheInfo);
            }

            ++cnt;
        }
        Debug.Log("로딩 끗! 총 갯수 : " + cnt);
    }
예제 #3
0
 //지금 실행되는 딸의 스켸줄 관리
 public void AddDautherSchedule(ScheInfo scheInfo)
 {
     instance.dautherScheduleList.Add(scheInfo);
 }
예제 #4
0
 void ModifyBudget(ScheInfo scheInfo)
 {
 }