Exemplo n.º 1
0
    protected void Start()
    {
        m_moneyEffect = gameObject.AddComponent <MoneyEffect>();
        m_healthBar   = gameObject.AddComponent <HealthBar>();

        m_healthBar.maxHealth     = m_hp;
        m_healthBar.currentHealth = m_hp;
    }
Exemplo n.º 2
0
    void Start()
    {
        m_moneyEffect = gameObject.AddComponent <MoneyEffect>();
        m_moneyEffect.SetParent(GameObject.Find("counter-money").transform);
        m_moneyEffect.SetOffset(new Vector2(-7, -20));

        m_unitQueueUI = GameObject.Find("unit-queue").GetComponent <UnitQueuUI>();
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (City.currentCompany == null)
        {
            return;
        }

        //make effect when the value changes
        float delta;

        if (City.currentCompany.fund != preProperty)
        {
            delta = City.currentCompany.fund - preProperty;
            MoneyEffect.CreateMoneyEffect(property.transform,
                                          delta > 0 ? ("+" + delta.ToString()) : delta.ToString(),
                                          delta > 0 ? new Color(255, 180, 0) : Color.red); //golden and red
            preProperty = City.currentCompany.fund;
        }
        if (City.currentCompany.fame != preFame)
        {
            delta = City.currentCompany.fame - preFame;
            MoneyEffect.CreateMoneyEffect(reputation.transform,
                                          delta > 0 ? ("+" + delta.ToString()) : delta.ToString(),
                                          delta > 0 ? Color.green : Color.red); //green and red
            preFame = City.currentCompany.fame;
        }
        if (Population.GDP != preGDP)
        {
            delta = Population.GDP - preGDP;
            MoneyEffect.CreateMoneyEffect(GDP.transform,
                                          delta > 0 ? ("+" + delta.ToString()) : delta.ToString(),
                                          delta > 0 ? new Color(255, 180, 0) : Color.red); //golden and red
            preGDP = Population.GDP;
        }
        if (Population.amount != prePopulation)
        {
            delta = Population.amount - prePopulation;
            MoneyEffect.CreateMoneyEffect(population.transform,
                                          delta > 0 ? ("+" + delta.ToString()) : delta.ToString(),
                                          delta > 0 ? Color.green : Color.red); //green and red
            prePopulation = Population.amount;
        }

        //set bottom panel's information displayed
        property.text   = City.currentCompany.fund.ToString();
        reputation.text = City.currentCompany.fame.ToString();
        population.text = Population.amount.ToString();
        GDP.text        = Population.GDP.ToString();
    }
Exemplo n.º 4
0
    void Start()
    {
        m_gptTimer.Reset();

        m_moneyEffect = gameObject.AddComponent <MoneyEffect>();
        m_moneyEffect.SetParent(GameObject.Find("counter-money").transform);
        m_moneyEffect.SetOffset(new Vector2(-7, -20));

        // Reset the money
        m_playerMoney = PLAYER_START_GOLD;
        m_enemyMoney  = ENEMY_START_GOLD;

        // Reset AI variables
        m_playerCities  = new List <PointCity>();
        m_playerFabs    = new List <PointFab>();
        m_playerWonders = new List <PointWonder>();

        m_enemyCities  = new List <PointCity>();
        m_enemyFabs    = new List <PointFab>();
        m_enemyWonders = new List <PointWonder>();
    }
Exemplo n.º 5
0
 void Start()
 {
     m_moneyEffect = gameObject.AddComponent <MoneyEffect>();
 }