Commit dcf1d525 authored by shujianhe's avatar shujianhe

1 加载场景调整和测试用缩略图

2 组列表调整
3 终止更新缩略图
4 游戏进度从服务器拉去
5 关闭立即上报行为,20帧后在实际跳转
parent 18f481ea
......@@ -76,6 +76,82 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &165307577509819478
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 216671789900275948}
- component: {fileID: 1520829811932201433}
- component: {fileID: 948336499519928204}
m_Layer: 0
m_Name: groupListBg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &216671789900275948
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165307577509819478}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1633357141748549960}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -41, y: -1582}
m_SizeDelta: {x: 0, y: 800}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1520829811932201433
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165307577509819478}
m_CullTransparentMesh: 1
--- !u!114 &948336499519928204
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165307577509819478}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &367631070194179690
GameObject:
m_ObjectHideFlags: 0
......@@ -206,6 +282,7 @@ RectTransform:
- {fileID: 2696017519285237368}
- {fileID: 9202005404466210624}
- {fileID: 3684281432546734940}
- {fileID: 216671789900275948}
- {fileID: 7778848243247776032}
- {fileID: 4207755507653322023}
- {fileID: 1976999355571500960}
......@@ -937,7 +1014,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 314}
m_AnchoredPosition: {x: 4, y: 840}
m_SizeDelta: {x: 0, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1036549963076789408
......@@ -1478,7 +1555,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0.9490196, g: 0.9490196, b: 0.9490196, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
......@@ -1668,7 +1745,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -38, y: -282}
m_SizeDelta: {x: 640, y: 30}
m_SizeDelta: {x: 900, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &770547139677435937
MonoBehaviour:
......@@ -1768,7 +1845,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 295.4}
m_AnchoredPosition: {x: 4, y: 821.4}
m_SizeDelta: {x: 0, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2831736868530311398
......@@ -2353,7 +2430,7 @@ RectTransform:
m_GameObject: {fileID: 5697974217771189481}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.8, y: 0.8, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4930126960711289547}
......@@ -2361,8 +2438,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -6, y: -127}
m_SizeDelta: {x: 1000, y: 1000}
m_AnchoredPosition: {x: 0, y: -127}
m_SizeDelta: {x: 1200, y: 1200}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &2672100261875538246
CanvasRenderer:
......@@ -2738,7 +2815,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.00012207031, y: 0.00024414062}
m_SizeDelta: {x: 0, y: 290}
m_SizeDelta: {x: 0, y: 440}
m_Pivot: {x: 0, y: 1}
--- !u!222 &6177109562948806136
CanvasRenderer:
......@@ -2761,7 +2838,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9411765, g: 0.9411765, b: 0.9411765, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
......@@ -2844,7 +2921,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: a739bbba4c0a9a94085973b67bc95bcf, type: 3}
m_Sprite: {fileID: 21300000, guid: ee269de026792d844afca7b89b541787, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -2868,7 +2945,6 @@ GameObject:
- component: {fileID: 8127201246377606253}
- component: {fileID: 249506130850906235}
- component: {fileID: 3881126791468221942}
- component: {fileID: 4691931816764605594}
m_Layer: 0
m_Name: gameShowView
m_TagString: Untagged
......@@ -2979,36 +3055,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7d1f5d2c8f31b4b408c2617ac6ccbcde, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &4691931816764605594
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6769909122946713645}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6841462502927162422
GameObject:
m_ObjectHideFlags: 0
......@@ -3714,8 +3760,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 300}
m_AnchoredPosition: {x: -4, y: 353}
m_SizeDelta: {x: 0, y: 440}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &660496339158997908
CanvasRenderer:
......@@ -3738,14 +3784,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.20784314}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
......
This diff is collapsed.
......@@ -15,6 +15,7 @@ public class AreaInfoUseData
public class GameScenUserInfo
{
static public string RunGameDatasRootName = "gameData";
public string thumbnailUrl = "";
public string img = "";//线图
public string json = "";//数据
public string finishImg = "";//完成图
......@@ -96,6 +97,7 @@ public class GameScenUserInfo
}
public void setShowAreaids(string areaids)
{
if (areaids.Equals("")) return;
string[] ids = areaids.Split(",");
Dictionary<short, bool> existIds = new Dictionary<short, bool>();
foreach (var item in areaInfoUseData)
......
......@@ -81,3 +81,30 @@ public class netLableImageItem: System.Object
return id;
}
}
[System.Serializable]
public class resutltObject<T>
{
public T data;
}
public class HistoryClick
{
public int status;
public string msg;
public string sign;
public resutltObject<HistoryClickData> result;
public string getHistory()
{
List<int> history = new List<int>();
if (status.Equals(200))
{
HistoryClickData historyClickData = (HistoryClickData)result.data;
return historyClickData.append;
}
return "";
}
}
[System.Serializable]
public class HistoryClickData
{
public string append = "";
}
\ No newline at end of file
......@@ -7,37 +7,24 @@ using UnityEngine;
public class gameSceneAreaGroupHandler : gridView
{
public float itemWidth = 110f;
public float itemHeight = 110f;
public float itemInterval = 5f;
private bool isInit = false;
private float scale = 1;
public float ItemWidth
{
get { return ItemWidth; }
}
public float ItemHeight
{
get { return itemHeight; }
}
public float ItemInterval
{
get { return itemInterval; }
}
//public float ItemWidth
//{
// get { return ItemWidth; }
//}
//public float ItemHeight
//{
// get { return itemHeight; }
//}
//public float ItemInterval
//{
// get { return itemInterval; }
//}
// Start is called before the first frame update
void Start()
{
if (isInit == true) return;
isInit = true;
RectTransform rectTransform = transform.parent.GetComponent<RectTransform>();
var nowTransform = GetComponent<RectTransform>();
utilsTools.DisplaySize = new Vector2(rectTransform.rect.width, rectTransform.rect.height);
scale = (rectTransform.rect.height / 1920f); //1920/rectTransform.rect.height;
if((itemHeight * scale) > (nowTransform.rect.height * 0.8))
{
scale = (nowTransform.rect.height * 0.8f) / itemHeight;
}
RectTransform rectTransform = transform.parent.Find("bg").GetComponent<RectTransform>();
utilsTools.DisplaySize = new Vector2(rectTransform.rect.width,rectTransform.rect.height);
}
// Update is called once per frame
......@@ -45,17 +32,11 @@ public class gameSceneAreaGroupHandler : gridView
}
public void setDataNoGrid(int cout, gradViewBack gradView)
{
if (isInit == false)
{
Start();
}
Debug.Log(string.Format("width = {0},height={1},interval={2}", itemWidth, itemHeight, itemInterval));
setDataNoGrid(cout, itemWidth * scale, itemHeight * scale, itemInterval * scale,(GameObject obj,int idx,ListViewBackTypeEnum lvb) =>
setData(cout,(GameObject obj,int idx,ListViewBackTypeEnum lvb) =>
{
var aa1 = obj.GetComponent<RectTransform>();
aa1.localScale = new Vector3(scale,scale);
//var aa1 = obj.GetComponent<RectTransform>();
//aa1.localScale = new Vector3(scale,scale);
gradView(obj,idx,lvb);
}, false,null,20);
});
}
}
......@@ -21,6 +21,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
onEvent("showAreaEventOk", onSelectAreaEvent);
onEvent("showAreaPalyerEnd", onShowAreaPalyerEndEvent);
onEvent("inGameLoadingBarEnd", onInGameLoadingBarEndEvent);
onEvent("CloseScenePrve", onCloseScenePrveHandler);
utilsTools.addTimer_Update(gameObject, "first", (string name) =>
{
if (utilsTools.ContainsKeyGDataByKey("NativeGameData") == false)
......@@ -36,7 +37,21 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
return false;
}
utilsTools.setGameScenUserInfo(jsonData.id, jsonData.getLineUrl(), jsonData.getColorUrl(), jsonData.getJsonUrl(), jsonData.file);
startId(jsonData.id);
startId(jsonData.id,jsonData);
utilsTools.httpGET(this, "{0}/app/v1/game/ts/imgSchedule?zygt=hzwz&tgtk=1&imgId={1}&uid={2}", true, (string id, string url, bool isSuccess, System.Object data) =>
{
if(isSuccess)
{
HistoryClick historyClick = JsonUtility.FromJson<HistoryClick>(data as string);
string history = historyClick.getHistory();
gameScenUserInfo.setShowAreaids(history);
return 0;
}
else
{
return 1;
}
},utilsTools.getGDataByKey<String>("urlRoot",""),jsonData.sid,utilsTools.getGDataByKey<String>("uid",""));
}
return false;
}, 2);
......@@ -67,13 +82,17 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
void Update()
{
}
public void startId(string id)
public void startId(string id,netLableImageItem jsondata = null)
{
GameScenUserInfo gameScenUser = utilsTools.getGameScenUserInfo(id);
if(gameScenUser == null)
{
return;
}
if(jsondata != null)
{
gameScenUser.thumbnailUrl = jsondata.getSmallLineUrl();
}
utilsTools.sendEventObjectParams("initViewShowData", gameScenUser);
gameScenUserInfo = gameScenUser;
}
......@@ -120,6 +139,15 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
int now = Convert.ToInt32(gameScenUserInfo.areaInfoUseData.Count / allAreaSize * 100);
utilsTools.sendEventObjectParams("changeGameUserProgress", now);
}
void onCloseScenePrveHandler(List<UnityEngine.Object> uobject,List<System.Object> objects)
{
if (gameScenUserInfo != null)
{
utilsTools.saveGameScenUserInfo(gameScenUserInfo);
updateProgress();
gameScenUserInfo = null;//直接释放如果期间没有保存,就一起丢失
}
}
public void updateProgress()
{
String urlRoot = utilsTools.getGDataByKey<String>("urlRoot", "");
......@@ -147,8 +175,10 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
utilsTools.httpPOST(this, url, jsonParam, true,back);
}
public void OnDestroy()
{
if(gameScenUserInfo != null)
{
utilsTools.saveGameScenUserInfo(gameScenUserInfo);
......
......@@ -45,6 +45,17 @@ public class gridView : MonoBehaviour
var gameObjectContext = GetComponent<ScrollRect>();
gameObjectContext.normalizedPosition = vector2;
}
virtual public Vector2 getCellSize()
{
Vector2 vector2 = new Vector2();
GameObject gameObjectContext = GetComponent<ScrollRect>().content.gameObject;
var gridLayout = gameObjectContext.GetComponent<GridLayoutGroup>();
if(gridLayout != null )
{
vector2 = gridLayout.cellSize;
}
return vector2;
}
virtual public void setData(int size,gradViewBack back,bool useVec = true, GetGradViewInfo getGradViewInfo = null)
{
if (perfabPaths.Count == 0)
......
......@@ -457,8 +457,19 @@ public class mainGameView : MonoBehaviour
if(areaIdBase != null)
{
colorTexure2d = colorImg.GetComponent<Image>().sprite.texture;
thumbnailTexture2d = new Texture2D(gameidJsondata.width, gameidJsondata.height, TextureFormat.RGB24,false);
allColor.Add("color",colorTexure2d.GetPixels(0,0,colorTexure2d.width,colorTexure2d.height));
if (gameidJsondata == null)
{
TaskManages.getInstance().addTask(this, (System.Object[] _) =>
{
thumbnailTexture2d = new Texture2D(gameidJsondata.width, gameidJsondata.height, TextureFormat.RGB24, false);
allColor.Add("color", colorTexure2d.GetPixels(0, 0, colorTexure2d.width, colorTexure2d.height));
return;
});
}
else {
thumbnailTexture2d = new Texture2D(gameidJsondata.width, gameidJsondata.height, TextureFormat.RGB24, false);
allColor.Add("color", colorTexure2d.GetPixels(0, 0, colorTexure2d.width, colorTexure2d.height));
}
}
}
}
......
......@@ -161,7 +161,12 @@ public class colorItem : MonoBehaviour
}
public void resetSize(float x,float y)
{
RectTransform rectTransform = GetComponent<RectTransform>();
rectTransform.localScale = new Vector3 (100f/x,100f/y, 1);
//RectTransform rectTransform = GetComponent<RectTransform>();
//rectTransform.localScale = new Vector3 (100f/x,100f/y, 1);
int cout = transform.childCount;
for (int i = 0; i < cout; i++)
{
//transform.GetChild(i).localScale= new Vector3(x/100f, y/100f, 1);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment