You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.7 KiB
57 lines
2.7 KiB
1 month ago
|
using System;
|
||
|
// using FCollision;
|
||
|
using Sog;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace CoreGame.Render
|
||
|
{
|
||
|
public static class EntityCreateSrv2
|
||
|
{
|
||
|
public static CombatEntity CreateHeroEntity2(CombatContext context, int heroSkinId, int eid, bool isLocalPlayer = false)
|
||
|
{
|
||
|
// var showCfg = RoleModelDescMgr.Instance.GetConfig(heroSkinId);
|
||
|
var ce = context.CreateEntity(eid,"Hero" + heroSkinId);
|
||
|
// PropertySrv.GetHeroBasePropValue(ce);
|
||
|
// ce.isHero = true;
|
||
|
// ce.AddBlackboard(CfgType.HeroCfg, heroSkinId, new[] { heroSkinId }, Array.Empty<int>(), ce.creationIndex,
|
||
|
// false);
|
||
|
// ce.AddFaction(Faction.Player, SelectUseType.Actor);
|
||
|
// AbilitySrv.AttachActiveAbilityGroup(CommParamDescMgr.Instance.RoleDefaultSki.int_val, ce);
|
||
|
// ce.AddAudio(ce.creationIndex);
|
||
|
// ce.AddAsset(new MainAssetParam()
|
||
|
// {
|
||
|
// path = $"{showCfg.folderPath}/{showCfg.prefabAnim}.prefab",
|
||
|
// parentNodeName = "RenderWorld",
|
||
|
// scaleParam = 1,
|
||
|
// }, null);
|
||
|
//
|
||
|
// // 逻辑位置
|
||
|
// // ce.AddLogicTransform(Fixed64Vector2.zero, Fixed64Vector2.one, Fixed64Vector2.right);
|
||
|
// // 逻辑collision
|
||
|
// FCollisionCreateData fCollisionCreateData = new FCollisionCreateData();
|
||
|
// fCollisionCreateData.shape = (CollisionShapeType)showCfg.colliderType;
|
||
|
// fCollisionCreateData.center = new Fixed64Vector2(showCfg.colliderCenter[0] * Fixed64.EN4, showCfg.colliderCenter[1] * Fixed64.EN4);
|
||
|
// fCollisionCreateData.worldExtends = new Fixed64Vector2(showCfg.colliderSize[0] * Fixed64.EN4, showCfg.colliderSize[1] * Fixed64.EN4);
|
||
|
// fCollisionCreateData.worldRadius = showCfg.colliderSize[0] * Fixed64.EN4;
|
||
|
// var fCollisionShape = FCollisionShape.CreateFromCfg(fCollisionCreateData);
|
||
|
// fCollisionShape.owner = ce;
|
||
|
// fCollisionShape.ConditionalUpdateShape();
|
||
|
// // ce.AddFCollision(fCollisionShape, FCollisionLayer.Player , ce);
|
||
|
// // ce.fCollision.Attach();
|
||
|
//
|
||
|
// ce.AddTransformProxy(Vector2.zero, Vector2.right, ce);
|
||
|
// if (isLocalPlayer)
|
||
|
// {
|
||
|
// Contexts.Combat.localCtrlEid = ce.creationIndex;
|
||
|
// Contexts.Combat.localPlayerEid = ce.creationIndex;
|
||
|
// BattleModule.s_LocalPlayerEid = ce.creationIndex;
|
||
|
// }
|
||
|
//
|
||
|
// ce.isAttractor = true;
|
||
|
// ce.AddEquips(ce);
|
||
|
// ce.equips.SwitchSlotNoCheck(0);
|
||
|
// GunSrv.DynamicEquipGun(ce, CoreUIBridge.BattleInfoParams.equipInfo);
|
||
|
return ce;
|
||
|
}
|
||
|
}
|
||
|
}
|