|
@@ -7,7 +7,7 @@ using System;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
- public class GuideView : BaseWindow
|
|
|
+ public class GuideView : BaseView
|
|
|
{
|
|
|
private UI_GuideUI _ui;
|
|
|
private bool _needUpdate;
|
|
@@ -15,6 +15,7 @@ namespace GFGGame
|
|
|
private float devWidth;
|
|
|
private float devHeight;
|
|
|
private int yTxt;
|
|
|
+ private bool showAni;
|
|
|
|
|
|
private int guideId;
|
|
|
private int guideIndex;
|
|
@@ -22,6 +23,8 @@ namespace GFGGame
|
|
|
|
|
|
private GameObject _gameObject;
|
|
|
private GoWrapper _wrapper;
|
|
|
+
|
|
|
+ private int sortingOrder;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
base.Dispose();
|
|
@@ -34,8 +37,8 @@ namespace GFGGame
|
|
|
packageName = UI_GuideUI.PACKAGE_NAME;
|
|
|
_ui = UI_GuideUI.Create();
|
|
|
this.viewCom = _ui.target;
|
|
|
- this.clickBlankToClose = false;
|
|
|
- // this.layer = ConstViewLayer.TOP;
|
|
|
+ // this.clickBlankToClose = false;
|
|
|
+ this.layer = ConstViewLayer.TOP;
|
|
|
isfullScreen = true;
|
|
|
_ui.m_rectFrameTemp.visible = false;
|
|
|
_ui.m_rectFrame.target.visible = false;
|
|
@@ -64,6 +67,7 @@ namespace GFGGame
|
|
|
|
|
|
guideId = (int)dataList[6];
|
|
|
guideIndex = (int)dataList[7];
|
|
|
+ showAni = (bool)dataList[8];
|
|
|
|
|
|
if (txtContent != null && txtContent.Length > 0)
|
|
|
{
|
|
@@ -82,18 +86,18 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_compTxt.target.visible = false;
|
|
|
}
|
|
|
-
|
|
|
+ _ui.m_comHolder.target.visible = false;
|
|
|
_ui.m_rectFrameTemp.width = _ui.m_mask.target.width;
|
|
|
_ui.m_rectFrameTemp.height = _ui.m_mask.target.height;
|
|
|
_ui.m_rectFrameTemp.x = 0;
|
|
|
_ui.m_rectFrameTemp.y = 0;
|
|
|
if (guideTarget != null)
|
|
|
{
|
|
|
+
|
|
|
UpdateGuideRect();
|
|
|
Timers.inst.AddUpdate(UpdateGuideRect);
|
|
|
_ui.m_mask.target.visible = true;
|
|
|
- _ui.m_comHolder.target.visible = true;
|
|
|
-
|
|
|
+ guideTarget.touchable = false;
|
|
|
guideTarget.onClick.Add(OnClickTarget);
|
|
|
if (guideTarget == null) OnClickTarget();
|
|
|
|
|
@@ -102,6 +106,8 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_comHolder.target.visible = false;
|
|
|
_ui.m_mask.target.visible = false;
|
|
|
+ _ui.m_rectFrameTemp.visible = false;
|
|
|
+
|
|
|
}
|
|
|
_ui.m_compTxt.target.y = Math.Min(yTxt, GRoot.inst.height - _ui.m_compTxt.target.height - 3);
|
|
|
// _ui.m_rectFrame.target.visible = true;
|
|
@@ -111,7 +117,7 @@ namespace GFGGame
|
|
|
{
|
|
|
Timers.inst.Remove(UpdateGuideRect);
|
|
|
base.OnHide();
|
|
|
- if (guideTarget == null)
|
|
|
+ if (isOptionalGuide || guideTarget == null)
|
|
|
{
|
|
|
OnClickTarget();
|
|
|
}
|
|
@@ -130,8 +136,9 @@ namespace GFGGame
|
|
|
_ui.m_mask.m_guideArea.size = new Vector2((int)rect.size.x, (int)rect.size.y);
|
|
|
_ui.m_mask.m_guideArea.position = new Vector2((int)rect.position.x, (int)rect.position.y);
|
|
|
|
|
|
-
|
|
|
+ Debug.Log("zoya000:" + _ui.m_mask.m_guideArea.position);
|
|
|
_ui.m_comHolder.target.position = _ui.m_mask.m_guideArea.position;
|
|
|
+ Debug.Log("zoya111:" + _ui.m_comHolder.target.position);
|
|
|
_ui.m_comHolder.target.size = _ui.m_mask.m_guideArea.size;
|
|
|
int padding = 90;
|
|
|
bool atBottom = _ui.m_mask.m_guideArea.y + _ui.m_mask.m_guideArea.height + padding + _ui.m_compTxt.target.height + padding > GRoot.inst.height;
|
|
@@ -145,11 +152,37 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_compTxt.target.y = _ui.m_mask.m_guideArea.y + _ui.m_mask.m_guideArea.height + padding;
|
|
|
}
|
|
|
+ Debug.Log("zoya222:" + _ui.m_compTxt.target.y);
|
|
|
+
|
|
|
}
|
|
|
int targetWidth = 20;
|
|
|
- if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) <= targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) <= targetWidth)
|
|
|
+
|
|
|
+ if (showAni)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) > targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) > targetWidth)
|
|
|
+ {
|
|
|
+ _ui.m_rectFrameTemp.visible = true;
|
|
|
+ float duration = 0.5f;
|
|
|
+ _ui.m_rectFrameTemp.TweenResize(new Vector2(_ui.m_rectFrame.target.width, _ui.m_rectFrame.target.height), duration);
|
|
|
+ _ui.m_rectFrameTemp.TweenMove(new Vector2(_ui.m_rectFrame.target.x, _ui.m_rectFrame.target.y), duration);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ guideTarget.touchable = true;
|
|
|
+ _ui.m_comHolder.target.visible = true;
|
|
|
+ _ui.m_rectFrameTemp.visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- Timers.inst.Remove(UpdateGuideRect);
|
|
|
+ // if (Mathf.Abs(_ui.m_rectFrameTemp.width - _ui.m_rectFrame.target.width) <= targetWidth && Mathf.Abs(_ui.m_rectFrameTemp.height - _ui.m_rectFrame.target.height) <= targetWidth)
|
|
|
+ // {
|
|
|
+ // Timers.inst.Remove(UpdateGuideRect);
|
|
|
+ // }
|
|
|
+ _ui.m_comHolder.target.visible = true;
|
|
|
+ guideTarget.touchable = true;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|