修改学员席位判定逻辑
This commit is contained in:
parent
0eb3599a46
commit
6206bec3f6
|
@ -356,7 +356,6 @@ public class View_Panel2 : XUIPanel
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
ced.subjectID = currentSubjectID;
|
ced.subjectID = currentSubjectID;
|
||||||
ced.SeatID = currentSeatID;
|
ced.SeatID = currentSeatID;
|
||||||
ced.account = currentAccount;
|
ced.account = currentAccount;
|
||||||
|
@ -484,12 +483,10 @@ public class View_Panel2 : XUIPanel
|
||||||
start_training_btn.onClick.AddListener(() =>
|
start_training_btn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
GameMain.model = false;
|
GameMain.model = false;
|
||||||
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||||
//加入房间
|
//加入房间
|
||||||
string RoomName = "joinroom " + currentRoomName;
|
string RoomName = "joinroom " + currentRoomName;
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
///进入导调
|
///进入导调
|
||||||
entering_key_btn.onClick.AddListener(() =>
|
entering_key_btn.onClick.AddListener(() =>
|
||||||
|
@ -613,6 +610,7 @@ public class View_Panel2 : XUIPanel
|
||||||
/// <param name="sdi"></param>
|
/// <param name="sdi"></param>
|
||||||
public void CreateSubjectInfo(List<RSData.SubjectDataItem> sdi)
|
public void CreateSubjectInfo(List<RSData.SubjectDataItem> sdi)
|
||||||
{
|
{
|
||||||
|
UIBootstrap.Instance.GetSubjectInfo(sdi);
|
||||||
DestorySubjectSeatInfo();
|
DestorySubjectSeatInfo();
|
||||||
List<Toggle> allToggles = new List<Toggle>();
|
List<Toggle> allToggles = new List<Toggle>();
|
||||||
bool isAssigned = false;
|
bool isAssigned = false;
|
||||||
|
@ -726,6 +724,7 @@ public class View_Panel2 : XUIPanel
|
||||||
if (upsd.state)
|
if (upsd.state)
|
||||||
{
|
{
|
||||||
submitInstruct.text = "提交成功";
|
submitInstruct.text = "提交成功";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -733,6 +732,8 @@ public class View_Panel2 : XUIPanel
|
||||||
}
|
}
|
||||||
currentSubjectInfo = await AsyncWebReq.Get<RSData.SubjectInfo>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticeseat&PracticeId=" + currentDIPracticeID + "&PracticeSubjectId=" + currentDISubjectID);
|
currentSubjectInfo = await AsyncWebReq.Get<RSData.SubjectInfo>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticeseat&PracticeId=" + currentDIPracticeID + "&PracticeSubjectId=" + currentDISubjectID);
|
||||||
CreateSubjectInfo(currentSubjectInfo.data);
|
CreateSubjectInfo(currentSubjectInfo.data);
|
||||||
|
|
||||||
|
UIBootstrap.Instance.GetSubjectInfo(currentSubjectInfo.data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,14 @@ public class GameManager : MonoBehaviour
|
||||||
spt.gameObject.transform.position = spawnPos.position;
|
spt.gameObject.transform.position = spawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true);
|
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true);
|
||||||
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.roomID) == "0")
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
||||||
|
}
|
||||||
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
||||||
tenkokuModule.mainCamera = spt.transform;
|
tenkokuModule.mainCamera = spt.transform;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +69,14 @@ public class GameManager : MonoBehaviour
|
||||||
spt.gameObject.transform.position = spawnPos.position;
|
spt.gameObject.transform.position = spawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), false);
|
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), false);
|
||||||
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(data[3]) == "0")
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "offline":
|
case "offline":
|
||||||
|
@ -84,6 +100,14 @@ public class GameManager : MonoBehaviour
|
||||||
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), false);
|
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), false);
|
||||||
spt.transform.position = new Vector3(spawnPos.position.x + index * 0.5f, spawnPos.position.y, spawnPos.position.z + index * 0.5f);
|
spt.transform.position = new Vector3(spawnPos.position.x + index * 0.5f, spawnPos.position.y, spawnPos.position.z + index * 0.5f);
|
||||||
spt.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(userInfo[2]) == "0")
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
||||||
|
}
|
||||||
userIds.Add(ulong.Parse(userInfo[0]));
|
userIds.Add(ulong.Parse(userInfo[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
public string sceneInfoUrl;
|
public string sceneInfoUrl;
|
||||||
public Editinformation editinformation = new Editinformation();
|
public Editinformation editinformation = new Editinformation();
|
||||||
public SceneRoot currentSceneInfo = new SceneRoot();
|
public SceneRoot currentSceneInfo = new SceneRoot();
|
||||||
|
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
|
||||||
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
|
@ -34,7 +34,27 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
string _url = sceneInfoUrl + roomId;
|
string _url = sceneInfoUrl + roomId;
|
||||||
//Debug.LogError(_url);
|
//Debug.LogError(_url);
|
||||||
currentSceneInfo = await AsyncWebReq.Get<SceneRoot>(_url);
|
currentSceneInfo = await AsyncWebReq.Get<SceneRoot>(_url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public void GetSubjectInfo(List<RSData.SubjectDataItem> sdi)
|
||||||
|
{
|
||||||
|
subjectInfo = sdi;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string GetRoleByIDPracticeId(string practiceID)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < subjectInfo.Count; i++)
|
||||||
|
{
|
||||||
|
if (subjectInfo[i].SeatId == practiceID)
|
||||||
|
{
|
||||||
|
return subjectInfo[i].Role;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void OnGetRooms(string msg)
|
public void OnGetRooms(string msg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,11 +31,11 @@ namespace AdamSync
|
||||||
isPlayer = _isPlayer;
|
isPlayer = _isPlayer;
|
||||||
if (!_isPlayer)
|
if (!_isPlayer)
|
||||||
{
|
{
|
||||||
Destroy(gameObject.GetComponent<Camera>());
|
|
||||||
Destroy(gameObject.GetComponent<SimpleCameraController>());
|
|
||||||
Destroy(gameObject.GetComponent<HighlightingRenderer>());
|
Destroy(gameObject.GetComponent<HighlightingRenderer>());
|
||||||
|
Destroy(gameObject.GetComponent<SimpleCameraController>());
|
||||||
Destroy(gameObject.GetComponent<PostProcessLayer>());
|
Destroy(gameObject.GetComponent<PostProcessLayer>());
|
||||||
Destroy(gameObject.GetComponent<AudioListener>());
|
Destroy(gameObject.GetComponent<AudioListener>());
|
||||||
|
Destroy(gameObject.GetComponent<Camera>());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,8 @@ TagManager:
|
||||||
- Ground
|
- Ground
|
||||||
- WRJ
|
- WRJ
|
||||||
- HuoPao
|
- HuoPao
|
||||||
-
|
- Red
|
||||||
-
|
- Blue
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
|
Loading…
Reference in New Issue