From 3822e15410e709887e04f3842d90d2d9abc4dac8 Mon Sep 17 00:00:00 2001 From: wserver/wangdisen <1065498738@qq.com> Date: Tue, 16 Aug 2022 13:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9InitNoDb=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Hotfix/Demo/Unit/UnitFactory.cs | 5 +++++ Unity/Codes/Model/Demo/People/People.cs | 17 ++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) 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);