This commit is contained in:
parent
a306bcad2c
commit
2c00ef06a2
|
@ -211,7 +211,7 @@ public class Microwaveweapon : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (miceopos!=null)
|
if (miceopos!=null)
|
||||||
{
|
{
|
||||||
microblog.MicrowaveDisplay(micdistance / 10);
|
microblog.MicrowaveDisplay(micdistance);
|
||||||
Closeattack(miceopos);
|
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]));
|
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(() => {
|
microwavemoder.transform.DOLookAt(vector, 0.1f).SetEase(Ease.Linear).OnComplete(() => {
|
||||||
microblog.MicrowaveDisplay(micdistance / 10);
|
microblog.MicrowaveDisplay(micdistance);
|
||||||
StartCoroutine(Offlaserstrike());
|
StartCoroutine(Offlaserstrike());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,15 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
||||||
{
|
{
|
||||||
equipmentCommon.GetComponent<TerrestrialRadioInterferenceManger>().InterferingFrequency = info[2];
|
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
|
else
|
||||||
{
|
{
|
||||||
if (equipmentCommon)
|
if (equipmentCommon)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using DG.Tweening;
|
using AdamSync;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
@ -16,8 +15,10 @@ public class HighPriorityTarget : MonoBehaviour
|
||||||
/// 重点设备完整度
|
/// 重点设备完整度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float EquipmentIntegrity = 1;
|
public static float EquipmentIntegrity = 1;
|
||||||
|
/// <summary>
|
||||||
|
/// 编号
|
||||||
|
/// </summary>
|
||||||
|
public string Number;
|
||||||
#region 单体保护目标属性
|
#region 单体保护目标属性
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单体保护目标属性血量
|
/// 单体保护目标属性血量
|
||||||
|
@ -59,18 +60,37 @@ public class HighPriorityTarget : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 被攻击
|
/// 被攻击
|
||||||
/// </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);
|
if (isSend)
|
||||||
Bao.transform.localPosition = Pos;
|
{
|
||||||
Bao.transform.SetParent(null);
|
HP -= 10;
|
||||||
Bao.SetActive(true);
|
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)
|
if (HP < 50)
|
||||||
{
|
{
|
||||||
ModerFull.SetActive(false);
|
ModerFull.SetActive(false);
|
||||||
ModerDamage.SetActive(true);
|
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