public static void AddToObject(GameObject where, Vector3 destination, Quaternion rotation) { Destroy(where.GetComponent <MoveToObjectSmooth>()); MoveToObjectSmooth smooth = where.AddComponent <MoveToObjectSmooth>(); smooth.destinationPostition = destination; smooth.destinationRotation = rotation; }
public void OnButtonPressed() { MoveToObjectSmooth.AddToObject(movingObject, cameraPoint.transform.position, cameraPoint.transform.rotation); }