Exemplo n.º 1
0
 void Start()
 {
     anim          = GetComponent <Animator> ();
     swordAnim     = GetComponentInChildren <Animator> ();
     enemyDetector = GameObject.FindObjectOfType <EnemyDetector> ();
     SetPlayerActive(true);
 }
 void Start()
 {
     m_rb            = GetComponent <Rigidbody>();
     m_collider      = GetComponent <CapsuleCollider>();
     m_anim          = GetComponent <Animator>();
     m_enemyDetector = GetComponent <EnemyDetector>();
 }
 // Start is called before the first frame update
 void Start()
 {
     rb            = GetComponent <Rigidbody>();
     orientation   = new Vector3(-1, 0, 1).normalized;
     rb.velocity   = orientation * speed;
     enemyDetector = GetComponentInChildren <EnemyDetector>();
 }
Exemplo n.º 4
0
 void Start()
 {
     m_tank        = this.transform.root.gameObject;
     m_effect      = Resources.Load <GameObject>("Explosion");
     m_enemyDector = GetComponentInParent <EnemyDetector>();
     m_targetPos   = m_enemyDector.Target.transform.position;
     this.gameObject.transform.LookAt(m_targetPos); // 敵の方向に弾を向ける
 }
Exemplo n.º 5
0
 public Flee(Gatherer gatherer, NavMeshAgent navMeshAgent, EnemyDetector enemyDetector, Animator animator, ParticleSystem particleSystem)
 {
     _gatherer       = gatherer;
     _navMeshAgent   = navMeshAgent;
     _enemyDetector  = enemyDetector;
     _animator       = animator;
     _particleSystem = particleSystem;
 }
 private void Start()
 {
     enemyAlreadySpawned = new List <GameObject>();
     if (spawnPlace.Length != enemyToSpawn.Length)
     {
         Debug.LogError("Enemy spawner should have the same number of place and enemy to work");
     }
     playerDetector = GetComponent <EnemyDetector>();
 }
Exemplo n.º 7
0
    void OnTriggerEnter(Collider col)
    {
        EnemyDetector enemyDetector = col.gameObject.GetComponent <EnemyDetector> ();

        if (enemyDetector != null)
        {
            enemyDetector.AddEnemy(this);
        }
    }
Exemplo n.º 8
0
 private void Start()
 {
     uc             = GameObject.Find("UnitController").GetComponent <UnitController>();
     sr             = GetComponentInChildren <SpriteRenderer>();
     hpbar_slider   = GetComponentInChildren <Slider>();
     enemy_detector = GetComponentInChildren <EnemyDetector>();
     attack_timer   = attackSpeed;
     maxHP          = HP;
 }
 // Start is called before the first frame update
 void Start()
 {
     if (Camera.main != null)
     {
         _cameraEffect = Camera.main.GetComponent <CameraEffect>();
     }
     _enemyDetector = GetComponent <EnemyDetector>();
     rb             = GetComponent <Rigidbody>();
 }
Exemplo n.º 10
0
    void OnCollisionEnter(Collision col)
    {
        Enemy enemy = col.gameObject.GetComponent <Enemy> ();

        if (enemy != null)
        {
            EnemyManager.Get().RemoveEnemy(enemy);
            EnemyDetector.Get().RemoveEnemy(enemy);
        }
        GameObject.Destroy(col.gameObject);
    }
    protected override void Start()
    {
        base.Start();
        currentState = State.Death;

        enemyDetector   = GetComponentInChildren <EnemyDetector>();
        patrolBehaviour = GetComponent <PatrolBehaviour>();
        chaseBehaviour  = GetComponent <ChaseBehaviour>();
        mover           = GetComponent <Mover>();
        fighter         = GetComponent <Fighter>();
        anim            = GetComponent <Animator>();

        enemyDetector.PlayerDetected.AddListener(UpdateTarget);
        enemyDetector.PlayerLost.AddListener(UpdateTarget);
    }
Exemplo n.º 12
0
 void Start()
 {
     detector = GetComponentInChildren <EnemyDetector>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerDetector = GetComponent <EnemyDetector>();
 }
Exemplo n.º 14
0
 // wykonuja sie najpierw awaki a potem start
 void Awake()
 {
     singleton = this;
 }
Exemplo n.º 15
0
 private void Start()
 {
     playerDetector = transform.parent.GetComponent <EnemyDetector>();
 }
Exemplo n.º 16
0
 // Start is called before the first frame update
 void Start()
 {
     behaviourObject = gameObject.GetComponentInParent <TurretBehaviourDefinition>();
     currState       = TurretBehaviourDefinition.State.patrol;
     detector        = GetComponentsInChildren <EnemyDetector>()[0];
 }