示例#1
0
 /// <summary>
 /// 添加角色到Layer(在Layer中添加的角色将自动赋予碰撞检查)
 /// </summary>
 ///
 /// <param name="object"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 public void AddObject(Actor o, float x, float y)
 {
     if (isClose)
     {
         return;
     }
     lock (objects)
     {
         if (this.objects.Add(o))
         {
             o.AddLayer(x, y, this);
             this.collisionChecker.AddObject(o);
             o.AddLayer(this);
         }
     }
 }
示例#2
0
 /// <summary>
 /// 添加角色到Layer(在Layer中添加的角色将自动赋予碰撞检查)
 /// </summary>
 ///
 /// <param name="object"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 public void AddObject(Actor o, float x, float y)
 {
     if (isClose)
     {
         return;
     }
     lock (objects)
     {
         if (this.objects.Add(o))
         {
             o.AddLayer(x, y, this);
             this.collisionChecker.AddObject(o);
             o.AddLayer(this);
         }
     }
 }