public void RemovePoint(int index) { if (wayPointVerticies.Count > index && index > -1) { wayPointVerticies[index].DestroyWayPoint(); wayPointVerticies.RemoveAt(index); OnPathUpdate?.Invoke(); } else { Debug.LogError($"Error: WayPoint with index {index} doesnt exist."); } }
public bool TryAddPoint(Vector3 position) { var intersects = IntersectsAnyPoint(position); if (intersects) { return(false); } var wayPointGameObject = Instantiate(pathEntityConfig.WayPointPrefab, position, pathEntityConfig.WayPointPrefab.transform.rotation); wayPointVerticies.Add(wayPointGameObject.GetComponent <IWayPointEntity>()); OnPathUpdate?.Invoke(); return(true); }
protected void Start() { BgCurve = BgCurve ?? GetComponent <BGCurve>(); OnPathUpdate?.Invoke(); }