private void ChangeWayPoint() { if (!move) { return; } Vector3 pos = to3D(meshboard.GetNextPoint(to2D())); Vector3 temp = location.position; wayPoint = (pos != null) ? pos : temp; }
// Vector3 nPos) public void Init() { meshboard = Camera.main.GetComponent<MeshBoard>(); location = transform; location.position = to3D( new Point( 0,7 ) ); wayPoint = to3D( meshboard.GetNextPoint( to2D() ) ); location.LookAt( wayPoint ); location.gameObject.active = true; location.GetChild(0).gameObject.active = true; move = true; }
public void Init() // Vector3 nPos) { meshboard = Camera.main.GetComponent <MeshBoard>(); location = transform; location.position = to3D(new Point(0, 7)); wayPoint = to3D(meshboard.GetNextPoint(to2D())); location.LookAt(wayPoint); location.gameObject.active = true; location.GetChild(0).gameObject.active = true; move = true; }