void SetupStoryCharaMaster(int index) { //-------------------------------- // アクセス番号決定 //-------------------------------- if (index >= m_StoryCharaMasterArray.Length) { index = 0; } if (index < 0) { index = m_StoryCharaMasterArray.Length - 1; } MasterDataStoryChara storyCharaMaster = m_StoryCharaMasterArray[index]; m_CurrentStoryCharaMaster = storyCharaMaster; m_Index = index; m_DebugPartyOffset.CheckAdjustUV(); m_CharaResource = new AssetLoadStoryViewResource(); m_DebugPartyOffset.NameText = "MasterDataStoryChara"; m_DebugPartyOffset.m_IdInputField.text = storyCharaMaster.fix_id.ToString(); m_DebugPartyOffset.SetupUV(m_OffsetXArray[m_Index] , m_OffsetYArray[m_Index] , m_TilingArray[m_Index] ); m_DebugPartyOffset.SetupAdjustUV(storyCharaMaster.img_offset_x * 0.001f, storyCharaMaster.img_offset_y * 0.001f, storyCharaMaster.img_tiling * 0.001f); m_DebugPartyOffset.CheckAdjustUV(); m_CharaResource.SetStoryCharaId(storyCharaMaster.fix_id); StartCoroutine(LoopAssetLoad(() => { m_DebugPartyOffset.ThirdUnitMaterial.SetTexture("_MainTex", m_CharaResource.GetTexture()); SetUpUVParam(); })); }
public void SetUpParamChara(int index) { //-------------------------------- // アクセス番号決定 //-------------------------------- if (index >= m_CharaMasterArray.Length) { index = 0; } if (index < 0) { index = m_CharaMasterArray.Length - 1; } MasterDataParamChara charaMaster = m_CharaMasterArray[index]; m_CurrentCharaMaster = charaMaster; m_Index = index; m_DebugPartyOffset.NameText = charaMaster.name; m_DebugPartyOffset.m_IdInputField.text = charaMaster.fix_id.ToString(); m_DebugPartyOffset.m_NoInputField.text = charaMaster.draw_id.ToString(); m_DebugPartyOffset.SetupUV(m_OffsetXArray[m_Index, (int)CurrentUVTarget] , m_OffsetYArray[m_Index, (int)CurrentUVTarget] , m_TilingArray[m_Index, (int)CurrentUVTarget] ); m_DebugPartyOffset.SetupAdjustUV(charaMaster.img_2_offsetX * 0.001f, charaMaster.img_2_offsetY * 0.001f, charaMaster.img_2_tiling * 0.001f); m_DebugPartyOffset.CheckAdjustUV(); AssetBundler.Create().SetAsUnitTexture(charaMaster.fix_id, (o) => { Texture2D tex = o.GetTexture2D(TextureWrapMode.Clamp); m_DebugPartyOffset.ThirdUnitMaterial.SetTexture("_MainTex", tex); foreach (GlobalDefine.PartyCharaIndex charaIndex in Enum.GetValues(typeof(GlobalDefine.PartyCharaIndex))) { SetUpUVParam(charaIndex); } }, (s) => { m_DebugPartyOffset.ThirdUnitMaterial.SetTexture("_MainTex", null); }).Load(); }