Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class BezierExample : MonoBehaviour {
- public GameObject prefab;
- public GameObject start;
- public GameObject objectForCurveNearStart;
- public GameObject objectForCurveNearTarget;
- public GameObject target;
- // Use this for initialization
- void Start () {
- var bez = new Bezier(start.transform.position, objectForCurveNearStart.transform.position, objectForCurveNearTarget.transform.position, target.transform.position);
- bez.CalculatePoints(10);
- foreach (Vector3 point in bez.points)
- {
- Debug.Log(point);
- Instantiate(prefab, point, Quaternion.identity);
- }
- }
- // Update is called once per frame
- void Update () {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment