Пример #1
0
    public void SpawnXpReceivedText(int xp, XpReceivedText.ReceiveXpAnimation animation)
    {
        GameObject    go            = Instantiate(xpReceivedTextPrefab, uiCanvas);
        RectTransform rectTransform = go.GetComponent <RectTransform>();
        Vector3       spawnPosition = GetRandomSpawnPositionWithinBounds(rectTransform);

        rectTransform.anchoredPosition = spawnPosition;
        go.GetComponentInChildren <XpReceivedText>().Play(xp, animation);
    }
Пример #2
0
 public void ReceiveXP(int xp, XpReceivedText.ReceiveXpAnimation animation)
 {
     SetCurrentXP(xp);
     ui.SpawnXpReceivedText(xp, animation);
     ui.SetXP(currentXP);
     if (XPIsMaxedOut())
     {
         LevelUp();
     }
 }