Ejemplo n.º 1
0
    public void AddOrSubtractLife(object sender, Events.CollectableEventArgs e)
    {
        if (e.collectableObjectData.LifeIfFallOut != 0)
        {
            valueToAdd = e.collectableObjectData.LifeIfFallOut;
        }
        else
        {
            valueToAdd = e.collectableObjectData.LifeIfCollected;
        }

        if (life < 5 || valueToAdd < 0)
        {
            life         += valueToAdd;
            LifeText.text = life.ToString();
            //Debug.Log("Life " + life);
        }

        if (life <= 0)
        {
            Events.instance.EndGameRaiseEvent();
        }
    }
Ejemplo n.º 2
0
 public void InfoChange(object sender, Events.CollectableEventArgs e)
 {
     infoText.color = startColor;
     infoText.text  = e.collectableObjectData.SpecialText;
 }
Ejemplo n.º 3
0
 public void addTime(object sender, Events.CollectableEventArgs e)
 {
     time += e.collectableObjectData.TimeAdd;
     //Debug.Log("Score " + time);
 }
Ejemplo n.º 4
0
 private void ReturnToPool(object sender, Events.CollectableEventArgs e)
 {
     e.collectableGameObject.SetActive(false);
     ActiveGameObjects.RemoveAt(ActiveGameObjects.IndexOf(e.collectableGameObject));
 }
Ejemplo n.º 5
0
 public void AddScore(object sender, Events.CollectableEventArgs e)
 {
     score         += e.collectableObjectData.Points;
     ScoreText.text = score.ToString();
 }