using System.Collections; using System.Collections.Generic; using BITKit; using BITKit.Entities; using NodeCanvas.Framework; using Project.B.CharacterController; using UnityEngine; namespace Net.Project.B.NodeCanvas { public class TeleportPlayerTask : ActionTask { public BBParameter Target; protected override void OnExecute() { if (BITApp.ServiceProvider.QueryComponents(out IEntitiesService entitiesService) is false) { EndAction(false); return; } foreach (var (_,characterController) in entitiesService.QueryComponents()) { characterController.Position = Target.value.position; characterController.ViewRotation = Target.value.rotation; } EndAction(true); } } }