mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -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
|
#endregion
|
||||||
|
|
||||||
public bool HasTag(string tag)
|
public bool HasTag(string atomicTag)
|
||||||
{
|
{
|
||||||
if (tag == null) return false;
|
if (atomicTag == null) return false;
|
||||||
return sortedTags.ContainsKey(tag);
|
return sortedTags.ContainsKey(atomicTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTag(StringConstant tag)
|
public void AddTag(StringConstant atomicTag)
|
||||||
{
|
{
|
||||||
if (tag == null || tag.Value == null) return;
|
if (atomicTag == null || atomicTag.Value == null) return;
|
||||||
if (sortedTags.ContainsKey(tag.Value)) return;
|
if (sortedTags.ContainsKey(atomicTag.Value)) return;
|
||||||
sortedTags.Add(tag.Value, tag);
|
sortedTags.Add(atomicTag.Value, atomicTag);
|
||||||
|
|
||||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||||
|
|
||||||
// Update static accessors:
|
// Update static accessors:
|
||||||
if (!taggedGOs.ContainsKey(tag.Value)) taggedGOs.Add(tag.Value, new List<GameObject>());
|
if (!taggedGOs.ContainsKey(atomicTag.Value)) taggedGOs.Add(atomicTag.Value, new List<GameObject>());
|
||||||
taggedGOs[tag.Value].Add(this.gameObject);
|
taggedGOs[atomicTag.Value].Add(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveTag(string tag)
|
public void RemoveTag(string atomicTag)
|
||||||
{
|
{
|
||||||
if (tag == null) return;
|
if (atomicTag == null) return;
|
||||||
if (sortedTags.ContainsKey(tag)) return;
|
if (sortedTags.ContainsKey(atomicTag)) return;
|
||||||
sortedTags.Remove(tag);
|
sortedTags.Remove(atomicTag);
|
||||||
|
|
||||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||||
|
|
||||||
// Update static accessors:
|
// Update static accessors:
|
||||||
if (!taggedGOs.ContainsKey(tag)) return; // this should never happen
|
if (!taggedGOs.ContainsKey(atomicTag)) return; // this should never happen
|
||||||
taggedGOs[tag].Remove(this.gameObject);
|
taggedGOs[atomicTag].Remove(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject FindByTag(string tag)
|
public static GameObject FindByTag(string tag)
|
||||||
|
@ -23,14 +23,14 @@ namespace UnityAtoms
|
|||||||
Changed.Raise(Value);
|
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;
|
oldValue = value;
|
||||||
this.value = value;
|
value = newValue;
|
||||||
if (Changed != null) { Changed.Raise(value); }
|
if (Changed != null) { Changed.Raise(newValue); }
|
||||||
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(this.value, this.oldValue); }
|
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(value, oldValue); }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user