Esempio n. 1
0
        public static T InstantiateAndInject <T>(T original, Transform parent, bool instantiateInWorldSpace) where T : Object
        {
            var go = Object.Instantiate(original, parent, instantiateInWorldSpace) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go as T);
        }
Esempio n. 2
0
        public static T InstantiateAndInject <T>(T original, Vector3 position, Quaternion rotation, Transform parent) where T : Object
        {
            var go = Object.Instantiate(original, position, rotation, parent) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go as T);
        }
Esempio n. 3
0
        public static GameObject InstantiateAndInject(Object original)
        {
            var go = Object.Instantiate(original) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go);
        }
Esempio n. 4
0
        public static T InstantiateAndInject <T>(T original) where T : Object
        {
            var go = Object.Instantiate(original) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go as T);
        }
Esempio n. 5
0
        public static GameObject InstantiateAndInject(Object original, Vector3 position, Quaternion rotation)
        {
            var go = Object.Instantiate(original, position, rotation) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go);
        }
Esempio n. 6
0
        public static GameObject InstantiateAndInject(Object original, Transform parent, bool instantiateInWorldSpace)
        {
            var go = Object.Instantiate(original, parent, instantiateInWorldSpace) as GameObject;

            DIComponentsInitializer.InjectWithChildrens(go);
            return(go);
        }
        private void OnEnable()
        {
            var allObjects = FindObjectsOfType <GameObject>();

            foreach (var go in allObjects)
            {
                DIComponentsInitializer.Inject(go);
            }
        }