/// <summary> /// Set stop parameters and activate brakes /// </summary> /// <param name="stationBehaviour">Leave after or stop forever</param> /// <param name="stopTimeout">Optional</param> public void StopAtStation(StationBehaviour stationBehaviour, float stopTimeout, bool turnOffEngines) { _turnOffEngines = turnOffEngines; _stopTimeout = stopTimeout; _stationBehaviour = stationBehaviour; Stop(); }
public void useStation(StationBehaviour station) { Debug.Log("Use Station: " + station); if (station != null) { rigidbody.isKinematic = true; collider.enabled = false; stationTimer = 0.2f; // wait 0.2 seconds } else { collider.enabled = true; } currentStation = station; }
// Use this for initialization void Start() { Screen.showCursor = false; screenCenter = new Vector3(Screen.width / 2, Screen.height / 2, 0f); initialConstraints = rigidbody.constraints; animation = GetComponentInChildren<Animation>(); waterClock = (WaterClock)FindObjectOfType(typeof(WaterClock)); facingDirection = Facing.Right; isDead = false; currentStation = null; stationTimer = 0f; }