is it a unity fault or this little script done this lag?

i added to my project this code:

public static List<List<T>> GetAllCombos<T>(List<T> list)
		int comboCount = (int)Math.Pow(2, list.Count) - 1;
		List<List<T>> result = new List<List<T>>();
		for (int i = 1; i < comboCount + 1; i++)
			// make each combo here
			result.Add(new List<T>());
			for (int j = 0; j < list.Count; j++)
				if ((i >> j) % 2 != 0)
		return result;

before this i had a normal framerate but now in stats i have 0.1fps. Is it possible that this script made this?

Yes, quite likely. The Unity Profiler will confirm that for you, but this script looks like it could get horribly inefficient, horribly quickly…

What exactly are you trying to do? How often are you calling this function? How many items are there in “list”?

If there are, say, 20 items in list, and you’re calling this function in Update(), then the statements inside your nested loop are being executed 20,971,520 times every frame…