SamsonGame/Assets/Sources/Lean/Transition/Examples/Scripts/RepeatFromCode.cs

18 lines
400 B
C#
Raw Permalink Normal View History

2021-12-29 20:50:11 +03:00
using UnityEngine;
using Lean.Transition;
public class RepeatFromCode : MonoBehaviour
{
void Start()
{
InvokeRepeating("UpAndDown", 0.0f, 2.0f); // Call every 2 seconds
}
void UpAndDown()
{
transform.
localPositionTransition(Vector3.up, 1). // Move up over 1 second
JoinTransition(). // Connect together
localPositionTransition(Vector3.down, 1); // Move down over 1 second
}
}