Ejemplo n.º 1
0
    private void UpdateValues(UnityAction onCompleted = null)
    {
        values.UpdateProperties(target);

        Debug.LogFormat("Updating properties: {0}", values.properties.ArrayToString());

        string json;

        if (presetProperties.NeedsWrite(out json))
        {
            if (onCompleted == null)
            {
                firebase.SetValueAsync(databasePath, json);
            }
            else
            {
                firebase.SetValueAsync(databasePath, json).ContinueWith(
                    task => {
                    if (task.IsCompleted)
                    {
                        onCompleted.Invoke();
                    }
                }
                    );
            }
        }
    }