|
@@ -136,8 +136,19 @@ namespace CommonAI.Zone.Instance
|
|
|
this.mUnitVirtual = TemplateManager.Factory.CreateUnitVirtual(this);
|
|
|
}
|
|
|
|
|
|
- protected override void Disposing()
|
|
|
+ public override bool IsNeedProcessDead()
|
|
|
+ {
|
|
|
+ return this.mProcessDeadTime == 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void Disposing()
|
|
|
{
|
|
|
+ if(this.IsMonster && (this.mProcessDeadTime == 0 || this.CurrentHP > 0 || this.mProcessDeadTime == 0))
|
|
|
+ {
|
|
|
+ log.Info("单位Disposing:" + this.Parent.UUID + ", " + this.Parent.GetSceneID() + ", " + this.ID + ", " + this.CurrentHP + "," +
|
|
|
+ this.IsMonster + ", " + mProcessDeadTime);
|
|
|
+ }
|
|
|
+
|
|
|
if (mUnitVirtual != null)
|
|
|
{
|
|
|
mUnitVirtual.OnDispose(this);
|
|
@@ -636,8 +647,12 @@ namespace CommonAI.Zone.Instance
|
|
|
if (this.mOnDamage != null)
|
|
|
this.mOnDamage.Invoke(this, attacker, reduceHP, source);
|
|
|
}
|
|
|
- internal void callback_onDead(InstanceZone zone, InstanceUnit attacker)
|
|
|
+
|
|
|
+ public long mProcessDeadTime = 0;
|
|
|
+
|
|
|
+ internal void callback_onDead(InstanceZone zone, InstanceUnit attacker)
|
|
|
{
|
|
|
+ this.mProcessDeadTime = CommonLang.TimeUtil.GetTimestampMS();
|
|
|
this.OnUnitDead();
|
|
|
if (this.mOnDead != null)
|
|
|
this.mOnDead.Invoke(this, attacker);
|