diff --git a/Server/Hotfix/Demo/Unit/UnitFactory.cs b/Server/Hotfix/Demo/Unit/UnitFactory.cs index 701f109..9508e3d 100644 --- a/Server/Hotfix/Demo/Unit/UnitFactory.cs +++ b/Server/Hotfix/Demo/Unit/UnitFactory.cs @@ -197,6 +197,11 @@ namespace ET public static void InitNoDb(Unit unit) { + var bc = unit.GetComponent(); + if (bc == null) + { + return; + } foreach (var v in unit.GetComponent().Children.Values) { foreach (var c in v.Children.Values) diff --git a/Unity/Codes/Model/Demo/People/People.cs b/Unity/Codes/Model/Demo/People/People.cs index e78692d..546d6b7 100644 --- a/Unity/Codes/Model/Demo/People/People.cs +++ b/Unity/Codes/Model/Demo/People/People.cs @@ -19,7 +19,7 @@ namespace ET public int Exp; public int Level; public int Age; - + public int BehaveType; public long TargetId; public int CurrSkillId; public float PosX; @@ -31,20 +31,7 @@ namespace ET public int Wisdom; //智慧 public int MoveSpeed; //移动速度 - public int BehaveType - { - set - { - this.BehaveType = value; -#if !SERVER - Game.EventSystem.Publish(new EventType.BehaveTypeChanged() { People = this }); -#endif - } - get - { - return this.BehaveType; - } - } + [BsonIgnore] public RoleConfig Config => RoleConfigCategory.Instance.Get(this.ConfigId);