Inheritance: MonoBehaviour
	// Use this for initialization
	void Start ()
    {
        base.Start();
        if(HealthBar != null)
        {
            GameObject bar = (GameObject)Object.Instantiate(HealthBar, transform.position, Quaternion.identity);
            //healthBarScript = HealthBar.GetComponent<HealthBarScript>();
            healthBarScript = bar.GetComponent<HealthBarScript>();
            hasHealthBar = true;
        }
        //first attack was set in editor
        if(AttackOne != null)
        {
            attackOnePresent = true;
            
            firstAttack = 1;
            lastAttack++;
        }
        //second attack is set in editor
        if(AttackTwo != null)
        {
            attackTwoPresent = true;
            lastAttack++;
        }
        //third attack is set in editor
        if(AttackThree != null)
        {
            attackThreePresent = true;
            lastAttack++;
        }
        //assigns actual update time, using the time variables * 60;
        straightLength = (int)(TimeStraight * 60f);
        vertLength = (int)(TimeTurning * 60f);
        coolDownLength = (int)(TimeCoolDown * 60f);
        //sets directional vectors, this way I dont have to continually make new ones over the course of the game.
        forward = new Vector3(0f, 1f, 0f);
        diagRight = new Vector3(1f, 1f, 0f);
        diagLeft = new Vector3(-1f, 1f, 0f);
        //finds and sets the player object as target, used so I can check if I want to attack.
        target = GameObject.FindGameObjectWithTag("Player");
        //instantiates xRange
        xRange = new Vector2();
	}
    // Use this for initialization
    void Start()
    {
        currentHealth = maxHealth;

        changeMeshScript = GetComponent<ChangeMeshOnAnimation>();

        healthBar = GetComponentInChildren<HealthBarScript>();
    }
 void Start()
 {
     healthBar = GameObject.FindGameObjectWithTag("Player").GetComponent<HealthBarScript>();
     // 2 - Limited time to live to avoid any leak
     Destroy(gameObject, 4); // 4sec
 }
 // Use this for initialization
 void Start()
 {
     characterAnimator = GetComponentInChildren<Animator>();
     healthBar = GetComponentInChildren<HealthBarScript>();
     Begin();
 }
Beispiel #5
0
 // Start is called before the first frame update
 void Start()
 {
     _animator = GetComponent <Animator>();
     HealthBarScript.SetHealthBarValue(1);
 }
Beispiel #6
0
 private void Awake()
 {
     health = GetComponentInChildren <HealthBarScript>();
     health.healthbarbackground.gameObject.SetActive(false);
 }
    // Use this for initialization
    void Start()
    {
        //Find the player
        playerBody = GameObject.Find("PlayerController").transform;

        //Find attackPoints 3 and 4
        attackPoint3 = GameObject.Find("AttackPoint3").transform;
        attackPoint4 = GameObject.Find("AttackPoint4").transform;

        //Find the player HealthBarScript
        playerHP = playerBody.GetComponent<HealthBarScript>();

        //Find the Weapon
        enemyWeapon = GetComponentInChildren<Transform>();

        kickRate = coolDownKick;
        sphereRate = coolDownSphere;
        exeRate = coolDownExe;
    }
Beispiel #8
0
 private void Start()
 {
     DontDestroyOnLoad(this.gameObject);
     PlayerHealthManager = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealthManager>();
     HealthBarScript     = GameObject.FindGameObjectWithTag("HealthBar").GetComponent <HealthBarScript>();
 }
 // Use this for initialization
 void Start()
 {
     //Get the reference to the Player's health
     playerHealth = FindObjectOfType <HealthBarScript>();
 }
Beispiel #10
0
 private void Start()
 {
     layout    = GetComponent <LayoutElement>();
     image     = GetComponent <Image>();
     healthBar = GetComponentInParent <HealthBarScript>();
 }
Beispiel #11
0
 // Brings the current hp up to the max hp
 // Grabs the object and component for the canvas and health bar script
 private void OnEnable()
 {
     currentHealth = maxHealth;
     healthObject  = GameObject.Find("WorldSpaceCanvas");
     healthBar     = healthObject.GetComponent <HealthBarScript>();
 }
Beispiel #12
0
 // Use this for initialization
 void Start()
 {
     health = GameObject.FindGameObjectWithTag ("Player").GetComponent<HealthBarScript> ();
 }
 // Use this for initialization
 void Start()
 {
     healthBar = transform.parent.GetComponentInChildren<HealthBarScript>();
 }