//시간 관련 func public void ChangeMinute(int _value) { int temp = minute + _value; if (temp == 60) { minute = 0; ChangeHP(-5); if (hour == 24) { hour = 7; if (day == 28) { if (season == SEASON.WINTER) { season = SEASON.SPRING; day = 1; } else { season++; day = 1; } } } else { hour++; } } else { minute = temp; } }
//변수 초기화 public void InitData() { minute = 0; hour = 7; day = 1; curHp = MaxHp; season = SEASON.SPRING; gold = 3000; isSleeping = false; reset = false; isNextDay = false; curMapNum = 0; //playerSpeed = 0.08f; //runSpeed = 0.05f; playerSpeed = 1f; runSpeed = 0.5f; playerPos = new Vector3(745.0f, 1100.0f, 1.0f); clockHand = GameObject.Find("ClockHand"); tempRot = 170.0f; //clockHand.transform.rotation = Quaternion.Euler(new Vector3(0, 0, 170.0f)); inventory = Inventory.instance.inventoryItemList; AddItemList(); }
public void RenewalDay() { hour = 7; minute = 0; isNextDay = true; if (day == 28) { if (season == SEASON.WINTER) { season = SEASON.SPRING; day = 1; } else { season++; day = 1; } } else { day++; } LinkDataToText(); sleepException = true; clockHand.transform.rotation = Quaternion.Euler(new Vector3(0, 0, 170.0f)); tempRot = 170.0f; isNextDay = false; playerSpeed = 0.08f; coffeeDrink = false; int rand = Random.Range(1, 4); BGMManager.instance.Play(rand); BGMManager.instance.FadeIn(); }
public void update(float dayNum) { if (dayNum % 3f == 0f) { switch (season) { case SEASON.SPRING: season = SEASON.SUMMER; //filter.color = new Color(1, 1, 1, 0); background.sprite = summer; tree1.sprite = summerTree; tree2.sprite = summerTree; break; case SEASON.SUMMER: season = SEASON.AUTUMN; //filter.color = new Color(1, .7f, 0, .15f); background.sprite = autumn; tree1.sprite = autumnTree; tree2.sprite = autumnTree; break; case SEASON.AUTUMN: season = SEASON.WINTER; //filter.color = new Color(.3f, .2f, 0, .2f); background.sprite = winter; tree1.sprite = winterTree; tree2.sprite = winterTree; break; case SEASON.WINTER: season = SEASON.SPRING; //filter.color = new Color(.5f, .5f, .5f, .55f); background.sprite = spring; tree1.sprite = springTree; tree2.sprite = springTree; break; } } }
static void StringTypeMenu() { Console.WriteLine("SPRING"); Console.WriteLine("SUMMER"); Console.WriteLine("FALL"); Console.WriteLine("WINTER"); string sel = Console.ReadLine(); // 문자열에 해당하는 enum값을 찾아서 얻어옴 SEASON season = (SEASON)Enum.Parse( typeof(SEASON), sel); switch (season) { case SEASON.SPRING: Console.WriteLine((int)season + ". 봄은 생명이 약동"); break; case SEASON.SUMMER: Console.WriteLine((int)season + ". 여름은 만물이 성장"); break; case SEASON.FALL: Console.WriteLine((int)season + ". 가을은 결실을 거둠"); break; case SEASON.WINTER: Console.WriteLine((int)season + ". 겨울은 만물이 잠이 듬"); break; } }
/// <summary> /// 選択したフレームをハイライトする /// </summary> /// <param name="select">選択中のフレーム</param> private void SelectFlame(SEASON select) { for (int i = 1; i < flameList.Length; i++) { flameList[i].SetActive(false); } flameList[(int)select].SetActive(true); }
public void changeSeason(string timeOfYear) { switch (timeOfYear) { case "SPRING": season = SEASON.SPRING; break; case "SUMMER": season = SEASON.SUMMER; break; case "AUTUMN": season = SEASON.AUTUMN; break; case "WINTER": season = SEASON.WINTER; break; } }
private void Fetch(SEASON before, SEASON after) { switch (before) { case SEASON.NONE: break; case SEASON.SPRING: spring.Disabled(); break; case SEASON.SUMMER: summer.Disabled(); break; case SEASON.AUTUMN: break; case SEASON.WINTER: winter.Disabled(); break; default: break; } switch (after) { case SEASON.NONE: break; case SEASON.SPRING: spring.Enabled(); break; case SEASON.SUMMER: summer.Enabled(); break; case SEASON.AUTUMN: break; case SEASON.WINTER: winter.Enabled(); break; default: break; } }
private IEnumerator ChangeFlame() { SEASON current = season; ChangeState(STATE.POSE); flameList[0].SetActive(true); int time = 60; for (int i = time; i > 0; i--) { if (Input.GetKeyDown(KeyCode.LeftControl)) { i = time; season--; if (season < SEASON.NONE) { season = SEASON.WINTER; } SelectFlame(season); } if (Input.GetKeyDown(KeyCode.RightControl)) { i = time; season++; if (season > SEASON.WINTER) { season = SEASON.NONE; } SelectFlame(season); } yield return(null); } // 現在と違うものを選択していた場合 if (season != current) { Fetch(current, season); } ChangeState(STATE.GAME); flameList[0].SetActive(false); yield break; }
static void Main(string[] args) { Console.WriteLine("0. 봄"); Console.WriteLine("1. 여름"); Console.WriteLine("2. 가을"); Console.WriteLine("3. 겨울"); Console.WriteLine(); Console.WriteLine("계절 대문자 영문 입력 >> "); string str = Console.ReadLine(); SEASON season = (SEASON)Enum.Parse( typeof(SEASON), str); RunCase(season); /* * Console.WriteLine("번호 선택 >> "); * int num = Int32.Parse(Console.ReadLine()); * RunCase(num); */ }
static void RunCase(SEASON season) { switch (season) { case SEASON.SPRING: Console.WriteLine("봄은 새싹이 자란다"); break; case SEASON.SUMMER: Console.WriteLine("해수욕장 가자"); break; case SEASON.FALL: Console.WriteLine("책을 읽자"); break; case SEASON.WINTER: Console.WriteLine("스키를 타자"); break; } }
//변수 초기화 public void InitializeVariables() { minute = 0; hour = 7; day = 1; curHp = MaxHp; season = SEASON.SPRING; gold = 3000; isSleeping = false; reset = false; isNextDay = false; curMapNum = 0; //playerSpeed = 0.08f; //runSpeed = 0.05f; playerSpeed = 1f; runSpeed = 0.5f; }
//LOAD public void loadSeason(string s) { switch (s) { case "SPRING": season = SEASON.SPRING; //filter.color = new Color(.5f, .5f, .5f, .55f); background.sprite = spring; tree1.sprite = springTree; tree2.sprite = springTree; break; case "SUMMER": season = SEASON.SUMMER; //filter.color = new Color(1, 1, 1, 0); background.sprite = summer; tree1.sprite = summerTree; tree2.sprite = summerTree; break; case "AUTUMN": season = SEASON.AUTUMN; //filter.color = new Color(1, .7f, 0, .15f); background.sprite = autumn; tree1.sprite = autumnTree; tree2.sprite = autumnTree; break; case "WINTER": season = SEASON.WINTER; //filter.color = new Color(.3f, .2f, 0, .2f); background.sprite = winter; tree1.sprite = winterTree; tree2.sprite = winterTree; break; } wm.secondLoad(getSeason()); tree1.sortingOrder = 2; tree2.sortingOrder = 2; }
private void loadComboBox(SEASON tmp_SEASONS) { cmbobox_MoveTo.Items.Clear(); foreach (SERIE s in L_SERIES) { cmbobox_MoveTo.Items.Add(s.Name); } }
private void changeNumber(SEASON currSeason, int newNum, int index) { string sBasePath = currSeason.Path.Remove(currSeason.Path.LastIndexOf("\\") + 1); string sNewPath = sBasePath + set_SeasonName + CheckSpace(set_Season1) + newNum.ToString(); SEASON newSeason = currSeason; if (!System.IO.Directory.Exists(sNewPath)) { System.IO.Directory.Move(currSeason.Path, sNewPath); LOG("Moved directory :\t" + currSeason.Path + "\nto :\t" + sNewPath); newSeason.Path = sNewPath; newSeason.Name = set_SeasonName + CheckSpace(set_Season1) + newNum.ToString(); newSeason.Number = newNum; replaceListItem(currSeason, newSeason); /* foreach (SEASON sn in getSelectedSeason(currSerie.ID)) { // Console.WriteLine("newNAME :\t" + sn.Name + "\nnewPath :\t" + sn.Path); }*/ currSeason = newSeason; UpdateListBoxes(currSerie.Name, S_DEFAULT, ""); } else { ERROR("The directory '" + sNewPath + "' already exists!"); } }
private void UpdateSelectedView(string type, string serie, string season = S_DEFAULT, string episode = S_DEFAULT) { lstbox_Selected.Items.Clear(); currSerie = L_SERIES.Find(x => x.Name == serie); currSeason = L_SEASONS.Find(x => x.Name == season && x.FK == currSerie.ID); currEpisode = L_EPISODES.Find(x => x.Name == episode && x.FK == currSeason.ID); LOG("Serie data: \n" + "Name:\t\t" + currSerie.Name + "\t\tID:\t" + currSerie.ID + "\tPath:\t" + currSerie.Path + "\nSeason data: \n" + "Name:\t\t" + currSeason.Name + "\t\tID:\t" + currSeason.ID + "\tFK:\t" + currSeason.FK + "\tNumber: \t" + currSeason.Number + "\nEpisode data: \n" + "Name:\t\t" + currEpisode.Name + "\t\tID:\t" + currEpisode.ID + "\tFK:\t" + currEpisode.FK + "\tNumber: \t" + currEpisode.Number); btnDeleteSelected.IsEnabled = true; if (type == "serie") { lbl_SeasonNumberSelected.IsEnabled = false; txtbox_NumberSelected.IsEnabled = false; btnNumberSelected.IsEnabled = false; btnMoveSelected.IsEnabled = false; cmbobox_MoveTo.IsEnabled = false; lbl_NewNameSelected.IsEnabled = true; txtbox_NewSelected.IsEnabled = true; btnNewSelected.IsEnabled = true; btnRenameSelected.IsEnabled = true; txtbox_RenameSelected.IsEnabled = true; lstbox_Selected.Items.Add("SERIE"); lstbox_Selected.Items.Add("Name :\t" + serie); btn_AutoRename.IsEnabled = true; btn_AutoRename2.IsEnabled = false; txtbox_RenameSelected.Text = serie; txtbox_NewSelected.Text = "Enter the new Serie name"; } if (type == "season") { SEASON tmp_SEASONS = findSeason(serie, season); btnRenameSelected.IsEnabled = false; txtbox_RenameSelected.IsEnabled = false; btnMoveSelected.IsEnabled = true; cmbobox_MoveTo.IsEnabled = true; lbl_NewNameSelected.IsEnabled = true; txtbox_NewSelected.IsEnabled = true; btnNewSelected.IsEnabled = true; txtbox_NewSelected.Text = tmp_SEASONS.Name; lbl_SeasonNumberSelected.IsEnabled = true; txtbox_NumberSelected.IsEnabled = true; btnNumberSelected.IsEnabled = true; lstbox_Selected.Items.Add("SEASON"); lstbox_Selected.Items.Add("Name :\t" + tmp_SEASONS.Name); lstbox_Selected.Items.Add("Num :\t" + tmp_SEASONS.Number.ToString()); txtbox_NumberSelected.Text = tmp_SEASONS.Number.ToString(); loadComboBox(tmp_SEASONS); btn_AutoRename2.IsEnabled = true; } if (type == "episode") { SEASON tmp_SEASONS = findSeason(serie, season); EPISODE tmp_EPISODE = findEpisode(serie, season, episode); btnRenameSelected.IsEnabled = false; txtbox_RenameSelected.IsEnabled = false; btnMoveSelected.IsEnabled = true; cmbobox_MoveTo.IsEnabled = true; lbl_NewNameSelected.IsEnabled = false; txtbox_NewSelected.IsEnabled = false; btnNewSelected.IsEnabled = false; lbl_SeasonNumberSelected.IsEnabled = true; txtbox_NumberSelected.IsEnabled = true; btnNumberSelected.IsEnabled = true; // string stmp_NewName = GenerateNewName(tmp_VIDEO.Path, serie, tmp_SEASONS.Number, tmp_EPISODE.Number); lstbox_Selected.Items.Add("EPISODE"); lstbox_Selected.Items.Add("Old Name :\t" + episode); // lstbox_Selected.Items.Add("New Name :\t" + stmp_NewName); lstbox_Selected.Items.Add("Num :\t" + tmp_EPISODE.Number.ToString()); loadComboBox(tmp_EPISODE); } }
private void replaceListItem(SEASON oldSeason, SEASON newSeason) { int pos = L_SEASONS.IndexOf(oldSeason); L_SEASONS.RemoveAt(pos); L_SEASONS.Insert(pos, newSeason); }