void Start() { m_Timer = GetComponent <Timer>(); m_Timer.StartTimer(Random.Range(m_MinSpawnCooldown, m_MaxSpawnCooldown)); m_Collided = false; m_SpawnedTrain = 0; m_GameManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <SMRTGameManager>(); }
// Use this for initialization void Start() { m_RouteMaster = GameObject.FindGameObjectWithTag(m_RouteTag); m_GameManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <SMRTGameManager>(); m_RouteComp = m_RouteMaster.GetComponent <RouteScript>(); m_Renderer = gameObject.GetComponent <Renderer>(); m_DistanceTravelled = 0.0f; m_TimeInStation = 0.0f; m_CurrentStationIndex = 0; m_IncreaseToNextStation = true; m_Collidied = false; m_LookAtCache = GetGoToVector().normalized; UpdateTrain(GetCurrentStation(), GetGoToVector()); }