Compare commits
2 Commits
da8a13cf40
...
4030e6ea11
Author | SHA1 | Date |
---|---|---|
|
4030e6ea11 | |
|
04c7431319 |
|
@ -0,0 +1,128 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2778715354047445530
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2778715354047445528}
|
||||
- component: {fileID: 2778715354047445531}
|
||||
m_Layer: 0
|
||||
m_Name: InnerLaserlineRenderer1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2778715354047445528
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2778715354047445530}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!120 &2778715354047445531
|
||||
LineRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2778715354047445530}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 0
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 0
|
||||
m_RayTracingMode: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 3a76c8e4586908d47819bbffbeebf94d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Positions: []
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
colorGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 0.30365106, g: 0.9811321, b: 0.06941971, a: 1}
|
||||
key1: {r: 1, g: 1, b: 1, a: 1}
|
||||
key2: {r: 0, g: 0, b: 0, a: 0}
|
||||
key3: {r: 0, g: 0, b: 0, a: 0}
|
||||
key4: {r: 0, g: 0, b: 0, a: 0}
|
||||
key5: {r: 0, g: 0, b: 0, a: 0}
|
||||
key6: {r: 0, g: 0, b: 0, a: 0}
|
||||
key7: {r: 0, g: 0, b: 0, a: 0}
|
||||
ctime0: 65535
|
||||
ctime1: 65535
|
||||
ctime2: 0
|
||||
ctime3: 0
|
||||
ctime4: 0
|
||||
ctime5: 0
|
||||
ctime6: 0
|
||||
ctime7: 0
|
||||
atime0: 0
|
||||
atime1: 65535
|
||||
atime2: 0
|
||||
atime3: 0
|
||||
atime4: 0
|
||||
atime5: 0
|
||||
atime6: 0
|
||||
atime7: 0
|
||||
m_Mode: 0
|
||||
m_NumColorKeys: 2
|
||||
m_NumAlphaKeys: 2
|
||||
numCornerVertices: 0
|
||||
numCapVertices: 0
|
||||
alignment: 0
|
||||
textureMode: 0
|
||||
shadowBias: 0.5
|
||||
generateLightingData: 0
|
||||
m_UseWorldSpace: 0
|
||||
m_Loop: 0
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f064c02e94ae7374bad17615eb677c26
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,128 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2584644335633137912
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2584644335633137910}
|
||||
- component: {fileID: 2584644335633137911}
|
||||
m_Layer: 0
|
||||
m_Name: OuterLaserlineRenderer1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2584644335633137910
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2584644335633137912}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!120 &2584644335633137911
|
||||
LineRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2584644335633137912}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 0
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 0
|
||||
m_RayTracingMode: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 577497e0a437355459fb96d45abf0338, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Positions: []
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 2
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
colorGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 0, b: 0, a: 1}
|
||||
key1: {r: 1, g: 0, b: 0, a: 1}
|
||||
key2: {r: 0, g: 0, b: 0, a: 0}
|
||||
key3: {r: 0, g: 0, b: 0, a: 0}
|
||||
key4: {r: 0, g: 0, b: 0, a: 0}
|
||||
key5: {r: 0, g: 0, b: 0, a: 0}
|
||||
key6: {r: 0, g: 0, b: 0, a: 0}
|
||||
key7: {r: 0, g: 0, b: 0, a: 0}
|
||||
ctime0: 0
|
||||
ctime1: 65535
|
||||
ctime2: 0
|
||||
ctime3: 0
|
||||
ctime4: 0
|
||||
ctime5: 0
|
||||
ctime6: 0
|
||||
ctime7: 0
|
||||
atime0: 0
|
||||
atime1: 65535
|
||||
atime2: 0
|
||||
atime3: 0
|
||||
atime4: 0
|
||||
atime5: 0
|
||||
atime6: 0
|
||||
atime7: 0
|
||||
m_Mode: 0
|
||||
m_NumColorKeys: 2
|
||||
m_NumAlphaKeys: 2
|
||||
numCornerVertices: 0
|
||||
numCapVertices: 0
|
||||
alignment: 0
|
||||
textureMode: 0
|
||||
shadowBias: 0.5
|
||||
generateLightingData: 0
|
||||
m_UseWorldSpace: 0
|
||||
m_Loop: 0
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 477f618dc259ebb41afe8c6608a44544
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2326,7 +2326,7 @@ GameObject:
|
|||
- component: {fileID: -6342104493674816539}
|
||||
m_Layer: 0
|
||||
m_Name: "\u5FAE\u6CE2\u6B66\u5668"
|
||||
m_TagString: Untagged
|
||||
m_TagString: AttackTarget
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
@ -2382,6 +2382,20 @@ MonoBehaviour:
|
|||
Microwavedamagetime:
|
||||
Microwaveinterferencedistance:
|
||||
MicrowaveinterferenceAngle:
|
||||
ismicow: 0
|
||||
microwavemoder: {fileID: 1644062476028321268}
|
||||
microwavepoint: {fileID: 5778623683364182569}
|
||||
miceopos: {fileID: 0}
|
||||
InnerLaserlineRendererPrefab1: {fileID: 2778715354047445530, guid: f064c02e94ae7374bad17615eb677c26,
|
||||
type: 3}
|
||||
OuterLaserlineRendererPrefab1: {fileID: 2584644335633137912, guid: 477f618dc259ebb41afe8c6608a44544,
|
||||
type: 3}
|
||||
InnerLaserlineRenderer1: {fileID: 0}
|
||||
OuterLaserlineRenderer1: {fileID: 0}
|
||||
micspeed: 20
|
||||
microwtimer: 0
|
||||
Destructioneffect: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
||||
type: 3}
|
||||
--- !u!1 &1644179144300041678
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -10111,7 +10111,6 @@ MonoBehaviour:
|
|||
Front: 1
|
||||
Detection: {fileID: 3494968556799403172, guid: c20b9fea41a9bce4e8780bab3d0e13f9,
|
||||
type: 3}
|
||||
Receivingposin: {fileID: 0}
|
||||
--- !u!114 &7615181139496386323
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -5768,7 +5768,7 @@ GameObject:
|
|||
- component: {fileID: 63964881690402892}
|
||||
m_Layer: 0
|
||||
m_Name: "\u9891\u8C31\u63A2\u6D4B"
|
||||
m_TagString: Untagged
|
||||
m_TagString: AttackTarget
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
|
|
@ -10,7 +10,6 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 343842254875067695}
|
||||
- component: {fileID: 343842254875067688}
|
||||
- component: {fileID: 343842254875067689}
|
||||
m_Layer: 0
|
||||
m_Name: Minimap Camera
|
||||
m_TagString: Untagged
|
||||
|
@ -75,11 +74,3 @@ Camera:
|
|||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!81 &343842254875067689
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 343842254875067690}
|
||||
m_Enabled: 1
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
using AdamThinkDevicesData;
|
||||
using AdamSync;
|
||||
using AdamThinkDevicesData;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -6,6 +9,10 @@ using UnityEngine;
|
|||
public class Microwaveweapon : MonoBehaviour
|
||||
{
|
||||
public EquipmentCommon equipment;
|
||||
/// <summary>
|
||||
/// 把自身对象存到链表
|
||||
/// </summary>
|
||||
public static List<Microwaveweapon> MicrowaveweaponList = new List<Microwaveweapon>();
|
||||
#region 微波武器
|
||||
/// <summary>
|
||||
/// 储能间隔时间
|
||||
|
@ -25,10 +32,10 @@ public class Microwaveweapon : MonoBehaviour
|
|||
public string MicrowaveinterferenceAngle;
|
||||
#endregion
|
||||
|
||||
private bool _isStartRehearsing = false;
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// 是否演练开关
|
||||
/// </summary>
|
||||
private bool _isStartRehearsing = false;
|
||||
public bool isStartRehearsing
|
||||
{
|
||||
get { return _isStartRehearsing; }
|
||||
|
@ -42,11 +49,64 @@ public class Microwaveweapon : MonoBehaviour
|
|||
}
|
||||
}
|
||||
public event System.Action<bool> OnActivationChanged;
|
||||
#region
|
||||
/// <summary>
|
||||
/// 看向开关
|
||||
/// </summary>
|
||||
public bool ismicow = false;
|
||||
/// <summary>
|
||||
/// 微波武器打击
|
||||
/// </summary>
|
||||
public GameObject microwavemoder;
|
||||
public GameObject microwavepoint;
|
||||
public Transform miceopos;//看向无人机和打击无人机
|
||||
public GameObject InnerLaserlineRendererPrefab1;//用来发射微波激光武器
|
||||
public GameObject OuterLaserlineRendererPrefab1;//用来绘制射线的
|
||||
public LineRenderer InnerLaserlineRenderer1;
|
||||
public LineRenderer OuterLaserlineRenderer1;
|
||||
/// <summary>
|
||||
/// 微波武器发射的速度
|
||||
/// </summary>
|
||||
public float micspeed = 20;
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 接收每次间隔打击时间
|
||||
/// </summary>
|
||||
public float microwtimer;
|
||||
/// <summary>
|
||||
/// 关闭协程
|
||||
/// </summary>
|
||||
public Coroutine coroutine;
|
||||
/// <summary>
|
||||
/// 击毁特效
|
||||
/// </summary>
|
||||
public GameObject Destructioneffect;
|
||||
void Start()
|
||||
{
|
||||
equipment = GetComponent<EquipmentCommon>();
|
||||
|
||||
MicrowaveweaponList.Add(this);
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
//微波武器进攻的地方
|
||||
GameObject sendgame = Instantiate(InnerLaserlineRendererPrefab1);
|
||||
sendgame.transform.position = Vector3.zero;
|
||||
InnerLaserlineRenderer1 = sendgame.GetComponent<LineRenderer>();
|
||||
if (InnerLaserlineRenderer1)
|
||||
{
|
||||
InnerLaserlineRenderer1.positionCount = 2;
|
||||
InnerLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);
|
||||
InnerLaserlineRenderer1.SetPosition(1, microwavepoint.transform.position);
|
||||
}
|
||||
|
||||
GameObject sendsgames = Instantiate(OuterLaserlineRendererPrefab1);
|
||||
sendsgames.transform.position = Vector3.zero;
|
||||
OuterLaserlineRenderer1 = sendsgames.GetComponent<LineRenderer>();
|
||||
if (OuterLaserlineRenderer1)
|
||||
{
|
||||
OuterLaserlineRenderer1.positionCount = 2;
|
||||
OuterLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);
|
||||
OuterLaserlineRenderer1.SetPosition(1, microwavepoint.transform.position);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 演练是否开始开关
|
||||
|
@ -56,12 +116,61 @@ public class Microwaveweapon : MonoBehaviour
|
|||
if (bol)
|
||||
{
|
||||
Debug.Log("开始演练");
|
||||
Openmode();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("暂停演练");
|
||||
Offmode();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 关闭激光打击
|
||||
/// </summary>
|
||||
private void Offmode()
|
||||
{
|
||||
if (equipment.isPlayer&&coroutine!=null)
|
||||
{
|
||||
StopCoroutine(Timern());
|
||||
coroutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开启激光打击
|
||||
/// </summary>
|
||||
private void Openmode()
|
||||
{
|
||||
if (equipment.isPlayer&&coroutine ==null)
|
||||
{
|
||||
StartCoroutine(Timern());
|
||||
}
|
||||
}
|
||||
public IEnumerator Timern()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return new WaitForSeconds(microwtimer);
|
||||
Debug.LogError("攻击了");
|
||||
if (microwtimer>0&&miceopos!=null)
|
||||
{
|
||||
Launchattack();
|
||||
var newdata = Getmicdata();
|
||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", newdata));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 攻击无人机位置上全
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
protected string Getmicdata()
|
||||
{
|
||||
Debug.Log("上传位置");
|
||||
return string.Format("{0},{1},{2},{3},{4}","Micow", equipment.deviceID, miceopos.transform.position.x,miceopos.transform.position.y,miceopos.transform.position.z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备的参数
|
||||
/// </summary>
|
||||
|
@ -73,6 +182,7 @@ public class Microwaveweapon : MonoBehaviour
|
|||
{
|
||||
case "储能间隔时间:":
|
||||
Storageintervaltime = weaponitemone[i].para_value;
|
||||
microwtimer =float.Parse(Storageintervaltime);
|
||||
break;
|
||||
case "毁伤目标累积作用时间:":
|
||||
Microwavedamagetime = weaponitemone[i].para_value;
|
||||
|
@ -91,6 +201,93 @@ public class Microwaveweapon : MonoBehaviour
|
|||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 微波武器朝向无人机
|
||||
/// </summary>
|
||||
public void Orientation()
|
||||
{
|
||||
if (miceopos != null)
|
||||
{
|
||||
microwavepoint.transform.DOLookAt(miceopos.position, 0.1f).SetEase(Ease.Linear);
|
||||
ismicow = false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 激光发起攻击
|
||||
/// </summary>
|
||||
public void Launchattack()
|
||||
{
|
||||
if (miceopos!=null)
|
||||
{
|
||||
if (InnerLaserlineRenderer1)
|
||||
{
|
||||
InnerLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);
|
||||
InnerLaserlineRenderer1.SetPosition(1, miceopos.transform.position);
|
||||
}
|
||||
if (OuterLaserlineRenderer1)
|
||||
{
|
||||
OuterLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);
|
||||
OuterLaserlineRenderer1.SetPosition(1, miceopos.transform.position);
|
||||
}
|
||||
Closeattack(miceopos);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传服务器即关闭激光
|
||||
/// </summary>
|
||||
/// <param name="pos"></param>
|
||||
/// <returns></returns>
|
||||
private void Closeattack(Transform pos)
|
||||
{
|
||||
UnmannedAerialVehicle unmannedAerialVehicle =pos.GetComponent<UnmannedAerialVehicle>();
|
||||
if (unmannedAerialVehicle!=null)
|
||||
{
|
||||
Destructiondata(unmannedAerialVehicle);
|
||||
StartCoroutine(Offlaserstrike());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 击毁无人机
|
||||
/// </summary>
|
||||
public void Destructiondata(UnmannedAerialVehicle unmannedAerialVehicle)
|
||||
{
|
||||
var newdata = Aeroplane(unmannedAerialVehicle);
|
||||
DeviceManager.Instance.send2roomStr.Enqueue(newdata);
|
||||
GameObject game = Instantiate(Destructioneffect, unmannedAerialVehicle.transform);
|
||||
game.transform.localPosition = Vector3.zero;
|
||||
game.transform.SetParent(null);
|
||||
game.SetActive(true);
|
||||
Destroy(unmannedAerialVehicle.gameObject);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 销毁无人机
|
||||
/// </summary>
|
||||
/// <param name="unmannedAerialVehicle"></param>
|
||||
/// <returns></returns>
|
||||
public string Aeroplane(UnmannedAerialVehicle unmannedAerialVehicle)
|
||||
{
|
||||
return string.Format("{0},{1},{2}","Planedata",unmannedAerialVehicle.unmannedAerialVehicleManage.equipmentCommon.deviceID,unmannedAerialVehicle.serialNumber);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭激光
|
||||
/// </summary>
|
||||
public IEnumerator Offlaserstrike()
|
||||
{
|
||||
yield return new WaitForSeconds(1f);
|
||||
if (InnerLaserlineRenderer1)
|
||||
{
|
||||
InnerLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);//射线起点位置
|
||||
InnerLaserlineRenderer1.SetPosition(1, microwavepoint.transform.position);//射线终点位置
|
||||
}
|
||||
if (OuterLaserlineRenderer1)
|
||||
{
|
||||
OuterLaserlineRenderer1.SetPosition(0, microwavepoint.transform.position);//射线起点位置
|
||||
OuterLaserlineRenderer1.SetPosition(1, microwavepoint.transform.position);//射线终点位置
|
||||
}
|
||||
ismicow = false;
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
void Start()
|
||||
{
|
||||
EquipmentCommon = GetComponent<EquipmentCommon>();
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -108,7 +109,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
}
|
||||
void Update()
|
||||
{
|
||||
Search();
|
||||
Search();//微波武器朝向无人机
|
||||
}
|
||||
/// <summary>
|
||||
/// 搜索范围内的无人机
|
||||
|
@ -120,13 +121,23 @@ public class Spectrumdetection : MonoBehaviour
|
|||
{
|
||||
if (colliders[i].transform.gameObject.tag=="WRJ")
|
||||
{
|
||||
Debug.LogError("进来了");
|
||||
UnmannedAerialVehicle unmannedAerialVehicle = null;
|
||||
if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
||||
{
|
||||
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
||||
if (unmannedAerialVehicle !=null)
|
||||
{
|
||||
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false));
|
||||
if (microwaveweapon)
|
||||
{
|
||||
microwaveweapon.ismicow = true;
|
||||
microwaveweapon.miceopos = unmannedAerialVehicle.transform;
|
||||
microwaveweapon.Orientation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ using Newtonsoft.Json.Linq;
|
|||
public static class InterfaceManager
|
||||
{
|
||||
|
||||
private static string _IP = "172.16.1.128";
|
||||
private static string _IP = "172.16.1.118";
|
||||
public static string IP
|
||||
{
|
||||
get { return _IP; }
|
||||
|
|
Loading…
Reference in New Issue