adding in some needed packages
This commit is contained in:
parent
9e739f5dc8
commit
aba5310742
1012 changed files with 494191 additions and 1 deletions
22
Assets/DamageNumbersPro/Demo/Scripts/DNP_UIMove.cs
Normal file
22
Assets/DamageNumbersPro/Demo/Scripts/DNP_UIMove.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DNP_UIMove : MonoBehaviour
|
||||
{
|
||||
public Vector2 fromPosition;
|
||||
public Vector2 toPosition;
|
||||
public float frequency = 4f;
|
||||
|
||||
RectTransform rectTransform;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
rectTransform.anchoredPosition = Vector2.Lerp(fromPosition, toPosition, Mathf.Sin(Time.time * frequency) * 0.5f + 0.5f);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue