SyncBlackBoard List option?

NodeCanvas Forums Support SyncBlackBoard List option?

This topic contains 1 reply, has 2 voices, and was last updated by  Gavalakis 6 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12801

    scorernb
    Participant

    Hi

    I am not a expert on reflection serialise deserialise , but can any give some directions how to get NodeCanvas Blackboards to act on a change in the List<String> or better my own Data class. The supplied SyncBlackboard.CS works only with the strings, int;’s vectors and so on, the prime properties of Unity, but NodeCanvas has no options for like SyncListsStructs<TO>.
    I also found the “ifsISerializationCallbacks” interface but how to implement these all together.

    Thanks

    #12805

    Gavalakis
    Keymaster

    Hello and sorry for the late reply due to Christmas.

    Are you referring specifically to networking, or just for an event for when a Blackboard variable change?
    If the case is the second, then Blackboard variables have an event which you can subscribe to and which is raised when the variable value change.
    Here is an example code:

    
    public class Example : MonoBehaviour {
    
    	void Start(){
    		var bb = GetComponent<Blackboard>();
    		var variable = bb.GetVariable("myFloat");
    		variable.onValueChanged += OnVariableValueChange;
    	}
    
    	void OnVariableValueChange(string name, object newValue){
    		Debug.Log(string.Format("Variable {0} changed to {1}", name, newValue));
    	}
    }
    

    This can work with any type of variable.
    Let me know if that is indeed what you’ve asked.

    Happy new year!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.