コード例 #1
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         ApplicationStatusManager.GetStatus <StartStatus>().EnterToStart();
     }
 }
コード例 #2
0
    public static void NextLine()
    {
        s_currentLine++;
        s_questionTime = Time.time;

        if (s_currentLine < currentPoemData.m_content.Length)
        {
            if (currentPoemData.m_content[s_currentLine].Contains("space"))
            {
                GlobalEvent.DispatchEvent(GameEventEnum.CreateSpace);
                s_currentLine++;
            }

            CreateAnswer();
        }
        else
        {
            if (s_GameModel == GameModel.normal)
            {
                ApplicationStatusManager.GetStatus <GameStatus>().OpenFinishUI();
            }
            else
            {
                NewPoem();
                GlobalEvent.DispatchEvent(GameEventEnum.NextPoem);
            }
        }
    }
コード例 #3
0
    // 按键消息接受
    public void OnStart()
    {
        m_bIsActive = false;
        StopCoroutine("TextAnim");

        ApplicationStatusManager.GetStatus <StartStatus> ().EnterToLobby();
        // ApplicationStatusManager.EnterStatus<GameStatus>();
    }
コード例 #4
0
 void ReceviceSocketStatus(InputNetworkConnectStatusEvent e)
 {
     isConnect = false;
     if (e.m_status == NetworkState.Connected)
     {
         ApplicationStatusManager.GetStatus <LoginState>().Login(SystemInfo.deviceUniqueIdentifier, UserData.NickName);
     }
 }
コード例 #5
0
    // Start Action
    public override void Start()
    {
        Debug.Log("[Action_EnterMap] : Start : ");

        MapManager kMapManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("MapManager") as MapManager;

        kMapManager.EnterMap(m_iMapID);

        End();
    }
コード例 #6
0
    // 按钮消息接受
    public void OnRecvClick(InputUIOnClickEvent e)
    {
        MessageManager.Message kMsg = new MessageManager.Message();
        kMsg.m_eType     = MessageManager.MessageType.MT_DialogClick;
        kMsg.m_dicParams = new Dictionary <string, string> ();
        MessageManager kMessageManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("MessageManager") as MessageManager;

        kMessageManager.AddMessage(kMsg);
        Debug.Log("Dialog Window On Clicked");
    }
コード例 #7
0
    public void EnterMap(int iMapID)
    {
        if (iMapID == m_iCurMapID)
        {
            return;
        }

        ApplicationStatusManager.GetStatus <GameStatus>().ChangeMapScene(m_iCurMapID, iMapID);

        m_iCurMapID = iMapID;
    }
コード例 #8
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.F12))
     {
         ApplicationStatusManager.GetStatus <GameStatus>().SaveGame("save_0.txt");
     }
     else if (Input.GetKey(KeyCode.F11))
     {
         ApplicationStatusManager.GetStatus <GameStatus>().LoadGame("save_0.txt");
     }
 }
コード例 #9
0
 static int GetStatus(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string             arg0 = ToLua.CheckString(L, 1);
         IApplicationStatus o    = ApplicationStatusManager.GetStatus(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #10
0
    private void _ProcessMsg(Message kMsg)
    {
        if (kMsg.m_eType == MessageType.MT_DialogClick)
        {
            StoryManager kStoryManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("StoryManager") as StoryManager;
            Story        curstory      = kStoryManager.GetCurrentStory();
            if (curstory == null)
            {
                Debug.LogError("[MessageManager] : MessageType.MT_DialogClick Error,Story is null");
                return;
            }
            Action_Dialog kActionDialog = curstory.GetCurrentAction() as Action_Dialog;
            if (kActionDialog == null)
            {
                Debug.LogError("[MessageManager] : MessageType.MT_DialogClick Error,Story is null");
                return;
            }

            // 需要判断story的下一个是否仍旧是dialog类型
            kActionDialog.OnDialogEnd();
        }
    }
コード例 #11
0
    public void OnDialogEnd()
    {
        // 对话结束的时候,需要判定一下是否需要隐藏界面,依据是下一个动作是否仍旧是action_dialog类型
        bool         isneeddel     = true;
        StoryManager kStoryManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("StoryManager") as StoryManager;
        Story        curstory      = kStoryManager.GetCurrentStory();

        if (curstory != null)
        {
            Action_Dialog kNextAction = curstory.GetNextAction() as Action_Dialog;
            if (kNextAction != null)
            {
                isneeddel = false;
            }
        }
        if (isneeddel)
        {
            ApplicationStatusManager.GetStatus <GameStatus>().OnDialogEnd(isneeddel);
        }

        // 结束本动作
        End();
    }
コード例 #12
0
    // Start Action
    public override void Start()
    {
        Debug.Log("[Action_Dialog] : Start : " + m_dialogcontent);

        ApplicationStatusManager.GetStatus <GameStatus>().OnDialog(m_dialogcontent, m_roleid);
    }
コード例 #13
0
 public void ClickBack(InputUIOnClickEvent e)
 {
     ApplicationStatusManager.GetStatus <ModelSelectState>().Back();
 }
コード例 #14
0
 public void ClickArcadeModel(InputUIOnClickEvent e)
 {
     ApplicationStatusManager.GetStatus <ModelSelectState>().ArcadeModel();
 }
コード例 #15
0
 void FinsihCountDown()
 {
     ApplicationStatusManager.GetStatus <GameStatus>().FinishCountDown();
 }
コード例 #16
0
 void OnClickAgain(InputUIOnClickEvent e)
 {
     ApplicationStatusManager.GetStatus <GameStatus>().PlayAgain();
 }
コード例 #17
0
    static void LevelJudge(bool isError)
    {
        if (isError)
        {
            ComboCount = 0;
            //Score -= 30;

            GlobalEvent.DispatchEvent(GameEventEnum.ShowScoreLevel, ScoreLevel.bad);

            if (s_GameModel == GameModel.Arcade)
            {
                HP--;

                GlobalEvent.DispatchEvent(GameEventEnum.ScoreChange);

                if (HP == 0)
                {
                    ApplicationStatusManager.GetStatus <GameStatus>().OpenFinishUI();
                }
            }
        }
        else
        {
            ComboCount++;

            if (ComboCount > s_maxCombo)
            {
                s_maxCombo = ComboCount;
            }

            float useTime  = Time.time - s_questionTime;
            int   scoreTmp = 0;

            ScoreLevel level = ScoreLevel.normal;

            if (useTime < 4)
            {
                level    = ScoreLevel.perfect;
                scoreTmp = 50;
            }
            else if (useTime < 6)
            {
                level    = ScoreLevel.nice;
                scoreTmp = 20;
            }
            else if (useTime < 10)
            {
                level    = ScoreLevel.good;
                scoreTmp = 10;
            }
            else
            {
                level    = ScoreLevel.normal;
                scoreTmp = 5;
            }

            Score += ComboCount * scoreTmp;

            GlobalEvent.DispatchEvent(GameEventEnum.ShowScoreLevel, level);

            if (s_GameModel == GameModel.Arcade)
            {
                GlobalEvent.DispatchEvent(GameEventEnum.ScoreChange);
            }
        }
    }