コード例 #1
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        uint   uCharaId     = 0;
        string pPositionKey = "";

        for (int sIndex = 0; sIndex < m_pOptions.Count; sIndex++)
        {
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // CHARA ID
            if (m_pOptions[sIndex].m_pKey == "chara")
            {
                bool bIsSuccess = uint.TryParse(m_pOptions[sIndex].m_pValue, out uCharaId);
                KrDebug.Assert(bIsSuccess, "Parsing failed to type unsigned int = " + m_pOptions[sIndex].m_pValue, typeof(KrCharagekiCommandCharacterAction));
            }
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // ACTION ID
            else if (m_pOptions[sIndex].m_pKey == "position")
            {
                pPositionKey = m_pOptions[sIndex].m_pValue;
            }
        }

        KrDebug.Assert(uCharaId > 0, "there is no chara id!!", typeof(KrCharagekiCommandSetCharacterPosition));
        KrDebug.Assert(!string.IsNullOrEmpty(pPositionKey), "there is no position!!", typeof(KrCharagekiCommandSetCharacterPosition));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        KrDebug.Log("Chara action : chara = " + uCharaId + ", position = " + pPositionKey, typeof(KrCharagekiCommandSetCharacterPosition));

        KrDebug.Assert(KrCharagekiDef.s_pPOSITION_DIC.ContainsKey(pPositionKey), "Key not found from KrCharagekiDef.s_pPOSITION_DIC. key = " + pPositionKey, typeof(KrCharagekiCommandSetCharacterPosition));
        Vector3 vPosition = KrCharagekiDef.s_pPOSITION_DIC[pPositionKey];

        pUIController.SetPosition(uCharaId, vPosition);
    }
コード例 #2
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PROTECTED FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution with option
    // @Param : uId        => Character id
    //        : pManager   => Charageki manager
    protected override void Exec(uint uId, KrCharagekiManager pManager)
    {
        KrDebug.Log("Load character : id = " + uId, typeof(KrCharagekiCommandLoadCharacter));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        pUIController.LoadCharacter(uId);
    }
コード例 #3
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PROTECTED FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution with option
    // @Param : sId         => Character id
    //        : pManager    => Charageki manager
    protected override void Exec(uint sId, KrCharagekiManager pManager)
    {
        KrCharagekiUIController pUIController = pManager.GetUIController();

        KrDebug.Log("Show character : id = " + sId, typeof(KrCharagekiCommandShowCharacter));
        pUIController.ShowCharacter(sId);
    }
コード例 #4
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        uint uCharaId  = 0;
        uint uActionId = 0;

        for (int sIndex = 0; sIndex < m_pOptions.Count; sIndex++)
        {
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // CHARA ID
            if (m_pOptions[sIndex].m_pKey == "chara")
            {
                bool bIsSuccess = uint.TryParse(m_pOptions[sIndex].m_pValue, out uCharaId);
                KrDebug.Assert(bIsSuccess, "Parsing failed to type unsigned int = " + m_pOptions[sIndex].m_pValue, typeof(KrCharagekiCommandCharacterAction));
            }
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // ACTION ID
            else if (m_pOptions[sIndex].m_pKey == "action")
            {
                bool bIsSuccess = uint.TryParse(m_pOptions[sIndex].m_pValue, out uActionId);
                KrDebug.Assert(bIsSuccess, "Parsing failed to type unsigned int = " + m_pOptions[sIndex].m_pValue, typeof(KrCharagekiCommandCharacterAction));
            }
        }

        KrDebug.Assert(uCharaId > 0, "there is no chara id!!", typeof(KrCharagekiCommandSetText));
        KrDebug.Assert(uActionId > 0, "there is no action id!!", typeof(KrCharagekiCommandSetText));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        KrDebug.Log("chara action : chara = " + uCharaId + ", action = " + uActionId, typeof(KrCharagekiCommandCharacterAction));
        pUIController.SetAction(uCharaId, uActionId);
    }
