public void GetReward(int i) { if (MissionController.Instance.missions[i].isDone && !MissionController.Instance.missions[i].GainReward) { Alpha.MissionSystem.reward r = MissionController.Instance.missions[i].Reward; switch (r.type) { case Alpha.MissionSystem.reward.Type.Gem: GameManager.Instance.ChangeGem(r.amount); GameManager.Instance.saveCurrency(); break; case Alpha.MissionSystem.reward.Type.Coin: GameManager.Instance.ChangeCoin(r.amount); GameManager.Instance.saveCurrency(); break; case Alpha.MissionSystem.reward.Type.exp: GameManager.Instance.AddEXP(r.amount); GameManager.Instance.saveState(); break; } MissionController.Instance.missions[i].GainReward = true; MissionController.Instance.SendMissions(); GameManager.Instance.saveState(); missions[i].transform.GetChild(3).gameObject.SetActive(true); loadMissions(); } }
public Mission(string persian, string English, Type type, int times, reward.Type t, int rewardAmount, bool InMatch, int ID) { this.type = type; this.Times = times; CurrentTimes = 0; this.EnglishTitle = English; this.PersianTitle = persian; this.Reward = new reward(t, rewardAmount); this.InMatch = InMatch; this.Id = ID; }
public Mission() { Reward = new reward(reward.Type.Coin, 0); }