You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Ugc.Editor is struct, not class type.
The code in the example is executable, but it is not a C# best practice.
To Reproduce
use Calling Code
Calling Code
Steamworks.Ugc.Editor
// The code you're using to call into Steamworks
using UgcEditor = Steamworks.Ugc.Editor;
UgcEditor ugcEditor;
if (xxxFlag)
ugcEditor = UgcEditor.NewCommunityFile;
ugcEditor.WithTitle(title)
.WithDescription("This is a description")
//.WithContent(modDirectory)
.WithContent("C:\\Users\\xxxx\\AppData\\LocalLow\\Company\\AppName\\Mods\\test1");
ProgressView progress = xxx;
progress.BindView(xxx);
ugcEditor.SubmitAsync(progress, null);
Expected behavior
Desktop (please complete the following information):
OS: Windows11 64bit
Unity: Unity 2021.3
Additional context
Add any other context about the problem here.
When I invoke Withxxx function, C# will copy this data with 13 fields, and changed one of them(for example title).We only need one instance instead of re-copying it every time
Generally speaking, chain calls is class not struct. For example, DoTween.Sequence, C# StringBuilder.
I try to provide two solutions:
Please warm this in ReadMe "Publish your own file" block, because this chain calls is not common...orz
using UgcEditor = Steamworks.Ugc.Editor;
var result = UgcEditor.NewCommunityFile
.WithTitle("My New FIle")
.WithDescription("This is a description")
.WithContent("C:\\Users\\xxxx\\AppData\\LocalLow\\Company\\AppName\\Mods\\test1")
.SubmitAsync(null, (PublishResult pr) =>
{
Debug.Log(pr.Result);
});
// UgcEditor is struct
var ugcEditor = UgcEditor.NewCommunityFile;
var ugcEditor2 = ugcEditor.WithContent("directory path here");
// ugcEditor is not equal ugcEditor2,
// call ugcEditor.SubmitAsync() is not equal ugcEditor2.SubmitAsync()
Change type to class, not struct. Or rename Steamworks.Ugc.Editor with Steamworks.Ugc.EditorStruct
People who have been bothered by this issue for 24 hours leave a message here
Describe the bug
Ugc.Editor is struct, not class type.
The code in the example is executable, but it is not a C# best practice.
To Reproduce
use Calling Code
Calling Code
Steamworks.Ugc.Editor
// The code you're using to call into Steamworks
Expected behavior
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Because structure types have value semantics, we recommend you define immutable structure types.
I try to provide two solutions:
People who have been bothered by this issue for 24 hours leave a message hereSame question
#722
The text was updated successfully, but these errors were encountered: