Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import Curvy from json Issue
#1
Hello,

   I am importing a json created by json Utility with a SerializedCurvySpline. 


Code:
  SerializedCurvySpline newSpline = new SerializedCurvySpline(JsonUtility.FromJson<CurvySpline>(File.ReadAllText(pathPath)),CurvySerializationSpace.Global);
           CurvySpline cs = path.AddComponent<CurvySpline>();
           cs = new CurvySpline(newSpline);

I have tried this several ways and it complains about two things.

  1. Assets/Plugins/Curvy/Base/CurvyUISpline.cs(17,18): error CS1729: The type `FluffyUnderware.Curvy.CurvySpline' does not contain a constructor that takes `0' arguments
  2. Says that the constructor of CurvySpline doesn't take one argument. 
Is this something to do with the partial classes and the inheritance in UICurvySpline? How do I make a new CurvySpline from a json?
Reply
#2
Hi,
Those errors are compile time errors, right?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(05-29-2019, 03:17 PM)_Aka_ Wrote: Hi,
Those errors are compile time errors, right?

Yes.

EDIT: THAT IS THE FASTEST RESPONSE EVER!
Reply
#4
Hahaha, thanks. Too bad my second answer is not at the same level of speed. It's not my fault, it's Kojima's Big Grin

About your issue, replace your last line of code with one
Code:
newSpline.WriteIntoSpline(cs, CurvySerializationSpace.Global);
I have to admit that I don't remember if the Start() method is called automatically by Curvy at the same frame when calling AddComponent. If you have any issue with the spline initialization, try calling cs.Start() before using cs
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
(05-29-2019, 04:38 PM)_Aka_ Wrote: Hahaha, thanks. Too bad my second answer is not at the same level of speed. It's not my fault, it's Kojima's Big Grin

About your issue, replace your last line of code with one
Code:
newSpline.WriteIntoSpline(cs, CurvySerializationSpace.Global);
I have to admit that I don't remember if the Start() method is called automatically by Curvy at the same frame when calling AddComponent. If you have any issue with the spline initialization, try calling cs.Start() before using cs

This worked great. Sorry I didn't see that in the docs. Thanks again!
Reply
#6
You are welcome
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Information Curvy 6.0.0 is live _Aka_ 2 94 1 hour ago
Last Post: _Aka_
  Curvy Spline mover is jerky BlankMauser 5 85 08-16-2019, 09:31 PM
Last Post: _Aka_
  Follow Up Spline Issue JHulse95 8 334 07-25-2019, 02:36 PM
Last Post: _Aka_
  UI button to start Curvy Spline in scene funkd 1 126 07-12-2019, 11:19 AM
Last Post: _Aka_

Forum Jump: