コード例 #1
0
        protected override void OnStart()
        {
            RectTransform targetNode = m_Finder.FindNode(false) as RectTransform;

            if (targetNode == null)
            {
                return;
            }

            m_Canvas = targetNode.GetComponent <Canvas>();
            if (m_Canvas == null)
            {
                m_Canvas = targetNode.gameObject.AddComponent <Canvas>();
                m_Canvas.overrideSorting = true;
                m_CanvasPreSortingOrder  = -1;
            }
            else
            {
                m_CanvasPreSortingOrder = m_Canvas.sortingOrder;
            }

            m_GraphicRaycaster = targetNode.GetComponent <GraphicRaycaster>();
            if (m_GraphicRaycaster == null)
            {
                m_IsCreateGraphicRaycaster = true;
                m_GraphicRaycaster         = targetNode.gameObject.AddComponent <GraphicRaycaster>();
            }

            Action <int> orderUpdate = OnSortingOrderUpdate;

            UIMgr.S.OpenTopPanel(EngineUI.HighlightMaskPanel, null, orderUpdate);
        }
コード例 #2
0
 void SetNodeFinder()
 {
     m_Finder = new UINodeFinder();
     m_Finder.SetParam(new object[2]
     {
         "SkipGuidePanel", "SkipButton"
     });
     m_TargetButton = m_Finder.FindNode(false);
     m_Finder.SetParam(new object[2]
     {
         "SkipGuidePanel", "BgButton"
     });
     m_BgBtn = m_Finder.FindNode(false);
     if (m_TargetButton == null)
     {
         Log.w("=======skipguide uinode is null=======");
     }
 }
コード例 #3
0
        protected override void OnStart()
        {
            RectTransform targetNode = m_Finder.FindNode(false) as RectTransform;

            if (targetNode == null)
            {
                Log.w("======transform is null=======");
                return;
            }
            // UIMgr.S.OpenTopPanel(UIID.GuideSpineHandPanel, null, targetNode, m_Offset, m_MoveToPos,m_SpineAnimName);
        }
コード例 #4
0
ファイル: GuideHandCommand.cs プロジェクト: moto2002/Fish
        protected override void OnStart()
        {
            RectTransform targetNode = m_Finder.FindNode(false) as RectTransform;

            if (targetNode == null)
            {
                return;
            }

            UIMgr.S.OpenTopPanel(EngineUI.GuideHandPanel, null, targetNode, m_Offset);
        }
コード例 #5
0
        protected override void OnStart()
        {
            m_TargetButton = m_Finder.FindNode(false);

            if (m_TargetButton == null)
            {
                return;
            }

            AppLoopMgr.S.onUpdate += Update;
        }
コード例 #6
0
        protected override void OnStart()
        {
            m_TargetButton = m_Finder.FindNode(false);

            if (m_TargetButton == null)
            {
                return;
            }

            UIMgr.S.topPanelHideMask = PanelHideMask.UnInteractive;
            AppLoopMgr.S.onUpdate   += Update;
        }
コード例 #7
0
        protected override void OnStart()
        {
            m_TargetButton = m_Finder.FindNode(false);

            if (m_TargetButton == null)
            {
                //Log.e("Can't find targe ui node");
                return;
            }

            AppLoopMgr.S.onUpdate += Update;

            UIMgr.S.topPanelHideMask = PanelHideMask.UnInteractive;

            UIMgr.S.OpenTopPanel(UIID.GuideUIClipPanel, null, m_TargetButton, m_Raduis, m_Offset);
        }
コード例 #8
0
ファイル: UIClipCommand.cs プロジェクト: SPLiHua/Skylark
        protected override void OnStart()
        {
            if (m_Finder != null)
            {
                m_TargetButton = m_Finder.FindNode(false);
            }
            // if (m_TargetButton == null)
            // {
            //     Log.E("Can't find targe ui node");
            //     return;
            // }

            AppLoopMgr.S.onUpdate += Update;

            UIMgr.S.OpenPanelTop(UIID.UIClipPanel, m_Params);
        }
コード例 #9
0
ファイル: GuideHandPanel.cs プロジェクト: SPLiHua/Skylark
        protected override void OnPanelOpen(params object[] args)
        {
            transform.localPosition = new Vector3(0, 0, -1000);

            if (args != null)
            {
                Vector3 pos = Vector3.zero;
                if (args.Length > 0)
                {
                    pos = Utility.UtilityTable.String2Vector2((string)args[0], '|');
                    m_HandGo.transform.localPosition = pos;

                    if (args.Length > 1)
                    {
                        m_Finder = args[1] as IUINodeFinder;
                        Transform targetTrans = m_Finder.FindNode(false);

                        Vector2   ui1ScreenPos = UIMgr.S.m_UIRoot.UICamera.WorldToScreenPoint(targetTrans.position);
                        Transform topPanel     = GetTopParentPanel(targetTrans);
                        if (topPanel != null)
                        {
                            Vector2 localPos;
                            bool    isSucess = RectTransformUtility.ScreenPointToLocalPointInRectangle(topPanel.GetComponent <RectTransform>(), ui1ScreenPos, UIMgr.S.m_UIRoot.UICamera, out localPos);
                            if (isSucess)
                            {
                                m_HandGo.transform.localPosition = new Vector3(localPos.x, localPos.y, 0);
                            }
                            else
                            {
                                m_HandGo.transform.localPosition = new Vector3(targetTrans.localPosition.x, targetTrans.localPosition.y, 0);
                            }
                        }

                        m_HandGo.transform.localPosition += pos;
                    }

                    if (m_Sequence != null)
                    {
                        DOTween.Kill(m_HandGo.transform);
                    }
                    Vector3 scale = Vector3.one;
                    m_Sequence = DOTween.Sequence().Append(m_HandGo.transform.DOScale(scale * 1.2f, 0.5f)).Append(m_HandGo.transform.DOScale(scale, 0.5f))
                                 .SetEase(Ease.Linear).SetLoops(-1).SetUpdate(true);
                }
            }
        }
