Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
3546300af1
|
@ -10024,6 +10024,11 @@ MonoBehaviour:
|
|||
imageprs: {fileID: 8234605787508067104}
|
||||
rawImage: {fileID: 2648302242586125239}
|
||||
Mapsize: 0
|
||||
radarCenter: {fileID: 0}
|
||||
targets: []
|
||||
radarBackground: {fileID: 0}
|
||||
targetPointPrefab: {fileID: 206342759773512327, guid: 91611532a57ff5640a422ee5073cdc5f,
|
||||
type: 3}
|
||||
colliders: []
|
||||
attackColliders1: []
|
||||
--- !u!54 &916690897
|
||||
|
|
|
@ -1800,6 +1800,11 @@ PrefabInstance:
|
|||
propertyPath: m_Layer
|
||||
value: 15
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3}
|
||||
--- !u!1 &6311100753636855780 stripped
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &206342759773512327
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2688497756288788902}
|
||||
- component: {fileID: 7290575562297055200}
|
||||
- component: {fileID: 1764915735450254642}
|
||||
m_Layer: 12
|
||||
m_Name: WRJPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2688497756288788902
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 206342759773512327}
|
||||
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}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 29.26, y: 4.95}
|
||||
m_SizeDelta: {x: 9.895126, y: 9.895126}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7290575562297055200
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 206342759773512327}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &1764915735450254642
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 206342759773512327}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.08717966, g: 0, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 91611532a57ff5640a422ee5073cdc5f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -144,6 +144,7 @@ public class RadarManger : MonoBehaviour
|
|||
{
|
||||
//失活摄像机
|
||||
minCamera.gameObject.SetActive(false);
|
||||
radarCenter = this.transform;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
|
@ -154,24 +155,43 @@ public class RadarManger : MonoBehaviour
|
|||
OnActivationChanged += OnActivationChangedHandler;
|
||||
//DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||
}
|
||||
|
||||
public Transform radarCenter;
|
||||
public List<GameObject> targets = new List<GameObject>();
|
||||
public Image radarBackground;
|
||||
public GameObject targetPointPrefab;
|
||||
void Update()
|
||||
{
|
||||
//老师点了开始演习就激活摄像机
|
||||
if (isStartRehearsing)
|
||||
{
|
||||
minCamera.gameObject.SetActive(true);
|
||||
targets = GameObject.FindGameObjectsWithTag("WRJ").ToList().FindAll(a => a.GetComponent<UnmannedAerialVehicleManage>().GetRCS() > float.Parse(RCS));
|
||||
|
||||
foreach (Transform child in rawImage.transform)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
foreach (GameObject target in targets)
|
||||
{
|
||||
Vector3 relativePosition = target.transform.position - radarCenter.position;
|
||||
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
|
||||
GameObject point = Instantiate(targetPointPrefab, rawImage.transform);
|
||||
RectTransform rt = point.GetComponent<RectTransform>();
|
||||
rt.anchoredPosition = radarPosition;
|
||||
}
|
||||
|
||||
}
|
||||
if (onlyOne && equipmentCommon.deviceID.Length > 10)
|
||||
{
|
||||
onlyOne = false;
|
||||
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||
}
|
||||
//if (onlyOne && equipmentCommon.deviceID.Length > 10)
|
||||
//{
|
||||
// onlyOne = false;
|
||||
// DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||
//}
|
||||
Deadzone();//雷达盲区
|
||||
if (Mapsize >1)
|
||||
{
|
||||
Dotsize();//改变雷达地图上显示无人机大小
|
||||
}
|
||||
//if (Mapsize >1)
|
||||
//{
|
||||
// Dotsize();//改变雷达地图上显示无人机大小
|
||||
//}
|
||||
}
|
||||
|
||||
private void Dotsize()
|
||||
|
@ -179,12 +199,12 @@ public class RadarManger : MonoBehaviour
|
|||
GameObject[] wrjdtdx = GameObject.FindGameObjectsWithTag("WRJ");
|
||||
for (int i = 0; i < wrjdtdx.Length; i++)
|
||||
{
|
||||
if (wrjdtdx[i].gameObject.tag=="WRJ"&& equipmentCommon.isPlayer)
|
||||
if (wrjdtdx[i].gameObject.tag == "WRJ" && equipmentCommon.isPlayer)
|
||||
{
|
||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = wrjdtdx[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||
if (unmannedAerialVehicleManage&& unmannedAerialVehicleManage.gamemap)
|
||||
if (unmannedAerialVehicleManage && unmannedAerialVehicleManage.gamemap)
|
||||
{
|
||||
unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize,1,Mapsize);
|
||||
unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize, 1, Mapsize);
|
||||
//Debug.Log("改变了无人机显示大小");
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +212,7 @@ public class RadarManger : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 启动暂停
|
||||
/// <summary>
|
||||
/// 导条变化调用
|
||||
|
@ -366,18 +386,18 @@ public class RadarManger : MonoBehaviour
|
|||
{
|
||||
for (int i = 0; i < colliders2.Count; i++)
|
||||
{
|
||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||
if (unmannedAerialVehicle)
|
||||
{
|
||||
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
||||
if (!isnearBlindArea)
|
||||
continue;
|
||||
attackColliders1.Add(colliders[i]);
|
||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null&& x.isLasing == false&& x.lasertime <= 0));
|
||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0));
|
||||
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => x != null && x.ismicow == false);
|
||||
if (laserFireControlPlatformManger)
|
||||
{
|
||||
laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime+1.5f;
|
||||
laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime + 1.5f;
|
||||
laserFireControlPlatformManger.isLasing = true;
|
||||
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||
laserFireControlPlatformManger.Lasing();
|
||||
|
|
|
@ -162,6 +162,11 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
public string opticalReconnaissanceCapability;
|
||||
|
||||
#endregion
|
||||
public float GetRCS()
|
||||
{
|
||||
return float.Parse(RCS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 频段设置面板
|
||||
/// </summary>
|
||||
|
@ -752,7 +757,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
FireSpeed = 0;
|
||||
}
|
||||
}
|
||||
CheckRSC();
|
||||
//CheckRSC();
|
||||
if (i == (weaponitemone.Count - 1))
|
||||
{
|
||||
StartCoroutine(WeaponitemoneDataAddition());
|
||||
|
@ -1158,7 +1163,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
{
|
||||
isMove = false;
|
||||
gamePos.gameObject.SetActive(true);
|
||||
gamemap.gameObject.SetActive(true);
|
||||
//gamemap.gameObject.SetActive(true);
|
||||
Vector3 _positions = positions.Dequeue();
|
||||
var nowData = GetSyncData(_positions);
|
||||
MyNetMQClient.instance.Send(nowData);
|
||||
|
@ -1176,7 +1181,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
||||
{
|
||||
gamePos.gameObject.SetActive(true);
|
||||
gamemap.gameObject.SetActive(true);
|
||||
//gamemap.gameObject.SetActive(true);
|
||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||
float _time = _distance / FireSpeed;
|
||||
|
|
Loading…
Reference in New Issue