This commit is contained in:
parent
1adc3fba33
commit
c306533ca1
|
@ -833,6 +833,8 @@ MonoBehaviour:
|
|||
toggle5: {fileID: 5382943705491709219}
|
||||
toggle6: {fileID: 6251437642903478223}
|
||||
toggle7: {fileID: 117463751223528660}
|
||||
Frequency:
|
||||
camera: {fileID: 480111845}
|
||||
--- !u!65 &1537869982341012852
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -81,7 +81,10 @@ public class Spectrumdetection : MonoBehaviour
|
|||
/// 最终的波段
|
||||
/// </summary>
|
||||
public string Frequency;
|
||||
|
||||
/// <summary>
|
||||
/// 摄像机显示层数
|
||||
/// </summary>
|
||||
public Camera camera;
|
||||
void Start()
|
||||
{
|
||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
|
@ -102,6 +105,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "HUF";
|
||||
camera.cullingMask = 1 << 16;
|
||||
}
|
||||
});
|
||||
toggle2.onValueChanged.AddListener((ison) =>
|
||||
|
@ -109,6 +113,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "L";
|
||||
camera.cullingMask = 1 << 17;
|
||||
}
|
||||
});
|
||||
toggle3.onValueChanged.AddListener((ison) =>
|
||||
|
@ -116,6 +121,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "S";
|
||||
camera.cullingMask = 1 << 18;
|
||||
}
|
||||
});
|
||||
toggle4.onValueChanged.AddListener((ison) =>
|
||||
|
@ -123,6 +129,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "C";
|
||||
camera.cullingMask = 1 << 19;
|
||||
}
|
||||
});
|
||||
toggle5.onValueChanged.AddListener((ison) =>
|
||||
|
@ -130,6 +137,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "X";
|
||||
camera.cullingMask = 1 << 20;
|
||||
}
|
||||
});
|
||||
toggle6.onValueChanged.AddListener((ison) =>
|
||||
|
@ -137,6 +145,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "Ku";
|
||||
camera.cullingMask = 1 << 21;
|
||||
}
|
||||
});
|
||||
toggle7.onValueChanged.AddListener((ison) =>
|
||||
|
@ -144,6 +153,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
Frequency = "Ka";
|
||||
camera.cullingMask = (1 << 22);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -235,7 +245,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
|
||||
private void Microwavefrequency()
|
||||
{
|
||||
if (frequency.Length>0)
|
||||
if (frequency.Length > 0)
|
||||
{
|
||||
string[] str = frequency.Split(',');
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
|
@ -247,7 +257,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
break;
|
||||
case "L":
|
||||
toggle2.gameObject.SetActive(true);
|
||||
break ;
|
||||
break;
|
||||
case "S":
|
||||
toggle3.gameObject.SetActive(true);
|
||||
break;
|
||||
|
@ -281,7 +291,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void Emittedray()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0)&& UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0")
|
||||
if (Input.GetMouseButtonDown(0) && UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0")
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
|
@ -289,7 +299,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (Physics.Raycast(ray,out hit,1000))
|
||||
if (Physics.Raycast(ray, out hit, 1000))
|
||||
{
|
||||
if (hit.collider.GetComponent<EquipmentCommon>())
|
||||
{
|
||||
|
@ -312,25 +322,25 @@ public class Spectrumdetection : MonoBehaviour
|
|||
Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(Detectionrange) * 100);
|
||||
for (int i = 0; i < colliders.Length; i++)
|
||||
{
|
||||
if (colliders[i].transform.gameObject.tag=="WRJ")
|
||||
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)
|
||||
if (unmannedAerialVehicle != null)
|
||||
{
|
||||
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false));
|
||||
if (microwaveweapon)
|
||||
{
|
||||
microwaveweapon.ismicow = true;
|
||||
microwaveweapon.miceopos = unmannedAerialVehicle.transform;
|
||||
microwaveweapon.miceopos = unmannedAerialVehicle.transform;
|
||||
microwaveweapon.Orientation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,6 +140,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
if (ison)
|
||||
{
|
||||
disturb = "HUF";
|
||||
|
||||
}
|
||||
});
|
||||
toggle2.onValueChanged.AddListener((ison) =>
|
||||
|
|
Loading…
Reference in New Issue