// Update is called once per frame void Update() { if (this.CityObserver.Fresh) { var packet = this.CityObserver.LastPacket; this._lastPacket = packet; this.Construct(packet); } if (!this.EnableAi) { this.RemoveAi(); } }
private void Construct(JsonCityMatrixMlai packet) { if (packet == null) { return; } this.UpdateCity(packet.predict); if (this.EnableAi && packet.ShowAi) { this.UpdateAi(packet.predict, packet.ai); } else { this.RemoveAi(); } }