using Entitas; using UnityEngine; using Game; public class ShadowSystem : IExecuteSystem, IInitializeSystem { private IGroup _entities; public void Initialize() { _entities = Util.GetGroup(GameMatcher.Skill); } public void Execute() { foreach (var entity in _entities) { UpdateSkillPointer(entity); //更新技能指示器 } } public void UpdateSkillPointer(GameEntity entity) { var view = entity.view; if (view.SkillPointerObject == null) { return; } var move = entity.move; var skill = entity.skill; var trans = view.SkillPointerObject.GameObject.transform; var dir = skill.IsRunning ? skill.CastDir : move.MoveDir; trans.position = new Vector3(move.Position.x, move.GroundPosition.y + 0.005f, move.Position.z); trans.localEulerAngles = new Vector3(90, 0, Util.Vec3ToRot(dir)); } }