Skip to content
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

Add two separate methods to NetworkVariable as supplements to Value property #3184

Open
babaq opened this issue Dec 29, 2024 · 0 comments
Open
Labels
stat:awaiting triage Status - Awaiting triage from the Netcode team. type:feature New feature, request or improvement

Comments

@babaq
Copy link

babaq commented Dec 29, 2024

Is your feature request related to a problem? Please describe.
In the process of NetworkVariable.Value = value, two parts of operation happen, one is to set the Value, then if new value is different than old value, set NetworkVariable dirty so that remote value get updated and both local and remote OnValueChanged delegate gets called.

But sometimes, we only want to perform one part of operation, e.g. (1) only set the Value without notify remote peer and without invoke OnValueChanged, (2) just notify without touching the Value.

Describe the solution you'd like
add two methods :

public void SetValueWithoutNotify(T value)

public void Notify()

Describe alternatives you've considered
currently as a sub optimal solution, i use this:

NetworkVariable.Value=value; NetworkVariable.ResetDirty();

NetworkVariable.SetDirty(true); NetworkVariable.OnValueChanged(NetworkVariable.Value,NetworkVariable.Value); 

Additional context
Add any other context or screenshots about the feature request here.

@babaq babaq added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:feature New feature, request or improvement labels Dec 29, 2024
@babaq babaq changed the title Add two separate methods as supplements to Value property Add two separate methods to NetworkVariable as supplements to Value property Dec 29, 2024
@babaq babaq changed the title Add two separate methods to NetworkVariable as supplements to Value property Add two separate methods to NetworkVariable as supplements to Value property Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting triage Status - Awaiting triage from the Netcode team. type:feature New feature, request or improvement
Projects
None yet
Development

No branches or pull requests

1 participant