protected void Awake() { lifevars = this.getvars <lifescript>(); sprayvars = this.getvars <sprayattack>(); rend = GetComponent <SpriteRenderer>(); coll = GetComponent <Collider2D>(); gameObject.SetActive(false); }
protected new void Awake() { base.Awake(); (rend = GetComponent <SpriteRenderer>()).enabled = false; (coll = GetComponent <Collider2D>()).enabled = false; lifevars = GetComponent <lifescript>(); if (lifevars != null) { lifevars.death = death; lifevars.life = maxhealth; lifevars.whileDying = coll.disable; lifevars.whileDying += resetCoolDown; } cooldownTimer = 2.5f; closeTimer = new timelib.timer(cooldownTimer); }
void Start() { lifeScript = GameObject.FindGameObjectWithTag("HP").GetComponent <lifescript>(); }
// Use this for initialization void Start() { rigidbody2D = GetComponent <Rigidbody2D>(); lifeScript = GameObject.FindGameObjectWithTag("HP").GetComponent <lifescript>(); }
// Start is called before the first frame update void Awake() { Alien = GameObject.Find("Alien"); lifescript = Alien.GetComponent <lifescript>(); }