# Mechanism for finding dependencies

This explains the mechanism for finding dependencies of MonoBehaviour fields.

It searches for assignable objects (dependencies) to MonoBehaviour fields within a specified scope.

**What is Scope?**

Scope is the range in the hierarchy view where dependencies are searched.

❗ To zoom  a image in, press Ctrl + scroll the mouse wheel.

<figure><img src="https://2917139309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fto4xkZ2OpP4MpUQlLw9K%2Fuploads%2FibecH5UbaEYMBl7SjpEz%2Fscope.png?alt=media&#x26;token=2d0a5a5b-2ea7-44e1-bb0b-274dca2447e4" alt=""><figcaption></figcaption></figure>

**The Ways to Specify Scope:**

1. The default scope can be set in the Injector Window.

![](https://2917139309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fto4xkZ2OpP4MpUQlLw9K%2Fuploads%2FRblsuntqLPJx7j5w8gs7%2Fdefault%20scope.png?alt=media\&token=c5a6038f-2e90-41af-88ed-cf17ad5c244c)

How to access the Injector Window:

(1) Advanced button

<figure><img src="https://2917139309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fto4xkZ2OpP4MpUQlLw9K%2Fuploads%2FIrArMw0RVapxk4L4LDt3%2Fadvanced%20button.png?alt=media&#x26;token=320eb847-28c4-4c32-a4e5-445b45d47a2e" alt=""><figcaption></figcaption></figure>

(2) Menu: Window/Santutu/Dependency Injector Window

2\. Methods to set individual scopes for MonoBehaviour fields:

(1) In the Dependency Injection Results Window

<figure><img src="https://2917139309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fto4xkZ2OpP4MpUQlLw9K%2Fuploads%2FozmVbxQbBZ3ijs8iPrhq%2Fset%20scope.png?alt=media&#x26;token=b6e0df94-637b-4f5e-8333-4f94c1ac9e98" alt=""><figcaption></figcaption></figure>

❗ When the scope is modified in the editor window, the change is permanently saved and applied with the highest priority. If the modification is removed, it reverts to the default value or atttibute value.

(2) Using attributes in code

<figure><img src="https://2917139309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fto4xkZ2OpP4MpUQlLw9K%2Fuploads%2Fxm3KEqBhs8dVL1yJFtg3%2Fset%20scope2.png?alt=media&#x26;token=2e31387e-1bb9-47a6-8a7d-e69a17e70fa2" alt=""><figcaption></figcaption></figure>

&#x20;\
3\. Also please refer to filter page.<br>

{% content-ref url="../advanced/filters" %}
[filters](https://santutu.gitbook.io/mono-dependency-injection/advanced/filters)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://santutu.gitbook.io/mono-dependency-injection/mechanism/mechanism-for-finding-dependencies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
