39 lines
1004 B
C#
39 lines
1004 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Temp_Controller : MonoBehaviour {
|
|
|
|
//public Vector3 target;
|
|
//public float speed = 1.0f;
|
|
// Use this for initialization
|
|
void Start () {
|
|
//GameManager.Instance.GeneratePlayers(true);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
//transform.position = Vector3.Lerp(transform.position, target, speed);
|
|
}
|
|
|
|
public float fixedTime = 0.0f;
|
|
|
|
public float target = 5.0f;
|
|
private float fixedDeltaTime = 0.0f;
|
|
|
|
[Space]
|
|
public Vector3 fix = Vector3.zero;
|
|
public Vector3 tar = Vector3.one * 5;
|
|
|
|
public float speed = 2f;
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
//fixedTime = Mathf.Lerp(fixedTime, target, Time.fixedDeltaTime / (target - fixedDeltaTime));
|
|
//fixedDeltaTime += Time.fixedDeltaTime;
|
|
//Debug.Log(string.Format("currentTime:{0}", fixedTime));
|
|
|
|
//transform.position = Vector3.Lerp(transform.position, tar, Time.fixedDeltaTime/(Vector3.Distance(transform.position,tar))*speed);
|
|
}
|
|
}
|