コード例 #5
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PROTECTED FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution with option
    // @Param : uId         => Background id
    //        : pManager    => Charageki manager
    protected override void Exec(uint uId, KrCharagekiManager pManager)
    {
        KrDebug.Log("Set bg : sId = " + uId, typeof(KrCharagekiCommandSetSpriteBg));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        pUIController.SetBg(uId);
    }
コード例 #6
0
 // @Brief : Initialize
 // @Param : pScripts        => Script paths
 //        : pCharaParent    => Character parent
 //        : eViewMode       => Character display mode
 //        : fAutoTime       => Wait time after completion of processing of auto mode
 //        : pAssetBasePath  => Asset base path
 //        : pServerBaseUrl  => Server base url
 private void Initialize(string[] pScripts, Transform pCharaParent, KrCharagekiUICharacterContainer.eVIEW_MODE eViewMode, float fAutoTime, string pAssetBasePath, string pServerBaseUrl = "")
 {
     m_pScriptPaths = pScripts;
     KrCharagekiDef.s_pASSET_BASE_PATH = pAssetBasePath;
     KrCharagekiDef.s_pSERVER_BASE_URL = pServerBaseUrl;
     // Cached controller
     m_pUIController = new KrCharagekiUIController(pCharaParent, eViewMode, fAutoTime);
 }
コード例 #7
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        KrDebug.Log("Fade in : ", typeof(KrCharagekiCommandFadeIn));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        // MEMO : Non option
        pUIController.FadeIn();
    }
コード例 #8
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        KrDebug.Log("Show text : ", typeof(KrCharagekiCommandShowText));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        // MEMO : Non option
        pUIController.ShowText();
    }
コード例 #9
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        KrDebug.Log("Show title : ", typeof(KrCharagekiCommandSetSpriteBg));
        KrCharagekiUIController pUIController = pManager.GetUIController();

        // MEMO : Non option
        pUIController.ShowTitle();
    }
コード例 #10
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        float fWaitTime = 0.0f;

        for (int sIndex = 0; sIndex < m_pOptions.Count; sIndex++)
        {
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // KEY
            if (m_pOptions[sIndex].m_pKey == "time")
            {
                bool bIsSuccess = float.TryParse(m_pOptions[sIndex].m_pValue, out fWaitTime);
                KrDebug.Assert(bIsSuccess, "Parsing failed to type float = " + m_pOptions[sIndex].m_pValue, typeof(KrCharagekiCommandWaitTime));
            }
        }

        KrCharagekiUIController pUIController = pManager.GetUIController();

        KrDebug.Log("Set wait time = " + fWaitTime, typeof(KrCharagekiCommandWaitTime));
        pUIController.SetWaitTime(fWaitTime);
    }
コード例 #11
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution command
    // @Param : pManager    => Charageki manager
    public override void Exec(KrCharagekiManager pManager)
    {
        bool bWait = false;

        for (int sIndex = 0; sIndex < m_pOptions.Count; sIndex++)
        {
            //:::::::::::::::::::::::::::::::::::::::::::::::::::
            // KEY
            if (m_pOptions[sIndex].m_pKey == "wait")
            {
                bool bIsSuccess = bool.TryParse(m_pOptions[sIndex].m_pValue, out bWait);
                KrDebug.Assert(bIsSuccess, "Parsing failed to type bool = " + m_pOptions[sIndex].m_pValue, typeof(KrCharagekiCommandWaitInput));
            }
        }

        KrCharagekiUIController pUIController = pManager.GetUIController();

        KrDebug.Log("Set wait input = " + bWait, typeof(KrCharagekiCommandWaitInput));
        pUIController.SetWaitInput(bWait);
    }
