Пример #1
0
    private Dictionary <PanelLayer, Transform> layerDict; //各个层级所对应的父物体

    public void Awake()
    {
        instance = this;
        InitLayer();
        dict = new Dictionary <string, PanelBase>();
        DontDestroyOnLoad(gameObject);
    }
Пример #2
0
    void Start()
    {
        print("Normal_Start");

        GameMgr.Instance.PlayerPos = this.PlayerPos;

        if (enableMiniMap)
        {
            MemoryMgr.InstantiateGameObject(DirPath.LittleUiDir + UiName.Image_MiniMap, GlobalVar.G_Canvas.transform);
        }

        if (!string.IsNullOrEmpty(UiPanelName))
        {
            PanelMgr.PushPanel(UiPanelName);
            if (UiPanelName == PanelName.battlePanel)
            {
                CEventCenter.BroadMessage(Message.M_RankAwake, 0, 0);
            }
        }

        if (creatTestPeople)
        {
            new TestPerson("Test", DirPath.GameObjectDir + GameObjectName.TestPerson, EnemyPos);
        }
    }
Пример #3
0
 protected override void OnAnySceneUnload()
 {
     base.OnAnySceneUnload();
     PanelMgr.Clear();
     MainLoop.Instance.Clear();
     CEventCenter.Clear();
 }
Пример #4
0
        partial void OnSafeAwake()
        {
            RegisterAll();
            PanelMgr.PushPanel(startPanel.StringValue);
//			AudioMgr.Instance.PlayBgm(startBgm.StringValue);
            //do any thing you want
        }
Пример #5
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.C))
     {
         PanelMgr.PushPanelWithMessage(PanelName.LoadingPanel, Message.LoadSceneAsync, SceneName.Battle);
     }
 }
 protected override void OnAnySceneUnload()
 {
     base.OnAnySceneUnload();
     PanelMgr.Clear();
     MainLoop.Instance.Clear();
     EffectUnitInfo.Clear();
 }
Пример #7
0
 protected override void OnTriggerExit2D(Collider2D col)
 {
     base.OnTriggerExit2D(col);
     if (isShowing)
     {
         PanelMgr.PopPanel();
     }
 }
 partial void OnLoad()
 {
     //do any thing you want
     add_button_listener("Btns/StartBtn",
                         () =>
                         PanelMgr.PushPanelWithMessage(
                             PanelName.LoadingPanel,
                             Message.M_LoadSceneAsync,
                             SceneName.jbScene));
 }
Пример #9
0
        partial void OnSafeAwake()
        {
            //初始化等级数据
            UlevelMgr.Instance.Init();

            CEventCenter.AddListener(Message.LoginLogicServerSuccess, OnLoginLogicServerSuccess);
            CEventCenter.AddListener(Message.GetUgameInfoSuccess, OnGetUgaemInfoSuccess);
            //do any thing you want
            PanelMgr.PushPanel(startPanel.StringValue);
        }
Пример #10
0
        /// <summary>
        /// 加载场景,并加载新UI
        /// </summary>
        /// <param name="newSceneName"></param>
        /// <param name="newPanelName"></param>
        public static void LoadScene(string newSceneName, string newPanelName)
        {
            if (currentSceneName == newSceneName)
            {
                return;
            }

            MainLoop.Instance.StartCoroutine(_LoadScene(AbstractSceneInfo.GetScene(newSceneName),
                                                        null,
                                                        () => PanelMgr.PushPanel(newPanelName)));
        }
Пример #11
0
    private void OnStartBack(ProtocolBase protocol)
    {
        ProtocolBytes proto     = (ProtocolBytes)protocol;
        int           start     = 0;
        string        protoName = proto.GetString(start, ref start);
        int           ret       = proto.GetInt(start, ref start);

        if (ret != 0)
        {
            PanelMgr.ShowTip("开始失败!");
        }
    }
Пример #12
0
 private void OnLoadSceneAsync(string sceneName)
 {
     if (sceneName == SceneMgr.CurrentSceneName)
     {
         PanelMgr.PopPanel();
     }
     SceneMgr.LoadSceneAsync(sceneName, onLoading: (value) =>
     {
         this.slider.value = (float)value / 100.0f;
         this.text.text    = "LoadingPanel..." + value + "%";
     });
 }
Пример #13
0
        void Start()
        {
            PanelMgr.PushPanel(startPanel.StringValue);
            AudioMgr.Instance.PlayBgm(startBgm.StringValue);


            if (enableMiniMap)
            {
                ResourceMgr.InstantiateGameObject(UiName.Image_MiniMapBackGround,
                                                  GlobalVar.G_Canvas.transform);
            }
        }
