Beispiel #1
0
 /// <summary>
 /// 显示中央讯息
 /// </summary>
 /// <param name="msg">tip 内容</param>
 /// <param name="type">0:战斗外用,1:战斗内用的</param>
 /// <returns></returns>
 public static void ShowTipsMessage(string msg, int type)
 {
     WndManager.CreateWnd <MessageWnd>(WndType.DialogWnd, false, false, (wnd) => {
         (wnd as MessageWnd).SetType(type);
         (wnd as MessageWnd).SetData(msg);
     });
 }
Beispiel #2
0
 /// <summary>
 /// 显示敌我目标tips
 /// </summary>
 /// <param name="Info">目标数据</param>
 /// <param name="tipRect">弹出tips的控件对象</param>
 /// <param name="align">对其方式</param>
 /// <param name="isTouchDestroy">是否触碰销毁</param>
 /// <returns></returns>
 public static void ShowTargetTips(TargetHeroInfo Info, RectTransform tipRect, TipAlignment align, Vector2 offset, bool isTouchDestroy)
 {
     WndManager.DestoryWnd <TargetInfoWnd>();
     WndManager.CreateWnd <TargetInfoWnd>(WndType.DialogWnd, false, false, (wnd) => {
         (wnd as TargetInfoWnd).SetData(new object[] { 0, Info, tipRect, align, offset, isTouchDestroy });
     });
 }
Beispiel #3
0
 /// <summary>
 /// 过渡窗口处理
 /// </summary>
 /// <param name="waitTime">loading 过渡时间</param>
 /// <param name="callback">loading,回调参数中可以判断点击了那个按钮</param>
 /// <returns></returns>
 public static bool LoadingWnd(float waitTime, Action <ILoading> callback = null)
 {
     WndManager.CreateWnd <LoadingWnd>(WndType.NormalWnd, false, false, (wnd) => {
         (wnd as LoadingWnd).SetData(waitTime, callback);
     });
     return(true);
 }
Beispiel #4
0
 /// <summary>
 /// 显示剧情对话
 /// </summary>
 /// <param name="dialogID">剧情id</param>
 /// <param name="TestMode">调试模式,给测试用的</param>
 /// <returns></returns>
 public static void ShowDialog(uint dialogID, bool TestMode = false)
 {
     WndManager.CreateWnd <AdventureDialogueWnd>(WndType.DialogWnd, false, false, (wnd) => {
         (wnd as AdventureDialogueWnd).SetData(dialogID);
         (wnd as AdventureDialogueWnd).TestMode = TestMode;
     });
 }
Beispiel #5
0
 // Start is called before the first frame update
 void Start()
 {
     ///mat.SetColor();
     RegisterHooks();
     WndManager.CreateWnd <FlagItemWnd>(WndType.DialogWnd, false, false, (wnd) =>
     {
         (wnd as FlagItemWnd).SetData(Qizhi.transform.position);
     });
 }
Beispiel #6
0
 private void GreenBall()
 {
     if (m_btnRing != null && m_kickBall != null)
     {
         m_btnRing.gameObject.SetActive(false);
         m_kickBall.gameObject.SetActive(false);
     }
     EventCenter.DispatchEvent(EventCenterType.Battle_SightView, -1, null);
     WndManager.CreateWnd <SwingModeWnd>(WndType.NormalWnd, false, false, null);
 }
Beispiel #7
0
 private void OnBattle_RoundStart(int sender, object Param)
 {
     if (BattleM.BallInAra == AreaType.PuttingGreen)
     {
         WndManager.CreateWnd <SwingModeWnd>(WndType.NormalWnd, false, false, null);
     }
     else
     {
         WndManager.CreateWnd <BattleMainWnd>(WndType.NormalWnd, false, false, null);
     }
 }
Beispiel #8
0
    private void joinGame()
    {
        //LoadDependeAB();
#if UNITY_EDITOR
        //LoginM.LoadServerListFromText(Application.dataPath + "/Config/" + ConstantData.ServerListFile);
#else
        //LoginM.LoadServerListFromText(Application.streamingAssetsPath + "/Config/" + ConstantData.ServerListFile);
#endif
        //SceneM.Load(LoginScene.GetSceneName(), false, Scheduler.loading, false);
        WndManager.CreateWnd <StarupWnd>(WndType.NormalWnd, false, false, (wnd) => { });
    }
