map
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using NBC;
|
||||
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using Unity.Mathematics;
|
||||
|
||||
@@ -51,21 +52,15 @@ namespace NBF.Fishing2
|
||||
}
|
||||
|
||||
|
||||
#region 静态
|
||||
|
||||
public static MapUnit Create(Map map, MapUnitInfo unitInfo, bool isMainPlayer = false)
|
||||
{
|
||||
var unit = Entity.Create<MapUnit>(map.Scene, true, true);
|
||||
unit.SetUnitInfo(unitInfo);
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public void SetUnitInfo(MapUnitInfo unitInfo)
|
||||
{
|
||||
NumericComponent numericComponent = AddComponent<NumericComponent>();
|
||||
var moveComponent = GetOrAddComponent<MoveComponent>();
|
||||
GetOrAddComponent<ObjectWait>();
|
||||
var unitBasic = GetOrAddComponent<MapUnitBasic>();
|
||||
unitBasic.UpdateInfo(unitInfo);
|
||||
|
||||
|
||||
var numericComponent = GetOrAddComponent<NumericComponent>();
|
||||
foreach (var kv in unitInfo.KV)
|
||||
{
|
||||
numericComponent.Set(kv.Key, kv.Value);
|
||||
|
||||
Reference in New Issue
Block a user