void Update() { rectTransform.position = Camera.main.WorldToScreenPoint(Node.Position); TimeRemaining -= Time.deltaTime; if (TimeRemaining < 0) { clientManager.RemoveFromOrderList(gameObject); Node.Order = null; NotificationQueue.PushNotification("Vous avez manquer une livraison !"); Destroy(gameObject); } else if (TimeRemaining <= clientManager.TimeRemainingWarning) { objectiveWarningObject.GetComponent <Image>().enabled = true; countdownObject.GetComponent <Text>().color = Color.white; } if (Node.pizza.Count > 0) { Node.pizza[0].Destroy(); PizzaAmount--; } countdownObject.GetComponent <Text>().text = Convert.ToString((int)TimeRemaining); pizzaCountObject.GetComponent <Text>().text = Convert.ToString(PizzaAmount); }
private void DelayedNotifications() { remainingSeconds = ConvertMinutesToSeconds(minutes, seconds); float timeToLastMinute = remainingSeconds - 60; Game.DelayedEvents.AddDelayedAction(delegate { NotificationQueue.PushNotification("Il reste une minute."); }, timeToLastMinute); float timeToLastFiveMinutes = remainingSeconds - 300; if (timeToLastFiveMinutes > 0) { Game.DelayedEvents.AddDelayedAction(delegate { NotificationQueue.PushNotification("Il reste 5 minutes."); }, timeToLastFiveMinutes); } float timetoLastTenMinutes = remainingSeconds - 600; if (timetoLastTenMinutes > 0) { Game.DelayedEvents.AddDelayedAction(delegate { NotificationQueue.PushNotification("Il reste 10 minutes."); }, timetoLastTenMinutes); } }
public void Lose() { if (gameEnded) { return; } gameEnded = true; NotificationQueue.PushNotification(new Notification() { text = "You lost", onHide = ReturnToLevelSelect }); }
void CommandCompleted(Node node) { NotificationQueue.PushNotification("Vous avez complété une commande !"); Objectives currentObjectives = Game.Map.cash; int income = currentObjectives.OrderBaseReward + (currentObjectives.RewardPerPizza * node.pizza.Count); currentObjectives.IncomeCash(income); for (int i = 0; i < node.pizza.Count; i++) { Destroy(node.pizza[i].gameObject); } }
void Follow() { Hero hero = Game.HeroManager.getActiveHero(); if (hero != null) { Camera.main.transform.position = new Vector3(hero.transform.position.x, hero.transform.position.y, Camera.main.transform.position.z); } else { if (!isNotifQueued) { isNotifQueued = true; NotificationQueue.PushNotification("Il faut au moins un héro pour le suivre."); DelayManager.LocalCallTo(delegate { isNotifQueued = false; }, 5f, this); } } }