private void fromDroppedDangerState() { if (!this.EnemiesPresent) { this.RemoveBannerBlessings(); this.bannerState = BannerState.Unused; } else if (this.wearer != null) { this.lastBearer = this.wearer; this.bannerState = BannerState.WieldedDanger; } }
private void fromWieldedSafeState() { if (this.wearer == null) { this.KillFormerBearer(); this.bannerState = BannerState.Unused; } else if (this.EnemiesPresent) { this.GrantBannerBlessings(); this.bannerState = BannerState.WieldedDanger; } }
public void loadBannerForZoneId(string zoneIdiOS, string zoneIdAndroid, AMR.Enums.AMRSDKBannerPosition position, int offset, bool autoShow) { if (state == BannerState.Loading) { return; } this.zoneIdiOS = zoneIdiOS; this.zoneIdAndroid = zoneIdAndroid; this.position = position; this.offset = offset; this.autoShow = autoShow; this.isConflicted = false; hideBanner(); state = BannerState.Loading; BannerDelegate bDelegate = new BannerDelegate(this); if (Application.platform == RuntimePlatform.IPhonePlayer) { if (zoneIdiOS != null) { Banner = new AMR.iOS.AMRBanner(); Banner.loadBannerForZoneId(zoneIdiOS, position, offset, bDelegate); } } else if (Application.platform == RuntimePlatform.Android) { if (zoneIdAndroid != null) { if (Banner == null) { Banner = new AMR.Android.AMRBanner(); } Banner.loadBannerForZoneId(zoneIdAndroid, position, offset, bDelegate); } } }
private void fromUnusedState() { if (this.wearer != null) { this.lastBearer = this.wearer; if (this.EnemiesPresent) { this.GrantBannerBlessings(); this.bannerState = BannerState.WieldedDanger; } else { this.bannerState = BannerState.WieldedSafe; } } }
private void fromWieldedDangerState() { if (!this.EnemiesPresent) { this.KillFormerBearer(); this.bannerState = BannerState.Unused; } else if (this.wearer == null && this.lastBearer.corpse == null) { this.KillFormerBearer(); this.bannerState = BannerState.Unused; } else if (this.wearer == null) { this.lastBearer = null; this.bannerState = BannerState.DroppedDanger; } }
/// <summary> /// Loads the bottom banner if it is not already loaded or loading /// </summary> private void LoadBottomBanner() { if (bottomBannerState == BannerState.Idle) { if (bottomBanner == null) { // Create the banner view bottomBanner = new BannerView(BannderAdUnitId, AdSize.SmartBanner, AdPosition.Bottom); // Set the event callbacks for the bottom banner bottomBanner.OnAdLoaded += OnBottomBannerLoaded; bottomBanner.OnAdFailedToLoad += OnBottomBannerFailedToLoad; } // Set the state to loading bottomBannerState = BannerState.Loading; // Load and show the banner bottomBanner.LoadAd(CreateAdRequest()); } }
private void setState(BannerState newState) { currentState = newState; WaitPanel.SetActive(newState == BannerState.Wait); RaceInPanel.SetActive(newState == BannerState.RaceIn); JoinRacePanel.SetActive(newState == BannerState.Join); ReadyPanel.SetActive(newState == BannerState.Ready); SetPanel.SetActive(newState == BannerState.Set); GoPanel.SetActive(newState == BannerState.Go); switch (newState) { case BannerState.RaceIn: case BannerState.Join: showCountdown(); break; default: hideCountdown(); break; } }
/// <summary> /// Invoked when the bottom banner fails to load /// </summary> private void OnBottomBannerFailedToLoad(object sender, AdFailedToLoadEventArgs e) { // Failed to load bottom banner, set the state to Idle so we can try and load it again next time bottomBannerState = BannerState.Idle; }
/// <summary> /// Invoked when the bottom banner has loaded /// </summary> private void OnBottomBannerLoaded(object sender, EventArgs args) { // Bottom banner succeffully loaded bottomBannerState = BannerState.Loaded; }
/// <summary> /// Invoked when the top banner has loaded /// </summary> private void OnTopBannerLoaded(object sender, EventArgs args) { // Top banner succeffully loaded topBannerState = BannerState.Loaded; }