예제 #1
0
 void Start()
 {
     HighestSpeedPosition = transform.localPosition;
     SlowestSpeedPosition = transform.Find("slowest").transform.localPosition;
     stationMover         = FindObjectOfType <StationMover>();
     dummyTrain           = FindObjectOfType <DummyTrain>().gameObject;
 }
예제 #2
0
 void Start()
 {
     stationMover        = FindObjectOfType <StationMover>();
     trainDoorsOpenSound = FindObjectOfType <TrainDoorsOpenSound>();
     audioscreech        = GetComponent <AudioPlayer>();
     Part1Complete      += PlayPart2;
     displayLights       = FindObjectsOfType <StationDisplayLight>();
 }
예제 #3
0
 // 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();
 }
예제 #4
0
    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;
    }
예제 #5
0
    // 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>();
    }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     DefaultRotation = transform.localRotation.eulerAngles.y;
     stationMover    = FindObjectOfType <StationMover>();
 }
예제 #7
0
 private void Start()
 {
     stationMover = FindObjectOfType <StationMover>();
 }
예제 #8
0
 private void Start()
 {
     m_SpeedHandler  = FindObjectOfType <TrainSpeedHandler>();
     m_StationMover  = FindObjectOfType <StationMover>();
     m_EscapeBlocker = GameObject.Find("EscapeDetector");
 }