loading

War Robots 遊戲源碼 - 2014 年版

暴力拆解的遊戲源碼,並沒有做文件分類,僅供學習之用途,如果用於惡意則我們不負責任

部分源碼預覽:

namespace Game
{
	public class PlayerPopupNotificationsController : Controller, IMailSubscriber
	{
		public override void Begin()
		{
			Player.playerLevelUpEvent += new Action(this.CheckPopups);
			Player.playerLoadedEvent += new Action(this.CheckPopups);
			Player.playerRateMeEvent += new Action(this.CheckPopups);
			Player.playerParamsChangedEvent += new Action(this.CheckPopups);
			MailMessenger.Subscribe(this);
			this.CheckPopups();
		}

		public override void End()
		{
			Player.playerLevelUpEvent -= new Action(this.CheckPopups);
			Player.playerLoadedEvent -= new Action(this.CheckPopups);
			Player.playerRateMeEvent -= new Action(this.CheckPopups);
			Player.playerParamsChangedEvent -= new Action(this.CheckPopups);
			MailMessenger.Unsubscribe(this);
		}

		private void CheckPopups()
		{
			if (Player.isLoaded)
			{
				Player.ParseInbox();
				this.CheckRateMePopup();
				this.CheckAndShowLevelUp();
			}
		}

		private void CheckAndShowLevelUp()
		{
			if (Player.lastLevelUpInfo != null && !Player.lastLevelUpInfo.used)
			{
				LevelUpPopup.Create(null, null);
			}
		}

		private void CheckRateMePopup()
		{
			if (Player.isNeedShowRateMe)
			{
				Player.isNeedShowRateMe = false;
				RateMePopup.Create();
			}
		}

		public void MailReceived(RateAppMailMessage mailMessage)
		{
			MailMessenger.MarkMessageAsRead(mailMessage);
			RateUsPopup.Create(mailMessage.WithCheckboxes, mailMessage.ShowReason);
		}
	}
}

以上

管理員團隊

敬上