(client)feat:实现子弹定义以及生成,实现初始化动画,实现血条 (#43)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
@ -10,10 +10,10 @@ namespace Entity
|
||||
public class Character : Entity
|
||||
{
|
||||
public CharacterDef characterDef;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
aiTree = new RandomWander();
|
||||
aiTree = new JobGiver_RandomWander();
|
||||
attributes = new AttributesDef();
|
||||
}
|
||||
|
||||
@ -22,6 +22,17 @@ namespace Entity
|
||||
if (characterDef == null)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public override void TryAttack()
|
||||
{
|
||||
if (IsAttacking)
|
||||
return;
|
||||
if (!Managers.DefineManager.Instance.defines.TryGetValue(nameof(BulletDef), out var def))
|
||||
return;
|
||||
var buttonDef = def.Values.First();
|
||||
Vector3 dir = Utils.MousePosition.GetWorldPosition();
|
||||
Managers.EntityManage.Instance.GenerateBulletEntity((BulletDef)buttonDef, Position,
|
||||
dir - Position, this);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user