You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1008 B
C#
33 lines
1008 B
C#
using Entitas;
|
|
using UnityEngine;
|
|
using Game;
|
|
|
|
public class ShadowSystem : IExecuteSystem, IInitializeSystem
|
|
{
|
|
private IGroup<GameEntity> _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));
|
|
}
|
|
} |