public override void UpdateOnceBeforeFrame() { try { Term = (IMySensorBlock)Entity; if (Term.BlockDefinition.SubtypeName.EndsWith("_DS_RADAR")) { CreateTerminalControls <IMySensorBlock>(); valid = true; notifyCache = new Dictionary <Vector3D, IMySensorBlock>(); CoreHolo.Register(Entity.EntityId, this); Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME; //update the block. } if (MyAPIGateway.Session.OnlineMode == MyOnlineModeEnum.OFFLINE || MyAPIGateway.Multiplayer.IsServer) { Read(); } else { CoreHolo.RequestSetting(Entity.EntityId); } } catch (Exception ex) { Log.DebugWrite(DebugLevel.Error, ex); } }
private void Notify(Vector3D vec, IMySensorBlock value) { if (!notifyCache.ContainsKey(vec)) { notifyCache.Add(vec, value); } }