mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
Renamed new parameters hiding existing members
* Renamed new parameters on methods in AtomicTags and ScriptableObjectVariable that hide existing members.
This commit is contained in:
parent
7763f81ede
commit
7f3b08e887
@ -86,36 +86,36 @@ namespace UnityAtoms
|
||||
|
||||
#endregion
|
||||
|
||||
public bool HasTag(string tag)
|
||||
public bool HasTag(string atomicTag)
|
||||
{
|
||||
if (tag == null) return false;
|
||||
return sortedTags.ContainsKey(tag);
|
||||
if (atomicTag == null) return false;
|
||||
return sortedTags.ContainsKey(atomicTag);
|
||||
}
|
||||
|
||||
public void AddTag(StringConstant tag)
|
||||
public void AddTag(StringConstant atomicTag)
|
||||
{
|
||||
if (tag == null || tag.Value == null) return;
|
||||
if (sortedTags.ContainsKey(tag.Value)) return;
|
||||
sortedTags.Add(tag.Value, tag);
|
||||
if (atomicTag == null || atomicTag.Value == null) return;
|
||||
if (sortedTags.ContainsKey(atomicTag.Value)) return;
|
||||
sortedTags.Add(atomicTag.Value, atomicTag);
|
||||
|
||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||
|
||||
// Update static accessors:
|
||||
if (!taggedGOs.ContainsKey(tag.Value)) taggedGOs.Add(tag.Value, new List<GameObject>());
|
||||
taggedGOs[tag.Value].Add(this.gameObject);
|
||||
if (!taggedGOs.ContainsKey(atomicTag.Value)) taggedGOs.Add(atomicTag.Value, new List<GameObject>());
|
||||
taggedGOs[atomicTag.Value].Add(this.gameObject);
|
||||
}
|
||||
|
||||
public void RemoveTag(string tag)
|
||||
public void RemoveTag(string atomicTag)
|
||||
{
|
||||
if (tag == null) return;
|
||||
if (sortedTags.ContainsKey(tag)) return;
|
||||
sortedTags.Remove(tag);
|
||||
if (atomicTag == null) return;
|
||||
if (sortedTags.ContainsKey(atomicTag)) return;
|
||||
sortedTags.Remove(atomicTag);
|
||||
|
||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||
|
||||
// Update static accessors:
|
||||
if (!taggedGOs.ContainsKey(tag)) return; // this should never happen
|
||||
taggedGOs[tag].Remove(this.gameObject);
|
||||
if (!taggedGOs.ContainsKey(atomicTag)) return; // this should never happen
|
||||
taggedGOs[atomicTag].Remove(this.gameObject);
|
||||
}
|
||||
|
||||
public static GameObject FindByTag(string tag)
|
||||
|
@ -23,14 +23,14 @@ namespace UnityAtoms
|
||||
Changed.Raise(Value);
|
||||
}
|
||||
|
||||
public bool SetValue(T value)
|
||||
public bool SetValue(T newValue)
|
||||
{
|
||||
if (!AreEqual(this.value, value))
|
||||
if (!AreEqual(value, newValue))
|
||||
{
|
||||
this.oldValue = this.value;
|
||||
this.value = value;
|
||||
if (Changed != null) { Changed.Raise(value); }
|
||||
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(this.value, this.oldValue); }
|
||||
oldValue = value;
|
||||
value = newValue;
|
||||
if (Changed != null) { Changed.Raise(newValue); }
|
||||
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(value, oldValue); }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user