/// <summary> /// /// </summary> /// <param name="resid"></param> public void SetupWeapon(int resid) { if (!DataManager.WeaponTable.ContainsKey(resid)) { return; } WeaponTableItem weaponTab = DataManager.WeaponTable[resid] as WeaponTableItem; if (weaponTab == null) { GameDebug.LogError(" WeaponTable没有找到武器 id = " + resid.ToString()); return; } if (resid != mResid) { if (mWeapon != null) { mWeapon.Destroy(); } mResid = resid; mWeapon = new MeshVisual(); mWeapon.CreateWithConfig(AssetConfig.WeaponPath + weaponTab.modelname, OnVisualSuccess, OnVisualFailed, false); } }
virtual protected bool ChangeModel(int model) { if (model == -1) { return(false); } if (!DataManager.ModelTable.ContainsKey(model)) { return(false); } ModelTableItem modelTab = DataManager.ModelTable[model] as ModelTableItem; if (modelTab == null) { GameDebug.LogError(dbgGetIdentifier() + " 没有找到模型 id = " + model.ToString()); return(false); } DestroyVisual(); mModelResID = model; mVisual = new MeshVisual(); mVisual.CreateWithConfig(modelTab.filename, onVisualSucess, onVisualFail, true); return(true); }
public void ChangeAttach(AttachMountType type, string path, string mount) { MeshVisual visual = new MeshVisual(); visual.CreateWithConfig(path, null, null, false); ChangeAttach(type, visual, mount); }
/// <summary> /// 对玩家, 只改变模型; 其他单位模型和武器技能都被改变. /// </summary> public override bool ChangeWeapon(int weaponID) { if (!CanChangeWeapon() || mActiveFlagsContainer[ActiveFlagsDef.DisableChangeWeaponModel] != 0) { return(false); } if (weaponID == -1) { return(false); } //测试武器 if (!DataManager.WeaponTable.ContainsKey(weaponID)) { GameDebug.LogError(dbgGetIdentifier() + " not find weapon id=" + weaponID.ToString()); return(false); } if (mWeaponAttach != null) { DetachVisual(mWeaponAttach); mWeaponAttach.visual.Destroy(); mWeaponAttach = null; } RemoveAttach(AttachMountType.Weapon); if (mWeaponVisual != null) { mWeaponVisual.Destroy(); mWeaponVisual = null; } if (mLastWeaponBuffID != uint.MaxValue) { ErrorHandler.Parse( RemoveSkillBuffByResID(mLastWeaponBuffID), "failed to remove skill buff on skill stopped" ); mLastWeaponBuffID = uint.MaxValue; } mWeaopnRes = DataManager.WeaponTable[weaponID] as WeaponTableItem; mWeaponVisual = new MeshVisual(); if (string.IsNullOrEmpty(mWeaopnRes.modelname)) { onWeaponVisualSucess(); } else { mWeaponVisual.CreateWithConfig(AssetConfig.WeaponPath + mWeaopnRes.modelname, onWeaponVisualSucess, onWeaponVisualFail, false); } return(true); }
public void btnCreatePlayer() { //PlayerInitParam param = new PlayerInitParam(); //param.player_data = new PlayerData(); //param.player_data.classs = 1; //player = new Player(); //player.Init(param); //player.LoadModel(); MeshVisual visual = new MeshVisual(); visual.CreateWithConfig("role_male_roledefault", null, null); }
public void SetupCharacter(int resid, int[] equiplist, int wingid, uint winglevel) { if (!DataManager.ModelTable.ContainsKey(resid)) { return; } ModelTableItem modelTab = DataManager.ModelTable[resid] as ModelTableItem; if (modelTab == null) { GameDebug.LogError(" DataManager没有找到模型 id = " + resid.ToString()); return; } if (resid != mResid) { if (mVisual != null) { mVisual.Destroy(); } mResid = resid; mVisual = new MeshVisual(); mVisual.CreateWithConfig(modelTab.filename, OnVisualSuccess, OnVisualFailed, true); } else { mInvalidAnim = true; } //切换装备 //TODO:装备相关的表和数据都还没有做好,做好了在这里处理 ApplyEquipConfig(equiplist); if (wingid < 0) { RemoveAttach(AttachMountType.Wing); } else { ChangeWing(wingid, winglevel); } }
public void ChangeWing(int wingid, uint winglv) { if (mWingID == wingid && mWingLv == winglv) { return; } mWingID = wingid; mWingLv = winglv; WingCommonTableItem commonRes = DataManager.WingCommonTable[wingid] as WingCommonTableItem; if (commonRes == null) { return; } string modelName = WingModule.GetModelName(wingid, winglv); MeshVisual visual = new MeshVisual(); visual.CreateWithConfig(AssetConfig.WeaponPath + modelName, null, null, false); ChangeAttach(AttachMountType.Wing, visual, commonRes.modelSlot); }
public void ChangeWeapon(int weaponid) { if (weaponid == mWeaponID) { return; } BehaviourUtil.StopCoroutine(ChangeWeapon_impl(mWeaponID)); if (!DataManager.WeaponTable.ContainsKey(weaponid)) { return; } if (mWeapon != null) { mWeapon.Destroy(); } foreach (uint effectid in mShowEffect) { SceneManager.Instance.GetCurScene().GetParticleManager().RemoveParticle(effectid); } mShowEffect.Clear(); mWeaponID = weaponid; //BehaviourUtil.StartCoroutine(ChangeWeapon_impl(weaponid)); WeaponTableItem mWeaopnRes = DataManager.WeaponTable[weaponid] as WeaponTableItem; mWeapon = new MeshVisual(); mWeapon.CreateWithConfig(AssetConfig.WeaponPath + mWeaopnRes.modelname, null, OnWeaponFailed, false); TransformData trans = new TransformData(); trans.Rot = new Vector3(90, 0, 0); trans.Scale = Vector3.one * mWeaopnRes.scale; ChangeAttach(AttachMountType.Weapon, mWeapon, mWeaopnRes.mountpoint, trans); }
private IEnumerator ChangeWeapon_impl(int weaponid) { WeaponTableItem mWeaopnRes = DataManager.WeaponTable[weaponid] as WeaponTableItem; if (mWeapon != null) { mWeapon.Destroy(); } if (mWeaopnRes == null) { yield break; } while (mVisual == null || !mVisual.IsCompleteOrDestroy) { yield return(1); } mChangingWeaponID = weaponid; mWeapon = new MeshVisual(); mWeapon.CreateWithConfig(AssetConfig.WeaponPath + mWeaopnRes.modelname, OnWeaponSuccess, OnWeaponFailed, false); }
public void btnLoadSkeletal() { visual = new MeshVisual(); visual.CreateWithConfig(animInput.value, null, null, true); }