This commit is contained in:
账号名 2024-01-21 16:32:42 +08:00
parent ab43740c90
commit 414700473b
3 changed files with 5 additions and 2 deletions

View File

@ -172,6 +172,7 @@ public class DeviceManager : MonoSingleton<DeviceManager>
}
else if (info[0] == "KeyTarget")
{
Debug.Log("KeyTarget...:" + data);
HighPriorityTarget highPriorityTarget= HighPriorityTarget.HighPriorityTargets.Find(x => x.Number == info[1]);
if(highPriorityTarget)
{

View File

@ -47,7 +47,8 @@ public class HighPriorityTarget : MonoBehaviour
// Start is called before the first frame update
void Start()
{
HighPriorityTargets.Add(this);
Number = HighPriorityTargets.Count.ToString();
}
// Update is called once per frame

View File

@ -254,12 +254,13 @@ public class UnmannedAerialVehicle : MonoBehaviour
{
while (attackTarget)
{
Vector3 v3 = attackTarget.position;
yield return new WaitForSeconds(5f);
GameObject obj = Instantiate(bulletPrefab, bulletPoint.position, bulletPoint.rotation);
obj.SetActive(true);
//Rigidbody rb = obj.GetComponent<Rigidbody>();
//rb.AddForce(bulletPoint.forward * 20f, ForceMode.Impulse);
obj.transform.DOMove(attackTarget.position, 2).SetEase(Ease.Linear);
obj.transform.DOMove(v3, 2).SetEase(Ease.Linear);
ShellBoom sb = obj.AddComponent<ShellBoom>();
sb.isPlayer = unmannedAerialVehicleManage.equipmentCommon.isPlayer;
sb.onShellAttack.AddListener(() =>