Compare commits
2 Commits
96a090910f
...
658c7f664f
Author | SHA1 | Date |
---|---|---|
|
658c7f664f | |
|
9cf7d80ee8 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,10 @@
|
|||
using AdamSync;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Permissions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// 重点保护目标
|
||||
|
@ -44,11 +48,91 @@ public class HighPriorityTarget : MonoBehaviour
|
|||
/// 损坏模型
|
||||
/// </summary>
|
||||
public GameObject ModerDamage;
|
||||
/// <summary>
|
||||
/// 调节频率面板
|
||||
/// </summary>
|
||||
public Image regulate;
|
||||
/// <summary>
|
||||
/// 关闭频率面板
|
||||
/// </summary>
|
||||
public Button buttonreg;
|
||||
/// <summary>
|
||||
/// 频率选择
|
||||
/// </summary>
|
||||
public Toggle toggle1;
|
||||
public Toggle toggle2;
|
||||
public Toggle toggle3;
|
||||
public Toggle toggle4;
|
||||
public Toggle toggle5;
|
||||
public Toggle toggle6;
|
||||
public Toggle toggle7;
|
||||
/// <summary>
|
||||
/// 接收的字段
|
||||
/// </summary>
|
||||
public string frequency;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
HighPriorityTargets.Add(this);
|
||||
Number = HighPriorityTargets.Count.ToString();
|
||||
buttonreg.onClick.AddListener(() =>
|
||||
{
|
||||
regulate.gameObject.SetActive(false);
|
||||
});
|
||||
Interferencefrequency();
|
||||
}
|
||||
|
||||
private void Interferencefrequency()
|
||||
{
|
||||
toggle1.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "HUF";
|
||||
}
|
||||
});
|
||||
toggle2.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "L";
|
||||
}
|
||||
});
|
||||
toggle3.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "S";
|
||||
}
|
||||
});
|
||||
toggle4.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "C";
|
||||
}
|
||||
});
|
||||
toggle5.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "X";
|
||||
}
|
||||
});
|
||||
toggle6.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "Ku";
|
||||
}
|
||||
});
|
||||
toggle7.onValueChanged.AddListener((ison) =>
|
||||
{
|
||||
if (ison)
|
||||
{
|
||||
frequency = "Ka";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
@ -56,6 +140,22 @@ public class HighPriorityTarget : MonoBehaviour
|
|||
{
|
||||
if (Camera.main)
|
||||
KeyObjectiveUI.transform.LookAt(Camera.main.transform);
|
||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
if (EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Physics.Raycast(ray,out hit,1000))
|
||||
{
|
||||
if (hit.collider.gameObject.tag== "AttackTarget" &&hit.transform.GetComponent<HighPriorityTarget>())
|
||||
{
|
||||
regulate.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue