public static void MakeAllMonsterTex(CMD_Picturebook cmd, int allMonsterCount) { for (int i = 0; i < allMonsterCount; i++) { PicturebookMonster monsterData = cmd.GetMonsterData(i); if (monsterData == null) { break; } string iconId = monsterData.monsterMaster.Simple.iconId; string monsterIconPathByIconId = GUIMonsterIcon.GetMonsterIconPathByIconId(iconId); string resourcePath = GUIMonsterIcon.InternalGetMonsterIconPathByIconId(iconId); PicturebookItem.TextureData textureData = new PicturebookItem.TextureData(); textureData._monsterTexture = new Texture2D(PicturebookItem.ICON_TEXTURE_CX, PicturebookItem.ICON_TEXTURE_CY); textureData._monsterAlphaTexture = new Texture2D(PicturebookItem.ICON_TEXTURE_CX, PicturebookItem.ICON_TEXTURE_CY); PicturebookMonsterIcon.SetTextureMonsterParts(ref textureData, resourcePath, monsterIconPathByIconId); PicturebookItem._monsterTextureDataList.Add(textureData); } }
private void SetIconMonsterData(int listIndex, PicturebookMonsterIcon monsterIcon, PicturebookMonster monsterData, Action <PicturebookMonster> actionShortPress) { if (PicturebookItem._monsterTextureDataList.Count > listIndex) { monsterIcon.SetMonsterIcon(PicturebookItem._monsterTextureDataList[listIndex], monsterData.monsterMaster.Group.growStep, monsterData.isUnknown); monsterIcon.SetMonsterData(monsterData); if (monsterData.isUnknown) { monsterIcon.SetTouchAct_S(null); } else { monsterIcon.SetTouchAct_S(delegate(PicturebookMonster noop) { actionShortPress(monsterData); }); } } }
public void SetMonsterIcon(PicturebookItem.TextureData textureData, string growStep, bool isUnknown) { if (null == this.txCHAR.material) { Shader iconShader = GUIMonsterIcon.GetIconShader(); this.txCHAR.material = new Material(iconShader); } if (!textureData._isMainTexture) { this.txCHAR.material.SetTexture("_MaskTex", textureData._monsterAlphaTexture); this.txCHAR.material.SetTexture("_MainTex", textureData._monsterTexture); } else { NGUIUtil.ChangeUITexture(this.txCHAR, textureData._monsterTexture, false); this.txCHAR.material.SetTexture("_MaskTex", Texture2D.whiteTexture); } int growStep2 = int.Parse(growStep); PicturebookMonsterIcon.SetThumbnailFrame(this.spBASE, this.spFRAME, growStep2); this.ngTX_IS_UNKOWN.gameObject.SetActive(isUnknown); MonsterIconGrayout.SetGrayout(base.gameObject, (!isUnknown) ? GUIMonsterIcon.DIMM_LEVEL.ACTIVE : GUIMonsterIcon.DIMM_LEVEL.DISABLE); }