This is how Autobots vs Unicron and Thomas meets Primus goes in Thomas and Friends: Transformers Prime: Friendship is Magic: Beast Hunters: Predacons Rising.
[The Autobots and Unicron begin fighting]
[Bumblebee ducks a shot and Rarity fires a beam of magic]
[Inside Megatron's head]
Megatron: Bothersome pest. That pest is the very one who robbed me of my Spark. And now I possess the power to return the favor!
Unicron: You possess nothing! It is I who possess all that you were and ever will be.
Arcee: We need to retreat.
Rainbow Dash: She's right. Let's scidaddle.
Bulkhead: The only way out is down. We can't call for a groundbridge until we put some space between Unicron and us!
Applejack: That's right.
Unicron: Behold my infinite might!
[Unicron creates two Dark Energon cannons and begins firing]
[The Autobots run for it]
Bumblebee: Let's roll. Come on, chief.
Rarity: Let's go.
[They transform and drive off]
Arcee: We're out of time.
Rainbow Dash: Yeah.
Bulkhead: Whoa! Stop!
Applejack: Look out!
[They come to a stop]
Bulkhead: A smelting pit?
Applejack: What's that doing there?
Arcee: Cybertron's been dormant for thousands of years, but that's still burning?
Rainbow Dash: Whoa.
Bumblebee: Ratchet, we need a ground bridge.
Rarity: And be quick about it, darling.
[Ratchet does so]
[Back at the asteroid belt]
Wheeljack: Optimus, Twilight, if we don't get out of here right now...Optimus! Twilight!
Starlight Glimmer: Get out of there!
[The storm closes in]
[Optimus gets the Allspark]
[They reach the ship just as the storm arrives]
Wheeljack: That's why he's Prime. Cutting it a little close, don't you think?
Starlight Glimmer: Are you okay?
Optimus Prime: Wheeljack, set a course for Cybertron.
Twilight Sparkle: Let's go.
Wheeljack: Hang on to your hubcaps.
Starlight Glimmer: Whoa!
[They fly off]
Wheeljack: That's the future of life on Cybertron, huh? I kind of figured it'd be bigger.
Starlight Glimmer: What?
[They continue to fly]
Wheeljack: Hold tight!
Starlight Glimmer: Watch out, Wheeljack!
[Back at Darkmount]
[The Autobots fall]
Rarity: Not good!
[They instead fall into a Groundbridge]
[Bumblebee and Rarity sigh with relief]
Unicron: Servants of Prime, you will now join your brethren!
[Bumblebee and Rarity look at each other and nod]
Bumblebee: You got that right!
Rarity: See you never, darling.
[They run to the edge and jump into the Groundbridge]
[Inside Megatron's head]
Megatron: I... am...weak!
Unicron: But our merciless attack drove the Autobots into submission! They fled for their very Sparks! A victory over unworthy opponents, especially one that did not result in their demise, is far from an achievement. Clearly, our improved state is not enough to accomplish the deed for which I have come. For that, I shall require a much greater instrument of destruction.
[Meanwhile, with Thomas and his friends]
Thomas: Primus has to be Unicron's planned target. He just has to be.
Percy: Why are you so focused on what's happening now?
Thomas: Because, I fear the worst for Cybertron in the future.
Percy: Then how are we supposed to find Primus if he's not an inhabitant of this planet?
Thomas: Because, he is Cybertron itself.
Percy: Come again?
Thomas: Cybertron is his disguise.
Percy: I still don't get what you're on about.
James: He's saying Primus is Cybertron and he isn't in Cybertron's core. He is Cybertron's core.
Thomas: We need to find Primus and warn him as quickly as possible.
[They head to Cybertron's core where they find Primus]
Primus: OpThomas Prime! You've returned.
Thomas: Yeah. I have something to tell you.
Thomas: Your brother's back and he's planning to destroy you once and for all.
Primus: So, Unicron has returned.
Primus: It would appear that his Antispark survived the blast of Optimus and Twilight Sparkle.
Thomas: But what about your strength? You stopped him once before didn't you?
Primus: Yes, but even after I banished my brother, I knew that even I wouldn't be able to stop him from re-surfacing again. But you, my student, were destined for this. You can stop Unicron by using the Matrixes of Harmony.
Thomas: How do I do that?
Primus: Just look for the old Darkmount fortress.
Primus: Just be careful though, the Pits of Kaon are very dangerous.
[Thomas nods and he and his friends leave]
Bulkhead: How is this happening? I mean, we put out a call inviting refugees back to Cybertron, and Unicron's the first in line? Not to mention those Predacons. What have we come home to?
Applejack: We'll find out soon.
Smokescreen: What are we supposed to call him, huh Megacron? Unitron?
Pinkie Pie: Oooh! Ooh! How about Megatrix?
Arcee: Really? That's your biggest issue right now?
Rainbow Dash: Seriously, this no time for guessing games.
Smokescreen: Right, right. All right, good. So, what's the game plan?
Pinkie Pie: Just wondering.
Bumblebee: While Unicron may now inhabit a mortal form, he is still a god and thus cannot be defeated by customary means. Optimus? Wheeljack! This is Bumblebee. We have an urgent situation.
Rarity: Twilight! It's Rarity!
Optimus Prime: Bumblebee, this is Optimus Prime. Proceed.
Twilight Sparkle: Rarity, what's wrong?
Bumblebee: Optimus! Can you hear me? Come in, please. Wheeljack, do you read?
Wheeljack: That hit we took did some damage. Receiver's operational, but we can't transmit. Nothing.
Starlight Glimmer: Oh great.
Arcee: You have your voice back. Now is not the time to go radio-silent.
Rainbow Dash: Yeah. Come on, Bee. Speak up.
Bumblebee: Optimus, in the event that you can hear us, Unicron has found his way back to Cybertron. Repeat the Chaos-bringer is here, on our soil, in possession of Megatron's body.
Rarity: And he's upgraded his armor.
Optimus Prime: Wheeljack, ensure that the light-speed drive is still fully operational.
Twilight Sparkle: Starlight, make sure he does so.
Bumblebee: So, what now I mean, besides hoping that Optimus got the message?
Rarity: I'm sure you'll come up with something, darling.
Smokescreen: We figure out why Unicron's here. And what he wants. The big "U" could have taken Earth behind our backs.
Pinkie Pie: It's not like it literally happened.
Wheeljack: Why come back to Cybertron?
Starlight Glimmer: We're just wondering.
Optimus Prime: There would be only one reason, Wheeljack. To destroy the Spark of his archenemy Primus.
Twilight Sparkle: [gasps] So, Thomas' vision was right.
Wheeljack: But that's the core of our planet!
Starlight Glimmer: Then Thomas was right. Primus was Unicron's planned target.
Arcee: It isn't fair. How many more times do we have to save a world have to fight for the survival of our home?
Rainbow Dash: Yeah. How?
Ratchet: Regrettably, the struggle between creation and destruction is an eternal one. And the battle lines which separate the two... run through the very Spark of Cybertron. Good and evil. Order and chaos. One victorious, one vanquished, each forming the core of their own separate worlds Cybertron... and Earth. And now.. The darkness has followed us. All the way home.
Fluttershy: [gets an idea and gasps] The Matrixes of Harmony!
Fluttershy: The Matrixes of Harmony defeated Megatron once before. We can use them to defeat Unicron!