|
@@ -31,7 +31,7 @@ public class OnePicNav : MonoBehaviour
|
|
|
|
|
|
public GameObject shaPan;
|
|
|
|
|
|
-
|
|
|
+ public int lastIndex = -99;
|
|
|
// Start is called before the first frame update
|
|
|
|
|
|
void Start()
|
|
@@ -69,6 +69,11 @@ public class OnePicNav : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
public void OnButtnClick(int index) {
|
|
|
+ if (lastIndex == index)
|
|
|
+ return;
|
|
|
+ if (lastIndex > -1) {
|
|
|
+ layers[lastIndex].GetComponent<YZTRootLayer>().OnUILeave();
|
|
|
+ }
|
|
|
for (int j = 0; j < layers.Count; j++)
|
|
|
{
|
|
|
layers[j].gameObject.SetActive(false);
|
|
@@ -78,6 +83,7 @@ public class OnePicNav : MonoBehaviour
|
|
|
btns[j].GetComponentInChildren<Text>().color = new Color32(137, 147, 173, 255);
|
|
|
}
|
|
|
btns[index].GetComponentInChildren<Text>().color = Color.white;
|
|
|
+ lastIndex = index;
|
|
|
Tweener tw = s_image.GetComponent<RectTransform>().DOLocalMoveX(targetPos[index].x, 0.3f);
|
|
|
tw.SetEase(Ease.OutBack);
|
|
|
if (index < layers.Count)
|