You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
847 B
28 lines
847 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using UnityEngine;
|
|
|
|
public class move : MonoBehaviour
|
|
{
|
|
public float Speed = 1f;
|
|
public int num = 0;
|
|
public check check;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (check.Go)
|
|
{
|
|
float step = Speed * Time.deltaTime;
|
|
gameObject.transform.localPosition = new Vector3(Mathf.Lerp(gameObject.transform.localPosition.x, 0, step), Mathf.Lerp(gameObject.transform.localPosition.y, 0.1f + 0.3f * num, step), Mathf.Lerp(gameObject.transform.localPosition.z, -1.1f * num, step));//²åÖµËã·¨
|
|
}
|
|
//gameObject.transform.localPosition = new Vector3(0, 0.1f + 0.3f * num, -1.1f * num);//²åÖµËã·¨
|
|
}
|
|
}
|