コード例 #10
0
ファイル: ButtonCommand.cs プロジェクト: SPLiHua/Skylark
        protected override void OnStart()
        {
            var target = m_Finder.FindNode(false);

            if (target == null)
            {
                return;
            }

            m_TargetButton = target.GetComponent <Button>();

            if (m_TargetButton == null)
            {
                return;
            }

            m_TargetButton.onClick.AddListener(OnClickTargetButton);
        }
コード例 #11
0
ファイル: GuideTipPanel.cs プロジェクト: SPLiHua/Skylark
        protected override void OnPanelOpen(params object[] args)
        {
            transform.localPosition = new Vector3(0, 0, -1000);

            if (args != null)
            {
                m_TipText.text = (string)args[0];

                Vector3 pos = Vector3.zero;
                if (args.Length > 1)
                {
                    pos = Utility.UtilityTable.String2Vector2((string)args[1], '|');
                    m_TipText.transform.parent.parent.localPosition = pos;

                    if (args.Length > 2)
                    {
                        m_Finder = args[2] as IUINodeFinder;
                        Transform targetTrans  = m_Finder.FindNode(false);
                        Vector2   ui1ScreenPos = UIMgr.S.m_UIRoot.UICamera.WorldToScreenPoint(targetTrans.position);

                        Transform topPanel = GetTopParentPanel(targetTrans);
                        if (topPanel != null)
                        {
                            Vector2 localPos;
                            bool    isSucess = RectTransformUtility.ScreenPointToLocalPointInRectangle(topPanel.GetComponent <RectTransform>(), ui1ScreenPos, UIMgr.S.m_UIRoot.UICamera, out localPos);
                            if (isSucess)
                            {
                                m_TipText.transform.parent.parent.localPosition = new Vector3(0, localPos.y, 0);
                            }
                            else
                            {
                                m_TipText.transform.parent.parent.localPosition = new Vector3(0, targetTrans.localPosition.y, 0);
                            }
                            m_TipText.transform.parent.parent.localPosition += pos;
                        }
                    }
                }
            }
        }
コード例 #12
0
ファイル: UIClipPanel.cs プロジェクト: SPLiHua/Skylark
        protected override void OnPanelOpen(params object[] param)
        {
            if (m_MaskTrans.GetComponent <BaseUIClip>())
            {
                GameObject.Destroy(m_MaskTrans.GetComponent <BaseUIClip>());
            }

            if (param != null)
            {
                Transform targetUI = null;
                // UIClipCommand.UIClipType uiClipType;
                // bool playAnim = false;
                // float radius = 0;
                Vector2 offset = new Vector2(0, 0);
                if (param.Length > 0)
                {
                    IUINodeFinder Finder = param[0] as IUINodeFinder;
                    targetUI = Finder.FindNode(false);
                }
                // if (param.Length > 1)
                // {
                //     string str = param[1].ToString();
                //     uiClipType = (UIClipCommand.UIClipType)Enum.Parse(typeof(UIClipCommand.UIClipType), str);
                // }
                // if (param.Length > 2)
                // {
                //     int i = Utility.UtilityTable.String2Int((string)param[2]);

                //     if (i == 0)
                //     {
                //         playAnim = false;
                //     }
                //     else
                //     {
                //         playAnim = true;
                //     }
                // }
                // if (param.Length > 3)
                // {
                //     radius = Utility.UtilityTable.String2Float((string)param[3]);
                // }
                // if (param.Length > 4)
                // {
                //     offset = Utility.UtilityTable.String2Vector2((string)param[4], '|');
                // }

                RectTransform rt = targetUI.GetComponent <RectTransform>();
                Debug.Assert(rt != null, "Can't find RectTransform in this ui");

                m_MaskTrans.gameObject.AddComponent <SquareClip>().RefreshMask(rt, false, 0, offset);

                // switch (uiClipType)
                // {
                //     case UIClipCommand.UIClipType.Circle:
                //         m_MaskTrans.gameObject.AddComponent<CircleClip>().RefreshMask(rt, false, 0, offset);
                //         break;
                //     case UIClipCommand.UIClipType.Square:
                //         m_MaskTrans.gameObject.AddComponent<SquareClip>().RefreshMask(rt, false, 0, offset);
                //         break;
                // }
            }
        }