[v2.7.0] Two Critical Bugs and The Fixes

Forums Announcements [v2.7.0] Two Critical Bugs and The Fixes

This topic contains 2 replies, has 2 voices, and was last updated by  Gavalakis 7 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1583

    Gavalakis
    Keymaster

    In version 2.7 there unfortunately have been two bugs introduced that are breaking the behaviour of existing flowscripts.
    Please follow these steps for fixing those bugs until the new version which is underway is live on the asset store.

    —–

    BUG: Input Port Values are reset to default.
    FIX: Please open up FlowNode.cs and change the “OnBeforeSerialize” method to be exactly like this code:

    
    		void ISerializationCallbackReceiver.OnBeforeSerialize(){
    			if (_inputPortValues == null){
    				_inputPortValues = new Dictionary<string, object>();
    			}
    			foreach (var port in inputPorts.Values.OfType<ValueInput>()){
    				if (!port.isConnected /*&& !port.isDefaultValue*/){
    					_inputPortValues[port.ID] = port.serializedValue;
    				}
    			}
    		}
    

    The difference with the original is that && !port.isDefaultValue is commented out.

    —–

    BUG: Null Reference Exception in Build, when things are working in Editor.
    FIX: Please open up FlowNode.cs and in both the ‘GetInputPort’ and ‘GetOutputPort’ methods, please remove the ‘#if UNITY_EDITOR | #endif’ directive, so that the code within it runs in the build as well.

    For example:

    
    		public Port GetInputPort(string ID){
    			Port input = null;
    			if (!inputPorts.TryGetValue(ID, out input)){
    				// #if UNITY_EDITOR
    				input = inputPorts.Values.FirstOrDefault(p => p.name.SplitCamelCase() == ID );
    				// #endif
    			}
    			return input;
    		}
    

    There is a similar ‘#if UNITY_EDITOR’ directive in the method ‘DeserializePortValues’ which you might also want to remove (keeping the code within the directive).

    —–

    If you encounter any trouble at all applying these changes, please send me an email to ‘support_AT_paradoxnotion’ with a request to send you the fixed version, along with your invoice ID, and I will do so ASAP.

    Thank you.

    #1647

    proepkes
    Participant

    I couldn’t find ‘DeserializePortValues’ but ‘DeserializeInputPortValues’

    #1650

    Gavalakis
    Keymaster

    Hello,
    Thanks. That was a typo error.
    For your information, version 2.7.0f1 that is currently on the asset store, already addresses these issues, so manually applying these changes is no longer needed.
    Thanks!

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

You must be logged in to reply to this topic.