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

Dev/v3.1.1 #18

Merged
merged 12 commits into from
Mar 7, 2018
Prev Previous commit
Next Next commit
Revert "调整判断 Object 引用相等的方式"
This reverts commit e726be8.
  • Loading branch information
Jiang Yin committed Jan 29, 2018
commit 199405e5951cfc4a4422a2e6b839369a4fe91e41
6 changes: 3 additions & 3 deletions GameFramework/ObjectPool/ObjectPoolManager.ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void Unspawn(object target)

foreach (Object<T> obj in m_Objects)
{
if (ReferenceEquals(obj.Peek().Target, target))
if (obj.Peek().Target == target)
{
Log.Debug("Object pool '{0}' unspawn '{1}'.", Utility.Text.GetFullName<T>(Name), obj.Peek().Name);
obj.Unspawn();
Expand Down Expand Up @@ -326,7 +326,7 @@ public void SetLocked(object target, bool locked)

foreach (Object<T> obj in m_Objects)
{
if (ReferenceEquals(obj.Peek().Target, target))
if (obj.Peek().Target == target)
{
Log.Debug("Object pool '{0}' set locked '{1}' to '{2}.", Utility.Text.GetFullName<T>(Name), obj.Peek().Name, locked.ToString());
obj.Locked = locked;
Expand Down Expand Up @@ -366,7 +366,7 @@ public void SetPriority(object target, int priority)

foreach (Object<T> obj in m_Objects)
{
if (ReferenceEquals(obj.Peek().Target, target))
if (obj.Peek().Target == target)
{
Log.Debug("Object pool '{0}' set priority '{1}' to '{2}.", Utility.Text.GetFullName<T>(Name), obj.Peek().Name, priority.ToString());
obj.Priority = priority;
Expand Down