public virtual void OnDeactivate() { foreach (Enemy enemy in enemies.Keys) { enemy.GetComponent <EnemyHandler>().SetActive(false); enemy.transform.position = enemies[enemy]; } boundary_box.Disable(); }
protected virtual void Awake() { BoxCollider2D collider = GetComponent <BoxCollider2D>(); collider.offset = local_center; collider.size = new Vector2(size.x * Section.width - 1, size.y * Section.height - 1); enemy_bound_box = GetComponentInChildren <BoundaryBox>(); if (enemy_bound_box != null) { enemy_bound_box.Set(this); enemy_bound_box.Disable(); } }
private void Awake() { if (_template != null) { _template.Ini(); foreach (Block b in template.GetBlocks()) { b.SetRoom(this); } } boundary_box = GetComponentInChildren <BoundaryBox>(); if (boundary_box != null) { boundary_box.Set(this); boundary_box.Disable(); } enemies = new Dictionary <Enemy, Vector3>(); }