Esempio n. 1
0
 void OnGoldChange(GoldChangedEvent e)
 {
     for (int i = 0; i < m_texts.Length; i++)
     {
         m_texts[i].text = e.value.ToString();
     }
 }
Esempio n. 2
0
    void OnGoldChange(GoldChangedEvent e)
    {
        if (m_started)
        {
            return;
        }

        if (e.value <= 0)
        {
            m_started = true;
            SoundSystem.Instance().play(m_defeatSong);
            DOVirtual.DelayedCall(m_stateDelay, () => { SceneSystem.changeScene("DefeatMenu"); });
        }
    }
Esempio n. 3
0
    void OnGoldGain(GoldChangedEvent e)
    {
        if (m_goldGainPrefab != null)
        {
            var obj = Instantiate(m_goldGainPrefab);
            obj.transform.position = transform.position;

            var gain = obj.GetComponentInChildren <GoldGain>();
            if (gain != null)
            {
                gain.SetValue(e.offset);
            }
        }

        if (e.value <= 0)
        {
            OnDeath();
        }
    }