//---Starting/Initializing functions---// void Start() { storeMaxSpeed = maxSpeed; targetSpeed = storeMaxSpeed; rigidbody = GetComponent <Rigidbody>(); npcHealth = GetComponent <TitanNPCHealth>(); }
float timer; // Timer for counting up to the next attack. void Awake() { // Setting up the references. player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <TitanPlayerHealth>(); enemyHealth = GetComponent <TitanNPCHealth>(); anim = GetComponent <Animator>(); }
// Use this for initialization void Start() { base.Start(); isHostile = true; hostileAI = GetComponent <AI>(); enemyHealth = GetComponent <TitanNPCHealth>(); _hitPoints = hitPoints; }
bool isSinking; // Whether the enemy has started sinking through the floor. void Awake() { // Setting up the references. //enemyAudio = GetComponent<AudioSource>(); capsuleCollider = GetComponent <CapsuleCollider>(); titanNPCHealth = this; // Setting the current health when the enemy first spawns. currentHealth = startingHealth; }
// Use this for initialization void Start() { base.Start(); npcHealth = GetComponent <TitanNPCHealth>(); neutralAI = GetComponent <AI>(); }