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
  Strange differences between editor and build jamesunity 1 435 07-20-2020, 08:49 PM
Last Post: _Aka_
  Gizmos not showing in the editor 2019.3.1 & 3.6 athos_k 5 1,706 06-15-2020, 01:25 PM
Last Post: _Aka_
  CurvySpline Editor event ATHellboy 1 985 03-08-2020, 01:51 PM
Last Post: _Aka_
  Lots of Allocs in Editor Update (Poor Performance in Editor) TdayMFG 4 1,809 02-06-2020, 10:13 PM
Last Post: _Aka_

Forum Jump: