|
@@ -5,6 +5,18 @@ namespace ET.Server
|
|
|
{
|
|
{
|
|
|
public static class RobotCaseSystem
|
|
public static class RobotCaseSystem
|
|
|
{
|
|
{
|
|
|
|
|
+ [ObjectSystem]
|
|
|
|
|
+ public class RobotCaseDestroySystem: DestroySystem<RobotCase>
|
|
|
|
|
+ {
|
|
|
|
|
+ protected override void Destroy(RobotCase self)
|
|
|
|
|
+ {
|
|
|
|
|
+ foreach (long id in self.Scenes)
|
|
|
|
|
+ {
|
|
|
|
|
+ ClientSceneManagerComponent.Instance.Remove(id);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 创建机器人,生命周期是RobotCase
|
|
// 创建机器人,生命周期是RobotCase
|
|
|
public static async ETTask NewRobot(this RobotCase self, int count, List<Scene> scenes)
|
|
public static async ETTask NewRobot(this RobotCase self, int count, List<Scene> scenes)
|
|
|
{
|
|
{
|
|
@@ -68,6 +80,7 @@ namespace ET.Server
|
|
|
await Client.LoginHelper.Login(clientScene, zone.ToString(), zone.ToString());
|
|
await Client.LoginHelper.Login(clientScene, zone.ToString(), zone.ToString());
|
|
|
await Client.EnterMapHelper.EnterMapAsync(clientScene);
|
|
await Client.EnterMapHelper.EnterMapAsync(clientScene);
|
|
|
Log.Debug($"create robot ok: {zone}");
|
|
Log.Debug($"create robot ok: {zone}");
|
|
|
|
|
+ self.Scenes.Add(clientScene.Id);
|
|
|
return clientScene;
|
|
return clientScene;
|
|
|
}
|
|
}
|
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -88,6 +101,7 @@ namespace ET.Server
|
|
|
await Client.LoginHelper.Login(clientScene, zone.ToString(), zone.ToString());
|
|
await Client.LoginHelper.Login(clientScene, zone.ToString(), zone.ToString());
|
|
|
await Client.EnterMapHelper.EnterMapAsync(clientScene);
|
|
await Client.EnterMapHelper.EnterMapAsync(clientScene);
|
|
|
Log.Debug($"create robot ok: {zone}");
|
|
Log.Debug($"create robot ok: {zone}");
|
|
|
|
|
+ self.Scenes.Add(clientScene.Id);
|
|
|
return clientScene;
|
|
return clientScene;
|
|
|
}
|
|
}
|
|
|
catch (Exception e)
|
|
catch (Exception e)
|