static int PlayerLoopSystemToInternal(PlayerLoopSystem sys, ref List <PlayerLoopSystemInternal> internalSys) { var idx = internalSys.Count; var newSys = new PlayerLoopSystemInternal { type = sys.type, updateDelegate = sys.updateDelegate, updateFunction = sys.updateFunction, loopConditionFunction = sys.loopConditionFunction, numSubSystems = 0 }; internalSys.Add(newSys); if (sys.subSystemList != null) { for (int i = 0; i < sys.subSystemList.Length; ++i) { newSys.numSubSystems += PlayerLoopSystemToInternal(sys.subSystemList[i], ref internalSys); } } internalSys[idx] = newSys; return(newSys.numSubSystems + 1); }
private static int PlayerLoopSystemToInternal(PlayerLoopSystem sys, ref List <PlayerLoopSystemInternal> internalSys) { int count = internalSys.Count; PlayerLoopSystemInternal playerLoopSystemInternal = new PlayerLoopSystemInternal { type = sys.type, updateDelegate = sys.updateDelegate, updateFunction = sys.updateFunction, loopConditionFunction = sys.loopConditionFunction, numSubSystems = 0 }; internalSys.Add(playerLoopSystemInternal); if (sys.subSystemList != null) { for (int i = 0; i < sys.subSystemList.Length; i++) { playerLoopSystemInternal.numSubSystems += PlayerLoop.PlayerLoopSystemToInternal(sys.subSystemList[i], ref internalSys); } } internalSys[count] = playerLoopSystemInternal; return(playerLoopSystemInternal.numSubSystems + 1); }