Don't Walk By - 3

Don't Walk By - 3

Feb 6, 2020. | By: Evan Diamond
1 min

The third CGD blog post about Don’t Walk By

Overview

This week I made adjustments to my touch manager system.

Touch Manager Adjustments

I changed it so that the touches were added and removed from the system based on the touches phase. If the touch has just been pressed down then a raycast would be used to detect the gameobjects it was touching add them to a dictionary. Similarly when a touch is lifted up a ray is fired to see what gameobject it was touching and remove them from the dictionary. If a touch was held down then a ray would be fired to see what it was touching and if what is was touching was not the same then the dictionary would be updated accordingly. I also made it in this touch phase update the stored positions of the touches. This produced much more cleaner dragging of gameobject which is a major use of the touch manager.

Drag Demo

Touch manager Wrappers

I also added a extra functionality to the touchmanager with more wrapper functions for uses to detect whether a touch has just pressed down, lifted up or stayed down, with overloads to get either the position of the touch or the touch itself.

About

Gamers developing new games.

Social Links

Our Bunker

University of the West of England,
Frenchay Campus, Bristol, BS16 1QY,
United Kingdom.