Exemplo n.º 1
0
        // Use this for initialization
        public void Start () {
#if RVOImp
		if (!astarRVO) {
//#if !AstarRelease
			agentID = RVO.Simulator.Instance.addAgent (new RVO.Vector2(transform.position.x,transform.position.z));
//#endif
		} else {
			Pathfinding.RVO.Simulator sim = (FindObjectOfType(typeof(RVOSimulator)) as RVOSimulator).GetSimulator ();
			rvoAgent = sim.AddAgent (transform.position);
			rvoAgent.Radius = radius;
			rvoAgent.MaxSpeed = maxSpeed;
			rvoAgent.Height = height;
			rvoAgent.AgentTimeHorizon = agentTimeHorizon;
			rvoAgent.ObstacleTimeHorizon = obstacleTimeHorizon;
		}
		
#endif
            SetTarget (-transform.position);// + transform.forward * 400);
            controller = GetComponent<RVOController> ();
		
        }
Exemplo n.º 2
0
        /** Initializes reference variables.
	 * If you override this function you should in most cases call base.Awake () at the start of it.
	  * */
        protected virtual void Awake () {
            seeker = GetComponent<Seeker>();

            //This is a simple optimization, cache the transform component lookup
            tr = transform;

            //Cache some other components (not all are necessarily there)
            controller = GetComponent<CharacterController>();
            navController = GetComponent<NavmeshController>();
            rvoController = GetComponent<RVOController>();
            if ( rvoController != null ) rvoController.enableRotation = false;
            rigid = GetComponent<Rigidbody>();
        }
Exemplo n.º 3
0
		void Awake () {
			seeker = GetComponent<Seeker>();
			controller = GetComponent<CharacterController>();
			rvoController = GetComponent<RVOController>();
			if ( rvoController != null ) rvoController.enableRotation = false;
			tr = transform;
		}