Ejemplo n.º 1
0
 void Update()
 {
     if (aiTribe.GetCharacterCount() <= 0)
     {
         Application.LoadLevel(2);
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        woodValueText.text   = "Wood: " + playerTribe.GetResourceAmount("wood");
        rockValueText.text   = "Rocks: " + playerTribe.GetResourceAmount("rock");
        workerValueText.text = "Workers: " + playerTribe.GetCharacterCount();
        foreach (CharacterBehaviour cb in playerTribe.GetCharacters())
        {
            string text = cb.GetName();
            if (cb.CarriedResourceType() != "")
            {
                text += "\nGathered " + cb.CarriedResourceType() + ": " + cb.CarriedResourceAmount();
            }
            cb.nameTextMesh.text = text;
        }
        messagesText.text = "";
        for (int i = messages.Length - 1; i > lastMsgRows - 1; i--)
        {
            messagesText.text += messages[i] + (i > lastMsgRows ? "\n" : "");
        }
        latestMessageText.text = "";
        for (int i = lastMsgRows - 1; i > 0; i--)
        {
            latestMessageText.text += messages[i] + (i > 0 ? "\n" : "");
        }
        latestMessageText.text += messages [0];

        if (lastPostTime + messageCooldown < Time.fixedTime && messageCooldown > 0 && !freeze)
        {
            PostMessage("", false);
        }

        if (!started)
        {
            started = true;
            PostMessage("Press the button on the right (and slightly above) to continue.", true);
        }
    }