SamplyGame.Apple.OnFire C# (CSharp) Method

OnFire() protected method

protected OnFire ( bool byPlayer ) : System.Threading.Tasks.Task
byPlayer bool
return System.Threading.Tasks.Task
		protected override async Task OnFire(bool byPlayer)
		{
			var cache = Application.ResourceCache;
			var node = CreateRigidBullet(byPlayer);
			var model = node.CreateComponent<StaticModel>();
			model.Model = cache.GetModel(Assets.Models.Coin);
			model.SetMaterial(cache.GetMaterial(Assets.Materials.Apple));
			node.SetScale(1);
			node.Rotation = new Quaternion(-40, 0, 0);
			await node.RunActionsAsync(
				new Urho.Actions.Parallel(
					new MoveBy(duration: 3f, position: new Vector3(0, 10 * (byPlayer ? 1 : -1), 0)),
					new RotateBy(duration: 3f, deltaAngleX: 0, deltaAngleY: 360 * 5, deltaAngleZ: 0)));
			node.Remove();
		}