新增位移,数值相关组件
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5432d229611d4f8e8fa72a637035bb40
|
||||
timeCreated: 1756044768
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ce24e5f59f2424faadee3d97e357365
|
||||
timeCreated: 1756049282
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class Map : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 好友房地图
|
||||
/// </summary>
|
||||
public bool IsRoomMap;
|
||||
|
||||
/// <summary>
|
||||
/// 地图中的单位
|
||||
/// </summary>
|
||||
public Dictionary<long, Unit> Units = new Dictionary<long, Unit>();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2acb8a2309ee4443a812939b0e02c18f
|
||||
timeCreated: 1756049289
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fb0ee12d9cf40408478e8f9ad9aafdd
|
||||
timeCreated: 1755915944
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70bbe8d6e0c04cdaa553cacaee37fe59
|
||||
timeCreated: 1755921259
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 629d828f3fc74ce78482025124c31f85
|
||||
timeCreated: 1756047176
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearBaitComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee9d5fa0951c490fafb108bfb3e1d496
|
||||
timeCreated: 1756047193
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearBobberComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f772262a6ee45ebaa276d716c191ddd
|
||||
timeCreated: 1756047151
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearHookComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 601122a982d048789ee9131376c72158
|
||||
timeCreated: 1756047164
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearLineComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e1209cd4f4242c2af9fbfbbb7480f6b
|
||||
timeCreated: 1756047232
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearLureComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5537f49777ef40f0adeb36bb7687356d
|
||||
timeCreated: 1756047207
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearReelComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60c6ee2c8c084dd29267b0653a1a239d
|
||||
timeCreated: 1756047139
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearRodComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a353dda940c4dd9bddcf7420d1c2108
|
||||
timeCreated: 1756047099
|
||||
@@ -1,9 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class GearWeightComponent : Entity
|
||||
{
|
||||
public int ConfigId;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82411b517dd84b9ca7839a4ddb486a66
|
||||
timeCreated: 1756047222
|
||||
@@ -1,26 +0,0 @@
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// 钓组组件
|
||||
/// </summary>
|
||||
public class UnitGearComponent : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 线长度
|
||||
/// </summary>
|
||||
public float LineLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 旋转速度
|
||||
/// </summary>
|
||||
public float ReelSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 鱼竿设置
|
||||
/// </summary>
|
||||
public int RedSetting { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c9a70a1145b41e2ad6c57384d7c922c
|
||||
timeCreated: 1755921173
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f63b5a4df9be4d1c839c3c1cc56c1275
|
||||
timeCreated: 1756048419
|
||||
@@ -1,15 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// 手电筒组件
|
||||
/// </summary>
|
||||
public class UnitFlashlightComponent : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 打开手电筒
|
||||
/// </summary>
|
||||
public bool OpenLight { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f151cee0d5f43ff90c3aa013214b1ea
|
||||
timeCreated: 1756048476
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f655e37e9dd4b5885e127f44e01100d
|
||||
timeCreated: 1756048586
|
||||
@@ -1,11 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity皮肤组件
|
||||
/// </summary>
|
||||
public class UnitSkinComponent : Entity
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40c5cce71c8443aa82ea4108e72c887b
|
||||
timeCreated: 1756048599
|
||||
@@ -1,52 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public class Unit : Entity
|
||||
{
|
||||
public int ConfigId { get; set; } //配置表id
|
||||
|
||||
private float3 position; //坐标
|
||||
|
||||
public float3 Position
|
||||
{
|
||||
get => position;
|
||||
set
|
||||
{
|
||||
float3 oldPos = position;
|
||||
position = value;
|
||||
Scene.EventComponent.Publish(new ChangePosition() { Unit = this, OldPos = oldPos });
|
||||
}
|
||||
}
|
||||
|
||||
public float3 Forward
|
||||
{
|
||||
get => math.mul(Rotation, math.forward());
|
||||
set => Rotation = quaternion.LookRotation(value, math.up());
|
||||
}
|
||||
|
||||
private quaternion rotation;
|
||||
|
||||
public quaternion Rotation
|
||||
{
|
||||
get => rotation;
|
||||
set
|
||||
{
|
||||
rotation = value;
|
||||
Scene.EventComponent.Publish(new ChangeRotation() { Unit = this });
|
||||
}
|
||||
}
|
||||
|
||||
public uint State { get; set; }
|
||||
public string StateArgs { get; set; }
|
||||
|
||||
public void ChangeState(uint state, string args)
|
||||
{
|
||||
Scene.EventComponent.Publish(new ChangeState() { Unit = this, State = state, Args = args });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff176fc098254fe2a1b48ea26eaf8857
|
||||
timeCreated: 1755915448
|
||||
@@ -1,22 +0,0 @@
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public struct ChangePosition
|
||||
{
|
||||
public Unit Unit;
|
||||
public float3 OldPos;
|
||||
}
|
||||
|
||||
public struct ChangeRotation
|
||||
{
|
||||
public Unit Unit;
|
||||
}
|
||||
|
||||
public struct ChangeState
|
||||
{
|
||||
public Unit Unit;
|
||||
public uint State;
|
||||
public string Args;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd2dd8a7207544b19be4b51b2a6ef215
|
||||
timeCreated: 1755915609
|
||||
@@ -1,33 +0,0 @@
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class UnitStateArgsFactory
|
||||
{
|
||||
public static UnitStateArgs Create(Unit unit, string[] args)
|
||||
{
|
||||
UnitStateArgs ret = null;
|
||||
// return new UnitStateArgs()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
if (ret != null)
|
||||
{
|
||||
ret.SetArgs(args);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UnitStateArgs
|
||||
{
|
||||
protected string[] Args;
|
||||
|
||||
public void SetArgs(string[] args)
|
||||
{
|
||||
Args = args;
|
||||
OnParseArgs();
|
||||
}
|
||||
|
||||
public abstract void OnParseArgs();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6afa60e6892f49d0aed14024432ab10d
|
||||
timeCreated: 1755917036
|
||||
Reference in New Issue
Block a user