-
Notifications
You must be signed in to change notification settings - Fork 450
refactor!: introduce NetVar.ValueRef & convert NetTrans.NetState to struct #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,14 @@ public NetworkVariable(T value) | |
[SerializeField] | ||
private T m_InternalValue; | ||
|
||
/// <summary> | ||
/// The temporary accessor to enable struct element access until [MTT-1020] complete | ||
/// </summary> | ||
public ref T ValueRef | ||
{ | ||
get => ref m_InternalValue; | ||
} | ||
Comment on lines
+69
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this part is introduced by PR #1051 originally, it's here too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is commented temporary, granted, but I'm not familiar with the linked issue. Can you elaborate on why marking the netvar dirty is not needed here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely sure what is the new design direction but I can tell you why NetworkTransform's State still works: we manually mark NetVar to be dirty later in code. So, we don't rely on a get/set prop marking NetVar dirty, we mark the NetVar dirty somewhere else. |
||
|
||
/// <summary> | ||
/// The value of the NetworkVariable container | ||
/// </summary> | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to see what it'd mean to convert from
class
tostruct
(turns out, it's not too bad :P)