• LerpToPosition.cs
  • /
  • /
  • /
  • /
1 using UnityEngine;
2 using
System.Collections;
3
4 public
class LerpToPosition : MonoBehaviour {
5
6     
public GameObject target;
7     
public float speed, height;
8
9
10
11     
void Start()
12     {
13         StartCoroutine(StandardLerp.EaseTranslate (gameObject, target.transform, speed));
14         
//Debug.Log ("test");
15     }
16
17     
/*
18     
void FixedUpdate() {
19         transform.position = Vector3.Lerp (
20             transform.position,
21             target.transform.position +
new Vector3(0,height,0),
22             Time.fixedDeltaTime * speed
23         );
24     }
25     */

26
27
28     
void Update()
29     {
30
31         
32     }
33
34 }


Gõ tìm kiếm nhanh...