public bool SetNpoEntity(PeEntity entity) { if (!_initialized) { return(false); } PeScenarioEntity pse = entity.gameObject.GetComponent <PeScenarioEntity>(); if (pse != null) { npoId = pse.spawnPoint.ID; npoEntity = entity; npcSpeechBox.SetNpcInfo(npoEntity.ExtGetName(), npoEntity.ExtGetFaceIconBig()); return(true); } else { if (entity == CreatureMgr.Instance.mainPlayer) { npoId = -1; npoEntity = entity; BiologyViewCmpt viewCmpt = npoEntity.biologyViewCmpt; Texture2D big_head = PeViewStudio.TakePhoto(viewCmpt, 150, 150, PeViewStudio.s_HeadPhotoPos, PeViewStudio.s_HeadPhotoRot); npcSpeechBox.SetNpcInfo(npoEntity.ExtGetName(), big_head); } } return(false); }
public bool SetObject(OBJECT obj) { if (!_initialized) { return(false); } npoEntity = PeScenarioUtility.GetEntity(obj); if (npoEntity != null) { npoId = obj.Id; if (npoEntity == CreatureMgr.Instance.mainPlayer) { BiologyViewCmpt viewCmpt = npoEntity.biologyViewCmpt; Texture2D big_head = PeViewStudio.TakePhoto(viewCmpt, 150, 150, PeViewStudio.s_HeadPhotoPos, PeViewStudio.s_HeadPhotoRot); npcSpeechBox.SetNpcInfo(npoEntity.ExtGetName(), big_head); } else { npcSpeechBox.SetNpcInfo(npoEntity.ExtGetName(), npoEntity.ExtGetFaceIconBig()); } return(true); } else { npoId = -1; npcSpeechBox.SetNpcInfo("", "Null"); } return(false); }
public void TakeRoleHerderTexture() { if (selectedIndex != -1 && selectedIndex < Roles.Length && modeInfoList[selectedIndex].mMode != null) { // RoleHerderTexture.SetTexture( PhotoStudio.Instance.TakePhoto(modeInfoList[selectedIndex].mMode, modeInfoList[selectedIndex].mRoleInfo.sex ) ); PeViewStudio.TakePhoto(modeInfoList[selectedIndex].mMode, 64, 64, PeViewStudio.s_HeadPhotoPos, PeViewStudio.s_HeadPhotoRot); } }
private CustomCharactor.CustomData CreateCustomData() { CustomCharactor.CustomData customData = new CustomCharactor.CustomData(); customData.headIcon = PeViewStudio.TakePhoto(mCurrent.gameObject, 64, 64, PeViewStudio.s_HeadPhotoPos, PeViewStudio.s_HeadPhotoRot); byte[] buf = mCurrent.mAppearData.Serialize(); customData.appearData = new AppearData(); customData.appearData.Deserialize(buf); customData.sex = (Sex == ESex.Male) ? CustomCharactor.ESex.Male : CustomCharactor.ESex.Female; customData.nudeAvatarData = new CustomCharactor.AvatarData(mCurrent.mNude); return(customData); }
Texture TakePhoto() { BiologyViewCmpt v = Entity.biologyViewCmpt; if (v == null /*|| v.modelTrans == null*/) //lz-2016.07.23 PeViewStudio.TakePhoto 里面处理了没有模型的情况,这里不用返回 { return(null); } CommonCmpt c = Entity.commonCmpt; if (c == null) { return(null); } return(PeViewStudio.TakePhoto(v, 64, 64, PeViewStudio.s_HeadPhotoPos, PeViewStudio.s_HeadPhotoRot));//PhotoStudio.Instance.TakePhoto(v.modelTrans.gameObject, (int)c.sex); }