修改学员席位判定逻辑
This commit is contained in:
parent
0eb3599a46
commit
6206bec3f6
|
@ -356,7 +356,6 @@ public class View_Panel2 : XUIPanel
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
ced.subjectID = currentSubjectID;
|
||||
ced.SeatID = currentSeatID;
|
||||
ced.account = currentAccount;
|
||||
|
@ -484,12 +483,10 @@ public class View_Panel2 : XUIPanel
|
|||
start_training_btn.onClick.AddListener(() =>
|
||||
{
|
||||
GameMain.model = false;
|
||||
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||
//加入房间
|
||||
string RoomName = "joinroom " + currentRoomName;
|
||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||
|
||||
|
||||
});
|
||||
///进入导调
|
||||
entering_key_btn.onClick.AddListener(() =>
|
||||
|
@ -613,6 +610,7 @@ public class View_Panel2 : XUIPanel
|
|||
/// <param name="sdi"></param>
|
||||
public void CreateSubjectInfo(List<RSData.SubjectDataItem> sdi)
|
||||
{
|
||||
UIBootstrap.Instance.GetSubjectInfo(sdi);
|
||||
DestorySubjectSeatInfo();
|
||||
List<Toggle> allToggles = new List<Toggle>();
|
||||
bool isAssigned = false;
|
||||
|
@ -726,6 +724,7 @@ public class View_Panel2 : XUIPanel
|
|||
if (upsd.state)
|
||||
{
|
||||
submitInstruct.text = "提交成功";
|
||||
|
||||
}
|
||||
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);
|
||||
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.eulerAngles = spawnPos.eulerAngles;
|
||||
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));
|
||||
tenkokuModule.mainCamera = spt.transform;
|
||||
}
|
||||
|
@ -61,6 +69,14 @@ public class GameManager : MonoBehaviour
|
|||
spt.gameObject.transform.position = spawnPos.position;
|
||||
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
||||
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;
|
||||
case "offline":
|
||||
|
@ -84,6 +100,14 @@ public class GameManager : MonoBehaviour
|
|||
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.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]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
public string sceneInfoUrl;
|
||||
public Editinformation editinformation = new Editinformation();
|
||||
public SceneRoot currentSceneInfo = new SceneRoot();
|
||||
|
||||
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
|
||||
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
@ -34,7 +34,27 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
string _url = sceneInfoUrl + roomId;
|
||||
//Debug.LogError(_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)
|
||||
{
|
||||
|
|
|
@ -31,11 +31,11 @@ namespace AdamSync
|
|||
isPlayer = _isPlayer;
|
||||
if (!_isPlayer)
|
||||
{
|
||||
Destroy(gameObject.GetComponent<Camera>());
|
||||
Destroy(gameObject.GetComponent<SimpleCameraController>());
|
||||
Destroy(gameObject.GetComponent<HighlightingRenderer>());
|
||||
Destroy(gameObject.GetComponent<SimpleCameraController>());
|
||||
Destroy(gameObject.GetComponent<PostProcessLayer>());
|
||||
Destroy(gameObject.GetComponent<AudioListener>());
|
||||
Destroy(gameObject.GetComponent<Camera>());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -17,8 +17,8 @@ TagManager:
|
|||
- Ground
|
||||
- WRJ
|
||||
- HuoPao
|
||||
-
|
||||
-
|
||||
- Red
|
||||
- Blue
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
Loading…
Reference in New Issue