July 2017
Beginner to intermediate
390 pages
10h 53m
English
First, we need to add a dictionary to our class. This will contain all the objects we create. Again, we have seen this before. We did a similar thing when we created the _internalList dictionary in our SurfaceMeshList class:
System.Collections.Generic.Dictionary<SurfaceId, GameObject> _meshList =
new System.Collections.Generic.Dictionary<SurfaceId, GameObject>();
Change HandleSurfaceChanged to look as follows:
void HandleSurfaceChanged( SurfaceId surfaceId, SurfaceChange changeType, Bounds bounds, DateTime lastModification) { // This is where we handle all changes switch (changeType) { case SurfaceChange.Added: case SurfaceChange.Updated: HandleNewOrUpdated(surfaceId, bounds, lastModification); break; } ...Read now
Unlock full access