This commit is contained in:
parent
a306bcad2c
commit
2c00ef06a2
|
@ -211,7 +211,7 @@ public class Microwaveweapon : MonoBehaviour
|
|||
{
|
||||
if (miceopos!=null)
|
||||
{
|
||||
microblog.MicrowaveDisplay(micdistance / 10);
|
||||
microblog.MicrowaveDisplay(micdistance);
|
||||
Closeattack(miceopos);
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ public class Microwaveweapon : MonoBehaviour
|
|||
//接收激光下发的位置
|
||||
Vector3 vector =new Vector3(float.Parse(data[2]), float.Parse(data[3]),float.Parse(data[4]));
|
||||
microwavemoder.transform.DOLookAt(vector, 0.1f).SetEase(Ease.Linear).OnComplete(() => {
|
||||
microblog.MicrowaveDisplay(micdistance / 10);
|
||||
microblog.MicrowaveDisplay(micdistance);
|
||||
StartCoroutine(Offlaserstrike());
|
||||
});
|
||||
|
||||
|
|
|
@ -162,6 +162,15 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
|||
{
|
||||
equipmentCommon.GetComponent<TerrestrialRadioInterferenceManger>().InterferingFrequency = info[2];
|
||||
}
|
||||
else if (info[0] == "KeyTarget")
|
||||
{
|
||||
HighPriorityTarget highPriorityTarget= HighPriorityTarget.HighPriorityTargets.Find(x => x.Number == info[1]);
|
||||
if(highPriorityTarget)
|
||||
{
|
||||
Vector3 Pos=new Vector3(float.Parse(info[3]), float.Parse(info[4]), float.Parse(info[5]));
|
||||
highPriorityTarget.BeAssaulted(Pos, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (equipmentCommon)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using AdamSync;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -16,8 +15,10 @@ public class HighPriorityTarget : MonoBehaviour
|
|||
/// 重点设备完整度
|
||||
/// </summary>
|
||||
public static float EquipmentIntegrity = 1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public string Number;
|
||||
#region 单体保护目标属性
|
||||
/// <summary>
|
||||
/// 单体保护目标属性血量
|
||||
|
@ -59,18 +60,37 @@ public class HighPriorityTarget : MonoBehaviour
|
|||
/// <summary>
|
||||
/// 被攻击
|
||||
/// </summary>
|
||||
public void BeAssaulted(Vector3 Pos)
|
||||
/// <param name="Pos">被攻击时触发点位置</param>
|
||||
/// <param name="isSend">是否向外发送同步消息</param>
|
||||
public void BeAssaulted(Vector3 Pos, bool isSend, int hp = 0)
|
||||
{
|
||||
HP -= 10;
|
||||
GameObject Bao = Instantiate(explodePrefab, transform);
|
||||
Bao.transform.localPosition = Pos;
|
||||
Bao.transform.SetParent(null);
|
||||
Bao.SetActive(true);
|
||||
|
||||
if (isSend)
|
||||
{
|
||||
HP -= 10;
|
||||
GameObject Bao = Instantiate(explodePrefab, transform);
|
||||
Bao.transform.localPosition = Pos;
|
||||
Bao.transform.SetParent(null);
|
||||
Bao.SetActive(true);
|
||||
string nowData = GetSyncDis(Pos);
|
||||
Debug.Log(nowData);
|
||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||
}
|
||||
else
|
||||
{
|
||||
HP = hp;
|
||||
}
|
||||
if (HP < 50)
|
||||
{
|
||||
ModerFull.SetActive(false);
|
||||
ModerDamage.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected string GetSyncDis(Vector3 pos)
|
||||
{
|
||||
return string.Format("{0},{1},{2},{3},{4},{5}", "KeyTarget", Number, HP, pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue