void Start() { HighestSpeedPosition = transform.localPosition; SlowestSpeedPosition = transform.Find("slowest").transform.localPosition; stationMover = FindObjectOfType <StationMover>(); dummyTrain = FindObjectOfType <DummyTrain>().gameObject; }
void Start() { stationMover = FindObjectOfType <StationMover>(); trainDoorsOpenSound = FindObjectOfType <TrainDoorsOpenSound>(); audioscreech = GetComponent <AudioPlayer>(); Part1Complete += PlayPart2; displayLights = FindObjectsOfType <StationDisplayLight>(); }
// Use this for initialization void Start() { for (int i = 0; i < transform.childCount; i++) { if (transform.GetChild(i).tag == "Cabin1" || transform.GetChild(i).tag == "Cabin2" || transform.GetChild(i).tag == "drivercabin") { audioPlayers.Add(transform.GetChild(i).GetComponent <AudioPlayer>()); } } trainEngine = transform.Find("TrainEngine").GetComponent <AudioPlayer>(); stationMover = FindObjectOfType <StationMover>(); trainEngine.Play(); }
private void Start() { stationMover = FindObjectOfType <StationMover>(); colliders = GetComponents <BoxCollider>(); foreach (BoxCollider col in colliders) { col.enabled = false; } // colliders[0].size = new Vector3(0.9f, 0.7f, 36f); wallCollider.enabled = false; }
// Use this for initialization void Start() { HandleCollider = GetComponent <BoxCollider>(); Accelerator = gameObject; AcceleratorHandle = HandleCollider.gameObject; VectorBeginPoint = Accelerator.transform.GetChild(1).gameObject; VectorEndPoint = Accelerator.transform.GetChild(0).gameObject; // Unparent the child VectorBeginPoint.transform.parent = transform.parent; VectorEndPoint.transform.parent = transform.parent; HandleMovementDirection = VectorEndPoint.transform.position - VectorBeginPoint.transform.position; HandleMovementDirection.Normalize(); //The direction where Acceleratorhandle can be moved forth and back. stationMover = FindObjectOfType <StationMover>(); trainSpeedHandler = FindObjectOfType <TrainSpeedHandler>(); Audio = GetComponent <AudioPlayer>(); }
// Use this for initialization void Start() { DefaultRotation = transform.localRotation.eulerAngles.y; stationMover = FindObjectOfType <StationMover>(); }
private void Start() { stationMover = FindObjectOfType <StationMover>(); }
private void Start() { m_SpeedHandler = FindObjectOfType <TrainSpeedHandler>(); m_StationMover = FindObjectOfType <StationMover>(); m_EscapeBlocker = GameObject.Find("EscapeDetector"); }