예제 #1
0
    public void OnMoveEnd(Vector3 pos)
    {
        //HanK
        if (gameSceneUI)
        {
            gameSceneUI.Change_DiceInfo(m_sBoard.GetDice(m_oCursor.transform.position));
        }

        m_nDiceState = GameData.GAME_DICE_READY;
        if (m_CurEvent.target == GameData.EVENT_TARGET_DICE)
        {
            m_lScore += m_sBoard.CheckDices(pos);
            if (gameSceneUI)
            {
                gameSceneUI.Change_Score(m_lScore);
            }

            if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
            {
                CLevelManager.CheckStage(m_lScore);
            }
        }

        if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
        {
            TutorialMoveEnd(pos);
        }
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
     {
         NGUITools.SetActive(this.gameObject, false);
     }
 }
예제 #3
0
    void Disappear()
    {
        //튜토리얼일 경우 주사위는 사라지지 않는다.
        if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
        {
            float percent = getPercent();
            if (percent > 0.9)
            {
                //전체 주사위가 사라진 시간이 목표 시간보다 많아 질경우
                return;
            }
        }

        float fDT = Time.deltaTime;

        m_fMoveTime += fDT;
        this.transform.Translate(0.0f, -(fDT / m_fMoveTotalTime), 0.0f, Space.World);

        if (m_fMoveTime >= m_fMoveTotalTime)
        {
            m_nState = GameData.OBJECT_STATE_NONE;
            this.transform.position = new Vector3(this.transform.position.x, -1.1f, this.transform.position.z);
            DisappearEnd();
        }
    }
예제 #4
0
    bool CheckControlState()
    {
        if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
        {
        }

        return(true);
    }
예제 #5
0
    bool CheckBoard()
    {
        if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
        {
            return(m_sBoard.IsFull());
        }

        return(false);
    }
예제 #6
0
 void Update()
 {
     if (CMainData.getGameMode() != GameData.GAME_MODE_TUTORIAL)
     {
         GameProcess();
     }
     else if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
     {
         TutorialProcess();
     }
 }
예제 #7
0
    void CheckTimer()
    {
        //주사위 생성 시간 검사
        CheckCreateDiceTime();

        //블리츠 종료 시간 검사
        if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
        {
            CheckBlitzTime();
        }
        else if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
        {
            CTimeManager.m_TimeStampBasic += Time.deltaTime;
        }
    }
예제 #8
0
 public static void SetTimer()
 {
     if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
     {
         CTimeManager.m_TimeCreateDice = GameData.TIMER_CREATE_DICE_BLITZ;
         m_TimeStampBlitz = 0.0f;
     }
     else if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
     {
         CTimeManager.m_TimeCreateDice = GameData.TIMER_CREATE_DICE_BASIC;
         m_TimeStampBasic = 0.0f;
     }
     else if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
     {
         CTimeManager.m_TimeCreateDice = GameData.TIMER_CREATE_DICE_TUTORIAL;
     }
 }
예제 #9
0
    public static void CheckStage(long nScore)
    {
        m_nStageLevel = (int)(nScore / 100);
        m_nStageLevel = Mathf.Min(m_nStageLevel, 999);
        m_nStageLevel = Mathf.Max(m_nStageLevel, 0);

        if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
        {
            CTimeManager.m_TimeCreateDice = (float)(GameData.TIMER_CREATE_DICE_BASIC - ((m_nStageLevel / 10) * 0.1));
            CTimeManager.m_TimeCreateDice = Mathf.Max(CTimeManager.m_TimeCreateDice, GameData.TIMER_CREATE_DICE_MIN);

            CTimeManager.m_TimeDisappearDice = (float)(GameData.OBJECT_DISAPPEAR_TIME - ((m_nStageLevel / 10) * 0.2));
            CTimeManager.m_TimeDisappearDice = Mathf.Max(CTimeManager.m_TimeDisappearDice, GameData.OBJECT_DISAPPEAR_TIME_MIN);

            CTimeManager.m_TimeDisappearPlusPercent = (float)(GameData.OBJECT_DISAPPEAR_PLUS_PERCENT - ((m_nStageLevel / 10) * 0.1));
            CTimeManager.m_TimeDisappearPlusPercent = Mathf.Max(CTimeManager.m_TimeDisappearPlusPercent, GameData.OBJECT_DISAPPEAR_PLUS_PERCENT_MIN);
        }
    }
