This commit is contained in:
parent
ab43740c90
commit
414700473b
|
@ -172,6 +172,7 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
||||||
}
|
}
|
||||||
else if (info[0] == "KeyTarget")
|
else if (info[0] == "KeyTarget")
|
||||||
{
|
{
|
||||||
|
Debug.Log("KeyTarget...:" + data);
|
||||||
HighPriorityTarget highPriorityTarget= HighPriorityTarget.HighPriorityTargets.Find(x => x.Number == info[1]);
|
HighPriorityTarget highPriorityTarget= HighPriorityTarget.HighPriorityTargets.Find(x => x.Number == info[1]);
|
||||||
if(highPriorityTarget)
|
if(highPriorityTarget)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,8 @@ public class HighPriorityTarget : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
HighPriorityTargets.Add(this);
|
||||||
|
Number = HighPriorityTargets.Count.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
|
|
@ -254,12 +254,13 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
||||||
{
|
{
|
||||||
while (attackTarget)
|
while (attackTarget)
|
||||||
{
|
{
|
||||||
|
Vector3 v3 = attackTarget.position;
|
||||||
yield return new WaitForSeconds(5f);
|
yield return new WaitForSeconds(5f);
|
||||||
GameObject obj = Instantiate(bulletPrefab, bulletPoint.position, bulletPoint.rotation);
|
GameObject obj = Instantiate(bulletPrefab, bulletPoint.position, bulletPoint.rotation);
|
||||||
obj.SetActive(true);
|
obj.SetActive(true);
|
||||||
//Rigidbody rb = obj.GetComponent<Rigidbody>();
|
//Rigidbody rb = obj.GetComponent<Rigidbody>();
|
||||||
//rb.AddForce(bulletPoint.forward * 20f, ForceMode.Impulse);
|
//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>();
|
ShellBoom sb = obj.AddComponent<ShellBoom>();
|
||||||
sb.isPlayer = unmannedAerialVehicleManage.equipmentCommon.isPlayer;
|
sb.isPlayer = unmannedAerialVehicleManage.equipmentCommon.isPlayer;
|
||||||
sb.onShellAttack.AddListener(() =>
|
sb.onShellAttack.AddListener(() =>
|
||||||
|
|
Loading…
Reference in New Issue