Exemple #1
0
        };                                                                         //持っているアイテム

        // Use this for initialization
        void Start()
        {
            Money    = PlayerPrefs.GetInt("お金", 0);
            NowJob   = JobDataBase.GetJob("赤ちゃん");
            mySprite = GetComponent <SpriteRenderer>();

            SetJobSprite();
        }
        public List <string> itemNames; //持っているアイテム

        // Use this for initialization
        void Start()
        {
            Money     = PlayerPrefs.GetInt("お金", 0);
            itemNames = PlayerPrefsUtils.LoadList <string>("アイテム");
            NowJob    = JobDataBase.GetJob(PlayerPrefs.GetString("職業", "赤ちゃん"));
            mySprite  = GetComponent <SpriteRenderer>();

            SetJobSprite();
        }
Exemple #3
0
 //現在のJobから成長可能なJobがあるか調べる
 private Job GrowableJob()
 {
     foreach (var nextJobName in NowJob.NextJobs)
     {
         Job nextJob = JobDataBase.GetJob(nextJobName);
         if (nextJob.IsGrowable(NowJob.Name, gameManager.nowIine, itemNames))
         {
             return(nextJob);
         }
     }
     return(null);
 }
        //現在のJobから成長可能なJobがあるか調べる
        private Job GrowableJob()
        {
            var list = NowJob.NextJobs.Where(nextJob => JobDataBase.GetJob(nextJob).IsGrowable(NowJob.Name, gameManager.nowIine, itemNames));

            if (list.Count() == 0)
            {
                return(null);
            }
            else
            {
                return(JobDataBase.GetJob(list.ElementAt(Random.Range(0, list.Count()))));
            }
        }