| 262 | |
| 263 | #if USE_EDITOR |
| 264 | void OnScriptsReloading() |
| 265 | { |
| 266 | ScopeLock lock(ObjectsLock); |
| 267 | if (Objects.HasItems()) |
| 268 | LOG(Warning, "Hot-reloading scripts with network objects active."); |
| 269 | if (Hierarchy) |
| 270 | { |
| 271 | Delete(Hierarchy); |
| 272 | Hierarchy = nullptr; |
| 273 | } |
| 274 | |
| 275 | // Clear any references to non-engine scripts before code hot-reload |
| 276 | BinaryModule* flaxModule = GetBinaryModuleFlaxEngine(); |
| 277 | for (auto i = SerializersTable.Begin(); i.IsNotEnd(); ++i) |
| 278 | { |
| 279 | if (i->Key.Module != flaxModule) |
| 280 | SerializersTable.Remove(i); |
| 281 | } |
| 282 | for (auto i = NetworkRpcInfo::RPCsTable.Begin(); i.IsNotEnd(); ++i) |
| 283 | { |
| 284 | if (i->Key.First.Module != flaxModule) |
| 285 | NetworkRpcInfo::RPCsTable.Remove(i); |
| 286 | } |
| 287 | } |
| 288 | #endif |
| 289 | } |
| 290 | |