食物也瘋狂
 
                 
                 
                 
                【遊戲介紹】
為了打倒偷走食物的小偷,召喚師愛麗絲展開了他的生存冒險!
【遊戲系統】
- 人物技能 
 a. 號召 - 號召一定範圍內的食怪到指定的位置
 b. 丟鍋蓋 - 朝指定方向丟出鍋蓋,彈飛擊中的召喚物、怪物
 c. 瞬間移動 - 朝指定召喚物緩慢的瞬間移動,可用來跨越地形障礙等等
 d. 集氣爆炸 - 長按對周圍造成傷害並累積熱度,若過熱則會對周圍產生衝擊性爆炸並短時間無法使用此技能
- 對話系統 
 小精靈師傅會帶著玩家了解世界,觸發特殊任務或劇情
 完成之後就可以解鎖更多更強的技能、召喚物!
- 物品系統 
 a. 背包 - 從地圖上採集或打敗怪物獲得的食材都會收進背包裡
 b. 食譜 - 可以製作藥水或召喚物,必須透過任務或劇情才能解鎖,解鎖後就可以登錄在快捷鍵方便使用
- 日夜系統 
 隨著時間會有日夜變化,而怪物會依照屬性在日夜各有強弱
 因此在視線不佳的夜晚,最好小範圍的移動
【Github】
【筆記】
- 對話系統 
 a. 在CSV檔中打好對話,再利用程式讀入- CSVloaderCSV.cs - 1 
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17- public void loadFile(string path, string fileName){ 
 arrayData.Clear ();
 StreamReader sr = null;
 try{
 sr=File.OpenText(path+"//"+fileName);
 Debug.Log("file found!");
 }catch{
 Debug.Log ("file lost");
 return;
 }
 string line;
 while ((line = sr.ReadLine ()) != null) {
 arrayData.Add (line.Split(','));
 }
 sr.Close ();
 sr.Dispose ();
 }- b. 顯示 - fairyTalkfairy.cs - 1 
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16- void talk(int i)//傳入第i段對話的引數 
 {
 Talk talky = talkUI.GetComponentInChildren<Talk>();
 int storySize = CSV.getInstance().arrayData[i].Length;
 talky.SetStorySize(storySize - 1);
 string[] talkStory = talky.story;
 for (int j = 1; j < storySize; j++)
 {//讀入第N段文字
 talkStory[j - 1] = CSV.getInstance().arrayData[i][j];
 Debug.Log(talkStory[j - 1]);
 }
 talkUI.SetActive(true);
 isTalk = true;
 nowString = "";
 }
- 背包系統 
 判斷撿到的物品是否已經存在背包裡,如果沒有再加入list- saveitemsaveitem.cs - 1 
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11- public void save(SaveItem ItemInfo) { 
 bool isInList=false;
 foreach (SaveItem _savedItem in _listData) {
 if (ItemInfo.species == _savedItem.species) {//in list
 _savedItem.num++;
 isInList = true;
 break;
 }
 }
 if(!isInList) _listData.Add(ItemInfo);
 }
