void Awake() { // Only allow one in a scene if (g != null) { DestroyImmediate(gameObject); return; } g = this; }
private void OnTriggerEnter2D(Collider2D collider) { if (riftsInViewList.Count == 0) { activeRift = this; riftIndex = 0; } riftsInViewList.Add(this); }
public override void Update(TimeSpan time) { UpdateSessions(time); _updateUnitsTimer.Update(time).IsPassed(ProcessUpdatedUnits); UpdateUnits(time); RiftManager?.Update(time); MiningLogHandler.Update(time); MeasureUpdate(time); }
private void ChangeActiveRift(int step) { riftIndex += step; if (riftIndex >= riftsInViewList.Count) { riftIndex = 0; } else if (riftIndex < 0) { riftIndex = riftsInViewList.Count - 1; } if (riftIndex == -1) { activeRift = null; } else { activeRift = riftsInViewList[riftIndex]; } }