Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     anim            = GetComponent <Animator>();
     enemyPatrolling = GetComponent <EnemyPatrolling>();
     //speed = enemyPatrolling.speed;
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     _health       = GetComponent <EnemyHealth> ();
     _chase        = GetComponent <EnemyChasing> ();
     _patrol       = GetComponent <EnemyPatrolling> ();
     _movement     = GetComponent <EnemyMovement>();
     _isPatrolling = true;//TEMP
 }
Example #3
0
    void Start() //avant c'était Awake
    {
        // Setting up the references.
        player = GameObject.FindGameObjectWithTag("Player");
        //Debug.Log(player);
        //playerHealth = player.currentHealth;
        characterHealth = player.GetComponent <CharacterHealth>();
        //enemyHealth = GetComponent<EnemyHealth>();
        anim = GetComponent <Animator>();

        enemyPatrolling = GetComponent <EnemyPatrolling>();
        enemyChasing    = GetComponent <EnemyChasing>();
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        _movement  = GetComponent <EnemyMovement>();
        _chase     = GetComponent <EnemyChasing> ();
        _patrol    = GetComponent <EnemyPatrolling> ();
        _collision = GetComponent <CollisionHandler> ();

        _health    = GetComponent <HealthHandler> ();
        _trigger   = GetComponent <TriggerHandler> ();
        _knockback = GetComponent <EnemyKnockback>();

        _animator = GetComponent <EnemyAnimator> ();

        _isPatrolling = true;        //TEMP
    }
Example #5
0
	void Awake (){
		rigid = GetComponent<Rigidbody2D> ();
		GameObject playerObj = GameObject.FindGameObjectWithTag ("Player");
		if (playerObj != null) {
			target = playerObj.transform;
		}
		//Get all the Scripts needed;
		_enemy = GameObject.FindGameObjectWithTag("Enemy");
		if(_enemy != null){
			_enemyMove = _enemy.GetComponent<EnemyMove>();
			_enemyHealth = _enemy.GetComponent<EnemyHealth> ();
			_enemyShoot = _enemy.GetComponent<EnemyWeaponController> ();
			_enemyEvade = _enemy.GetComponent<EnemyEvasiveManouver> ();
			_enemyPatrol = _enemy.GetComponent<EnemyPatrolling> ();
			_enemyChasing = _enemy.GetComponent<EnemyChasing> ();
		} else {
			print("Something went Wrong; Could not find this Enemy "+this+" in this scene");
		}
	}
Example #6
0
 // Use this for initialization
 void Start()
 {
     _health = GetComponent <EnemyHealth>();
     _chase  = GetComponent <EnemyChasing>();
     _patrol = GetComponent <EnemyPatrolling>();
 }