상속: MonoBehaviour
예제 #1
0
 /** Use this for initialization */
 public void Start()
 {
     seeker            = GetComponent <Seeker>();
     controller        = GetComponent <CharacterController>();
     navmeshController = GetComponent <NavmeshController>();
     tr = transform;
     Repath();
 }
예제 #2
0
 public void Start()
 {
     this.seeker            = base.GetComponent <Seeker>();
     this.controller        = base.GetComponent <CharacterController>();
     this.navmeshController = base.GetComponent <NavmeshController>();
     this.tr = base.transform;
     this.Repath();
 }
예제 #3
0
	/** Use this for initialization */
	public void Start () {
		seeker = GetComponent<Seeker>();
		controller = GetComponent<CharacterController>();
		navmeshController = GetComponent<NavmeshController>();
		
		tr = transform;
		Repath ();
	}
예제 #4
0
    /** Use this for initialization */
    public void Start() {
        seeker = GetComponent<Seeker>();
        controller = GetComponent<Rigidbody2D>();
        navmeshController = GetComponent<NavmeshController>();

        tr = transform;
        Repath();
    }
예제 #5
0
 /** Use this for initialization */
 public void Start()
 {
     seeker            = GetComponent <Seeker>();
     controller        = GetComponent <CharacterController>();
     navmeshController = GetComponent <NavmeshController>();
     target            = GameObject.Find("Player").transform;
     tr = transform;
     Repath();
 }
예제 #6
0
    public void ChangeNav(NavmeshController navmeshController)
    {
        Destroy(GetComponent(GetComponent <BehaviourLibraryLinker>().NavAgent.GetType()));

        System.Type type = navmeshController.GetType();
        Component   copy = gameObject.AddComponent(type);

        gameObject.GetComponent <BehaviourLibraryLinker>().navAgent = (NavmeshController)copy;
    }
예제 #7
0
    // Use this for initialization
    void Awake()
    {
        seeker = GetComponent <Seeker>();
        //This is a simple optimization, cache the transform component lookup
        tr = transform;
        seeker.pathCallback += OnPathComplete;

        controller    = GetComponent <CharacterController>();
        navController = GetComponent <NavmeshController>();
        rigid         = rigidbody;
    }
예제 #8
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>();
        rigid         = GetComponent <Rigidbody>();
    }
예제 #9
0
 protected virtual void Awake()
 {
     this.seeker        = base.GetComponent <Seeker>();
     this.tr            = base.transform;
     this.controller    = base.GetComponent <CharacterController>();
     this.navController = base.GetComponent <NavmeshController>();
     this.rvoController = base.GetComponent <RVOController>();
     if (this.rvoController != null)
     {
         this.rvoController.enableRotation = false;
     }
     this.rigid = base.GetComponent <Rigidbody>();
 }
예제 #10
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;

        //Make sure we receive callbacks when paths complete
        seeker.pathCallback += OnPathComplete;

        //Cache some other components (not all are necessarily there)
        controller    = GetComponent <CharacterController>();
        navController = GetComponent <NavmeshController>();
        rigid         = rigidbody;
    }
예제 #11
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 = rigidbody;
    }
예제 #12
0
    protected virtual void Awake()
    {
        seeker = GetComponent <Seeker>();

        FoodSource = GameObject.FindWithTag("Foodsource");
        //Spawner = GameObject.FindWithTag("Spawner");

        _ANeeds = GetComponent <A_Needs>();

        transform.rotation = Random.rotation;
        target             = new Vector3(Random.Range(-50, 50), 0, Random.Range(-50, 50));
        Debug.Log(target);
        //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>();
        rigid         = GetComponent <Rigidbody>();
    }
예제 #13
0
    protected virtual void Awake()
    {
        Player = (vp_FPPlayerEventHandler)transform.root.GetComponentInChildren(typeof(vp_FPPlayerEventHandler));
        walkTimeLimit=Random.Range(2,4);
        stopTimeLimit=Random.Range (9,12);
        walkTime=Time.time;

        seeker = GetComponent<Seeker>();

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

        //Make sure we receive callbacks when paths complete
        seeker.pathCallback += OnPathComplete;

        //Cache some other components (not all are necessarily there)
        controller = GetComponent<CharacterController>();
        navController = GetComponent<NavmeshController>();
        rigid = rigidbody;
    }
예제 #14
0
    protected virtual void Awake()
    {
        seeker = GetComponent<Seeker>();

        FoodSource = GameObject.FindWithTag("Foodsource");
        WorkWaypoint = GameObject.FindGameObjectWithTag ("WorkWaypoint");
        //Spawner = GameObject.FindWithTag("Spawner");

        _AState = GetComponent<AgentState>();

        transform.rotation = Random.rotation;

        Debug.Log(target);
        //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>();
        rigid = GetComponent<Rigidbody>();
    }
예제 #15
0
    protected virtual void Awake()
    {
        Player = (vp_FPPlayerEventHandler)transform.root.GetComponentInChildren(typeof(vp_FPPlayerEventHandler));
        currentlyEscorting=null;
        target=getRandomZone().transform;
        seeker = GetComponent<Seeker>();

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

        //Make sure we receive callbacks when paths complete
        seeker.pathCallback += OnPathComplete;

        //Cache some other components (not all are necessarily there)
        controller = GetComponent<CharacterController>();
        navController = GetComponent<NavmeshController>();
        rigid = rigidbody;
    }
예제 #16
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>();

        AnimControl = GetComponent<AIStates>();

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

        //Make sure we receive callbacks when paths complete
        seeker.pathCallback += OnPathComplete;

        //Cache some other components (not all are necessarily there)
        controller = GetComponent<CharacterController>();
        navController = GetComponent<NavmeshController>();
        rigid = rigidbody;
    }
예제 #17
0
    // Use this for initialization
    void Awake()
    {
        seeker = GetComponent<Seeker>();
        //This is a simple optimization, cache the transform component lookup
        tr = transform;
        seeker.pathCallback += OnPathComplete;

        controller = GetComponent<CharacterController>();
        navController = GetComponent<NavmeshController>();
        rigid = rigidbody;
    }
예제 #18
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 = rigidbody;
	}
예제 #19
0
    protected virtual void Awake()
    {
        seeker = GetComponent<Seeker>();

        FoodSource = GameObject.FindWithTag("Foodsource");
        //Spawner = GameObject.FindWithTag("Spawner");

        _ANeeds = GetComponent<A_Needs>();

        transform.rotation = Random.rotation;
        target = new Vector3 (Random.Range(-50,50),0,Random.Range(-50,50));
        Debug.Log(target);
        //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>();
        rigid = GetComponent<Rigidbody>();
    }
예제 #20
0
 public void Start()
 {
     this.seeker = base.GetComponent<Seeker>();
     this.controller = base.GetComponent<CharacterController>();
     this.navmeshController = base.GetComponent<NavmeshController>();
     this.tr = base.transform;
     this.Repath();
 }
예제 #21
0
 protected void Awake()
 {
     seeker = GetComponent<Seeker>();
     controller = GetComponent<CharacterController>();
     navController = GetComponent<NavmeshController>();
     Controllable = GetComponent<Controllable>();
 }
예제 #22
0
    /** Use this for initialization */
    public void Start()
    {
        target = GameObject.FindWithTag("Pyramid").transform;
        seeker = GetComponent<Seeker>();
        controller = GetComponent<CharacterController>();
        navmeshController = GetComponent<NavmeshController>();

        tr = transform;
        Repath ();
    }
예제 #23
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>();
        rigid = GetComponent<Rigidbody>();
    }
예제 #24
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 () {
		
		pl = GameObject.Find("PointList").GetComponent<PointList>();
		
		target = pl.points[1];
		seeker = GetComponent<Seeker>();
		
		//This is a simple optimization, cache the transform component lookup
		tr = transform;
		
		//Make sure we receive callbacks when paths complete
		seeker.pathCallback += OnPathComplete;
		
		//Cache some other components (not all are necessarily there)
		controller = GetComponent<CharacterController>();
		navController = GetComponent<NavmeshController>();
		rigid = rigidbody;
	}