// Use this for initialization void Start () { enemyPumpkinManager = GetComponent<EnemyPumpkinManager>(); victoryCondition = GetComponent<VictoryCondition>(); player = GameObject.FindGameObjectWithTag("Player"); playerManagerBackup = player.GetComponent<PlayerManagerBackup>(); }
// Use this for initialization void Start() { enemyPumpkinManager = GetComponent <EnemyPumpkinManager>(); victoryCondition = GetComponent <VictoryCondition>(); player = GameObject.FindGameObjectWithTag("Player"); playerManagerBackup = player.GetComponent <PlayerManagerBackup>(); }
// Use this for initialization void Start() { victoryCondition = GetComponent <VictoryConditionEnergy>(); player = GameObject.FindGameObjectWithTag("Player"); playerManagerBackup = player.GetComponent <PlayerManagerBackup>(); currentHealth = 100; }
// Sets public void setAwake() { currentHealth = maxHealth; player = GameObject.FindGameObjectWithTag("Player"); // Finds the gameobject with the tag "Player". playerManager = player.GetComponent<PlayerManagerBackup>(); // Gets the script PlayerManager of the player. pointsText = GameObject.FindGameObjectWithTag("Score"); score = pointsText.GetComponent<PointCounter>(); nav = GetComponent<NavMeshAgent>(); // Gets the NavMeshAgent component. playerInRange = false; // Initalize the playerInRange bool to false. playerAttacked = false; // Initialize the playerAttacked bool to false. onStunTimer = onStunTimerIni; // Initialize the onStunTimer. stunCooldown = stunCooldownIni; // Initialize the stunCooldown. stunOffset = stunOffsetIni; // Initialize the stunOffset. //enemyAudio = GetComponent<AudioSource>(); // Gets the AudioSource component from the enemy. //rigidBody = GetComponent<Rigidbody>(); // Gets the rigidbody component from the enemy. //capsuleCollider = GetComponent<CapsuleCollider>(); //sphereCollider = GetComponent<SphereCollider>(); //leftHandAttack1 = GetComponentInChildren<SphereCollider>(); // Gets the SphereCollider of the leftHandAttack1 children. anim = GetComponent<Animator>(); // Gets the animator component from the enemy. state = EnemyStates.AWAKE; // Goes to the AWAKE state. }
// Use this for initialization void Start() { playerManagerBackup = GetComponentInParent <PlayerManagerBackup>(); gameObject.SetActive(false); }