How to use a dependency injection mechanism between scenes

For instance, I have a scene with 2 game objects. The first has CButton component and its name “Button01”, the second one has CActor with name “Actor01”. CActor is an abstract class with two public methods Activate and Deactivate. So the button’s component is dependent of CActor object.
I want to inject this dependency into CButton component automatically using a dependency injection.
Let another game object is placed at the scene with CCompositionRoot component. It’s the place where I initialize some container and other dependencies. All dependencies are related with the first scene.

And now the question is how should I work with dependencies on other scenes which will be loaded after the first one? Is there some configuration file of scene’s dependencies? Because an hirerarchy of a scene can be changed. And names of object can be changed too. So how to resolve this cases?

Are you using Zenject? If so, you could do this by adding a ZenjectBinding component to the actor object. Then the actor object should be injected properly into the button component.

As for resolving dependencies between scenes, assuming again that you are using Zenject, your options are either scene decorators or scene contract names (see docs for details)