mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 02:35:06 +08:00
Fix parameter synced conflict (#1150)
* fix: parameter should be synced if any of sibling parameter is set to be synced * fix: parameter should be saved/synced if any of menu item references same parameter is set to be saved/synced
This commit is contained in:
parent
b83b89ce38
commit
c80d24ea46
@ -117,8 +117,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
var canBeBool = true;
|
||||
var canBeInt = true;
|
||||
var isSaved = true;
|
||||
var isSynced = true;
|
||||
var isSaved = false;
|
||||
var isSynced = false;
|
||||
|
||||
foreach (var mami in list)
|
||||
{
|
||||
@ -142,8 +142,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
else
|
||||
canBeBool &= mami.Control.value is >= 0 and <= 1;
|
||||
|
||||
isSaved &= mami.isSaved;
|
||||
isSynced &= mami.isSynced;
|
||||
isSaved |= mami.isSaved;
|
||||
isSynced |= mami.isSynced;
|
||||
}
|
||||
|
||||
if (!declaredParams.ContainsKey(paramName))
|
||||
|
@ -116,6 +116,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
|
||||
ResolvedParameter.saved |= info.ResolvedParameter.saved;
|
||||
ResolvedParameter.localOnly &= info.ResolvedParameter.localOnly;
|
||||
}
|
||||
|
||||
public void MergeChild(ParameterInfo info)
|
||||
@ -305,7 +306,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
newParameter.defaultValue = info.ResolvedParameter.HasDefaultValue ? info.ResolvedParameter.defaultValue : parameter.defaultValue;
|
||||
newParameter.name = parameter.name;
|
||||
newParameter.valueType = parameter.valueType;
|
||||
newParameter.networkSynced = parameter.networkSynced;
|
||||
newParameter.networkSynced = parameter.networkSynced || !info.ResolvedParameter.localOnly;
|
||||
newParameter.saved = parameter.saved || info.ResolvedParameter.saved;
|
||||
|
||||
return newParameter;
|
||||
|
Loading…
Reference in New Issue
Block a user