Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Additional fields on a Connection
#1
Hi,

Connections are the important points of a spline system. I like to have additional fields and game objects on a Connection-Point to define by my self.

Is there a way to add field currently without destroying them with the next update of curvy, or reload scene, play/stop?
If yes, how this can be technically solved?

Edit:
Another cool feature would be to have a user Callback/Event/etc directly after a Connection has been created by Curvy.
This is very useful to done some tasks directly. Adding triggers, game object or scrips or whatever.


Thank you.

Similar like this..
[Image: a1.jpg]
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply
#2
Two possible ways:

1.) Inherit a custom class from CurvyConnection. Never tried this, but >should< work.
2.) Attach any component that holds your additional data.

I'd prefer the 2nd approach. It's easier to use and more straight forward.
Reply
#3
2) It adds data to each ControlPoint and not to a Connection. This is not useful.
1) Doesn't works for any reason. Because the Connection Class is embedded into the Segment Class anyhow and return null always while trying to access it.

I want to have additional fields on a Connection not on multiple ControlPoints.

[Image: insp.jpg]
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply
#4
CurvyConnection is an independent component with it's own GameObject, having _CurvyGlobal_ as it's parent.
Reply
#5
(01-22-2016, 05:59 PM)Jake Wrote: CurvyConnection is an independent component with it's own GameObject, having _CurvyGlobal_ as it's parent.

Thanks..

(EDIT)
Means: Search by a editor script through the GameObject._CurvyGlobal_ for any child and add a component with my class values.
Works until here.
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply
#6
Got it to work!
I will post the solution here.
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply
#7
If you add scripts to a connection's Gameobject, use CurvySplineSegment.Connection.gameObject.GetComponent<>() to find your script.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  To dynamic generate the connection between paths Canis 4 670 08-07-2020, 07:33 PM
Last Post: _Aka_
  Connection survives spline duplication rmrmrm 7 1,493 05-22-2020, 01:28 PM
Last Post: _Aka_
  Make connection between 2 control points dazz777 11 3,056 04-17-2020, 01:37 PM
Last Post: _Aka_
  Sync orientation at connection points (Dynamic)) ATHellboy 1 898 02-05-2020, 09:47 PM
Last Post: _Aka_

Forum Jump: