private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } }
void Start() { // Movement _rb2d = GetComponent <Rigidbody2D>(); _shootAudio = GetComponent <AudioSource>(); _movementChanged = false; _movement = new System.Diagnostics.Stopwatch(); _movement.Start(); _shoot = new System.Diagnostics.Stopwatch(); _shoot.Start(); // Sprite _sprite = GetComponent <SpriteRenderer>(); // Hatches _opening = new System.Diagnostics.Stopwatch(); _opening.Start(); // Lifebar _lifebar = LifebarBoss.Instance; _lifebar.SetLIFEMAX = LIFEMAX; }