IdleGirl/Assets/2_Codes/MenuMovePattern.cs

25 lines
590 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MenuMovePattern : MonoBehaviour
{
public MenuManager manager;
void Update()
{
Vector3 nextpos = transform.localPosition;
if (nextpos.y < -0.3f)
{
nextpos.x = -0.15f;
nextpos.y += 0.6f;
transform.localPosition = nextpos;
}
nextpos.x += manager.patternSpeed/2 * Time.deltaTime;
nextpos.y -= manager.patternSpeed * Time.deltaTime;
transform.localPosition = nextpos;
}
}