mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
修复主从交互bug
This commit is contained in:
@@ -26,6 +26,6 @@ namespace JNGame.Sync.State.Tile.Entity.Component
|
||||
public virtual void OnTileEnter(){}
|
||||
|
||||
public virtual void OnTileExit(){}
|
||||
|
||||
public void OnTileSlaveExit(){}
|
||||
}
|
||||
}
|
@@ -125,6 +125,7 @@ namespace JNGame.Sync.State.Tile.Entity
|
||||
if (isHost && !isContains)
|
||||
{
|
||||
OnTileExit();
|
||||
if (SyncTile.IsSlave) OnTileSlaveExit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,5 +148,13 @@ namespace JNGame.Sync.State.Tile.Entity
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTileSlaveExit()
|
||||
{
|
||||
//给组件生命周期
|
||||
foreach (var component in GetComponents())
|
||||
{
|
||||
(component as JNTileComponent)?.OnTileSlaveExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user