예제 #1
0
        /* Awake */

        private void Awake()
        {
            m_CarController              = GetComponent <CarController> ();
            m_Rigidbody                  = GetComponent <Rigidbody> ();
            m_SteeringWheel              = GetComponentInChildren <VisualSteeringWheelController> ();
            m_Sensors                    = GetComponent <Sensors> ();
            m_sensorResponseHandlers     = GetComponents <SensorResponseHandler> ();
            IsAvoidingObstacle           = false;
            ObstacleAvoidanceSteerAmount = 1f;

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

            if (m_isUser)
            {
                IsUser = true;
            }

            progressNum = 0;
            SetTarget(circuit.Waypoints [progressNum], false);
        }
예제 #2
0
		/* Awake */

		private void Awake ()
		{
			m_CarController = GetComponent<CarController> ();
			m_Rigidbody = GetComponent<Rigidbody> ();
			m_SteeringWheel = GetComponentInChildren<VisualSteeringWheelController> ();
			m_Sensors = GetComponent<Sensors> ();
			m_sensorResponseHandlers = GetComponents<SensorResponseHandler> ();
			IsAvoidingObstacle = false;
			ObstacleAvoidanceSteerAmount = 1f;

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

			if (m_isUser) {
				IsUser = true;
			}

			progressNum = 0;
			SetTarget (circuit.Waypoints [progressNum], false);
		}