コード例 #12
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PROTECTED FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Execution with option
    // @Param : uId         => Value of "No" column of csv
    //        : pManager    => Charageki manager
    protected override void Exec(uint uId, KrCharagekiManager pManager)
    {
        KrCharagekiScenarioContainer pScenarioContainer = pManager.GetScenarioContainer();
        // Get row data of csv
        KrCsvDataRow pCsvDataRow = pScenarioContainer.GetScenario(uId.ToString(), "No");

        uint uCharaId   = 0;
        bool bIsSuccess = uint.TryParse(pCsvDataRow.GetValue("CharaId"), out uCharaId);

        KrDebug.Assert(bIsSuccess, "Parsing failed to type int = " + pCsvDataRow.GetValue("CharaId"), typeof(KrCharagekiCommandSetText));

        KrDebug.Assert(KrCharagekiDef.s_pCHARA_DIC.ContainsKey(uCharaId), "Invalid KrCharagekiDef.s_CHARA_NAME key = " + uCharaId, typeof(KrCharagekiCommandSetText));
        string pCharaName = KrCharagekiDef.s_pCHARA_DIC[uCharaId].GetCharacterName();
        string pComment   = pCsvDataRow.GetValue("Comment");

        KrDebug.Log("Play Text : " + "CharaId" + " = " + pCharaName + ", " + "Comment" + " = " + pComment, typeof(KrCharagekiCommandSetText));
        KrCharagekiUIController pUIController = pManager.GetUIController();
        // Set text
        float fReadingTime = pUIController.SetText(pCharaName, pComment);

        // Play voice
        string pVoiceName = pCsvDataRow.GetValue("VoiceId");

        KrDebug.Log("Play Voice: " + "CharaId" + " = " + pCharaName + ", " + "VoiceId" + " = " + pVoiceName, typeof(KrCharagekiCommandSetText));
        KrAudioSource pAudioSource = pUIController.PlayVoice(uCharaId, pVoiceName, pManager);

        if (pAudioSource == null)
        {
            // If there is no voice data, set the lip sync time from the length of the text
            pUIController.PlayLipSync(uCharaId, fReadingTime, pComment);
        }

        // Set log
        KrCharagekiLog          pLog          = new KrCharagekiLog(pCharaName, pComment);
        KrCharagekiLogContainer pLogContainer = pManager.GetLogContainer();

        pLogContainer.AddLog(pLog);
    }
コード例 #13
0
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PUBLIC FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief : Initialize
    // @Param : pParam  => Arguments for initialize
    public override void Initialize(KrUIArgumentParameter pParam)
    {
        KrCharagekiManager      pManager      = KrCharagekiManager.Create(transform, scriptPaths, charaParent, charagekiMode, 1.0f);
        KrCharagekiUIController pUIController = pManager.GetUIController();

        // AddListener tap screen
        tapScreen.onClick.AddListener(() =>
        {
            pManager.TapScreen();
        });

        // Register fade process
        pUIController.RegisterFade(KrValueAnimator.eEASE.NONE, 1.0f, 1.0f, fadeImage.gameObject, (float fFadeValue) =>
        {
            Color pColor    = fadeImage.color;
            pColor.a        = fFadeValue;
            fadeImage.color = pColor;
        });

        // Register title process
        pUIController.RegisterTitle((string pStr) =>
        {
            V_TITLE_TEXT.text = pStr;
        },
                                    () => { V_TITLE_TEXT.gameObject.SetActive(true); },
                                    () => { V_TITLE_TEXT.gameObject.SetActive(false); });

        // Register background process
        pUIController.RegisterBackground((Sprite pBackground) =>
        {
            backgroundImage.sprite = pBackground;
            backgroundImage.SetNativeSize();
        },
                                         () => { backgroundImage.gameObject.SetActive(true); },
                                         () => { backgroundImage.gameObject.SetActive(false); });

        // Register text area process
        pUIController.RegisterTextArea(0.1f, (string pCharaName) =>
        {
            V_CHARA_NAME.text = pCharaName;
        },
                                       (string pComment) =>
        {
            V_COMMENT.text = pComment;
        },
                                       () => { commentObject.gameObject.SetActive(true); },
                                       () => { commentObject.gameObject.SetActive(false); });

        // AddListener switch menu
        menu.onClick.AddListener(cbSwitchMenu);
        // AddListener skip
        skip.onClick.AddListener(() =>
        {
            pUIController.ResetAutoMode();
        });
        // AddListener auto mode
        auto.onClick.AddListener(() =>
        {
            pUIController.ToggleAutoMode();
        });
    }