Commit a23aca39 authored by JiangWanZhi's avatar JiangWanZhi

组点击边缘的,会显示下一个或者上一个、把抗锯齿关了

parent aab6aaf0
...@@ -3137,8 +3137,8 @@ RectTransform: ...@@ -3137,8 +3137,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 55} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: -590} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9176654368274725460 --- !u!222 &9176654368274725460
CanvasRenderer: CanvasRenderer:
......
...@@ -528,10 +528,10 @@ RectTransform: ...@@ -528,10 +528,10 @@ RectTransform:
m_Father: {fileID: 464840817} m_Father: {fileID: 464840817}
m_RootOrder: -1 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 750, y: 1624} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1643100475 --- !u!114 &1643100475
MonoBehaviour: MonoBehaviour:
...@@ -1497,27 +1497,27 @@ PrefabInstance: ...@@ -1497,27 +1497,27 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
value: 0.5 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0.5 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMin.x propertyPath: m_AnchorMin.x
value: 0.5 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0.5 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 750 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 1624 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
......
using Assets.scripts.Datas; using Assets.scripts.Datas;
using DG.Tweening;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -24,6 +25,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -24,6 +25,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
public GameObject gameShowView = null; public GameObject gameShowView = null;
public GameObject areaGroupList = null; public GameObject areaGroupList = null;
private int nowidx = 0; private int nowidx = 0;
private int oldindex = 0;
public float progress = 0; public float progress = 0;
public bool showAreaId = true; public bool showAreaId = true;
private List<TempGroupInfos> groupInfos = null; private List<TempGroupInfos> groupInfos = null;
...@@ -70,7 +72,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -70,7 +72,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); //整个大图都涂完了 onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); //整个大图都涂完了
onEvent("closeGameScene", onCloseGameSceneEvent); //关游戏 onEvent("closeGameScene", onCloseGameSceneEvent); //关游戏
onEvent("removeGroupByGid", onRemoveGroupByGidEvent); //自动涂gid不一致会调过来 onEvent("removeGroupByGid", onRemoveGroupByGidEvent); //自动涂gid不一致会调过来
onEvent("GroupIsLoadOver", onGroupIsLoadOver); //组的成员加载完成 onEvent("GroupIsLoadOver", onGroupIsLoadOver); //组的成员加载完成,就是组列表下的item
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>();
...@@ -101,9 +103,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -101,9 +103,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
private void onGroupIsLoadOver(List<UnityEngine.Object> uobjects, List<object> objects) private void onGroupIsLoadOver(List<UnityEngine.Object> uobjects, List<object> objects)
{ {
StartCoroutine(TestDelay()); StartCoroutine(DelayToSetListItemPos());
} }
IEnumerator TestDelay() IEnumerator DelayToSetListItemPos()
{ {
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
areaGroupList.GetComponent<gameSceneAreaGroupHandler>().SetChild_ListPosData(); areaGroupList.GetComponent<gameSceneAreaGroupHandler>().SetChild_ListPosData();
...@@ -201,6 +203,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -201,6 +203,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
} }
var maingameView = gameShowView.GetComponent<mainGameView>(); var maingameView = gameShowView.GetComponent<mainGameView>();
int idx = (int)objects[0]; int idx = (int)objects[0];
oldindex = nowidx;
nowidx = idx; nowidx = idx;
var nowSelectGroupId = groupInfos[idx].gid; var nowSelectGroupId = groupInfos[idx].gid;
item = gridViewList.getObjectById(idx).GetComponent<colorItem>(); item = gridViewList.getObjectById(idx).GetComponent<colorItem>();
...@@ -217,16 +220,59 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -217,16 +220,59 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}); });
Transform item_obj; Transform item_obj;
for (int i = 0; i < areaGroupList.transform.GetComponent<ScrollRect>().content.childCount; i++) ScrollRect Rect = areaGroupList.transform.GetComponent<ScrollRect>();
float targetpos ;
if (oldindex < nowidx) //点的是右边的
{
if (nowidx >= 5)
{
targetpos = -(120 * (nowidx - 4) - 20 + 5 * 2);
if (targetpos < Rect.content.localPosition.x)
{
Rect.content.DOLocalMoveX(targetpos, 1f);
return;
}
}
}
else if (oldindex > nowidx) //点的左边的
{
targetpos = -(120 * (nowidx - 1) + 10);
if (targetpos > Rect.content.localPosition.x)
{
Rect.content.DOLocalMoveX(targetpos, 1f);
return;
}
}
int itemNum = Rect.content.childCount;
for (int i = 0; i < itemNum; i++)
{ {
if (i == nowidx) if (i == nowidx)
continue; continue;
item_obj = areaGroupList.transform.GetComponent<ScrollRect>().content.GetChild(i); item_obj = Rect.content.GetChild(i);
item_obj.GetComponent<colorItem>().ChangeLocalPos_Select(i < nowidx, nowidx, item.transform.localPosition.x); item_obj.GetComponent<colorItem>().ChangeLocalPos_Select(i < nowidx, nowidx, item.transform.localPosition.x);
} }
//StartCoroutine(DelayToRefreshGrid());
}
IEnumerator DelayToRefreshGrid()
{
yield return new WaitForSeconds(0.6f);
if (areaGroupList.transform.GetComponent<ScrollRect>().content.GetComponent<GridLayoutGroup>().enabled)
{
LayoutRebuilder.ForceRebuildLayoutImmediate(areaGroupList.transform.GetComponent<ScrollRect>().content.GetComponent<RectTransform>());
}
else
{
areaGroupList.transform.GetComponent<ScrollRect>().content.GetComponent<GridLayoutGroup>().enabled = true;
}
} }
//游戏图片初始化完成 //游戏图片初始化完成
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)
......
...@@ -215,21 +215,6 @@ public class gridView : MonoBehaviour ...@@ -215,21 +215,6 @@ public class gridView : MonoBehaviour
GameObject.Destroy(childTransform.gameObject); GameObject.Destroy(childTransform.gameObject);
} }
//if (transform.name== "areaGroupList")
//{
// StartCoroutine(TestDelay());
//}
}
IEnumerator TestDelay()
{
yield return new WaitForSeconds(0.5f);
var content = transform.GetComponent<ScrollRect>().content;
content.GetComponent<GridLayoutGroup>().gameObject.SetActive(false);
for (int i = 0; i < content.childCount; i++)
{
content.GetChild(i).GetComponent<colorItem>().SetLocalRootPos();
}
} }
//只支持一个预制体 //只支持一个预制体
virtual public void setDataNoGrid(int size,float widthItem,float heightItem,float interval,gradViewBack back, bool useVec = true, GetGradViewInfo getGradViewInfo = null,float offset1 = 0.0f) virtual public void setDataNoGrid(int size,float widthItem,float heightItem,float interval,gradViewBack back, bool useVec = true, GetGradViewInfo getGradViewInfo = null,float offset1 = 0.0f)
......
...@@ -77,7 +77,7 @@ public class colorItem : MonoBehaviour ...@@ -77,7 +77,7 @@ public class colorItem : MonoBehaviour
if (isSelect) if (isSelect)
{ {
transform.DOScale(Vector3.one * 0.9f, 0.5f); transform.DOScale(Vector3.one*0.95f, 0.5f);
} }
else else
{ {
...@@ -223,11 +223,6 @@ public class colorItem : MonoBehaviour ...@@ -223,11 +223,6 @@ public class colorItem : MonoBehaviour
//NowProgress = nowProgress; //NowProgress = nowProgress;
} }
// Update is called once per frame
void Update()
{
}
public bool isFinish() public bool isFinish()
{ {
return utilsTools.isEqualByValue(nowProgress,1.0f,0.0000002f); return utilsTools.isEqualByValue(nowProgress,1.0f,0.0000002f);
...@@ -248,22 +243,29 @@ public class colorItem : MonoBehaviour ...@@ -248,22 +243,29 @@ public class colorItem : MonoBehaviour
{ {
} }
public void SetLocalRootPos() //保存一下本地的原始坐标 public void SetLocalRootPos() //保存一下第一个的原始坐标
{ {
LocalPos_Root = transform.localPosition; LocalPos_Root = transform.parent.GetChild(0).localPosition;
} }
private float offset_dis = 5;
public void ChangeLocalPos_Select(bool left,int clickindex,float clickpos) //当点击组的时候,其它往外面偏移一段 public void ChangeLocalPos_Select(bool left,int clickindex,float clickpos) //当点击组的时候,其它往外面偏移一段
{ {
if (left) //左边 if (left) //左边
{ {
transform.DOLocalMoveX(clickpos - 120 * (clickindex - index) - 20, 0.5f); //if (clickindex - 1 > index)
//transform.DOLocalMoveX(LocalPos_Root.x - 10, 0.5f); // return;
//transform.DOLocalMoveX(clickpos - 120 * (clickindex - index) - 5, 0.5f);
transform.DOLocalMoveX(LocalPos_Root.x + index * 120, 0.5f);
} }
else else
{ {
transform.DOLocalMoveX(clickpos + 120 * (index - clickindex) + 20, 0.5f); transform.DOLocalMoveX(clickpos + 120 * (index - clickindex) + offset_dis, 0.5f);
//transform.DOLocalMoveX(LocalPos_Root.x + 10, 0.5f); //transform.DOLocalMoveX(LocalPos_Root.x + 120 * index + offset_dis, 0.5f);
} }
} }
} }
...@@ -262,7 +262,7 @@ QualitySettings: ...@@ -262,7 +262,7 @@ QualitySettings:
globalTextureMipmapLimit: 0 globalTextureMipmapLimit: 0
textureMipmapLimitSettings: [] textureMipmapLimitSettings: []
anisotropicTextures: 2 anisotropicTextures: 2
antiAliasing: 8 antiAliasing: 0
softParticles: 1 softParticles: 1
softVegetation: 1 softVegetation: 1
realtimeReflectionProbes: 1 realtimeReflectionProbes: 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