You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
3 years ago
|
using System.Collections;
|
||
|
using System.Diagnostics;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
public class WatcherComponentAwakeSystem: AwakeSystem<WatcherComponent>
|
||
|
{
|
||
|
public override void Awake(WatcherComponent self)
|
||
|
{
|
||
|
WatcherComponent.Instance = self;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public class WatcherComponentDestroySystem: DestroySystem<WatcherComponent>
|
||
|
{
|
||
|
public override void Destroy(WatcherComponent self)
|
||
|
{
|
||
|
WatcherComponent.Instance = null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[FriendClass(typeof(WatcherComponent))]
|
||
|
public static class WatcherComponentSystem
|
||
|
{
|
||
|
public static void Start(this WatcherComponent self, int createScenes = 0)
|
||
|
{
|
||
|
string[] localIP = NetworkHelper.GetAddressIPs();
|
||
|
var processConfigs = StartProcessConfigCategory.Instance.GetAll();
|
||
|
foreach (StartProcessConfig startProcessConfig in processConfigs.Values)
|
||
|
{
|
||
|
if (!WatcherHelper.IsThisMachine(startProcessConfig.InnerIP, localIP))
|
||
|
{
|
||
|
continue;
|
||
|
}
|
||
|
Process process = WatcherHelper.StartProcess(startProcessConfig.Id, createScenes);
|
||
|
self.Processes.Add(startProcessConfig.Id, process);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|