Commit 5537eda1 authored by shujianhe's avatar shujianhe

添加zip接口

parent 78b7a29a
......@@ -19,6 +19,7 @@ public class GameScenUserInfo
public string json = "";//数据
public string finishImg = "";//完成图
public string id = "";//int 的id.toString()
public string file = "";//zip url
//以上是url
public int status = 0;//0 未开始 1 这个id进过游戏 2 至少有一个区域点亮 3完成
public double progress = 0;//0 -- 1 具体自己算百分比
......
......@@ -59,6 +59,7 @@ public class netLableImageItem: System.Object
public string pictureThn4;
public string pictureBin;
public string extraJson;
public string file;
public string getLineUrl()
{
return highImg;
......
......@@ -69,16 +69,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
transform.Find("gameEndOperBase").GetComponent<gameEndLogic>().initMember();
utilsTools.addTimer_Sec(gameObject, "loopGetHot", (String name) =>
{
//addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale",float.TryParse,(bool _) => {
// Debug.Log("doubleTouchScale = " + utilsTools.getGDataByKey<float>("doubleTouchScale",-0.02f).ToString());
// return;
//});
//addHotParams<short>("TUSE_areaOutValue", "areaOutValue", short.TryParse);
//addHotParams<float>("TUSE_MoveScale", "moveScale", float.TryParse);
//addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
//addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<short>("TUSE_areaOutValue", "areaOutValue", short.TryParse);
addHotParams<float>("TUSE_MoveScale", "moveScale", float.TryParse);
addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<float>("TUSE_dyMinShowFontSize", "dyMinShowFontSize", float.TryParse);
return true;
}, 3, 2000);
}, 3, 0);
}
void addHotParams<T>(string netKey,string localKey, StringOutTValue<T> back, NotifyBoolParam notifyBoolParam = null)
......@@ -393,7 +391,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
utilsTools.setGDataByKey("downZipBegin", utilsTools.getTotalMillisecond());
//https://cdn.zhangxingames.com/file/ccNO7LSXpxA8GzQUHq1.zip in
//"https://d21z6ifg4bbv2v.cloudfront.net/files/ccNO7LSXpxA8GzQUHq1.zip" wwww
StartCoroutine(LoadAndBytesUnzipWithWeb("https://cdn.zhangxingames.com/file/ccNO7LSXpxA8GzQUHq1.zip", zpath,(bool isOk) =>
StartCoroutine(LoadAndBytesUnzipWithWeb(gameScenUser.file, zpath,(bool isOk) =>
{
if (isOk)
{
......
......@@ -47,7 +47,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
//{"img":"https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccNO7LSXpxA8GzQUHq.png","json":"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccNO7LSXpxA8GzQUHq.json","finishImg":"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccNO7LSXpxA8GzQUHq_pictureColorThn4.jpg","id":"ccNO7LSXpxA8GzQUHq","status":0,"progress":0.0,"areaInfoUseData":[]}
//utilsTools.setGameScenUserInfo(id,"http://192.168.124.160:8795/srcImgs/colorFan/tuline.png","http://192.168.124.160:8795/srcImgs/colorFan/tucolor.png","http://192.168.124.160:8795/srcImgs/colorFan/tu.json");
//utilsTools.setGameScenUserInfo(id, "http://192.168.124.160:8795/srcImgs/temp2/tuline.png", "http://192.168.124.160:8795/srcImgs/temp2/tucolor.jpg", "http://192.168.124.160:8795/srcImgs/temp2/tu.json");
utilsTools.setGameScenUserInfo(id, "https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccNO7LSXpxA8GzQUHq.png", "https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccNO7LSXpxA8GzQUHq_pictureColorThn4.jpg", "https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccNO7LSXpxA8GzQUHq.json");
utilsTools.setGameScenUserInfo(id, "https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccNO7LSXpxA8GzQUHq.png", "https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccNO7LSXpxA8GzQUHq_pictureColorThn4.jpg", "https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccNO7LSXpxA8GzQUHq.json", "https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccNO7LSXpxA8GzQUHq.zip");
gameScenUser = utilsTools.getGameScenUserInfo(id);
}
if (gameScenUser == null)
......
......@@ -219,6 +219,7 @@ public class mainGameScaleMove : MonoBehaviour
}
void onDoubleTouchHandler(float nowTouchDistance)
{
var nowOffset = (nowTouchDistance - OldTouchCurrDis) * utilsTools.getGDataByKey<float>("doubleTouchScale", 0.002f);
//var nowOffset = nowTouchDistance * utilsTools.getGDataByKey<float>("doubleTouchScale",0.002f);
if(nowOffset < 0)
......@@ -236,11 +237,12 @@ public class mainGameScaleMove : MonoBehaviour
return;
}
}
int dt001 = utilsTools.getTotalMillisecond();
nowScale = new Vector2(nowScale.x + nowOffset,nowScale.y + nowOffset) ;
//nowScale = new Vector2(nowOffset, nowOffset);
OldTouchCurrDis = nowTouchDistance;
Vector2 offsetPos = Vector2.zero;
int dt002 = 0;
int dt003 = 0;
for (int i = 0; i < transform.childCount; i++)
{
var itemChild = transform.GetChild(i);
......@@ -268,11 +270,13 @@ public class mainGameScaleMove : MonoBehaviour
if (i == 0 && resetBtn)
{
RectTransform rectTrans = itemChild.GetComponent<RectTransform>();
dt002 = utilsTools.getTotalMillisecond();
bool leftIsOut = checkPtIsOutScene(rectTrans,new Vector2(rectTrans.rect.xMin, 0));
bool rightIsOut = checkPtIsOutScene(rectTrans,new Vector2(rectTrans.rect.xMax, 0));
bool topIsOut = checkPtIsOutScene(rectTrans,new Vector2(0, rectTrans.rect.yMax));
bool downIsOut = checkPtIsOutScene(rectTrans, new Vector2(0, rectTrans.rect.yMin));
if((leftIsOut && rightIsOut) || (topIsOut && downIsOut))
dt003 = utilsTools.getTotalMillisecond();
if ((leftIsOut && rightIsOut) || (topIsOut && downIsOut))
{
resetBtn.SetActive(true);
}
......@@ -283,7 +287,11 @@ public class mainGameScaleMove : MonoBehaviour
}
}
int dt004 = utilsTools.getTotalMillisecond();
updateScaleView();
int dt005 = utilsTools.getTotalMillisecond();
String msg = String.Format("5 - 4 = {0},3 - 2 = {1},5 -1 = {2}", dt005 - dt004, dt003 - dt002, dt005 - dt001);
Debug.Log(msg);
}
bool checkPtIsOutScene(RectTransform rectTrans,Vector2 pos)
{
......@@ -348,22 +356,23 @@ public class mainGameScaleMove : MonoBehaviour
float width = nowScale.x * nowSize.x;
float height = nowScale.y * nowSize.y;
//if(delatPos.x < 0 && (tempVector3.x + delatPos.x) < (width / -2))
//{
// delatPos.x = 0;
//}else if(delatPos.x > 0 && (tempVector3.x + delatPos.x) > (width / 2))
//{
// delatPos.x = 0;
//}
//if(delatPos.y < 0 && (tempVector3.y + delatPos.y) < (height / -2))
//{
// delatPos.y = 0;
//}
//else if(delatPos.y > 0 && (tempVector3.y + delatPos.y) > (height / 2))
//{
// delatPos.y = 0;
//}
//if (delatPos.x == delatPos.y && delatPos.x == 0) return;//都不用移动就不更新坐标
if (delatPos.x < 0 && (tempVector3.x + delatPos.x) < (width / -2))
{
delatPos.x = 0;
}
else if (delatPos.x > 0 && (tempVector3.x + delatPos.x) > (width / 2))
{
delatPos.x = 0;
}
if (delatPos.y < 0 && (tempVector3.y + delatPos.y) < (height / -2))
{
delatPos.y = 0;
}
else if (delatPos.y > 0 && (tempVector3.y + delatPos.y) > (height / 2))
{
delatPos.y = 0;
}
if (delatPos.x == delatPos.y && delatPos.x == 0) return;//都不用移动就不更新坐标
if (delatPos.x == 0f || delatPos.y == 0f)
{
......
......@@ -517,6 +517,7 @@ public class mainGameView : MonoBehaviour
public void updateScaleView()
{
Vector3 vector3 = lineImg.transform.localScale;
float dyMinShowFontSize = utilsTools.getGDataByKey<float>("dyMinShowFontSize", minShowFontSize);
if (areaIdBase != null && perfabPath.Equals("") == false)
{
//倍数怎么弄
......@@ -1133,7 +1134,7 @@ public class mainGameView : MonoBehaviour
//没有可渲染区域
removeAids.Add(item.m_aid);
List<Vector2Short> tempLineColors = new List<Vector2Short>();
//groupPtInfo.getLineByAid(item.m_aid,ref tempLineColors);
groupPtInfo.getLineByAid(item.m_aid,ref tempLineColors);
foreach (var item1 in tempLineColors)
{
if (digitMatrix.Data[item1.x, item1.y].Equals(bianlun))
......
......@@ -70,16 +70,10 @@ public class nodeNetProxy : MonoBehaviour
}
IEnumerator httpget(nodeNetProxyItem item)
{
//HttpWebRequest request = null;
//request = WebRequest.Create(item.url) as HttpWebRequest;
//request.Method = "GET";
//HttpWebResponse res = (HttpWebResponse)request.GetResponse();
UnityWebRequest request = UnityWebRequest.Get(item.url);
yield return request.SendWebRequest();
if (request.isHttpError || request.isNetworkError)
{
//POST(item.url, item.data["srcParams"].ToString(), item.isText, item.back);
item.call("", false, null);
yield return -1;
}
......@@ -89,8 +83,6 @@ public class nodeNetProxy : MonoBehaviour
if (item.isText)
{
String text = request.downloadHandler.text;
//StreamReader sr = new StreamReader(res.GetResponseStream(), Encoding.UTF8);
//string content = sr.ReadToEnd();
ret = item.call("", true, text);
}
else
......
......@@ -70,7 +70,7 @@ public class mainImageItem : IUListItemView
}
else
{
utilsTools.setGameScenUserInfo(id, item.getLineUrl(), item.getColorUrl(), item.getJsonUrl());
utilsTools.setGameScenUserInfo(id, item.getLineUrl(), item.getColorUrl(), item.getJsonUrl(),item.file);
data = utilsTools.getGameScenUserInfo(id);
path = data.getLocalThumbnailPath();
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.scripts.utils
{
public class VideoHelp
{
}
}
fileFormatVersion: 2
guid: 4a262f300263493429ca8ffad222db22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -628,7 +628,7 @@ public class utilsTools
public static void replayGameProcessById(string id,GameObject gameObject,List<Tuple<short,float,float>> playOrders)
{
}
public static bool setGameScenUserInfo(string id,string lineUrl,string colorUrl,string jsonUrl)
public static bool setGameScenUserInfo(string id,string lineUrl,string colorUrl,string jsonUrl,string zipUrl)
{
string gameSaveKey = "gameUserData_" + id.ToString();
string oldData = utilsDB.getDBStringDataByKey(gameSaveKey, "");
......@@ -642,6 +642,7 @@ public class utilsTools
gameScenUserDataInfo.finishImg = colorUrl;
gameScenUserDataInfo.json = jsonUrl;
gameScenUserDataInfo.id = id;
gameScenUserDataInfo.file = zipUrl;
utilsDB.setDBJsonDataByKey(gameSaveKey, JsonUtility.ToJson(gameScenUserDataInfo));
return true;
}
......
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