11-06-2021, 04:35 PM
(This post was last modified: 11-06-2021, 04:38 PM by josemendez.)
(11-06-2021, 04:18 PM)Hakazaba Wrote: Sorry, new problem. The event rod.Onblueprintloaded is never being triggered
It is for me, tested using this script:
Code:
using UnityEngine;
using Obi;
[RequireComponent(typeof(ObiRod))]
public class OnBlueprint : MonoBehaviour
{
void Awake()
{
GetComponent<ObiRod>().OnBlueprintLoaded += OnBlueprint_OnBlueprintLoaded;
}
private void OnBlueprint_OnBlueprintLoaded(ObiActor actor, ObiActorBlueprint blueprint)
{
Debug.Log("Loaded!");
}
}
Make sure you subscribe to it in Awake(). Blueprints are initially loaded in OnEnable(): if you subscribe to the event later, the blueprint will be already loaded (and hence, the event will not be triggered until the blueprint is re-loaded).