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
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Thumbs Up Can't delete connection lacota 3 6 03-16-2024, 11:34 AM
Last Post: _Aka_
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 4 13 11-27-2023, 01:04 PM
Last Post: _Aka_
  Connection "next' control point jh092 3 15 11-22-2023, 11:47 AM
Last Post: _Aka_

Forum Jump: