示例#1
0
    // @Brief : Compile script
    private void Compile()
    {
        StreamReader      pReader = KrResources.LoadText(m_pFilePath);
        KrCharagekiScript pScript = new KrCharagekiScript();

        try
        {
            pScript.LoadScript(pReader);
        }
        finally
        {
            if (pReader != null)
            {
                pReader.Close();
            }
        }
    }
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // PRIVATE FUNCTION
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    // @Brief  : Load script
    // @Return : KrCharagekiScript instance
    private KrCharagekiScript LoadScript()
    {
        KrCharagekiScript pScript = new KrCharagekiScript();

        for (int sIndex = 0; sIndex < m_pScriptPaths.Length; sIndex++)
        {
            StreamReader pReader = KrResources.LoadText(KrCharagekiDef.s_pASSET_BASE_PATH + m_pScriptPaths[sIndex], KrCharagekiDef.IsLoadingFromResources());
            try
            {
                pScript.LoadScript(pReader);
            }
            finally
            {
                if (pReader != null)
                {
                    pReader.Close();
                }
            }
        }
        return(pScript);
    }