Ejemplo n.º 1
0
        /// <summary>
        /// Check if spawning the game ui is fine. If already exists
        /// then is not fine.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private static bool CheckIfOkayToSpawnGameUI(JCS_DialogueType type)
        {
            if (JCS_UIManager.instance.GetJCSDialogue(type) != null)
            {
                JCS_Debug.LogError("(" + type.ToString() + ")No able to spawn Game UI cuz there are multiple GameUI in the scene...");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Destory the current selected dialogue.
        /// </summary>
        /// <param name="type"></param>
        public static void DestoryCurrentDialogue(JCS_DialogueType type)
        {
            if (JCS_GameManager.instance.GAME_PAUSE)
            {
                return;
            }

            JCS_UIManager.instance.HideTheLastOpenDialogue();

            switch (type)
            {
            case JCS_DialogueType.SYSTEM_DIALOGUE:
            case JCS_DialogueType.NPC_DIALOGUE:
            case JCS_DialogueType.PLAYER_DIALOGUE:
                PauseGame(false);
                break;
            }
        }
        /// <summary>
        /// Check to see if enable to spawn the dialogue or not
        /// </summary>
        /// <returns></returns>
        private static bool CheckIfOkayToSpawnDialogue(JCS_DialogueType type)
        {
            // Force Diaglogue have higher priority,
            // so it will block the lower priority dialogue type
            if (JCS_UIManager.instance.GetJCSDialogue(type) != null)
            {
                JCS_Debug.LogError("(" + type.ToString() + ")No able to spawn Dialogue cuz there are multiple dialogue in the scene...");
                return(false);
            }

            if (JCS_Canvas.GuessCanvas() == null)
            {
                JCS_Debug.LogError("No able to spawn Dialogue cuz Canvas are null...");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        public JCS_DialogueObject GetJCSDialogue(JCS_DialogueType type)
        {
            switch (type)
            {
            // Game UI
            case JCS_DialogueType.GAME_UI:
                return(this.mGameUI);

            // Dialogue Box
            case JCS_DialogueType.PLAYER_DIALOGUE:
                return(this.mFocusGameDialogue);

            case JCS_DialogueType.SYSTEM_DIALOGUE:
                return(this.mForceDialogue);
            }

            JCS_Debug.LogError("Failed to get Dialogue -> " + type);
            return(null);
        }
Ejemplo n.º 5
0
        //----------------------
        // Protected Variables

        //========================================
        //      setter / getter
        //------------------------------
        public void SetJCSDialogue(JCS_DialogueType type, JCS_DialogueObject jdo)
        {
            switch (type)
            {
            case JCS_DialogueType.GAME_UI:
            {
                if (mGameUI != null)
                {
                    //JCS_Debug.LogError("Failed to set \"In Game Dialogue\"...");
                    return;
                }

                this.mGameUI = jdo;
            }
            break;

            case JCS_DialogueType.PLAYER_DIALOGUE:
            {
                //if (mFocusGameDialogue != null)
                //{
                //    JCS_Debug.LogError("JCS_UIManager",   "Failed to set \"In Game Dialogue\"...");
                //    return;
                //}

                this.mFocusGameDialogue = jdo;
            }
            break;

            case JCS_DialogueType.SYSTEM_DIALOGUE:
            {
                if (mForceDialogue != null)
                {
                    //JCS_Debug.LogError("JCS_UIManager",   "Failed to set \"Force Dialogue\"...");
                    return;
                }

                mForceDialogue = jdo;
            }
            break;
            }
        }