Example #1
0
    void OnClick()
    {
        //UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("SceneSelect");
        //if (go != null) {
        //  UISceneSelect sceneSelect = go.GetComponent<UISceneSelect>();
        //  if (sceneSelect != null) sceneSelect.StartChapter(m_SceneId);
        //}
        RoleInfo role = LobbyClient.Instance.CurrentRole;

        if (role != null)
        {
            if (role.SceneInfo.ContainsKey(m_SceneId))
            {
                UIManager.Instance.HideWindowByName("ItemSourceTips");
                UIManager.Instance.HideWindowByName("ArtifactPanel");
                UnityEngine.GameObject goc = UIManager.Instance.GetWindowGoByName("SceneSelect");
                if (goc != null)
                {
                    LogicSystem.SendStoryMessage("cityplayermove", 0);//寻路
                    UISceneSelect uss = goc.GetComponent <UISceneSelect>();
                    if (uss != null)
                    {
                        uss.startChapterId = m_SceneId;
                    }
                }
            }
            else
            {
                SendScreeTipCenter(40);
            }
        }
    }
Example #2
0
    //点击跳转到场景介绍界面
    void OnClick()
    {
        //UIManager.Instance.HideWindowByName("SceneSelect");
        UISceneSelect sceneSelect = NGUITools.FindInParents <UISceneSelect>(gameObject);

        if (sceneSelect != null)
        {
            if (sceneSelect.IsChapterMoving())
            {
                return;
            }
        }
        UIManager.Instance.ShowWindowByName("SceneIntroduce");
        LogicSystem.EventChannelForGfx.Publish("ge_init_sceneintroduce", "ui", m_SceneId, m_SceneGrade, m_SubType);
    }
Example #3
0
 void OnClick()
 {
     if (m_IsCopy)
     {
         //UIManager.Instance.ToggleWindowVisible("SceneSelect");
         LogicSystem.SendStoryMessage("cityplayermove", 0);//寻路
         UnityEngine.GameObject goc = UIManager.Instance.GetWindowGoByName("SceneSelect");
         if (goc != null)
         {
             UISceneSelect uss = goc.GetComponent <UISceneSelect>();
             if (uss != null)
             {
                 uss.startChapterId = 0;//无指引
             }
         }
     }
     else
     {
         UIManager.Instance.ToggleWindowVisible("GameTask");
     }
 }
Example #4
0
    /// <summary>
    /// Center the panel on the specified target.
    /// </summary>

    void CenterOn(UnityEngine.Transform target, UnityEngine.Vector3 panelCenter)
    {
        if (target != null && mScrollView != null && mScrollView.panel != null)
        {
            UnityEngine.Transform panelTrans = mScrollView.panel.cachedTransform;
            mCenteredObject = target.gameObject;
            //通知翻页
            UICurrentChapter currentChapter = mCenteredObject.GetComponent <UICurrentChapter>();
            UISceneSelect    sceneSelect    = NGUITools.FindInParents <UISceneSelect>(this.gameObject);
            if (sceneSelect != null && currentChapter != null)
            {
                sceneSelect.SetCurrentChapter(currentChapter.m_ChapterId);
            }
            // Figure out the difference between the chosen child and the panel's center in local coordinates
            UnityEngine.Vector3 cp          = panelTrans.InverseTransformPoint(target.position);
            UnityEngine.Vector3 cc          = panelTrans.InverseTransformPoint(panelCenter);
            UnityEngine.Vector3 localOffset = cp - cc;

            // Offset shouldn't occur if blocked
            if (!mScrollView.canMoveHorizontally)
            {
                localOffset.x = 0f;
            }
            if (!mScrollView.canMoveVertically)
            {
                localOffset.y = 0f;
            }
            localOffset.z = 0f;

            // Spring the panel to this calculated position
            SpringPanel.Begin(mScrollView.panel.cachedGameObject,
                              panelTrans.localPosition - localOffset, springStrength).onFinished = onFinished;
        }
        else
        {
            mCenteredObject = null;
        }
    }
Example #5
0
    private bool GotoTargetUI(ArkCrossEngine.MissionConfig missionconfig)
    {
        bool result = false;

        if (missionconfig != null)
        {
            switch (missionconfig.TargetUI)
            {
            case 1:    //副本
                UnityEngine.GameObject goc = UIManager.Instance.TryGetWindowGameObject("SceneSelect");
                if (goc != null)
                {
                    LogicSystem.SendStoryMessage("cityplayermove", 0);    //寻路
                    UISceneSelect uss = goc.GetComponent <UISceneSelect>();
                    if (uss != null)
                    {
                        //uss.StartChapter(missionconfig.SceneId);
                        uss.startChapterId = missionconfig.SceneId;
                    }
                }
                result = true;
                break;

            case 2:    //pvp
                LogicSystem.SendStoryMessage("cityplayermove", 2);
                result = true;
                break;

            case 3:    //活动
                LogicSystem.SendStoryMessage("cityplayermove", 1);
                result = true;
                break;
            }
        }
        return(result);
    }