(client) chore:Clean code
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using Base;
|
||||
using Data;
|
||||
using Prefab;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
@ -10,7 +8,7 @@ namespace Entity
|
||||
{
|
||||
public Entity bulletSource;
|
||||
public float lifeTime = 10;
|
||||
|
||||
|
||||
public override void SetTarget(Vector3 pos)
|
||||
{
|
||||
base.SetTarget(pos);
|
||||
@ -20,7 +18,7 @@ namespace Entity
|
||||
protected override void AutoBehave()
|
||||
{
|
||||
TryMove();
|
||||
lifeTime-=Time.deltaTime;
|
||||
lifeTime -= Time.deltaTime;
|
||||
if (lifeTime <= 0)
|
||||
{
|
||||
Kill();
|
||||
@ -55,7 +53,7 @@ namespace Entity
|
||||
|
||||
// 计算当前向上方向与目标方向之间的角度
|
||||
var angle = Mathf.Atan2(targetDirection.y, targetDirection.x) * Mathf.Rad2Deg;
|
||||
|
||||
|
||||
|
||||
// 应用旋转
|
||||
transform.rotation = Quaternion.Euler(0f, 0f, angle);
|
||||
|
Reference in New Issue
Block a user