// Use this for initialization void Start() { healthsys = GetComponent <NPCHealth>(); enemycontroller = GetComponent <CharacterController>(); routes = route.GetComponentsInChildren <Transform>(); shiftAll(); }
/// <summary> /// Make an hit on other gameobject. /// </summary> public void ShootAtNPC() { npcHealth = npc.GetComponent<NPCHealth>(); lineBullet.enabled = true; lineBullet.SetPosition(0, transform.position); lineBullet.SetPosition(1, npc.transform.position); npcHealth.TakeDamage(weaponDamage); }
// Use this for initialization void Start() { rg = GetComponent <Rigidbody2D>(); healthScript = GetComponent <NPCHealth>(); if (ImpactSoundScript == null) { ImpactSoundScript = GetComponent <PlaySoundClipImpactSoundsPlayer>(); } }
//private NavMeshAgent agent; private void Awake() { health = GetComponent <Health>(); health.Healed += Health_Healed; npchealth = GetComponent <NPCHealth>(); npchealth.Died += NPCHealth_Died; compVillagerMovement = GetComponent <VillagerMovement>(); ts = GetComponent <TimeScale>(); //agent = GetComponent<NavMeshAgent>(); }
private void ShootAtNPC() { bullet = prefabSource.Bullet(); npcHealth = npc.GetComponent<NPCHealth>(); GameObject bulletCopy = (GameObject)Instantiate(bullet, transform.position, transform.rotation); bulletCopy.SetActive(true); Shoot script_b = bulletCopy.GetComponent<Shoot>(); script_b.SetStart(transform, npc.transform, transform.gameObject); }
private void Awake() { navMeshA = GetComponent <NavMeshAgent>(); player = Camera.main.transform.root.gameObject; patrolPoints = FindObjectsOfType <PatrolPoint>(); if (GetComponent <NPCHealth>()) { npcHealth = GetComponent <NPCHealth>(); } }
/// <summary> /// Make an hit on other gameobject. /// </summary> public void ShootAtNPC() { npcState = false; bullet = prefabSource.Bullet(); npcHealth = npc.GetComponent<NPCHealth>(); GameObject bulletCopy = (GameObject)Instantiate(bullet, transform.position, transform.rotation); bulletCopy.SetActive(true); Shoot script_b = bulletCopy.GetComponent<Shoot>(); script_b.SetStart(transform, npc.transform, transform.gameObject); if (gatlingControll.RotateSpeed < 15f)gatlingControll.RotateSpeed = gatlingControll.RotateSpeed + 1f; if (delay <= 0.22f && delay > 0.05f) delay = delay - 0.01f; }
/// <summary> /// Initialize single shoot to one NPC /// </summary> /// <param name="npcEnemy"> target </param> /// <param name="towerWeapon"> weapon typ </param> public void Shoot(GameObject npcEnemy, GameObject towerWeapon) { bullet = prefabSource.Bullet(); npc = npcEnemy; npcHealth = npcEnemy.GetComponent<NPCHealth>(); GameObject bullet_2 = (GameObject)Instantiate(bullet, transform.position, towerWeapon.transform.rotation); bullet_2.SetActive(true); Shoot script_b = bullet_2.GetComponent<Shoot>(); script_b.SetStart(transform, npcEnemy.transform, transform.gameObject); }
public void Init() { if (TrackedTarget == null) { return; } playersHealth = TrackedTarget.GetComponent <NPCHealth>(); playersUpgrades = TrackedTarget.GetComponent <Upgrades>(); playersInventory = TrackedTarget.GetComponent <PlayerInventory>(); playersId = TrackedTarget.GetComponent <PlayerId>(); playersId.CameraScript = this; cam = GetComponent <Camera>(); }
void Awake() { // Set up the references. //player = GameObject.Find("Player").transform; //playerHealth = players.GetComponent<TankHealth>(); enemyHealth = GetComponent <NPCHealth>(); nav = GetComponent <NavMeshAgent>(); //EnemyAnim = GetComponent<Animator>(); PlayerMovScript = FindObjectOfType <TankMovement>(); }
void Awake() { _agent = GetComponent <NavMeshAgent>(); playerObject = PlayerController.Instance.gameObject; patrolPoints = FindObjectsOfType <PatrolPoint>(); if (GetComponent <NPCHealth>()) { npcHealth = GetComponent <NPCHealth>(); } PlayerCam = Tools.MainCamera().gameObject; }
void Awake() { spriteFlippable2D = GetComponent <SpriteFlippable2D>(); flashable = GetComponent <Flashable>(); health = GetComponent <NPCHealth>(); movement = GetComponent <NPCMovement>(); Transform weaponHolderTransform = transform.Find("WeaponHolder"); if (weaponHolderTransform != null) { weaponHolder = weaponHolderTransform.gameObject; } heldWeapon = GetComponentInChildren <NPCHeldWeapon>(); }
void Awake() { playerID = GetComponent <PlayerId>(); upgrades = GetComponent <Upgrades>(); healthScript = GetComponent <NPCHealth>(); rg = GetComponent <Rigidbody2D>(); if (jetpackSound != null) { jetSource = jetpackSound.GetComponent <AudioSource>(); soundBase = jetSource.volume; } //drillMask = LayerMask.NameToLayer("Diggable"); oldTimer = unDeployTimer; engineSound = GetComponent <AudioSource>(); }
protected override void OnLaserHit(RaycastHit2D hit) { if (hit.collider.gameObject.layer != LayerMask.NameToLayer("Enemy")) { return; } NPCHealth npcHealth = hit.collider.gameObject.GetComponentInParent <NPCHealth>(); BossHealth bossHealth = hit.collider.gameObject.GetComponentInParent <BossHealth>(); if (npcHealth != null) { npcHealth.Damage(damage, true); } else if (bossHealth != null) { bossHealth.Damage(damage, true); } }
//the object which you place //the object which you use to teleport // Use this for initialization void Awake() { upgrades = GetComponent <Upgrades>(); healthScript = GetComponent <NPCHealth>(); idScript = GetComponent <PlayerId>(); }
void Awake() { NPCTargeting = GetComponent <NPCTargeting> (); myTag = GetComponent <Tag> (); NPCHealth = GetComponent <NPCHealth>(); }
// Use this for initialization void Start() { parent = transform.parent; healthScript = GetComponent <NPCHealth>(); }
// Use this for initialization void Awake() { script = GetComponent <PlaySoundClipImpactSound>(); health = GetComponent <NPCHealth>(); originalcooldown = cooldown; }
private void Awake() { npchealth = GetComponent <NPCHealth>(); npchealth.Died += NPCHealth_Died; cmpEnemyMovement = GetComponent <EnemyMovement>(); }