The entire story is like the vision of the MC after he is dead right after Ushio (MC's daughter) is dead.
He is transcending to the illusionary world as the robot who were created and live together with the girl in illusionary world which is actually Ushio.
Everytime the MC (Tomoya) makes someone happy in every person route, an orb of light will appear and be collected. But each orb can grant any wish to everyone. Which in anime is explained in ~After Story~ on Katsuki Shima's route and demonstrate in Fuuko's route. In VN, everytime we clear the route and make someone happy, in the opening menu, an orb of light appear under the tree. But after you clear Fuuko route, an orb is missing because Fuuko use it to wish for her older sister to marry Yuusuke and have happy marriage life.
But, this time, Tomoya's wish is too big for a single light orb to grant because reviving a dead person because it makes a singularity. Thus Tomoya need to collect more orb to grant that big wish. After his wish is granted, the illusionary world cease to exists because they have to be revived and turn back to when Ushio was just born. Then, in the game, the opening menu show young Ushio sleeping under the tree instead orbs.