T RegisterUnityObject <T>(T uobject, DestructionBy destructionBy = DestructionBy.Fixture) where T : UnityObject { if (destructionBy == DestructionBy.Fixture) { m_ObjectsDestroyedByFixture.Add(new ObjectAndName { obj = uobject, name = uobject.name }); } else if (destructionBy == DestructionBy.Test) { m_ObjectsDestroyedByTest.Add(uobject); } return(uobject); }
protected GameObject CreateGameObject(DestructionBy destructionBy) => CreateGameObject(null, destructionBy);
protected GameObject CreateGameObject(string name, DestructionBy destructionBy, params Type[] components) => RegisterUnityObject(new GameObject(MakeName(name ?? "go"), components), destructionBy);