Beispiel #1
0
        public virtual CCPhysicsBody AddBody(CCPhysicsBody body)
        {
            cp.AssertWarn(body != null, "the body can not be nullptr");

            if (body.GetWorld() == this)
            {
                return(null);
            }

            if (body.GetWorld() != null)
            {
                body.RemoveFromWorld();
            }

            AddBodyOrDelay(body);
            _bodies.Add(body);
            body._world = this;

            return(body);
        }
Beispiel #2
0
		public virtual CCPhysicsBody AddBody(CCPhysicsBody body)
		{
			cp.AssertWarn(body != null, "the body can not be nullptr");

			if (body.GetWorld() == this)
				return null;

			if (body.GetWorld() != null)
			{
				body.RemoveFromWorld();
			}

			AddBodyOrDelay(body);
			_bodies.Add(body);
			body._world = this;

			return body;
		}