Exemplo n.º 1
0
        protected override void GetInjectableMonoBehaviours(List <MonoBehaviour> monoBehaviours)
        {
            // We inject on all components on the root except ourself
            foreach (var monoBehaviour in GetComponents <MonoBehaviour>())
            {
                if (monoBehaviour == null)
                {
                    // Missing script
                    continue;
                }

                if (!ZenUtilInternal.IsInjectableMonoBehaviourType(monoBehaviour.GetType()))
                {
                    continue;
                }

                if (monoBehaviour == this)
                {
                    continue;
                }

                monoBehaviours.Add(monoBehaviour);
            }

            for (int i = 0; i < this.transform.childCount; i++)
            {
                var child = this.transform.GetChild(i);

                if (child != null)
                {
                    ZenUtilInternal.GetInjectableMonoBehaviours(
                        child.gameObject, monoBehaviours);
                }
            }
        }
Exemplo n.º 2
0
 protected override void GetInjectableMonoBehaviours(List <MonoBehaviour> monoBehaviours)
 {
     ZenUtilInternal.GetInjectableMonoBehaviours(this.gameObject.scene, monoBehaviours);
 }
Exemplo n.º 3
0
 protected override IEnumerable <MonoBehaviour> GetInjectableMonoBehaviours()
 {
     return(ZenUtilInternal.GetInjectableMonoBehaviours(this.gameObject.scene));
 }