Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get CGVolume from CGDataReference
#2
Hi,
The following script worked for me. Does it work for you?

Code:
using FluffyUnderware.Curvy;
using FluffyUnderware.Curvy.Generator;
using UnityEngine;

public class test : MonoBehaviour
{
    [CGDataReferenceSelector(
        typeof(CGVolume)
    )]
    public CGDataReference Volume = new CGDataReference();

    void LateUpdate()
    {
        Debug.Log(Volume.GetData<CGVolume>().Length);
    }
}

Note that this script uses LateUpdate, and not Update, to ensure that the generator gets the time to update first. You can achieve the same effect by setting the execution order of your scripts.
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
Get CGVolume from CGDataReference - by joebain - 10-07-2024, 12:22 PM
RE: Get CGVolume from CGDataReference - by _Aka_ - 10-07-2024, 07:43 PM
RE: Get CGVolume from CGDataReference - by _Aka_ - 10-08-2024, 04:06 PM

Forum Jump: