SamplyGame.Aircraft.Play C# (CSharp) Method

Play() public method

Spawn the aircraft and wait until it's exploded
public Play ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
		public Task Play()
		{
			liveTask = new TaskCompletionSource<bool>();
			Health = MaxHealth;
			var node = Node;

			// Define physics for handling collisions
			var body = node.CreateComponent<RigidBody>();
			body.Mass = 1;
			body.Kinematic = true;
			body.CollisionMask = (uint)CollisionLayer;
			CollisionShape shape = node.CreateComponent<CollisionShape>();
			shape.SetBox(CollisionShapeSize, Vector3.Zero, Quaternion.Identity);

			Init();
			node.SubscribeToNodeCollisionStart(OnCollided);
			return liveTask.Task;
		}