Пример #14
0
 public void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     //DontDestroyOnLoad(gameObject);
     InitLayer();
     dict = new Dictionary <string, PanelBase>();
 }
    public static void ShowGameMenu()
    {
        PanelMgr mgr = NavigationUtil.PanelMgr;

        if (mgr != null)
        {
            Debug.Log("Showing Game Menu!");
            mgr.OpenGameMenu();
        }
        else
        {
            Debug.Log("PanelMgr script missing!");
        }
    }
    public static void ShowInvitationPanel()
    {
        PanelMgr mgr = NavigationUtil.PanelMgr;

        if (mgr != null)
        {
            Debug.Log("Showing Invitation Panel!");
            mgr.OpenInvitationPanel();
        }
        else
        {
            Debug.Log("PanelMgr script Missing");
        }
    }
    public static void ShowPlayingPanel()
    {
        PanelMgr mgr = NavigationUtil.PanelMgr;

        if (mgr != null)
        {
            Debug.Log("Showing Playing Panel!");
            mgr.OpenPlayingPanel();
        }
        else
        {
            Debug.Log("PanelMgr script missing!");
        }
    }
Пример #18
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(this);
        }
        else
        {
            instance = this;
        }

        InitLayer();
        dict = new Dictionary <string, PanelBase>();
    }
 protected override void Update()
 {
     base.Update();
     if (Input.GetKeyDown(mapKey))
     {
         if (mapped)
         {
             PanelMgr.PopPanel();
         }
         else
         {
             PanelMgr.PushPanel(PanelName.MapPanel);
         }
         mapped = !mapped;
     }
 }
Пример #20
0
        void Start()
        {
            if (!gameObject.activeSelf || !enabled)
            {
                return;
            }
            PanelMgr.PushPanel(startPanel.StringValue);
            AudioMgr.Instance.PlayBgm(startBgm.StringValue);


            if (enableMiniMap)
            {
                ResourceMgr.InstantiateGameObject(UiName.Image_MiniMapBackGround,
                                                  GlobalVar.GCanvasObj.transform);
            }
        }
Пример #21
0
    private void Update()
    {
        if (Enable_C_ChangeScene)
        {
            if (Input.GetKeyDown(KeyCode.C))
            {
                SceneMgr.LoadScene(SceneName.testScene, null, () => Debug.Log("Enter new Scene"));
            }
        }

        if (enable_V_loadAsync)
        {
            if (Input.GetKeyDown(KeyCode.V))
            {
                PanelMgr.PushPanelWithMessage(PanelName.loadingPanel, Message.M_LoadSceneAsync, SceneName.testScene);
            }
        }
    }
Пример #22
0
    private void OnExitBack(ProtocolBase protocol)
    {
        ProtocolBytes proto     = (ProtocolBytes)protocol;
        int           start     = 0;
        string        protoName = proto.GetString(start, ref start);
        int           ret       = proto.GetInt(start, ref start);

        if (ret == 0)
        {
            PanelMgr.ShowTip("退出成功");
            PanelMgr.instance.OpenPanel <RoomListPanel>("");
            Close();
        }
        else
        {
            PanelMgr.ShowTip("退出失败");
        }
    }
Пример #23
0
 void Update()
 {
     if (isClose)
     {
         //Debug.Log("Close");
         if (Input.GetKeyDown(KeyCode.E))
         {
             if (isShowing)
             {
                 PanelMgr.PopPanel();
                 isShowing = false;
             }
             else
             {
                 PanelMgr.PushPanel(PanelName.ShopPanel);
                 isShowing = true;
             }
         }
     }
 }
        public void RunPanelUnit()
        {
            switch (panelType)
            {
            case DialogUnitInfo.PanelOperateType.Pop:
                PanelMgr.PopPanel();
                break;

            case DialogUnitInfo.PanelOperateType.Push:
                Debug.Log("DialogUnitInfo_RunPanelUnit_Switch_PushPanel");
                if (fade)
                {
                    PanelMgr.PushPanel(panelChooser.StringValue, new FadeInOut(floatValue));
                }
                else
                {
                    PanelMgr.PushPanel(panelChooser.StringValue);
                }
                break;
            }
        }
Пример #25
0
        private void Update()
        {
            if (!gameObject.activeSelf || !enabled)
            {
                return;
            }
            if (Enable_C_ChangeScene)
            {
                if (Input.GetKeyDown(KeyCode.C))
                {
                    SceneMgr.LoadScene(sceneName.StringValue, null, () => Debug.Log("Enter new Scene"));
                }
            }

            if (enable_V_loadAsync)
            {
                if (Input.GetKeyDown(KeyCode.V))
                {
                    PanelMgr.PushPanelWithMessage(PanelName.LoadingPanel, Message.M_LoadSceneAsync, sceneName.StringValue);
                }
            }
        }
Пример #26
0
 // Start is called before the first frame update
 public static void Initialize()
 {
     Assetbundle  = ABMgr.Instance;
     UI           = PanelMgr.Instance;
     VersionCheck = VersionCheckMgr.Instance;
 }
