1234567891011121314151617181920212223242526272829303132 |
- using DG.Tweening;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class NewBehaviourScript : MonoBehaviour
- {
- float times = 0;
- float MoveSpeed = 10;
- // Start is called before the first frame update
- void Start()
- {
- transform.DORotate(new Vector3(0, 200, 0), 10f);
- // transform.DOMove(transform.localPosition+new Vector3(0,0,5), 3f);
- }
- // Update is called once per frame
- void Update()
- {
- // transform.Translate(Vector3.forward * MoveSpeed * Time.deltaTime, Space.Self);
- times += Time.deltaTime;
- if (times > 1)
- {
-
- times = 0;
- transform.DOMove(transform.localPosition + transform.forward, 1f);
- }
- }
- }
|