Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Editor
#1
Hi.

I'm currently making an editor to build a kind of track (instantiating prefabs with a set of connected points from a spline).
Everything works fine, but when i change of scene and come back to the one containing my objects, all connections between splines are lost.

I use : 


Code:
firstPoint.gameObject.GetComponent<CurvySplineSegment>().ConnectTo(lastPoint.gameObject.GetComponent<CurvySplineSegment>(), CurvyConnection.HeadingMode.Sharp, CurvyConnection.SyncMode.SyncPosAndRot);
SceneView.RepaintAll();

any clues ?

I think i found, but could you confirm it's the rught way to do : 



Code:
EditorUtility.SetDirty(firstPoint.GetComponent<CurvySplineSegment>());
EditorUtility.SetDirty(lastPoint.GetComponent<CurvySplineSegment>());

 
Reply
#2
Sounds good. Connections are stored within segments, so you need to make the editor aware something changes, just like you did.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Can't export custom collision meshes Mike Danielsson 5 7 10-14-2022, 10:36 AM
Last Post: _Aka_
  Permission to publish custom CGModule source code? Apelsin 6 9,417 09-15-2022, 08:53 PM
Last Post: Josaf Tom
  Generator window causes my editor to lag every couple seconds niuage 1 3 03-28-2022, 11:05 AM
Last Post: _Aka_
  Unable to create custom deform mesh bit9labs 1 11 03-09-2022, 10:04 AM
Last Post: _Aka_

Forum Jump: