// @Brief : Initialize // @Param : pData => Character data protected override void Initialize(KrCharagekiUICharacterData pData) { base.Initialize(pData); m_pActionSpriteDic = new Dictionary <uint, Sprite>(); foreach (KeyValuePair <uint, string> pKeyValue in KrCharagekiDef.s_p2D_CHARA_ACTION_IMAGE) { string pDataPath = KrCharagekiDef.s_pASSET_BASE_PATH + string.Format(pKeyValue.Value, m_pCharaData.GetCharacterId()); Sprite pSprite = KrResources.LoadSprite(pDataPath, KrCharagekiDef.IsLoadingFromResources()); m_pActionSpriteDic.Add(pKeyValue.Key, pSprite); } Hide(); }
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // 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); }
// @Brief : Play bgm // @Param : pPath => Asset path of audio clip // @Return : Audio source public KrAudioSource PlayBgm(string pPath) { return(KrAudioManager.I.PlayBgm(KrCharagekiDef.s_pASSET_BASE_PATH + pPath, KrCharagekiDef.IsLoadingFromResources())); }
// @Brief : Load public void LoadSprite() { m_pBgSprite = KrResources.LoadSprite(KrCharagekiDef.s_pASSET_BASE_PATH + m_pImagePath, KrCharagekiDef.IsLoadingFromResources()); }
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // PUBLIC FUNCTION //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // @Brief : Load scenario // @Param : pKey => Key to register csv // pPath => Csv path public void LoadScenario(string pKey, string pPath) { KrCsvData pCsvData = KrCsvLoader.Load(KrCharagekiDef.s_pASSET_BASE_PATH + pPath, KrCharagekiDef.IsLoadingFromResources()); m_pScenarioDataDic.Add(pKey, pCsvData); }
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // PROTECTED FUNCTION //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // @Brief : Initialize // @Param : pData => Character data protected override void Initialize(KrCharagekiUICharacterData pData) { base.Initialize(pData); string pMocPath = KrCharagekiDef.s_pASSET_BASE_PATH + string.Format(KrCharagekiDef.s_pLIVE2D_MCO_FILE_FORMAT, pData.GetCharacterId()); string[] pTexturePaths = new string[KrCharagekiDef.s_pLIVE2D_MODEL_TEXTURES_FORMAT.Length]; for (int sIndex = 0; sIndex < KrCharagekiDef.s_pLIVE2D_MODEL_TEXTURES_FORMAT.Length; sIndex++) { string pTexturePath = KrCharagekiDef.s_pASSET_BASE_PATH + string.Format(KrCharagekiDef.s_pLIVE2D_MODEL_TEXTURES_FORMAT[sIndex], pData.GetCharacterId()); pTexturePaths[sIndex] = pTexturePath; } List <string> pMotions = new List <string>(); m_MotionDic = new Dictionary <uint, string>(); foreach (KeyValuePair <uint, string> pKeyValue in KrCharagekiDef.s_pLIVE2D_MOTION_FILE_DIC) { string pDataPath = KrCharagekiDef.s_pASSET_BASE_PATH + string.Format(pKeyValue.Value, m_pCharaData.GetCharacterId()); m_MotionDic.Add(pKeyValue.Key, pDataPath); pMotions.Add(pDataPath); } m_pLive2DModel = KrLive2DModel.Create(pMocPath, pTexturePaths, pMotions.ToArray(), KrCharagekiDef.IsLoadingFromResources(), transform); Hide(); }