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>(); }
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); // 敵の方向に弾を向ける }
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>(); }
void OnTriggerEnter(Collider col) { EnemyDetector enemyDetector = col.gameObject.GetComponent <EnemyDetector> (); if (enemyDetector != null) { enemyDetector.AddEnemy(this); } }
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>(); }
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); }
void Start() { detector = GetComponentInChildren <EnemyDetector>(); }
// Start is called before the first frame update void Start() { playerDetector = GetComponent <EnemyDetector>(); }
// wykonuja sie najpierw awaki a potem start void Awake() { singleton = this; }
private void Start() { playerDetector = transform.parent.GetComponent <EnemyDetector>(); }
// Start is called before the first frame update void Start() { behaviourObject = gameObject.GetComponentInParent <TurretBehaviourDefinition>(); currState = TurretBehaviourDefinition.State.patrol; detector = GetComponentsInChildren <EnemyDetector>()[0]; }