Пример #27
0
 private void StartShowPanel(PanelBase go, PanelMgr.PanelShowStyle showStyle, bool isOpen)
 {
     switch (showStyle)
     {
         case PanelShowStyle.Normal:
             ShowNormal(go, isOpen);
             break;
         case PanelShowStyle.CenterScaleBigNormal:
             ShowCenterScaleBigNormal(go, isOpen);
             break;
         case PanelShowStyle.LeftToSlide:
             ShowLeftScale(go, isOpen,true);
             break;
         case PanelShowStyle.RightToSlide:
             ShowLeftScale(go, isOpen, false);
             break;
         case PanelShowStyle.TopToSlide:
             ShowTopScale(go, isOpen, true);
             break;
         case PanelShowStyle.DownToSlide:
             ShowTopScale(go, isOpen, false);
             break;
     }
 }
Пример #28
0
        protected override void Update()
        {
            //            Debug.Log("玩家在" + Pos);


            //一技能
            if (Input.GetKeyDown(KeyCode.U))
            {
                //               Debug.Log("按U"+this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 1)
                {
                    Debug.Log("释放一技能:" + skills[this.BaseSkillCount].name);
                    skills[this.BaseSkillCount].Execute(this, true);
                }
            }

            //二技能
            if (Input.GetKeyDown(KeyCode.I))
            {
                //               Debug.Log("按I" + this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 2)
                {
                    Debug.Log("释放二技能:" + skills[this.BaseSkillCount + 1].name);
                    skills[this.BaseSkillCount + 1].Execute(this);
                }
            }

            //三技能
            if (Input.GetKeyDown(KeyCode.O))
            {
                Debug.Log("按O" + this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 3)
                {
//                    Debug.Log("释放三技能:"+skills[this.BaseSkillCount+2].name);
                    skills[this.BaseSkillCount + 2].Execute(this);
                }
            }

            //Z强化
            if (Input.GetKeyDown(KeyCode.Z))
            {
                TrySuper();
            }

            //背包
            if (Input.GetKeyDown(KeyCode.Tab))
            {
                PanelMgr.PushPanel(PanelName.packagePanel);
            }
            if (Input.GetKeyUp(KeyCode.Tab))
            {
                PanelMgr.PopPanel();
            }

            #region  连击

            SkillInstance lastSkill = null;
            var           index     = this.comboNum;

            if (this.comboNum > 0)
            {
                lastSkill = skills[index];

                Assert.IsTrue(this.comboNum > 0 && this.comboNum < 4);

                if (this.timer - lastSkill.startTime > canMoveTime[this.comboNum - 1])
                {
                    mainc._inControl = true;
                }

                if (this.timer - lastSkill.startTime >
                    lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] + durTimes[this.comboNum - 1])
                {
                    //Debug.Log("归零");
                    this.comboNum = 0;
                    MainLoop.Instance.RemoveUpdateFunc(_DeUpdate);
                    //恢复人物控制
                    mainc._inControl = true;
                }
            }

            if (Input.GetKeyDown(KeyCode.J))
            {
                if (!cc.isGrounded)
                {
                    mainc._playerVelocityY = 0;
                    this.TakeBattleEffect(new HitbackEffect(new Vector2(this.Dir * Mathf.Abs(this.airXMove), 0)));
                }
                mainc._inControl = false;

                //            Debug.Log("按下J");

                var thisSkill = skills[index];

                index++;


                if (this.comboNum == 0) //初次攻击
                {
                    this.timer = 0;
                    //开始增加时间
                    //                    Debug.Log("初次攻击");
                    MainLoop.Instance.AddUpdateFunc(_DeUpdate);
                    Debug.Log("执行了技能" + index + " " + thisSkill.name);
                    thisSkill.Execute(this, ignoreInput[0], this.timer);
                    this.comboNum++;
                }

                else if (
                    this.timer - lastSkill.startTime > lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] &&
                    this.timer - lastSkill.startTime <
                    lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] + durTimes[this.comboNum - 1] &&
                    this.comboNum < skillNames.Count)
                {
                    Debug.Log("执行了技能" + index + " " + thisSkill.name);
                    thisSkill.Execute(this, ignoreInput[this.comboNum - 1], this.timer);
                    this.comboNum++;
                }
            }
            #endregion
        }
Пример #29
0
 private void OnLoginLogicServerSuccess()
 {
     CEventCenter.RemoveListener(Message.LoginLogicServerSuccess, OnLoginLogicServerSuccess);
     Debug.Log("登陆逻辑服务器成功");
     PanelMgr.PushPanel(PanelName.HomePanel);
 }
Пример #30
0
 void Awake()
 {
     Instance = this;
 }
Пример #31
0
    private Dictionary <PanelLayer, Transform> layerDict;       // each layer's actual transfrom in scenes.
    #endregion

    #region Operation Cycle
    void Awake()
    {
        instance = this;
        InitLayer();
        dict = new Dictionary <string, PanelBase> ();
    }
Пример #32
0
 public static PanelMgr GetInstance()
 {
     if (!hasInstance){
         mInstance = new PanelMgr();
     }
     return mInstance;
 }