public void OnTriggerExit(Collider col) { if (col != null && col.CompareTag(Tag) && col.gameObject != null && !LocomotionHelper.IsCurrentControllerOfType <RaceController>(col.gameObject) && Action == ActionType.StartingLine) { RaceController component = col.gameObject.GetComponent <RaceController>(); if (component != null) { component.setControlsEnabled(enabled: true); } } }
public void OnTriggerEnter(Collider col) { if (!(col != null) || !col.CompareTag(Tag) || !(col.gameObject != null) || (IsMemberOnly && !Service.Get <CPDataEntityCollection>().IsLocalPlayerMember())) { return; } if (Action == ActionType.StartingLine) { RaceController component = col.gameObject.GetComponent <RaceController>(); if ((object)component != null) { component.SetInitialTrackDir(base.transform.forward); hasPopupOpened = false; } } else if (Action == ActionType.FinishLine) { if (LocomotionHelper.IsCurrentControllerOfType <RaceController>(col.gameObject)) { RaceGameController raceGameController = col.gameObject.GetComponent <RaceGameController>(); if (raceGameController == null) { raceGameController = col.gameObject.AddComponent <RaceGameController>(); } raceGameController.FinishRace(); } } else if (Action == ActionType.EndOfTrack && LocomotionHelper.IsCurrentControllerOfType <RaceController>(col.gameObject)) { RaceController component = col.gameObject.GetComponent <RaceController>(); if (component != null) { component.setControlsEnabled(enabled: true); } LocomotionHelper.SetCurrentController <RunController>(col.gameObject); RaceGameController raceGameController = col.gameObject.GetComponent <RaceGameController>(); if (raceGameController != null) { raceGameController.RemoveLocalPlayerRaceData(); Object.Destroy(raceGameController); } if (!hasPopupOpened) { Service.Get <QuestService>().SendEvent("FinishredRace"); } } }