void Awake() { state = States.Idle; if (body == null) { body = this.gameObject.GetComponent <Rigidbody2D>(); } if (blaster == null) { blaster = this.gameObject.GetComponent <BlasterController>(); } cooldownTime = 0; health = maxHealth; }
void Awake() { if (body == null) { body = this.gameObject.GetComponent <Rigidbody2D>(); } if (status == null) { status = GetComponent <PlayerStatus>(); } invicibleTime = invincibilityTime; cooldownTime = shootCooldown; blaster = this.gameObject.GetComponent <BlasterController>(); level = this.gameObject.GetComponent <ShipLevel>(); }