Beispiel #9
0
 private void GolfRotate()
 {
     if (m_wndMineBall == null)
     {
         WndManager.CreateWnd <MineBallSpinWnd>(WndType.MenuWnd, false, false, (wnd) =>
         {
             if (wnd != null)
             {
                 m_wndMineBall = wnd;
             }
         });
     }
     else
     {
         m_wndMineBall.gameObject.SetActive(true);
     }
 }
Beispiel #10
0
    // 异步载入场景
    private static IEnumerator NonsyncLoad(string sceneName, SceneData data)
    {
        // 取得载入器
        IScene scene = sceneLoadControl[sceneName];

        s_preScene      = s_CurIScene;
        s_loadingIScene = scene;


        if (s_preScene != null)
        {
            s_preScene.Clear();
        }
        // 1 播放开始载入的动画,并等待其播放完毕
        ILoading loading = null;

        WndManager.CreateWnd <LoadingWnd>(WndType.NormalWnd, false, false, (wnd) => {
            loading = (wnd as LoadingWnd);
            loading.Load();
        });
        yield return(Yielders.GetWaitForSeconds(0.5f));

        // 欲载入的处理
        scene.PrepareLoad();
        // 3 载入新的场景
        scene.Load(data);

        // 等待loading入场动作,设定2秒钟哦。正常是不会这样处理的。
        float waitTime      = 0;
        float totalWaitTime = 1.5f;

        int            displayProgress = 0;
        int            toProgress      = 0;
        AsyncOperation op = scene.AsyncLoading;

        if (scene.AsyncLoading != null)
        {
            // 等待载入完成
            while (!scene.IsEnd())
            {
                toProgress = (int)(op.progress * 100);
                while (displayProgress < toProgress)
                {
                    waitTime += Time.deltaTime;
                    ++displayProgress;
                    if (loading != null)
                    {
                        loading.Play(displayProgress);
                    }
                    yield return(g_wait);
                }
            }
            toProgress = 100;
            while (displayProgress < toProgress)
            {
                waitTime += Time.deltaTime;
                ++displayProgress;
                if (loading != null)
                {
                    loading.Play(displayProgress);
                }
                yield return(g_wait);
            }
        }
        // 场景载入完成(一定要在load完毕后才能替换,此时的环境才能称得上载入完成)
        s_CurIScene = scene;
        //
        scene.Awake();
        //
        while (waitTime < totalWaitTime)
        {
            waitTime += Time.deltaTime;
            yield return(g_wait);
        }

        if (loading != null)
        {
            loading.TryDestroy();
        }

        bLoading = false;

        yield return(Yielders.GetWaitForSeconds(0.5f));

        //载入完成。
        scene.BuildScene();
        scene.Start();
        // 载入完成
    }
Beispiel #11
0
 /// <summary>
 /// 显示提示窗口
 /// </summary>
 /// <param name="msg">消息文本</param>
 /// <param name="title">标题ID</param>
 /// <param name="type">确认对话框类型</param>
 /// <param name="callback">回调,回调参数中可以判断点击了那个按钮</param>
 /// <returns></returns>
 public static void ShowMsgBox(string msg, string title, MsgBoxType type = MsgBoxType.Ok, Action <IMsgBoxResult> callback = null)
 {
     WndManager.CreateWnd <ConfirmWnd>(WndType.DialogWnd, false, false, (wnd) => {
         (wnd as ConfirmWnd).SetData(msg, title, type, callback);
     });
 }
Beispiel #12
0
 /// <summary>
 /// 显示敌我目标tips
 /// </summary>
 /// <param name="Info">目标数据</param>
 /// <param name="ScreenPos">屏幕位置</param>
 /// <param name="align">对其方式</param>
 /// <param name="TargetSize">触碰3D对象的在屏幕中的大小</param>
 /// <param name="isTouchDestroy">是否触碰销毁</param>
 /// <returns></returns>
 public static void ShowTargetTips(TargetHeroInfo Info, Vector2 ScreenPos, TipAlignment align, Vector2 TargetSize, bool isTouchDestroy)
 {
     WndManager.CreateWnd <TargetInfoWnd>(WndType.DialogWnd, false, false, (wnd) => {
         (wnd as TargetInfoWnd).SetData(new object[] { 1, Info, ScreenPos, align, TargetSize, isTouchDestroy });
     });
 }
Beispiel #13
0
 public override void BuildUI()
 {
     SoundManager.PlayMusic(3);
     WndManager.CreateWnd <BattleMainWnd>(WndType.MenuWnd, false, false, null);
     m_eType = EEnterLoginSceneType.eEnterLoginSceneType_None;
 }