protected GameObject CreateGameObject() { GameObject result = new GameObject(GetType().Name); monoBehaviourHelper = result.AddComponent <DummyMonoBehaviour>(); monoBehaviourHelper.Manager = this; result.transform.SetParent(ManagerUtils.GetOrCreateManagersParent()); return(result); }
static AssetBundleLoader() { assetBundleRefs = new Dictionary <string, AssetBundleRef>(); GameObject go = new GameObject("AssetBundleLoader"); go.hideFlags |= HideFlags.HideInHierarchy; GameObject.DontDestroyOnLoad(go); monoBehaviourHelper = go.AddComponent <DummyMonoBehaviour>(); }
private void AddManagerToScene() { GameObject managersObject = GameObject.Find(ManagersName); if (managersObject == null) { managersObject = new GameObject(ManagersName); } GameObject myGameObject = new GameObject(GetType().Name); monoBehaviourHelper = myGameObject.AddComponent <DummyMonoBehaviour>(); }