コード例 #1
0
    TextMovementAnimation createNewTextAnimation()
    {
        GameObject            newScoreText = Instantiate(FlyingScoreText, uiCanvas);
        TextMovementAnimation newText      = newScoreText.GetComponent <TextMovementAnimation>();

        textMovements.Add(newText);
        return(newText);
    }
コード例 #2
0
    void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
    {
        CollectableItems.Collectable collectable = collectablePickedup.Collectable;

        if (collectable.GetItemValue() > 0)
        {
            TextMovementAnimation textMovement = GetUnusedText();
            textMovement.StartPosition = mainCamera.WorldToScreenPoint(collectable.GetCollectablePosition() + Vector3.up);
            textMovement.EndPosition   = scoreIndicator.transform.position + Offset;
            textMovement.SetScoreText(string.Format("+ {0}", collectable.GetItemValue()));
            textMovement.PlayAnimation();
        }
    }