예제 #10
0
    void Start()
    {
        g_Instance = this;
        Application.runInBackground = true;
        if (Localization.instance != null)
        {
            // Localization 객체에게 언어를 바꾸라고 합니다.

            Debug.Log("Locale is " + CMainData.Locale);

            if (CMainData.Locale.Contains("ko"))
            {
                Localization.instance.currentLanguage = "korea";
            }
            else if (CMainData.Locale.Contains("ja"))
            {
                Localization.instance.currentLanguage = "japan";
            }
            else
            {
                Localization.instance.currentLanguage = "english";
            }
        }

        // 기존 Input

        /*
         *      Queue queue = new Queue();
         * m_EventQueue = Queue.Synchronized(queue);
         *      m_EventQueue.Clear();
         */

        m_oBoard  = GameObject.Find("Board");
        m_oCursor = GameObject.Find("Cursor");
        m_sBoard  = m_oBoard.GetComponent("Board") as Board;
        m_sCursor = m_oCursor.GetComponent("Cursor") as Cursor;
        m_oScore  = GameObject.Find("objScore");
        m_Star    = GameObject.Find("Star");
        m_Star2   = GameObject.Find("Star2");
        m_Arrow   = GameObject.Find("Arrow");
        m_Arrow2  = GameObject.Find("Arrow2");

        CTimeManager.SetTimer();
        if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
        {
            //Processing GameUI
            //CMainData.setGameState(GameData.GAME_STATE_PRE);
        }

        m_Star.SetActive(false);
        m_Arrow.SetActive(false);
        m_Star2.SetActive(false);
        m_Arrow2.SetActive(false);

        //TEST CODE : tutorial test
        //CMainData.setGameMode(GameData.GAME_MODE_TUTORIAL);
        /* ******************************************************* */

        if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
        {
            TutorialModeUI.SetActive(true);
            GameModeUI.SetActive(false);
        }
        else
        {
            TutorialModeUI.SetActive(false);
            GameModeUI.SetActive(true);
        }

        tutorialUI = TutorialModeUI.GetComponent("TutorialSceneUI") as TutorialSceneUI;
    }
예제 #11
0
    void PlayBGM()
    {
        switch (m_nSoundState)
        {
        case SOUND_STATE.SOUND_STATE_GAME_INTRO_READY:
            Debug.Log("Game Mode = " + m_nSoundState);

            if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
            {
                SoundManager.g_Instance.PlayBGM("BGM_basic_Intro_01", false);
                m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_INTRO;
            }
            else if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
            {
                SoundManager.g_Instance.PlayBGM("BGM_blitz_Intro_01", false);
                m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_INTRO;
            }
            else if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
            {
                m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_ING_READY;
            }

            break;

        case SOUND_STATE.SOUND_STATE_GAME_INTRO:
            if (SoundManager.g_Instance.IsPlayingBGM() == false)
            {
                m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_ING_READY;
            }
            break;

        case SOUND_STATE.SOUND_STATE_GAME_ING_READY:

            Debug.Log("Game Mode = " + m_nSoundState);
            if (CMainData.getGameMode() == GameData.GAME_MODE_BASIC)
            {
                Debug.Log("basic Sound");
                SoundManager.g_Instance.PlayBGM("BGM_basic_Looping_01", true);
            }
            else if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
            {
                Debug.Log("blitz Sound");
                SoundManager.g_Instance.PlayBGM("BGM_blitz_Looping_01", true);
            }
            else if (CMainData.getGameMode() == GameData.GAME_MODE_TUTORIAL)
            {
                Debug.Log("Tutorial Sound");
                SoundManager.g_Instance.PlayBGM("BGM_tutorial_01", true);
            }

            m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_ING;
            break;

        case SOUND_STATE.SOUND_STATE_GAME_ING:

            if (CMainData.getGameMode() == GameData.GAME_MODE_BLITZ)
            {
                if (CTimeManager.m_TimeBlitz - CTimeManager.m_TimeStampBlitz < 30)
                {
                    SoundManager.g_Instance.PlayBGM("BGM_blitz_HurryUp_Looping_01", true);
                    m_nSoundState = SOUND_STATE.SOUND_STATE_GAME_ING_HURRY_UP;
                }
            }
            break;

        case SOUND_STATE.SOUND_STATE_GAME_ING_HURRY_UP:
            break;

        case SOUND_STATE.SOUND_STATE_GAME_END:
            SoundManager.g_Instance.PlayBGM("BGM_main_01", true);
            break;
        }
    }