void Start() { //Get instance of OutputManager and the TCP socket outputManager = GameObject.Find("TCP").GetComponent <OutputManager>(); tcp = outputManager.tcpReturn(); // Call the Spawn function after a delay of the spawnTime and then continue to call after the same amount of time. InvokeRepeating("Spawn", spawnTime, spawnTime); enemyMovement = enemy.GetComponent <EnemyMovement>(); }
void Awake() { // Find the objects in the game with the given name and reference the script component needed outputManager = GameObject.Find("TCP").GetComponent <OutputManager>(); playerHealth = GameObject.Find("Player").GetComponent <PlayerHealth>(); playerMovement = GameObject.Find("Player").GetComponent <PlayerMovement>(); enemyManager = GameObject.Find("EnemyManager").GetComponent <EnemyManager>(); playerShooting = GameObject.Find("GunBarrelEnd").GetComponent <PlayerShooting>(); // References to the TCP socket tcp = outputManager.tcpReturn(); tcp.registerListener(this); }
void Awake() { //Get instance of OutputManager outputManager = GameObject.Find("TCP").GetComponent <OutputManager>(); tcp = outputManager.tcpReturn(); // Setting up the references. anim = GetComponent <Animator> (); enemyAudio = GetComponent <AudioSource> (); hitParticles = GetComponentInChildren <ParticleSystem> (); capsuleCollider = GetComponent <CapsuleCollider> (); // Setting the current health when the enemy first spawns. currentHealth = startingHealth; }
void Awake() { //Get instance of OutputManager outputManager = GameObject.Find("TCP").GetComponent <OutputManager>(); tcp = outputManager.tcpReturn(); // Setting up the references. anim = GetComponent <Animator> (); playerAudio = GetComponent <AudioSource> (); playerMovement = GetComponent <PlayerMovement> (); playerShooting = GetComponentInChildren <PlayerShooting> (); // Set the initial health of the player. currentHealth = startingHealth; }
void Awake() { //Get instance of OutputManager outputManager = GameObject.Find("TCP").GetComponent <OutputManager>(); tcp = outputManager.tcpReturn(); #if !MOBILE_INPUT // Create a layer mask for the floor layer. floorMask = LayerMask.GetMask("Floor"); #endif // Get original starting position originPos = transform.position; // Set up references. anim = GetComponent <Animator> (); playerRigidbody = GetComponent <Rigidbody> (); }