Commit 3b4b25f7 authored by JiangWanZhi's avatar JiangWanZhi

添加一些备注

parent ac8baf3f
...@@ -24,7 +24,7 @@ public class GameScenUserInfo ...@@ -24,7 +24,7 @@ public class GameScenUserInfo
//以上是url //以上是url
public int status = 0;//0 未开始 1 这个id进过游戏 2 至少有一个区域点亮 3完成 public int status = 0;//0 未开始 1 这个id进过游戏 2 至少有一个区域点亮 3完成
public double progress = 0;//0 -- 1 具体自己算百分比 public double progress = 0;//0 -- 1 具体自己算百分比
public List<AreaInfoUseData> areaInfoUseData = new List<AreaInfoUseData>(); public List<AreaInfoUseData> areaInfoUseData = new List<AreaInfoUseData>(); //涂的区域的顺序
private string getUrlByLocalPath(string url) private string getUrlByLocalPath(string url)
{ {
if (url.StartsWith("http") == false) return ""; if (url.StartsWith("http") == false) return "";
......
...@@ -6,7 +6,7 @@ using UnityEngine; ...@@ -6,7 +6,7 @@ using UnityEngine;
public class gameAreaGroupItem public class gameAreaGroupItem
{ {
public short id; public short id;
public List<short> roomIds; public List<short> roomIds; //属于这个组的区域id‘集合
public float R; public float R;
public float G; public float G;
public float B; public float B;
......
...@@ -12,10 +12,10 @@ public class gameAreaItem ...@@ -12,10 +12,10 @@ public class gameAreaItem
public float G; public float G;
public float B; public float B;
public short id; public short id;
public short gid = -1;//id public short gid = -1;//��id
public short valid;//未知含义 未启用 public short valid;//δ֪���� δ����
public short useAreaData;//未知含义 未启用 public short useAreaData;//δ֪���� δ����
public bool notPaintCol;//未启用 public bool notPaintCol;//δ����
public string tempExKey = ""; public string tempExKey = "";
public bool isShow = false; public bool isShow = false;
public int threadHandState = 0; public int threadHandState = 0;
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Unity.VisualScripting; using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
public class gameIdJsonData public class gameIdJsonData //json文件的所有数据
{ {
public string nowId = ""; public string nowId = "";
public short width = 0; public short width = 0;
......
...@@ -17,6 +17,7 @@ class DebugNetHotData ...@@ -17,6 +17,7 @@ class DebugNetHotData
public bool isFile; public bool isFile;
public string msg; public string msg;
} }
//初始化、下载、解压
public class gameSceneLogic : MonoBehaviour, IEventHandler public class gameSceneLogic : MonoBehaviour, IEventHandler
{ {
// Start is called before the first frame update // Start is called before the first frame update
...@@ -58,17 +59,17 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -58,17 +59,17 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
} }
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None); Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
onEvent("switchGameAreaGroupId",this.onEvent_switchGameAreaGroupId_Handler); onEvent("switchGameAreaGroupId",this.onEvent_switchGameAreaGroupId_Handler); //切换组的ID
onEvent("gameViewOnInitEnd",this.onEvent_gameViewOnInitEnd_Handler); onEvent("gameViewOnInitEnd",this.onEvent_gameViewOnInitEnd_Handler); //游戏图片初始化完成
onEvent("gameClickPos",this.onEvent_gameClickPos_Handler); onEvent("gameClickPos",this.onEvent_gameClickPos_Handler); //灰色的点击回掉
onEvent("inGameLoadingBarEnd",this.onEvent_inGameLoadingBarEnd_Handler); onEvent("inGameLoadingBarEnd",this.onEvent_inGameLoadingBarEnd_Handler); //进入游戏的进度条加载完成
onEvent("showAreaEventOk", onSelectAreaEvent); onEvent("showAreaEventOk", onSelectAreaEvent); //当前组的都涂完了
onEvent("initViewShowData", onInitViewShowDataEvent); onEvent("initViewShowData", onInitViewShowDataEvent); //初始化数据完成
onEvent("changeGameUserProgress", onChangeGameUserProgressEvent); onEvent("changeGameUserProgress", onChangeGameUserProgressEvent); //整体进度改变
onEvent("tipShowPosMaxScale", onTipShowPosMaxScaleEvent); onEvent("tipShowPosMaxScale", onTipShowPosMaxScaleEvent); // 点提示,当前组随机一个没涂的位置放大
onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); //整个大图都涂完了
onEvent("closeGameScene", onCloseGameSceneEvent); onEvent("closeGameScene", onCloseGameSceneEvent); //关游戏
onEvent("removeGroupByGid", onRemoveGroupByGidEvent); onEvent("removeGroupByGid", onRemoveGroupByGidEvent); //自动涂gid不一致会调过来
transform.Find("ingameLoad/loadImg").gameObject.SetActive(false); transform.Find("ingameLoad/loadImg").gameObject.SetActive(false);
//gameScenUser //gameScenUser
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>(); var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
...@@ -86,8 +87,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -86,8 +87,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse); addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<short>("TUSE_areaOutValue", "areaOutValue", short.TryParse); addHotParams<short>("TUSE_areaOutValue", "areaOutValue", short.TryParse);
addHotParams<float>("TUSE_MoveScale", "moveScale", float.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); addHotParams<float>("TUSE_dyMinShowFontSize", "dyMinShowFontSize", float.TryParse);
addHotParams<int>("TUSE_PhoneOffsetValue", "PhoneOffsetValue", int.TryParse); addHotParams<int>("TUSE_PhoneOffsetValue", "PhoneOffsetValue", int.TryParse);
return true; return true;
...@@ -101,7 +100,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -101,7 +100,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
void addHotParams<T>(string netKey,string localKey, StringOutTValue<T> back, NotifyBoolParam notifyBoolParam = null) void addHotParams<T>(string netKey,string localKey, StringOutTValue<T> back, NotifyBoolParam notifyBoolParam = null)
{ {
string url = string.Format("http://www.xn--3-y50c.com:8560/keysOper?key={0}", netKey); string url = $"http://www.xn--3-y50c.com:8560/keysOper?key={netKey}";
utilsTools.setGDataByKey(url,localKey); utilsTools.setGDataByKey(url,localKey);
utilsTools.httpGET(this, url, true, (string id, string url, bool isSuccess, System.Object data) => utilsTools.httpGET(this, url, true, (string id, string url, bool isSuccess, System.Object data) =>
{ {
...@@ -131,6 +130,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -131,6 +130,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{ {
ActionManages.update(); ActionManages.update();
} }
//创建列表item的时候回调并设置、初始化和刷新
private void onUpdateGroupGridHandler(GameObject gobject, int idx, ListViewBackTypeEnum lvbType,TempGroupInfos group,bool isFirst = false) private void onUpdateGroupGridHandler(GameObject gobject, int idx, ListViewBackTypeEnum lvbType,TempGroupInfos group,bool isFirst = false)
{ {
if (lvbType == ListViewBackTypeEnum.create || ListViewBackTypeEnum.update == lvbType) if (lvbType == ListViewBackTypeEnum.create || ListViewBackTypeEnum.update == lvbType)
...@@ -170,6 +171,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -170,6 +171,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
childEventHandlers[eventName](uobjects, objects); childEventHandlers[eventName](uobjects, objects);
} }
} }
//切换组的id
private void onEvent_switchGameAreaGroupId_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects) private void onEvent_switchGameAreaGroupId_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{ {
Vector3 vector3; Vector3 vector3;
...@@ -203,6 +205,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -203,6 +205,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
} }
}); });
} }
//游戏图片初始化完成
private void onEvent_gameViewOnInitEnd_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects) private void onEvent_gameViewOnInitEnd_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{ {
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>(); var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
...@@ -364,7 +367,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -364,7 +367,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//rectTransform2.localPosition = new Vector3(rectTransform2.localPosition.x, transform1.localPosition.y - 10); //rectTransform2.localPosition = new Vector3(rectTransform2.localPosition.x, transform1.localPosition.y - 10);
} }
private void handlerLoadingPosition(Image image) private void handlerLoadingPosition(Image image) //进度条上面的图缩放一下
{ {
Debug.Log("handlerLoadingPosition hand endl"); Debug.Log("handlerLoadingPosition hand endl");
image.gameObject.SetActive(true); image.gameObject.SetActive(true);
...@@ -427,11 +430,11 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -427,11 +430,11 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{ {
Debug.Log("handlerLoadingPosition hand begin"); Debug.Log("handlerLoadingPosition hand begin");
string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id + ".zip"); string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id + ".zip");
if (utilsTools.IsPhone == false) if (utilsTools.IsWin == true)
zpath = zpath.Replace("/", "\\"); zpath = zpath.Replace("/", "\\");
gameScenUser.createWorkDirectory(); gameScenUser.createWorkDirectory();
string outPath = GameScenUserInfo.getAllRoot(); string outPath = GameScenUserInfo.getAllRoot();
if(utilsTools.IsPhone == false) if(utilsTools.IsWin == true)
{ {
outPath = outPath.Replace("/", "\\"); outPath = outPath.Replace("/", "\\");
} }
...@@ -447,51 +450,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -447,51 +450,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
utilsTools.setGDataByKey("downGaoQing", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("downGaoQing", utilsTools.getTotalMillisecond());
gameShowView.GetComponent<mainGameView>().loadGameImgId(); gameShowView.GetComponent<mainGameView>().loadGameImgId();
if (utilsTools.IsExistIO(lineImg) == false)
{
//utilsTools.httpDOWNIMG(this, gameScenUser.img, lineImg, (string id, string url, bool isSuccess, System.Object data) =>
//{
// return onDownColorImgHandler(id, url, isSuccess, data, lineImg);
//});
}
else
{
//if (utilsTools.IsExistIO(suoluetu) == false)
//{
// //utilsTools.loadLocalImage(this, image, lineImg, (bool isOk) =>
// //{
// // if (isOk)
// // {
// // Debug.Log("sdfdsfds " + (utilsTools.getTotalMillisecond() - temp1).ToSafeString());
// // image.color = Color.white;
// // handlerLoadingPosition(image);
// // }
// //});
//}
//else
//{
// int temp1 = utilsTools.getTotalMillisecond();
// utilsTools.loadLocalImage(this, image, suoluetu, (bool isOk) =>
// {
// if (isOk)
// {
// Debug.Log("sdfdsfds " + (utilsTools.getTotalMillisecond() - temp1).ToSafeString());
// image.color = Color.white;
// handlerLoadingPosition(image);
// }
// });
//}
}
} }
//下载和解压zip 没有下载过就去下载线稿图
void onInitViewShowDataEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects) void onInitViewShowDataEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{ {
utilsTools.setGDataByKey("firstT", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("firstT", utilsTools.getTotalMillisecond());
GameScenUserInfo gameScenUser = (GameScenUserInfo)objects[0]; GameScenUserInfo gameScenUser = (GameScenUserInfo)objects[0];
string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id+".zip"); string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id+".zip");
if (utilsTools.IsPhone == false) if (utilsTools.IsWin == true)
zpath = zpath.Replace("/", "\\"); zpath = zpath.Replace("/", "\\");
string suoluetu = gameScenUser.getLocalThumbnailPath(); string suoluetu = gameScenUser.getLocalThumbnailPath();
Image image = transform.Find("ingameLoad/loadImg").GetComponent<Image>(); Image image = transform.Find("ingameLoad/loadImg").GetComponent<Image>();
...@@ -563,6 +529,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -563,6 +529,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
} }
} }
//整体的进度改变
void onChangeGameUserProgressEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects) { void onChangeGameUserProgressEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects) {
int pro = (int)objects[0]; int pro = (int)objects[0];
transform.Find("ingameLoad").gameObject.SetActive(false); transform.Find("ingameLoad").gameObject.SetActive(false);
...@@ -571,6 +538,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -571,6 +538,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
UnityEngine.UI.Slider slider = transform.Find("gameProgress").GetComponent<UnityEngine.UI.Slider>(); UnityEngine.UI.Slider slider = transform.Find("gameProgress").GetComponent<UnityEngine.UI.Slider>();
slider.value = pro; slider.value = pro;
} }
//点提示,当前组随机一个没涂的位置放大
void onTipShowPosMaxScaleEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects) void onTipShowPosMaxScaleEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{ {
System.Object obj = objects[0]; System.Object obj = objects[0];
...@@ -579,6 +547,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -579,6 +547,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
gameAreaItem gameAreaItem1 = obj as gameAreaItem; gameAreaItem gameAreaItem1 = obj as gameAreaItem;
gameShowView.GetComponent<mainGameScaleMove>().onTipShowPosMaxScale(gameAreaItem1,width,height); gameShowView.GetComponent<mainGameScaleMove>().onTipShowPosMaxScale(gameAreaItem1,width,height);
} }
//整个大图都涂完了
void onGamePlayerEndHandlerEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects) void onGamePlayerEndHandlerEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects)
{ {
//Debug.Log("游戏完成,播放结束动画"); //Debug.Log("游戏完成,播放结束动画");
...@@ -597,6 +567,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -597,6 +567,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
// return false; // return false;
// }, 10); // }, 10);
} }
//当前组的都涂完了
void onSelectAreaEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects) void onSelectAreaEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{ {
gameAreaItem gameArea = (gameAreaItem)objects[0]; gameAreaItem gameArea = (gameAreaItem)objects[0];
......
...@@ -44,7 +44,7 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -44,7 +44,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
initData(); initData();
return false; return false;
}, 5); }, 5);
//string tuijian = "{\"status\":200,\"msg\":\"请求成功\",\"sign\":\"\",\"result\":{\"data\":["; //string tuijian = "{\"status\":200,\"msg\":\"����ɹ�\",\"sign\":\"\",\"result\":{\"data\":[";
//for (int i = 0; i < 8; i++) //for (int i = 0; i < 8; i++)
//{ //{
// tuijian = tuijian + json + ","; // tuijian = tuijian + json + ",";
...@@ -132,7 +132,7 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -132,7 +132,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
keyValuePairs.Add(idx, true ); keyValuePairs.Add(idx, true );
} }
List<Vector2Int> removeLists = new List<Vector2Int>(); List<Vector2Int> removeLists = new List<Vector2Int>();
foreach (var item in GroupByAreaPtInfos.mapAllDatas)//因为有特意裁处空白保持圆角和长的非1:2 foreach (var item in GroupByAreaPtInfos.mapAllDatas)//��Ϊ������ô��հױ���Բ�Ǻͳ��ķ�1:2
{ {
for (int i = 0; i < item.Value.Count; i++) for (int i = 0; i < item.Value.Count; i++)
{ {
...@@ -159,11 +159,11 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -159,11 +159,11 @@ public class replayerBack : MonoBehaviour, IEventHandler
GameScenUserInfo gameScenUser = (GameScenUserInfo)objects[0]; GameScenUserInfo gameScenUser = (GameScenUserInfo)objects[0];
nowGameScenUser = gameScenUser; nowGameScenUser = gameScenUser;
string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id + ".zip"); string zpath = utilsTools.getWritableByPath("outFiles/" + gameScenUser.id + ".zip");
if (utilsTools.IsPhone == false) if (utilsTools.IsWin == true)
zpath = zpath.Replace("/", "\\"); zpath = zpath.Replace("/", "\\");
string suoluetu = gameScenUser.getColorImgLocalPath();//gameScenUser.getLocalThumbnailPath(); string suoluetu = gameScenUser.getColorImgLocalPath();//gameScenUser.getLocalThumbnailPath();
Image image = mainShowView.GetComponent<Image>(); Image image = mainShowView.GetComponent<Image>();
image.color = new Color(1, 1, 1, 0);//未加载出来时候就透明化 image.color = new Color(1, 1, 1, 0);//δ���س���ʱ���͸����
string key = gameScenUser.id + "_showAd"; string key = gameScenUser.id + "_showAd";
showAd = utilsDB.getDBBoolDataByKey(key, showAd); showAd = utilsDB.getDBBoolDataByKey(key, showAd);
if (utilsTools.IsExistIO(suoluetu) == false) if (utilsTools.IsExistIO(suoluetu) == false)
...@@ -319,7 +319,7 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -319,7 +319,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
utilsTools.sendEvent("CloseScenePrve"); utilsTools.sendEvent("CloseScenePrve");
utilsTools.addTimer_Update(gameObject, "close", (String name) => utilsTools.addTimer_Update(gameObject, "close", (String name) =>
{ {
Debug.Log("关闭"); Debug.Log("�ر�");
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>("gameBackJavaData", null); var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>("gameBackJavaData", null);
gameBackJavaData.name = "replayer"; gameBackJavaData.name = "replayer";
if (gameBackJavaData == null) if (gameBackJavaData == null)
...@@ -499,7 +499,7 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -499,7 +499,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
{ {
if (mp4OperNext == 1) if (mp4OperNext == 1)
{ {
Debug.Log("分享中"); Debug.Log("������");
gameObject.transform.Find("inSaveProgress").gameObject.SetActive(false); gameObject.transform.Find("inSaveProgress").gameObject.SetActive(false);
utilsTools.share("", gameObject.name,""); utilsTools.share("", gameObject.name,"");
} }
...@@ -507,7 +507,7 @@ public class replayerBack : MonoBehaviour, IEventHandler ...@@ -507,7 +507,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
{ {
gameObject.transform.Find("inSaveProgress/fore").gameObject.SetActive(false); gameObject.transform.Find("inSaveProgress/fore").gameObject.SetActive(false);
gameObject.transform.Find("inSaveProgress/end").gameObject.SetActive(true); gameObject.transform.Find("inSaveProgress/end").gameObject.SetActive(true);
Debug.Log("保存完成"); Debug.Log("�������");
} }
} }
} }
......
...@@ -6,7 +6,7 @@ using Unity.VisualScripting; ...@@ -6,7 +6,7 @@ using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
//这个节点必须在现实的下边 //����ڵ��������ʵ���±�
class PosChecks class PosChecks
{ {
public Vector2 pos; public Vector2 pos;
...@@ -122,7 +122,7 @@ public class checkRootFirstRun : MonoBehaviour ...@@ -122,7 +122,7 @@ public class checkRootFirstRun : MonoBehaviour
var an1 = new Vector2(x1, y1); var an1 = new Vector2(x1, y1);
Debug.Log(an1); Debug.Log(an1);
utilsTools.setAnchor(gobject, an1); utilsTools.setAnchor(gobject, an1);
if(utilsTools.IsPhone == false){ if(utilsTools.IsWin == true){
gobject.localScale = new Vector2(0.2f, 0.2f); gobject.localScale = new Vector2(0.2f, 0.2f);
ActionManages.addMoveByScale(gobject.gameObject, 9, 5f, (GameObject _, int id) =>{ ActionManages.addMoveByScale(gobject.gameObject, 9, 5f, (GameObject _, int id) =>{
gobject.localScale = new Vector2(0.2f, 0.2f); gobject.localScale = new Vector2(0.2f, 0.2f);
...@@ -134,7 +134,7 @@ public class checkRootFirstRun : MonoBehaviour ...@@ -134,7 +134,7 @@ public class checkRootFirstRun : MonoBehaviour
int i = posChecks[0].isUse == false ? 0 : (posChecks[1].isUse == false ? 1 : -1); int i = posChecks[0].isUse == false ? 0 : (posChecks[1].isUse == false ? 1 : -1);
if(i == -1) if(i == -1)
{ {
//先清理一边老的的 //������һ���ϵĵ�
drawBlock(posChecks[0].pos, backColor); drawBlock(posChecks[0].pos, backColor);
posChecks[0].isUse = false; posChecks[0].isUse = false;
drawBlock(posChecks[1].pos, backColor); drawBlock(posChecks[1].pos, backColor);
...@@ -167,7 +167,7 @@ public class checkRootFirstRun : MonoBehaviour ...@@ -167,7 +167,7 @@ public class checkRootFirstRun : MonoBehaviour
} }
private void LateUpdate() private void LateUpdate()
{ {
if (utilsTools.IsPhone) if (utilsTools.IsWin)
{ {
if (Input.touchCount == 2) if (Input.touchCount == 2)
{ {
...@@ -271,13 +271,13 @@ public class checkRootFirstRun : MonoBehaviour ...@@ -271,13 +271,13 @@ public class checkRootFirstRun : MonoBehaviour
Vector2 vector = utilsTools.ScreenToUILocalPos(rectTransform, tempPos.pos); Vector2 vector = utilsTools.ScreenToUILocalPos(rectTransform, tempPos.pos);
if (rectTransform.rect.Contains(vector)) if (rectTransform.rect.Contains(vector))
{ {
Debug.Log("在区域内"); Debug.Log("��������");
tempPos.pos = vector; tempPos.pos = vector;
pushDrawPos(); pushDrawPos();
} }
else else
{ {
Debug.Log("不在区域内"); Debug.Log("����������");
} }
} }
} }
......
...@@ -7,7 +7,7 @@ using Unity.VisualScripting; ...@@ -7,7 +7,7 @@ using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
public class mainGameOneImageView : mainGameView public class mainGameOneImageView : mainGameView //回放上面,回放用的是一张图片
{ {
// Start is called before the first frame update // Start is called before the first frame update
public GameObject oneImg = null; public GameObject oneImg = null;
...@@ -169,7 +169,7 @@ public class mainGameOneImageView : mainGameView ...@@ -169,7 +169,7 @@ public class mainGameOneImageView : mainGameView
}); });
if (cout == 0) if (cout == 0)
{ {
//没有可渲染区域 //û�п���Ⱦ����
removeAids.Add(item.m_aid); removeAids.Add(item.m_aid);
List<Vector2Short> tempLineColors = new List<Vector2Short>(); List<Vector2Short> tempLineColors = new List<Vector2Short>();
groupPtInfo.getLineByAid(item.m_aid,ref tempLineColors); groupPtInfo.getLineByAid(item.m_aid,ref tempLineColors);
...@@ -207,7 +207,7 @@ public class mainGameOneImageView : mainGameView ...@@ -207,7 +207,7 @@ public class mainGameOneImageView : mainGameView
if (removeAids.Count > 0) if (removeAids.Count > 0)
{ {
//移除已经播放完成 //�Ƴ��Ѿ��������
foreach (var aid in removeAids) foreach (var aid in removeAids)
{ {
for (int i = 0; i < showAreaAnimationDatas.Count; i++) for (int i = 0; i < showAreaAnimationDatas.Count; i++)
...@@ -222,7 +222,7 @@ public class mainGameOneImageView : mainGameView ...@@ -222,7 +222,7 @@ public class mainGameOneImageView : mainGameView
drawThumbnailByAid(removeAids); drawThumbnailByAid(removeAids);
if (showAreaAnimationDatas.Count == 0) if (showAreaAnimationDatas.Count == 0)
{ {
//保存一次缩略遮罩 //����һ����������ͼ
if (utilsTools.isEqualByValue(gameScenUseInfo.progress, 1.0, 0.0000002f)) if (utilsTools.isEqualByValue(gameScenUseInfo.progress, 1.0, 0.0000002f))
{ {
TaskManages.getInstance().addTask(this, (System.Object[] parma) => TaskManages.getInstance().addTask(this, (System.Object[] parma) =>
...@@ -249,7 +249,7 @@ public class mainGameOneImageView : mainGameView ...@@ -249,7 +249,7 @@ public class mainGameOneImageView : mainGameView
}, 4); }, 4);
return; return;
} }
//为缩略图准备 //Ϊ����ͼ׼��
Vector2Short vector2Short = allColorSize["final"]; Vector2Short vector2Short = allColorSize["final"];
Vector2Short vector2ShortOut = allColorSize["outColor"]; Vector2Short vector2ShortOut = allColorSize["outColor"];
Color[] colors = new Color[vector2Short.x * vector2Short.y]; Color[] colors = new Color[vector2Short.x * vector2Short.y];
...@@ -308,7 +308,7 @@ public class mainGameOneImageView : mainGameView ...@@ -308,7 +308,7 @@ public class mainGameOneImageView : mainGameView
lineImg.SetActive(false); lineImg.SetActive(false);
return; return;
} }
//显示指定区域 //��ʾָ������
if (GroupByAreaPtInfos.mapAllDatas.ContainsKey((short)areaId)) if (GroupByAreaPtInfos.mapAllDatas.ContainsKey((short)areaId))
{ {
gameAreaItem areaItem1 = gameidJsondata.getAid((short)areaId); gameAreaItem areaItem1 = gameidJsondata.getAid((short)areaId);
...@@ -329,7 +329,7 @@ public class mainGameOneImageView : mainGameView ...@@ -329,7 +329,7 @@ public class mainGameOneImageView : mainGameView
allColor2["outColor"][idx] = color; allColor2["outColor"][idx] = color;
allColor2["thumbnail"][y * size2.x + x] = color; allColor2["thumbnail"][y * size2.x + x] = color;
} }
//边缘怎么弄? //��Ե��ôŪ?
if (isApply == true) if (isApply == true)
{ {
Apply(); Apply();
...@@ -341,7 +341,7 @@ public class mainGameOneImageView : mainGameView ...@@ -341,7 +341,7 @@ public class mainGameOneImageView : mainGameView
} }
} }
//回放使用 //�ط�ʹ��
public void showAreaPrveClear(bool isfirst) { public void showAreaPrveClear(bool isfirst) {
if(InitEndIsShowLine == false) if(InitEndIsShowLine == false)
{ {
...@@ -373,7 +373,7 @@ public class mainGameOneImageView : mainGameView ...@@ -373,7 +373,7 @@ public class mainGameOneImageView : mainGameView
} }
public override void resetSize() public override void resetSize()
{ {
//怎么保持宽高比 //��ô���ֿ��߱�
if (InitEndIsShowLine == true) if (InitEndIsShowLine == true)
{ {
float width = gameidJsondata.width; float width = gameidJsondata.width;
...@@ -391,7 +391,7 @@ public class mainGameOneImageView : mainGameView ...@@ -391,7 +391,7 @@ public class mainGameOneImageView : mainGameView
width = utilsTools.DisplaySize.x * 0.65f; width = utilsTools.DisplaySize.x * 0.65f;
height = width * 2; height = width * 2;
} }
//确定好宽高后赋 //ȷ���ÿ��ߺ�ֵ
GameObject[] gameObjects = { oneImg, areaIdBase }; GameObject[] gameObjects = { oneImg, areaIdBase };
Vector3 tempPos = rectTransform.localPosition; Vector3 tempPos = rectTransform.localPosition;
if (width.Equals(height) == false) if (width.Equals(height) == false)
...@@ -533,10 +533,11 @@ public class mainGameOneImageView : mainGameView ...@@ -533,10 +533,11 @@ public class mainGameOneImageView : mainGameView
}); });
} }
} }
public void idHashPosToArrayPosEx() public void idHashPosToArrayPosEx()
{ {
idHashPosToArrayPos(); idHashPosToArrayPos();
//将边缘重复放入周边区域 //����Ե�ظ������ܱ����� 将边缘重复放入周边区域
for (int i = 0; i < allBianLun.Count(); i++) for (int i = 0; i < allBianLun.Count(); i++)
{ {
int idx = allBianLun[i]; int idx = allBianLun[i];
...@@ -729,13 +730,13 @@ public class mainGameOneImageView : mainGameView ...@@ -729,13 +730,13 @@ public class mainGameOneImageView : mainGameView
} }
utilsTools.setGDataByKey("loadBinBegin", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("loadBinBegin", utilsTools.getTotalMillisecond());
string binpath = colorPath.Substring(0, linePath.Length - 4) + ".bin"; string binpath = colorPath.Substring(0, linePath.Length - 4) + ".bin";
if (utilsTools.IsPhone == false) if (utilsTools.IsWin == true)
{ {
binpath = binpath.Replace("/", "\\"); binpath = binpath.Replace("/", "\\");
} }
Byte[] bytes = File.ReadAllBytes(binpath); Byte[] bytes = File.ReadAllBytes(binpath);
bytesInitDigitMatrix(bytes); bytesInitDigitMatrix(bytes);
Debug.Log("bin初始化完成--------------"); Debug.Log("bin��ʼ�����--------------");
int start = 0; int start = 0;
int step = BitConverter.GetBytes((short)2).Length; int step = BitConverter.GetBytes((short)2).Length;
int stepInt = BitConverter.GetBytes(65539).Length; int stepInt = BitConverter.GetBytes(65539).Length;
......
...@@ -68,6 +68,8 @@ public class mainGameScaleMove : MonoBehaviour ...@@ -68,6 +68,8 @@ public class mainGameScaleMove : MonoBehaviour
resetBtn.SetActive(false); resetBtn.SetActive(false);
} }
} }
public void setCheckInput() public void setCheckInput()
{ {
if (checkInput == null) if (checkInput == null)
...@@ -273,11 +275,17 @@ public class mainGameScaleMove : MonoBehaviour ...@@ -273,11 +275,17 @@ public class mainGameScaleMove : MonoBehaviour
} }
Vector2 diff = new Vector2(Input.mousePosition.x + winPrvePos.x,Input.mousePosition.y + winPrvePos.y); Vector2 diff = new Vector2(Input.mousePosition.x + winPrvePos.x,Input.mousePosition.y + winPrvePos.y);
onOneTouchMove(Input.mousePosition, diff); onOneTouchMove(Input.mousePosition, diff);
}else if(utilsTools.ContainsKey(gameObject, "oneTouchBegin"))
}
else if(utilsTools.ContainsKey(gameObject, "oneTouchBegin"))
{ {
Vector2 diff = new Vector2(Input.mousePosition.x + winPrvePos.x, Input.mousePosition.y + winPrvePos.y); Vector2 diff = new Vector2(Input.mousePosition.x + winPrvePos.x, Input.mousePosition.y + winPrvePos.y);
onOneTouchEnd(Input.mousePosition, diff); onOneTouchEnd(Input.mousePosition, diff);
} }
} }
private void onOneTouchBegin(Vector2 vector2) private void onOneTouchBegin(Vector2 vector2)
{ {
...@@ -375,7 +383,6 @@ public class mainGameScaleMove : MonoBehaviour ...@@ -375,7 +383,6 @@ public class mainGameScaleMove : MonoBehaviour
checkInput(); checkInput();
} }
} }
} }
private void updateScaleView() private void updateScaleView()
{ {
...@@ -412,6 +419,7 @@ public class mainGameScaleMove : MonoBehaviour ...@@ -412,6 +419,7 @@ public class mainGameScaleMove : MonoBehaviour
var itemChild = transform.GetChild(i); var itemChild = transform.GetChild(i);
itemChild.localScale = nowScale; itemChild.localScale = nowScale;
} }
Debug.Log(areaItem.ToString()); Debug.Log(areaItem.ToString());
RectTransform idAreaRectTransform = transform.Find("areaIdBase/" + areaItem.tempExKey).GetComponent<RectTransform>(); RectTransform idAreaRectTransform = transform.Find("areaIdBase/" + areaItem.tempExKey).GetComponent<RectTransform>();
pos = idAreaRectTransform.localPosition * -1 * nowScale / initScale; pos = idAreaRectTransform.localPosition * -1 * nowScale / initScale;
......
This diff is collapsed.
...@@ -5,21 +5,21 @@ using System; ...@@ -5,21 +5,21 @@ using System;
using UnityEngine.UIElements; using UnityEngine.UIElements;
using Unity.VisualScripting; using Unity.VisualScripting;
/// <summary> /// <summary>
/// 数字矩阵 /// ���־���
/// </summary> /// </summary>
public class DigitMatrixShort public class DigitMatrixShort//泛洪算法 颜料桶算法
{ {
#region 属性 #region ����
public DigitMatrixSetBack back = null; public DigitMatrixSetBack back = null;
public DigitMatrixIsEqual<short> isEqualItem = null; public DigitMatrixIsEqual<short> isEqualItem = null;
public bool isPause = false; public bool isPause = false;
/// <summary> /// <summary>
/// 行数 /// ����
/// </summary> /// </summary>
public short RowCount { get; private set; } public short RowCount { get; private set; }
/// <summary> /// <summary>
/// 列数 /// ����
/// </summary> /// </summary>
public short ColumnCount { get; private set; } public short ColumnCount { get; private set; }
...@@ -72,15 +72,15 @@ public class DigitMatrixShort ...@@ -72,15 +72,15 @@ public class DigitMatrixShort
}, bianLun, false); }, bianLun, false);
//foreach (var item in tempPts) //foreach (var item in tempPts)
//{ //{
// Data[item.Item1, item.Item2] = oldValue;//恢复 // Data[item.Item1, item.Item2] = oldValue;//�ָ�
//} //}
} }
#region FloodFill8WithStack #region FloodFill8WithStack
/// <summary> /// <summary>
/// 漫水填充(基于堆的8邻域填充) /// ��ˮ���(���ڶѵ�8�������)
/// </summary> /// </summary>
/// <param name="r"></param> /// <param name="r">��</param>
/// <param name="c"></param> /// <param name="c">��</param>
/// <param name="newValue"></param> /// <param name="newValue"></param>
/// <param name="oldValue"></param> /// <param name="oldValue"></param>
/// <param name="matrix"></param> /// <param name="matrix"></param>
...@@ -135,7 +135,7 @@ public class DigitMatrixShort ...@@ -135,7 +135,7 @@ public class DigitMatrixShort
CheckNewSeed(r - 1, c + 1); CheckNewSeed(r - 1, c + 1);
CheckNewSeed(r + 1, c - 1); CheckNewSeed(r + 1, c - 1);
tryValues = tryValues + 1; tryValues = tryValues + 1;
if (tryValues > 4096 * 4096 * 10) break;//基本死循环了 if (tryValues > 4096 * 4096 * 10) break;//������ѭ����
} }
} }
#endregion #endregion
......
...@@ -26,7 +26,7 @@ public class AreaAnimationDiffuse ...@@ -26,7 +26,7 @@ public class AreaAnimationDiffuse
public short m_y; public short m_y;
public short m_aid; public short m_aid;
public short m_fpsStart = 1;//r 开始 public short m_fpsStart = 1;//r 开始
public short m_fpsEnd = 100;//r 结束 public short m_fpsEnd = 50;//r 结束 这个值调大了可以让动画效果变快,小了就是变慢
//key beginStart 值 value 这个圆环的像素 //key beginStart 值 value 这个圆环的像素
public ConcurrentDictionary<short, List<short>> m_datas = new ConcurrentDictionary<short, List<short>>(); public ConcurrentDictionary<short, List<short>> m_datas = new ConcurrentDictionary<short, List<short>>();
public int nowState = 0;//0 尚未开始 1 处理中 2 处理完成 public int nowState = 0;//0 尚未开始 1 处理中 2 处理完成
...@@ -71,12 +71,12 @@ public class RectInt ...@@ -71,12 +71,12 @@ public class RectInt
dowm = rectInt.dowm; dowm = rectInt.dowm;
} }
} }
public class GroupByAreaPtInfos public class GroupByAreaPtInfos //把组和大图对应的区域关联起来
{ {
//public Dictionary<short, List<Vector2Short>> datas = new Dictionary<short, List<Vector2Short>>(); //public Dictionary<short, List<Vector2Short>> datas = new Dictionary<short, List<Vector2Short>>();
public Dictionary<short, bool> datasBool = new Dictionary<short, bool>(); public Dictionary<short, bool> datasBool = new Dictionary<short, bool>(); //key 区域id bool true:没涂
private Dictionary<short, bool> lines = new Dictionary<short, bool>(); private Dictionary<short, bool> lines = new Dictionary<short, bool>(); //key:区域id true没涂
public static Dictionary<short, List<int>> mapAllDatas = new Dictionary<short, List<int>>(); public static Dictionary<short, List<int>> mapAllDatas = new Dictionary<short, List<int>>(); //key:区域id value:全部的像素点坐标
public static int width; public static int width;
public static int height; public static int height;
public bool getDataByAid(short aid, ref List<Vector2Short> data, bool isReBack = false) public bool getDataByAid(short aid, ref List<Vector2Short> data, bool isReBack = false)
...@@ -203,7 +203,7 @@ public class ColorIndexTables ...@@ -203,7 +203,7 @@ public class ColorIndexTables
color = new Color(temp.r, temp.g, temp.b, temp.a); color = new Color(temp.r, temp.g, temp.b, temp.a);
return true; return true;
} }
public bool getTiledColor(int x, int y, ref Color color) public bool getTiledColor(int x, int y, ref Color color) //选中区域整个铺满
{ {
if (x < 0) if (x < 0)
{ {
......
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