Ejemplo n.º 1
0
 void Start()
 {
     text.enabled = false;
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     startingScale = transform.localScale;
 }
Ejemplo n.º 2
0
    private void LevelUp()
    {
        int targetLevel = DetermineTargetLevel();

        for (int i = level; i < targetLevel; i++)
        {
            ActuallyLevelUp();
        }
        LevelUpTextUpdater.Trigger();
        if (levelUpEffect != null)
        {
            levelUpEffectInstance = Instantiate(levelUpEffect);
            showLevelUpEffect     = true;
            timer = 0f;
        }
        if (GetComponent <AudioSource>() != null)
        {
            GetComponent <AudioSource>().clip = levelUpSound;
            GetComponent <AudioSource>().Play();
        }
    }