Ejemplo n.º 1
0
        private void Update()
        {
            if (GlobalValue.GetCurrentGamePhase() == ENUM_GamePhase.Play)
            {
                if (PlayerInfo.GetData == true)
                {
                    GlobalValue.ChangeGamePhare(ENUM_GamePhase.Settlement);
                    PlayerInfo.RemoveTaskList("Find Data");
                }


                m_InputAxis = GlobalValue.GetInputAxis();
                m_Rigid2D.MovePosition(this.transform.position + m_InputAxis * m_Speed * Time.deltaTime);
                if (m_InputAxis != Vector3.zero)
                {
                    m_PlayerAni.SetBool("Run", true);
                }
                else
                {
                    m_PlayerAni.SetBool("Run", false);
                    this.transform.rotation = Quaternion.Euler(0, 0, 0);
                }

                //玩家移动的时候左右旋转
                if (m_InputAxis.x < 0)
                {
                    this.transform.rotation      = Quaternion.Euler(0, 180, 0);
                    m_CanvasPlayer.localRotation = Quaternion.Euler(0, 180, 0);
                }
                else
                {
                    this.transform.rotation      = Quaternion.Euler(0, 0, 0);
                    m_CanvasPlayer.localRotation = Quaternion.Euler(0, 0, 0);
                }
            }
            else if (GlobalValue.GetCurrentGamePhase() == ENUM_GamePhase.Introduce)
            {
                if (Input.anyKeyDown)
                {
                    UITool.HideNormalPanel();
                    DialogFormat dialogData = DialogData.GetNextDialogData(ENUM_DialogType.Introduce_Start);
                    if (dialogData == null)
                    {
                        GlobalValue.ChangeGamePhare(ENUM_GamePhase.Play);
                        UITool.HideDialogText();
                        TaskFormat task = new TaskFormat();
                        task.TaskName        = "Find Data";
                        task.TaskDescription = "Map Left Up!";
                        PlayerInfo.AddTaskList(task);
                    }
                    else
                    {
                        UITool.ShowDialogText(dialogData);
                    }
                }
            }
            else if (GlobalValue.GetCurrentGamePhase() == ENUM_GamePhase.Talking)
            {
                m_InputAxis = Vector2.zero;
            }
            else if (GlobalValue.GetCurrentGamePhase() == ENUM_GamePhase.Settlement)
            {
                //最终结算。
                GameObject.Find("Canvas").transform.Find("Panel_Settlement").gameObject.SetActive(true);
            }
        }