Example #1
0
    // Use this for initialization
    void Start()
    {
        slider     = FindObjectOfType <Slider>();
        _health    = slider.value;
        _survival  = GetComponent <Health_Bar>();
        _money     = 10.0f;
        money_text = GameObject.FindGameObjectWithTag("Money").GetComponent <Text>();

        money_text.text = "$" + _money.ToString();
    }
    // Start is called before the first frame update
    void Awake()
    {
        ActiveUI     = false;
        TimeActiveUI = 0f;

        HPManager = GetComponent <Enemy_HPManager>();
        HealthUI  = HP_Slider.GetComponent <Health_Bar>();

        HealthUI.SetMaxHealth(HPManager.MaxHealth);
        HP_Slider.gameObject.SetActive(false);
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        // Used for changing colors
        sr_Sphere    = this.GetComponent <SpriteRenderer>();
        t_Sphere     = this.GetComponent <Transform>();
        cc_Sphere    = this.GetComponent <CircleCollider2D>();
        s_sphere     = Resources.Load <Sprite>("Images/Sphere2");
        s_invincible = Resources.Load <Sprite>("Images/Shield");
        health_Bar   = GameObject.FindGameObjectWithTag("healthBar").GetComponent <Health_Bar>();


        spaceship = this.gameObject.transform.parent.gameObject;
        game_Controller_Object = GameObject.Find("GameController");
        game_Controller        = game_Controller_Object.GetComponent <Game_Controller>();

        // Starts invincibility
        coroutine = Invincible(3.0f);
        StartCoroutine(coroutine);
    }
Example #4
0
 void Awake()
 {
     instance = this;
 }
Example #5
0
 private void Awake()
 {
     health_Bar = GameObject.FindGameObjectWithTag("healthBar").GetComponent <Health_Bar>();
     health_Bar.resetHealth();
 }