コード例 #1
0
ファイル: Order.cs プロジェクト: msfredb7/GameJam-Aut2017
        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);
        }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
ファイル: Game.cs プロジェクト: msfredb7/GameJam-Aut2017
    public void Lose()
    {
        if (gameEnded)
        {
            return;
        }
        gameEnded = true;

        NotificationQueue.PushNotification(new Notification()
        {
            text = "You lost", onHide = ReturnToLevelSelect
        });
    }
コード例 #4
0
    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);
        }
    }
コード例 #5
0
    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);
            }
        }
    }