You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.9 KiB
70 lines
2.9 KiB
using AX.MessageSystem; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
public class PlanView : BaseToggle |
|
{ |
|
private Transform topNameParent; |
|
private Transform HealthBars; |
|
private GameObject mP_Character; |
|
private Transform hideNameToggle; |
|
|
|
private GameObject mDefaultTarget; |
|
|
|
private string mTglText = "视角切换"; |
|
private string mTglTextA = "预案视角"; |
|
|
|
|
|
void Start() |
|
{ |
|
topNameParent = GameObject.Find("Canvas").transform.Find("TheHeadName"); |
|
HealthBars = GameObject.Find("Canvas").transform.Find("HaemalPanel"); |
|
mP_Character = GameObject.Find("P_AllParent/P_Person/P_Character"); |
|
hideNameToggle = transform.parent.parent.parent.Find("HideName/HideNameToggle"); |
|
|
|
mDefaultTarget = GameObject.Find("Target"); |
|
|
|
} |
|
public override void RespondFun(bool value) |
|
{ |
|
if (value == true) |
|
{ |
|
MessageDispatcher.SendMessage("OBJ_HIDDEN", value); |
|
|
|
GameObject.Find("ViewSwitchToggle").transform.Find("Label").GetComponent<Text>().text = mTglTextA; |
|
|
|
GameObject.Find("Main Camera").GetComponent<CameraManager>().viewType = CameraViewState.PlanView; |
|
GameObject.Find("Main Camera").GetComponent<CameraManager>().ChangeTarget(mDefaultTarget); |
|
GameObject.Find("Main Camera").GetComponent<CameraManager>().ChangeCameraView(mDefaultTarget.transform.position, 40, 5, 100); |
|
|
|
//if (CurrentUserInfo.role != Role.导调组 && CurrentUserInfo.role != Role.总队指挥中心 |
|
// && CurrentUserInfo.role != Role.支队指挥中心 && CurrentUserInfo.role != Role.中队指挥 |
|
// && CurrentUserInfo.role != Role.战斗班长) |
|
//{ |
|
// GameObject.Find("Main Camera").GetComponent<CameraManager>().isThirdPerson = false; |
|
// if (GameObject.Find("Main Camera").GetComponent<CameraManager>().isThirdPerson == false) |
|
// { |
|
// GameObject.Find("Main Camera").GetComponent<CameraManager>().ChangeCameraView(mDefaultTarget.transform.position, 40, 5, 100); |
|
// } |
|
//} |
|
if (topNameParent.gameObject.activeInHierarchy) |
|
{ |
|
topNameParent.gameObject.SetActive(false); |
|
} |
|
if (HealthBars.gameObject.activeInHierarchy) |
|
{ |
|
HealthBars.gameObject.SetActive(false); |
|
} |
|
|
|
//切换到预案视角后,控制角色不能寻路 |
|
SelectedObjs.selectedRolePlay = null; |
|
|
|
transform.parent.parent.Find("ViewSwitchToggle").GetComponent<Toggle>().isOn = false; |
|
//只要点了预案视角 |
|
hideNameToggle.GetComponent<HideTopName>().isPlaneView = true; |
|
hideNameToggle.GetComponent<Toggle>().isOn = false; |
|
} |
|
|
|
//MessageDispatcher.SendMessage("PlaneView_Open", value); |
|
} |
|
}
|
|
|