Commit 2a07d6a0 authored by JiangWanZhi's avatar JiangWanZhi

添加一个事件名称的类

parent 3a644f12
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class EventName
{
public class Event
{
public const string Event_switchGameAreaGroupId = "switchGameAreaGroupId"; //切换组的ID
public const string Event_gameViewOnInitEnd = "gameViewOnInitEnd"; //图片初始化完成
public const string Event_gameClickPos = "gameClickPos"; //点击灰色区域
public const string Event_inGameLoadingBarEnd = "inGameLoadingBarEnd"; //进游戏的进度条加载完了
public const string Event_showAreaEventOk = "showAreaEventOk"; //当前选中的组的区域涂了一个
public const string Event_initViewShowData = "initViewShowData"; //初始化数据完成
public const string Event_changeGameUserProgress = "changeGameUserProgress"; //整体进度改变
public const string Event_tipShowPosMaxScale = "tipShowPosMaxScale"; //点提示
public const string Event_gamePlayerEndHandler = "gamePlayerEndHandler"; //整个大图都涂完了
public const string Event_closeGameScene = "closeGameScene"; //关游戏
public const string Event_removeGroupByGid = "removeGroupByGid"; //移除一个组
public const string Event_GroupIsLoadOver = "GroupIsLoadOver";//组的成员加载完成,就是组列表下的item
public const string Event_inGameLoadingValue = "inGameLoadingValue"; //进游戏的进度条进度
public const string Event_switchHomeLabels = "switchHomeLabels";
public const string Event_SwitchLableNext = "SwitchLableNext";
public const string Event_showImagePageData = "showImagePageData";
public const string Event_switchPage = "switchPage";
public const string Event_setImageViewLable = "setImageViewLable";
}
}
fileFormatVersion: 2
guid: dace7007c53007c48a27f2254aaa60fa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -4,16 +4,12 @@ using Debug = UnityEngine.Debug;
public class ScaleToImage : MonoBehaviour
{
public Transform target; //目标
public Transform target; //缩放和拖动的目标
bool isInit_Scale;
Vector3 touch1, touch2, oriPos, pos;
float scale, oriScale;
public float scaleSpeed = 1;
public bool isLimitScale;
public float scaleSpeed = 0.8f;
public Camera canvasCamera;
public Transform ScrollRect; //组的父节点
public float MinScale;
......@@ -30,40 +26,31 @@ public class ScaleToImage : MonoBehaviour
public Transform CloseBtn;
private bool isInit_move;
private Vector3 offset;
private Vector3 offset_Move;
private Vector3 ToFigerCenter; //指向手指中间的向量
private float ToFigerdistance; //距离
private Vector3 ToFigerCenter_Scale; //指向手指中间的向量
private float ToFigerdistance_Scale; //距离
private float MoveValue; //移动,缩放大了就小一些
private float MoveValue_Scale; //移动,缩放大了就小一些
private bool PlayAniFlag;
private bool PlayAniFlag_Scale;
private Vector3 OldPos_Move; //手指拖动上一帧的位置
private bool MoveEndFlag;
private bool IsPlayAniFlag;
private bool TestFlag;
private bool MoveFlag;
private Vector3 SavePos_Scale; //这个是保存放大到最大的倍数的时候回正的位置
private void Update()
{
if (Input.touchCount == 2)
{
if (MoveFlag)
{
MoveFlag = false;
}
Scale();
MoveEndFlag = false;
TestFlag = true;
}
else
{
isInit_Scale = false;
if (PlayAniFlag)
if (PlayAniFlag_Scale)
{
if (target.GetChild(0).localScale.x <= Min_Move) //缩放小的回大
{
......@@ -72,25 +59,21 @@ public class ScaleToImage : MonoBehaviour
target.GetChild(i).DOScale(Vector3.one * MinScale, 0.3f);
}
}
else if (target.GetChild(0).localScale.x >= Max_Move) //大的回来小
else if (target.GetChild(0).localScale.x >= MaxScale) //大的回来小
{
for (int i = 0; i < target.childCount; i++)
{
target.GetChild(i).DOScale(Vector3.one * MaxScale, 0.3f);
target.GetChild(i).DOMove(oriPos, 0.3f).onComplete=()=> { IsPlayAniFlag = false; };
target.GetChild(i).DOMove(SavePos_Scale, 0.3f).onComplete=()=> { IsPlayAniFlag = false; };
}
}
PlayAniFlag = false;
PlayAniFlag_Scale = false;
IsPlayAniFlag = true;
}
if (TestFlag)
{
//Debug.LogError($"11111 初始的位置:{oriPos} 现在的位置:{target.GetChild(0).position} 本地:{target.GetChild(0).localPosition} 初始的缩放:{oriScale} 现在的缩放:{target.GetChild(0).localScale}");
TestFlag = false;
}
Move();
}
}
private void Scale()
{
if (!isInit_Scale)
......@@ -107,8 +90,12 @@ public class ScaleToImage : MonoBehaviour
touch1 = new Vector3(touch1.x, touch1.y, 0);
touch2 = new Vector3(touch2.x, touch2.y, 0);
//目标初始点位
//图片的初始点位
oriPos = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y, 0);
if (target.GetChild(0).localScale.x >= MaxScale * 0.99f)
{
SavePos_Scale = target.GetChild(0).position;
}
float distance = Vector2.Distance(touch1, touch2) / 2f;
......@@ -116,13 +103,13 @@ public class ScaleToImage : MonoBehaviour
pos = normal * distance + touch2; //两个手指中间的点
//指向手指中心的单位向量
ToFigerCenter = (pos - oriPos).normalized;
ToFigerCenter_Scale = (pos - oriPos).normalized;
//距离
ToFigerdistance = Vector3.Distance(pos, oriPos);
ToFigerdistance_Scale = Vector3.Distance(pos, oriPos);
oriScale = target.GetChild(0).localScale.x;//开始的缩放值
isInit_Scale = true;
MoveValue = 1 / oriScale;
MoveValue_Scale = 1 / oriScale;
return;
}
......@@ -138,16 +125,16 @@ public class ScaleToImage : MonoBehaviour
float nowdis = Vector3.Distance(canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position), canvasCamera.ScreenToWorldPoint(Input.GetTouch(1).position));
scale = nowdis / Vector3.Distance(touch1, touch2); //大于1是放大,小于是缩小
//利用scaleSpeed控制缩放速度
scale = (scale - 1) * 0.8f; //正的话就是放大图片
//控制缩放速度
scale = (scale - 1) * scaleSpeed; //正的话就是放大图片
if (scale < 0)
{
scale = scale * oriScale * 0.8f; //缩小速度
scale = scale * oriScale * scaleSpeed; //缩小速度
}
if (target.GetChild(0).localScale.x < Min_Move)
{
PlayAniFlag = true;
PlayAniFlag_Scale = true;
return;
}
......@@ -161,22 +148,21 @@ public class ScaleToImage : MonoBehaviour
{
item.localScale = Vector3.one * Min_Move * 0.99f;
}
else if (scale_target > Max_Move)
else if (scale_target > MaxScale)
{
item.localScale = Vector3.one * (oriScale + scale);
PlayAniFlag = true;
PlayAniFlag_Scale = true;
}
else
{
item.localScale = Vector3.one * (oriScale + scale);
SavePos_Scale = item.position;
}
//改变目标位置,让位置保持不变
item.position = oriPos - ToFigerCenter * (item.localScale.x - oriScale) * ToFigerdistance * MoveValue;
item.position = oriPos - ToFigerCenter_Scale * (item.localScale.x - oriScale) * ToFigerdistance_Scale * MoveValue_Scale;
item.localPosition = new Vector3(item.localPosition.x, item.localPosition.y, 0);
}
//Debug.LogError($"11111 目标缩放:{scale_target} 动画标记:{PlayAniFlag} Min_Move:{Min_Move} Max_Move: {Max_Move} 初始点:{oriPos} 现在点:{target.GetChild(0).position}");
}
private void Move()
......@@ -187,14 +173,14 @@ public class ScaleToImage : MonoBehaviour
if (MoveEndFlag && !IsPlayAniFlag)
LerptoMove_End();
}
else if (Input.GetMouseButtonDown(0))
if (Input.GetMouseButtonDown(0))
{
if (IsImageArea(Input.mousePosition) && IsMidArea(Input.mousePosition))
{
MoveEndFlag = true;
}
}
else if (Input.GetMouseButton(0))
if (Input.GetMouseButton(0))
{
if(MoveEndFlag)
OnClickMove(Input.mousePosition);
......@@ -225,12 +211,13 @@ public class ScaleToImage : MonoBehaviour
{
if (!IsImageArea(ScreenPos))
return;
offset = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y,0) - new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0);
offset_Move = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y,0) - new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0);
isInit_move = true;
return;
}
else
{
var pos = new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0) + offset; //图片目标位置
var pos = new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0) + offset_Move; //图片目标位置
CanMove(pos.x, pos.y, out float x, out float y);
......@@ -241,7 +228,6 @@ public class ScaleToImage : MonoBehaviour
var item = target.GetChild(i);
item.position = pos;
}
MoveFlag = true;
}
}
......@@ -257,6 +243,7 @@ public class ScaleToImage : MonoBehaviour
float offset_y = (dis_y * scale - dis_y) / offset;
float offset_x = (dis_x * scale - dis_x) / offset;
if (Target_y < AreaPoint_Left_Down.position.y - offset_y)
{
y = AreaPoint_Left_Down.position.y - offset_y;
......@@ -326,6 +313,5 @@ public class ScaleToImage : MonoBehaviour
}
return false;
}
}
......@@ -28,7 +28,7 @@ public class gameEndLogic : MonoBehaviour,IEventHandler
{
transform.Find("inSaveProgress").gameObject.SetActive(false);
transform.Find("gameShowBase").gameObject.SetActive(false);
utilsTools.onEvent(this, "initViewShowData");
utilsTools.onEvent(this, EventName.Event.Event_initViewShowData);
utilsTools.onEvent(this, "onClick_saveOptions_msg");
}
}
......@@ -94,7 +94,7 @@ public class gameEndLogic : MonoBehaviour,IEventHandler
}
public void onContinueHandler()
{
utilsTools.sendEventObjectParams("closeGameScene");
utilsTools.sendEventObjectParams(EventName.Event.Event_closeGameScene);
}
//保存成mp4
private void onSaveToMp4Handler()
......@@ -216,7 +216,7 @@ public class gameEndLogic : MonoBehaviour,IEventHandler
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (eventName.Equals("initViewShowData"))
if (eventName.Equals(EventName.Event.Event_initViewShowData))
{
this.gameScenUseInfo = (GameScenUserInfo)objects[0];
}else if (eventName.Equals("onClick_saveOptions_msg"))
......
......@@ -14,7 +14,7 @@ public class gameInLoading : MonoBehaviour,IEventHandler
private Slider slider = null;
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (eventName.Equals("inGameLoadingValue"))
if (eventName.Equals(EventName.Event.Event_inGameLoadingValue))
{
float addValue = (float)objects[0];
bool isEnd = (bool)objects[1];
......@@ -40,10 +40,10 @@ public class gameInLoading : MonoBehaviour,IEventHandler
stepvalue = stepvalue1;
if (isEnd)
{
utilsTools.sendEvent("inGameLoadingBarEnd");
utilsTools.sendEvent(EventName.Event.Event_inGameLoadingBarEnd);
}
}
else if(eventName.Equals("initViewShowData"))
else if(eventName.Equals(EventName.Event.Event_initViewShowData))
{
gameObject.SetActive(true);
}
......@@ -57,8 +57,8 @@ public class gameInLoading : MonoBehaviour,IEventHandler
slider.value = 0;
slider.maxValue = maxvalue;
slider.minValue = 0;
utilsTools.onEvent(this, "inGameLoadingValue");
utilsTools.onEvent(this, "initViewShowData");
utilsTools.onEvent(this, EventName.Event.Event_inGameLoadingValue);
utilsTools.onEvent(this, EventName.Event.Event_initViewShowData);
}
// Update is called once per frame
void Update()
......@@ -75,7 +75,7 @@ public class gameInLoading : MonoBehaviour,IEventHandler
stepvalue = 0.0f;
//需要通知出去满了
Debug.Log("end ------------");
utilsTools.sendEvent("inGameLoadingBarEnd");
utilsTools.sendEvent(EventName.Event.Event_inGameLoadingBarEnd);
return;
}
else
......
......@@ -64,20 +64,19 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
utilsTools.setGDataByKey("urlRoot", "http://8.218.187.222:19897");
}
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
onEvent("switchGameAreaGroupId",this.onEvent_switchGameAreaGroupId_Handler); //切换组的ID
onEvent("gameViewOnInitEnd",this.onEvent_gameViewOnInitEnd_Handler); //游戏图片初始化完成
onEvent("gameClickPos",this.onEvent_gameClickPos_Handler); //灰色的点击回掉
onEvent("inGameLoadingBarEnd",this.onEvent_inGameLoadingBarEnd_Handler); //进入游戏的进度条加载完成
onEvent("showAreaEventOk", onSelectAreaEvent); //当前组的涂了一个
onEvent("initViewShowData", onInitViewShowDataEvent); //初始化数据完成
onEvent("changeGameUserProgress", onChangeGameUserProgressEvent); //整体进度改变
onEvent("tipShowPosMaxScale", onTipShowPosMaxScaleEvent); // 点提示,当前组随机一个没涂的位置放大
onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); //整个大图都涂完了
onEvent("closeGameScene", onCloseGameSceneEvent); //关游戏
onEvent("removeGroupByGid", onRemoveGroupByGidEvent); //自动涂gid不一致会调过来
onEvent("GroupIsLoadOver", onGroupIsLoadOver); //组的成员加载完成,就是组列表下的item
onEvent(EventName.Event.Event_switchGameAreaGroupId, this.onEvent_switchGameAreaGroupId_Handler); //切换组的ID
onEvent(EventName.Event.Event_gameViewOnInitEnd,this.onEvent_gameViewOnInitEnd_Handler); //游戏图片初始化完成
onEvent(EventName.Event.Event_gameClickPos,this.onEvent_gameClickPos_Handler); //灰色的点击回掉
onEvent(EventName.Event.Event_inGameLoadingBarEnd,this.onEvent_inGameLoadingBarEnd_Handler); //进入游戏的进度条加载完成
onEvent(EventName.Event.Event_showAreaEventOk, onSelectAreaEvent); //当前组的涂了一个
onEvent(EventName.Event.Event_initViewShowData, onInitViewShowDataEvent); //初始化数据完成
onEvent(EventName.Event.Event_changeGameUserProgress, onChangeGameUserProgressEvent); //整体进度改变
onEvent(EventName.Event.Event_tipShowPosMaxScale, onTipShowPosMaxScaleEvent); // 点提示,当前组随机一个没涂的位置放大
onEvent(EventName.Event.Event_gamePlayerEndHandler, onGamePlayerEndHandlerEvent); //整个大图都涂完了
onEvent(EventName.Event.Event_closeGameScene, onCloseGameSceneEvent); //关游戏
onEvent(EventName.Event.Event_removeGroupByGid, onRemoveGroupByGidEvent); //自动涂gid不一致会调过来
onEvent(EventName.Event.Event_GroupIsLoadOver, onGroupIsLoadOver); //组的成员加载完成,就是组列表下的item
transform.Find("ingameLoad/loadImg").gameObject.SetActive(false);
//gameScenUser
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
......@@ -313,7 +312,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
if(groupInfos.Count == 0)
{
utilsTools.sendEventObjectParams("inGameLoadingValue", 100f, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", false);
return;
}
......@@ -341,7 +340,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
rectTransform2.gameObject.SetActive(true);
maingameView.GetComponent<mainGameScaleMove>().setCheckInput();
utilsTools.sendEventObjectParams("inGameLoadingValue", 100f, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
}
......@@ -649,7 +648,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//gameEndLogic gameEndlogic = transform.Find("gameEndOperBase").GetComponent<gameEndLogic>();
//gameEndlogic.initView();
//暂时调回放场景
utilsTools.sendEvent("closeGameScene");
utilsTools.sendEvent(EventName.Event.Event_closeGameScene);
// utilsTools.addTimer_Update(gameObject, "close", (String name) =>
// {
// gameShowView.GetComponent<mainGameView>().onClear();
......@@ -748,7 +747,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
item.DOScale(Vector3.zero, 0.5f).onComplete = () =>
{
Debug.LogError($"这里销毁的组ID是:{gid} ");
Destroy(item.gameObject);
};
......@@ -773,7 +771,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
var Nextitme = areaGroupList.GetComponent<gameSceneAreaGroupHandler>().GetObjByDestoryGid(DestoryByGID).GetComponent<colorItem>();
Debug.LogError($"移除的组ID是:{DestoryByGID} 现在的组ID是:{Nextitme.GID}");
Nextitme.IsSelect = true;
Nextitme.onClickAreaGroup();
Nextitme.switchPlayAnimation();
......@@ -868,7 +865,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
public void skipToHome()
{
utilsTools.sendEvent("closeGameScene");
utilsTools.sendEvent(EventName.Event.Event_closeGameScene);
}
public void OnDestroy()
{
......
......@@ -20,9 +20,9 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
}
void Start()
{
onEvent("showAreaEventOk", onSelectAreaEvent);
onEvent(EventName.Event.Event_showAreaEventOk, onSelectAreaEvent);
onEvent("showAreaPalyerEnd", onShowAreaPalyerEndEvent);
onEvent("inGameLoadingBarEnd", onInGameLoadingBarEndEvent);
onEvent(EventName.Event.Event_inGameLoadingBarEnd, onInGameLoadingBarEndEvent);
onEvent("CloseScenePrve", onCloseScenePrveHandler);
utilsTools.addTimer_Update(gameObject, "first", (string name) =>
{
......@@ -155,7 +155,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
{
gameScenUser.thumbnailUrl = jsondata.getSmallLineUrl();
}
utilsTools.sendEventObjectParams("initViewShowData", gameScenUser);
utilsTools.sendEventObjectParams(EventName.Event.Event_initViewShowData, gameScenUser);
if (utilsTools.ContainsKeyGDataByKey("history"))
{
gameScenUser.setShowAreaids(utilsTools.getGDataByKey<string>("history",""));
......@@ -186,7 +186,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
int now = Convert.ToInt32(gameScenUserInfo.areaInfoUseData.Count / allAreaSize * 100);
if((now - Convert.ToInt32(old)) > 0)
{
utilsTools.sendEventObjectParams("changeGameUserProgress", now);
utilsTools.sendEventObjectParams(EventName.Event.Event_changeGameUserProgress, now);
}
}
}
......@@ -203,7 +203,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
if (gameScenUserInfo == null) return;
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
int now = Convert.ToInt32(gameScenUserInfo.areaInfoUseData.Count / allAreaSize * 100);
utilsTools.sendEventObjectParams("changeGameUserProgress", now);
utilsTools.sendEventObjectParams(EventName.Event.Event_changeGameUserProgress, now);
}
void onCloseScenePrveHandler(List<UnityEngine.Object> uobject,List<System.Object> objects)
{
......
......@@ -174,12 +174,12 @@ public class HomePageLibrary : MonoBehaviour,IEventHandler
if(Mathf.Abs(diff) > imageViews.GetComponent<RectTransform>().rect.width / 2)
{
//准备切页面
utilsTools.sendEventObjectParams("SwitchLableNext", diff, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_SwitchLableNext, diff, true);
}
else
{
//回复原始的X位置
utilsTools.sendEventObjectParams("SwitchLableNext", diff, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_SwitchLableNext, diff, false);
}
}
moveDir = 0;
......@@ -219,9 +219,9 @@ public class HomePageLibrary : MonoBehaviour,IEventHandler
labels = netLabelTypeData.result.data;
selectId = labels[0].id;
updateLabelScrollView();
utilsTools.sendEventObjectParams("showImagePageData", -1, false, "imageListL");
utilsTools.sendEventObjectParams("showImagePageData", 1, false, "imageListR");
utilsTools.sendEventObjectParams("showImagePageData", 0, true, "imageListM");//少量加载
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, -1, false, "imageListL");
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, 1, false, "imageListR");
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, 0, true, "imageListM");//少量加载
return true;
}
return false;
......@@ -245,9 +245,9 @@ public class HomePageLibrary : MonoBehaviour,IEventHandler
void Start()
{
setCheckInput();
onEvent("switchHomeLabels", onClickSwitchHomeLabelsEvent);
onEvent("SwitchLableNext", onSwitchLableNextEvent);
onEvent("showImagePageData", onShowImagePageDataEvent);
onEvent(EventName.Event.Event_switchHomeLabels, onClickSwitchHomeLabelsEvent);
onEvent(EventName.Event.Event_SwitchLableNext, onSwitchLableNextEvent);
onEvent(EventName.Event.Event_showImagePageData, onShowImagePageDataEvent);
onEvent("clickImageViewHandler", onClickImageViewHandlerEvent);
getLabels();
......@@ -326,9 +326,9 @@ public class HomePageLibrary : MonoBehaviour,IEventHandler
}
selectId = clickId;
utilsTools.sendEventObjectParams("showImagePageData", idx - 1, false, "imageListL");
utilsTools.sendEventObjectParams("showImagePageData", idx, true, "imageListM");//少量加载
utilsTools.sendEventObjectParams("showImagePageData", idx+1, false, "imageListR");
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, idx - 1, false, "imageListL");
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, idx, true, "imageListM");//少量加载
utilsTools.sendEventObjectParams(EventName.Event.Event_showImagePageData, idx+1, false, "imageListR");
//scrollViewSkipToPosAction(x);
}
......
......@@ -34,8 +34,8 @@ public class replayerBack : MonoBehaviour, IEventHandler
if (path.EndsWith("shareButton")) return 1;
return 0;
});
onEvent("initViewShowData", onInitViewShowDataEvent);
onEvent("gameViewOnInitEnd", onGameViewOnInitEndEvent);
onEvent(EventName.Event.Event_initViewShowData, onInitViewShowDataEvent);
onEvent(EventName.Event.Event_gameViewOnInitEnd, onGameViewOnInitEndEvent);
onEvent("onClick_saveOptions_msg", onClick_saveOptions_msg_Event);
string json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/cc--EDgRpc_nHQru7H.png\",\"hybridType\":64,\"id\":\"cc--EDgRpc_nHQru7H\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/cc--EDgRpc_nHQru7H.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
utilsTools.setGDataByKey("NativeGameData", JsonUtility.FromJson<netLableImageItem>(json));
......@@ -112,7 +112,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
}
string hist = utilsDB.getDBStringDataByKey("history_" + jsonData.id, "");
gameScenUser.setShowAreaids(hist);
utilsTools.sendEventObjectParams("initViewShowData", gameScenUser);
utilsTools.sendEventObjectParams(EventName.Event.Event_initViewShowData, gameScenUser);
}
//onGameViewOnInitEndEvent
void onGameViewOnInitEndEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
......
......@@ -23,12 +23,12 @@ public class salaScene_bottom : MonoBehaviour
{
Button button = transform.GetChild(oldIdx).gameObject.GetComponent<Button>();
button.interactable = true;
utilsTools.sendEventObjectParams("switchPage", transform.GetChild(OldIdx).name,false);
utilsTools.sendEventObjectParams(EventName.Event.Event_switchPage, transform.GetChild(OldIdx).name,false);
}
oldIdx = value;
Button button1 = transform.GetChild(oldIdx).gameObject.GetComponent<Button>();
button1.interactable = false;
utilsTools.sendEventObjectParams("switchPage", transform.GetChild(OldIdx).name,true);
utilsTools.sendEventObjectParams(EventName.Event.Event_switchPage, transform.GetChild(OldIdx).name,true);
}
}
......@@ -48,7 +48,7 @@ public class salaScene_bottom : MonoBehaviour
var btn = new UnityEngine.UI.Button.ButtonClickedEvent();
utilsTools.sendEventObjectParams("switchPage", gobjectItem.gameObject, "zhang", i);
utilsTools.sendEventObjectParams(EventName.Event.Event_switchPage, gobjectItem.gameObject, "zhang", i);
btn.AddListener(() => {
Int32 i2 = -1;
System.Object i3 = i2;
......
......@@ -21,7 +21,7 @@ public class salaScene_ImageView : gridView,IEventHandler
void Start()
{
clearAllItems();
utilsTools.onEvent(this, "setImageViewLable");
utilsTools.onEvent(this, EventName.Event.Event_setImageViewLable);
}
void UpdateLogic()
{
......@@ -44,7 +44,7 @@ public class salaScene_ImageView : gridView,IEventHandler
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (eventName.Equals("setImageViewLable"))
if (eventName.Equals(EventName.Event.Event_setImageViewLable))
{
string labelName = objects[0] as string;
this.nowUseIdx = 1;
......
......@@ -21,7 +21,7 @@ public class salaScene_labels : gridView, IEventHandler
lItem = getObjectById(idx).GetComponent<labelItem>();
lItem.select = true;
nowselect = idx;
utilsTools.sendEventObjectParams("setImageViewLable", name);
utilsTools.sendEventObjectParams(EventName.Event.Event_setImageViewLable, name);
}
}
......@@ -37,7 +37,7 @@ public class salaScene_labels : gridView, IEventHandler
label.select = nowselect == idx;
if (nowselect == idx)
{
utilsTools.sendEventObjectParams("setImageViewLable", alldata[idx]);
utilsTools.sendEventObjectParams(EventName.Event.Event_setImageViewLable, alldata[idx]);
}
}
......
......@@ -6,7 +6,7 @@ using UnityEngine;
public class salaScene_pages : MonoBehaviour, IEventHandler
{
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<object> objects){
if (eventName.Equals("switchPage")) {
if (eventName.Equals(EventName.Event.Event_switchPage)) {
string name = objects[0] as string;
Boolean isShow = Convert.ToBoolean(objects[1]);
this.transform.Find(name).gameObject.SetActive(isShow);
......@@ -17,7 +17,7 @@ public class salaScene_pages : MonoBehaviour, IEventHandler
void Start()
{
utilsTools.dynamicMount.Clear();
utilsTools.onEvent(this, "switchPage");
utilsTools.onEvent(this, EventName.Event.Event_switchPage);
var commons = transform.parent.Find("commons").gameObject;
utilsTools.dynamicMount.Add("commons", commons);
}
......
......@@ -295,6 +295,6 @@ public class gridView : MonoBehaviour
childTransform.SetParent(null);
GameObject.Destroy(childTransform.gameObject);
}
utilsTools.sendEventObjectParams("GroupIsLoadOver", null);
utilsTools.sendEventObjectParams(EventName.Event.Event_GroupIsLoadOver, null);
}
}
......@@ -50,7 +50,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
int a1 = utilsTools.getTotalMillisecond();
Vector2Short vector2Short2 = allColorSize["final"];
utilsTools.sendEventObjectParams("inGameLoadingValue", 6f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 6f, false);
for (int y1 = 0; y1 < height; y1++)
{
......@@ -125,7 +125,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
utilsTools.setGDataByKey("enableZoomMove", false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams("gamePlayerEndHandler");
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
});
}
});
......@@ -230,7 +230,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
utilsTools.setGDataByKey("enableZoomMove", false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams("gamePlayerEndHandler");
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
});
}
}
......@@ -287,7 +287,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
}
protected override void onInitEndHandler()
{
utilsTools.sendEventObjectParams("gameViewOnInitEnd", allColor2["outColor"],gameidJsondata.width,gameidJsondata.height);
utilsTools.sendEventObjectParams(EventName.Event.Event_gameViewOnInitEnd, allColor2["outColor"],gameidJsondata.width,gameidJsondata.height);
}
public void showAllArea()
{
......@@ -492,7 +492,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
else
{
utilsTools.setGDataByKey("downJsonBack", utilsTools.getTotalMillisecond());
utilsTools.sendEventObjectParams("inGameLoadingValue", 8f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 8f, false);
string jsondata = data as string;
gameIdJsonData gameidJsondata1 = JsonUtility.FromJson<gameIdJsonData>(jsondata);
......@@ -514,7 +514,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
}
}
}
utilsTools.sendEventObjectParams("inGameLoadingValue", 2f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 2f, false);
for (int i = 0; i < gameidJsondata1.roomGroupsData.Count; i++)
{
var group = gameidJsondata1.roomGroupsData[i];
......@@ -650,7 +650,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
}
else
{
utilsTools.sendEventObjectParams("inGameLoadingValue", 100f, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", true);
}
nowSelectgid = gid;
......@@ -722,7 +722,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
}
if (false == gameUserInfo.createWorkDirectory()) return false;
utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 3f, false);
for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++)
{
var userAreaData = gameUserInfo.areaInfoUseData[i];
......@@ -751,7 +751,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
float x = 1.0f;
float y = 1.0f;
int a1 = utilsTools.getTotalMillisecond();
utilsTools.sendEventObjectParams("inGameLoadingValue", 6f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 6f, false);
for (int y1 = 0; y1 < height; y1++)
{
y = y1;
......
......@@ -397,7 +397,7 @@ public class mainGameScaleMove : MonoBehaviour
Vector2 pos1 = vector * scaleVector;
short x = Convert.ToInt16(pos1.x + width / 2);
short y = Convert.ToInt16(pos1.y + height / 2);
utilsTools.sendEventObjectParams("gameClickPos", x,y);
utilsTools.sendEventObjectParams(EventName.Event.Event_gameClickPos, x,y);
}
}
// Update is called once per frame
......
......@@ -148,7 +148,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
float width = gameidJsondata.width;
float height = gameidJsondata.height;
int a1 = utilsTools.getTotalMillisecond();
utilsTools.sendEventObjectParams("inGameLoadingValue", 6f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 6f, false);
Color[] colors = thumbnailTexture2d.GetPixels(0, 0, gameidJsondata.width, gameidJsondata.height);
for(int y1 = 0;y1 < gameidJsondata.height; y1++)
......@@ -357,7 +357,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
int x = (int)datas[1];
int setp = (int)datas[2];
utilsTools.sendEventObjectParams("inGameLoadingValue", 4f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 4f, false);
Color[] colors = lineTexture2d.GetPixels(x, 0, setp, height);
int idx = 0;
bool isbackWrite = false;
......@@ -413,7 +413,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
return;
}
utilsTools.sendEventObjectParams("inGameLoadingValue", 5f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 5f, false);
gameidJsondata.roomGroupsData.Sort(gameAreaGroupItem.sortByIsComplete);
if (areaIdBase != null && perfabPath.Equals("") == false)
{
......@@ -421,7 +421,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
TaskItemBack onUpdateByIdNode = (System.Object[] listparam) =>
{
utilsTools.setGDataByKey("makeAreaIdBegin", utilsTools.getTotalMillisecond());
utilsTools.sendEventObjectParams("inGameLoadingValue", 5f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 5f, false);
checkAddAreaId();
utilsTools.setGDataByKey("makeAreaIdEnd", utilsTools.getTotalMillisecond());
onInitDigitMatrix("select");
......@@ -550,10 +550,10 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
protected virtual void onInitEndHandler()
{
Debug.Log("初始化完成 -----------------");
utilsTools.sendEvent("gameViewOnInitEnd");
utilsTools.sendEvent(EventName.Event.Event_gameViewOnInitEnd);
if(lowImg == null)
{
utilsTools.sendEventObjectParams("inGameLoadingValue", 100f, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
}
if(clickPosEff != null)
{
......@@ -587,7 +587,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
else
{
utilsTools.saveImageDefaultMetaInfoToPath(localpath);
utilsTools.sendEventObjectParams("inGameLoadingValue", 8f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 8f, false);
Image image = null;
if(typeId == 1)
{
......@@ -631,7 +631,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
else
{
utilsTools.setGDataByKey("downJsonBack", utilsTools.getTotalMillisecond());
utilsTools.sendEventObjectParams("inGameLoadingValue", 8f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 8f, false);
string jsondata = data as string;
gameIdJsonData gameidJsondata1 = JsonUtility.FromJson<gameIdJsonData>(jsondata);
......@@ -653,7 +653,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
}
}
utilsTools.sendEventObjectParams("inGameLoadingValue", 2f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 2f, false);
for (int i = 0; i < gameidJsondata1.roomGroupsData.Count; i++)
{
var group = gameidJsondata1.roomGroupsData[i];
......@@ -709,7 +709,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
if (false == gameUserInfo.createWorkDirectory())return false;
utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 3f, false);
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "true"));
this.gameScenUseInfo = gameUserInfo;
......@@ -786,7 +786,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
float width = gameidJsondata.width;
float height = gameidJsondata.height;
int a1 = utilsTools.getTotalMillisecond();
utilsTools.sendEventObjectParams("inGameLoadingValue", 6f, false);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 6f, false);
int index = 0;
Color[] colors = lineTexture2d.GetPixels(start, 0, step, gameidJsondata.height);
for (int y1 = 0; y1 < gameidJsondata.height; y1++)
......@@ -905,7 +905,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
else
{
utilsTools.sendEventObjectParams("inGameLoadingValue", 100f, true);
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", true);
}
nowSelectgid = gid;
......@@ -1005,7 +1005,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
utilsTools.setGDataByKey("enableZoomMove", false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams("gamePlayerEndHandler");
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
});
}
});
......@@ -1095,7 +1095,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
// gameClickPosEffect.player1(8, 0.3f);
//}
}
utilsTools.sendEventObjectParams("showAreaEventOk", areaItem, x, y);
utilsTools.sendEventObjectParams(EventName.Event.Event_showAreaEventOk, areaItem, x, y);
if (showBack != null)
showBack(aid, true);
return 1;
......@@ -1234,7 +1234,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
utilsTools.setGDataByKey("enableZoomMove", false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams("gamePlayerEndHandler");
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
});
}
}
......@@ -1426,7 +1426,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
if (infos.gid.Equals(nowSelectgid) == false)
{
short gid = infos.gid;
utilsTools.sendEventObjectParams("removeGroupByGid", nowSelectgid, gid);
utilsTools.sendEventObjectParams(EventName.Event.Event_removeGroupByGid, nowSelectgid, gid);
}
showAreaByPos(infos.px, infos.py, null, true);
idx++;
......@@ -1473,7 +1473,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
if (aid > -1)
{
var tipAidInfo = gameidJsondata.getAid(aid);
utilsTools.sendEventObjectParams("tipShowPosMaxScale", tipAidInfo, gameidJsondata.width, gameidJsondata.height);
utilsTools.sendEventObjectParams(EventName.Event.Event_tipShowPosMaxScale, tipAidInfo, gameidJsondata.width, gameidJsondata.height);
}
}
}
......
......@@ -210,7 +210,7 @@ public class colorItem : MonoBehaviour
//if (isSelect == false && isFinish() == false)
{
if (utilsTools.getGDataByKey<bool>("autoFillColor", false)) return;
utilsTools.sendEventObjectParams("switchGameAreaGroupId", index);
utilsTools.sendEventObjectParams(EventName.Event.Event_switchGameAreaGroupId, index);
}
if (CanPlayAniFlag)
......
......@@ -21,7 +21,7 @@ public class prfb_hor_item : MonoBehaviour
{
if(isSelect == false)
{
utilsTools.sendEventObjectParams("switchHomeLabels", data.id);
utilsTools.sendEventObjectParams(EventName.Event.Event_switchHomeLabels, data.id);
//setData(data, 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