Skip to content

Commit

Permalink
Added initialize and deinitialize implementations.
Browse files Browse the repository at this point in the history
Reworked SensorDistributionType.
  • Loading branch information
KarByc committed May 10, 2021
1 parent 799c1d9 commit e36998c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ClockSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,30 @@ public partial class ClockSensor : SensorBase
ClockData data;
private bool Sending = false;

public override SensorDistributionType DistributionType => SensorDistributionType.LowLoad;
public override SensorDistributionType DistributionType => SensorDistributionType.MainOrClient;
public override float PerformanceLoad { get; } = 0.05f;

public override void OnBridgeSetup(BridgeInstance bridge)
{
Bridge = bridge;
Publish = bridge.AddPublisher<ClockData>(Topic);
}

public void Start()
protected override void OnDestroy()
{
base.OnDestroy();
Destroyed = true;
}

protected override void Initialize()
{
Task.Run(Publisher);
realTimeStart = Time.time;
}

void OnDestroy()
protected override void Deinitialize()
{
Destroyed = true;

}

void Publisher()
Expand Down

0 comments on commit e36998c

Please sign in to comment.