Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Event, if a Preset is loaded?

Discussion in 'Scripting' started by Schwebo, Apr 28, 2023.

  1. Schwebo

    Schwebo

    Joined:
    Apr 12, 2023
    Posts:
    3
    Good morning,

    is there a event which is fired, oder method is called, when my Behavior has loaded the data model (Spline) oder wenn i set a new preset ?

    Code (CSharp):
    1.   public class SplineBehaviour : MonoBehaviour
    2.     {
    3.         [SerializeReference] public Spline Spline = new() { Sampling = 2 };
    4.  
    5.       void OnPresetLoaded() { /* something like that avaiable */}
    6. }
    Thank you
     
  2. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
    Why dont't you just create your own event?
     
  3. Schwebo

    Schwebo

    Joined:
    Apr 12, 2023
    Posts:
    3
    if i drag a "preset" to a game object via mouse, and the preset is loaded, it would be fine if i get informed by an event or callback. hwo Do you mean it , create my own event?
     
  4. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455