添加更换房间选择界面更换显示图片的逻辑
This commit is contained in:
parent
e374c67368
commit
18119e6161
|
@ -0,0 +1,92 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 45c4f0e4da4e1864e9ecb43b64a592c2
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1 +1 @@
|
|||
172.16.1.254:48888
|
||||
127.0.0.1:48888
|
|
@ -1 +1 @@
|
|||
serverIP=172.16.1.114
|
||||
serverIP=127.0.0.1
|
|
@ -1 +1 @@
|
|||
172.16.1.114
|
||||
127.0.0.1
|
|
@ -303,6 +303,7 @@ public class View_Panel2 : XUIPanel
|
|||
GameObject.Destroy(place.GetChild(i).gameObject);
|
||||
}
|
||||
}
|
||||
UIBootstrap.Instance.GetAllSceneRoots(roomdata);
|
||||
UIBootstrap.Instance.SetRoomdata(roomdata);
|
||||
UIBootstrap.Instance.CheckShowLoad(CreateRoom);
|
||||
//CreateRoom();
|
||||
|
@ -624,24 +625,24 @@ public class View_Panel2 : XUIPanel
|
|||
currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>(url);
|
||||
GameObject.Destroy(roomItem.gameObject);
|
||||
});
|
||||
string roomModelTemp = "";
|
||||
Task task = Task.Run(async () =>
|
||||
{
|
||||
roomModelTemp= await UIBootstrap.Instance.GetSceneModelByRoomID(roomId);
|
||||
});
|
||||
|
||||
Debug.LogError(roomModelTemp);
|
||||
if (GlobalFlag.field_Char1 == "学校")
|
||||
string roomMode = UIBootstrap.Instance.GetRoomModelByThinkingDataAndRoomID(roomItem.name);
|
||||
Debug.Log(UIBootstrap.Instance.GetRoomModelByThinkingDataAndRoomID(roomItem.name));
|
||||
if (roomMode == "学校")
|
||||
{
|
||||
roomItem.transform.Find("view_imag").GetComponent<Image>().sprite = xuexiao;
|
||||
}
|
||||
else if (GlobalFlag.field_Char1 == "山地")
|
||||
else if (roomMode == "山地")
|
||||
{
|
||||
roomItem.transform.Find("view_imag").GetComponent<Image>().sprite = shandi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ChanageImage(string roomModel)
|
||||
{
|
||||
Debug.LogError(roomModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public RSData.SubjectInfo currentSubjectInfo = new RSData.SubjectInfo();
|
||||
public string currentDIPracticeID;
|
||||
|
@ -896,8 +897,8 @@ public class View_Panel2 : XUIPanel
|
|||
//创建房间
|
||||
if (roomState.message == "success")
|
||||
{
|
||||
Debug.LogError(returnRoomId.data);
|
||||
Debug.LogError(currentRoomName);
|
||||
//Debug.LogError(returnRoomId.data);
|
||||
//Debug.LogError(currentRoomName);
|
||||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
||||
refresh_btn.onClick?.Invoke();
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
private string sceneInfoUrl;
|
||||
public Editinformation editinformation = new Editinformation();
|
||||
public SceneRoot currentSceneInfo = new SceneRoot();
|
||||
public List<SceneRoot> sceneRoots = new List<SceneRoot>();
|
||||
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
|
||||
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
||||
public AdamThinkDevicesData.DeviceData thinkDevicesData = new AdamThinkDevicesData.DeviceData();
|
||||
|
@ -46,6 +47,8 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
public async void GetSceneData(string roomId)
|
||||
{
|
||||
string _url = sceneInfoUrl + roomId;
|
||||
|
@ -55,13 +58,6 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
|
||||
}
|
||||
|
||||
public async Task<string> GetSceneModelByRoomID(string roomId)
|
||||
{
|
||||
string _url = sceneInfoUrl + roomId;
|
||||
//Debug.LogError(_url);
|
||||
currentSceneInfo = await AsyncWebReq.Get<SceneRoot>(_url);
|
||||
return currentSceneInfo.data.Field_Char1;
|
||||
}
|
||||
public void GetSubjectInfo(List<RSData.SubjectDataItem> sdi)
|
||||
{
|
||||
subjectInfo = sdi;
|
||||
|
@ -98,6 +94,31 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
public async void GetAllSceneRoots(RoomData roomId)
|
||||
{
|
||||
for (int i = 0; i < roomId.data.Count; i++)
|
||||
{
|
||||
SceneRoot s = new SceneRoot();
|
||||
string _url = sceneInfoUrl + roomId.data[i].Id;
|
||||
s = await AsyncWebReq.Get<SceneRoot>(_url);
|
||||
if (!sceneRoots.Contains(s))
|
||||
sceneRoots.Add(s);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 通过 房间 ID 获取 该房间的想定信息,然后解析出所属地形
|
||||
/// </summary>
|
||||
public string GetRoomModelByThinkingDataAndRoomID(string roomID)
|
||||
{
|
||||
for (int i = 0; i < sceneRoots.Count; i++)
|
||||
{
|
||||
if (sceneRoots[i].data.Id == roomID)
|
||||
{
|
||||
return sceneRoots[i].data.Field_Char1;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public List<List_paraItem> GetListParaItemById(string deviceId)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ public static class AsyncWebReq
|
|||
yield return request.SendWebRequest();//发送请求
|
||||
if (request.isNetworkError || request.isHttpError)
|
||||
{
|
||||
//Debug.Log("cannot get data:" + request.responseCode);
|
||||
Debug.Log("cannot get data:" + request.responseCode);
|
||||
action(null);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue